Bug 228317

Summary: Permissions for Camera expires after some time
Product: WebKit Reporter: jakubesuszynski
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, eric.carlson, jer.noble, marek.aug, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: iPhone / iPad   
OS: iOS 14   

Description jakubesuszynski 2021-07-27 00:00:56 PDT
I've a case where I fetch HTML from the backend and load it in WKWebView. It ask's me for camera permission for the URL I set. This HTML also fetches a quite big script, so it's expensive operation. After that I don't kill the View Controller, only dismiss it, so when user open it again, HTML is still loaded and ready. However, after some time with camera activated (I'm throwing a track's stream as a source for <video /> element) it just stops working - preview disappears. When I try to hit navigator.mediaDevices.getUserMedia() again, it just not resolve and quits script with no error. Is it intended? 

Also, Is is even possible to keep the permission after granting it once? App has camera permission, but WebView asks for it every time I init it
Comment 1 Radar WebKit Bug Importer 2021-08-03 00:01:17 PDT
<rdar://problem/81447591>
Comment 2 youenn fablet 2021-08-20 04:57:36 PDT
@jakube, do you have a repro case. Is it only happening in WKWebView or can you reproduce in Safari?

As of permission granting, you can use WKWebView delegates to grant persistent permissions available in latest iOS 15 betas.