From 1025435e63f5afb516c73261f8b114fb43b6c817 Mon Sep 17 00:00:00 2001 From: Zac West Date: Mon, 20 Sep 2021 20:43:44 -0700 Subject: [PATCH] Always allow media capture in frontend --- Sources/App/WebView/WebViewController.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Sources/App/WebView/WebViewController.swift b/Sources/App/WebView/WebViewController.swift index c670a4b4a..e86803be0 100644 --- a/Sources/App/WebView/WebViewController.swift +++ b/Sources/App/WebView/WebViewController.swift @@ -486,6 +486,19 @@ class WebViewController: UIViewController, WKNavigationDelegate, WKUIDelegate, U } } + #if compiler(>=5.5) && !targetEnvironment(macCatalyst) + @available(iOS 15, *) + func webView( + _ webView: WKWebView, + requestMediaCapturePermissionFor origin: WKSecurityOrigin, + initiatedByFrame frame: WKFrameInfo, + type: WKMediaCaptureType, + decisionHandler: @escaping (WKPermissionDecision) -> Void + ) { + decisionHandler(.grant) + } + #endif + @objc private func connectionInfoDidChange() { DispatchQueue.main.async { [self] in loadActiveURLIfNeeded()