better solution

This commit is contained in:
Mauro Romito 2025-02-24 12:04:20 +01:00
parent 82077e2e23
commit 6d36b2a796

View File

@ -167,8 +167,8 @@ private struct CallView: UIViewRepresentable {
// MARK: - WKUIDelegate
func webView(_ webView: WKWebView, decideMediaCapturePermissionsFor origin: WKSecurityOrigin, initiatedBy frame: WKFrameInfo, type: WKMediaCaptureType) async -> WKPermissionDecision {
// If we are using the local url, we allow the camera and microphone, otherwise we need to verify that the host matches the one from the provided URL.
guard url.isFileURL || origin.host == url.host else {
// Allow if the origin is local, otherwise don't allow permissions for domains different than what the call was started on
guard origin.protocol == "file" || origin.host == url.host else {
return .deny
}