Bug 188360
Summary: | mediaDevices in WKWebview is undefined | ||
---|---|---|---|
Product: | WebKit | Reporter: | Mike Hartington <mikehartington> |
Component: | WebRTC | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED CONFIGURATION CHANGED | ||
Severity: | Normal | CC: | alejandro.silva, beidson, bernie, bill, bugmail, daginge, eelco, elitree, eric.carlson, feross, flagworlds1, jer.noble, juliosincesar, marcel, molnar.timi7, ramanaedwin, shahraship, silviapfeiffer1, stefan, tomac, vitalyd87, webkit-bug-importer, webkit, will.morgan, wvsmlmdiaaxvhkrqov, youennf, znelson |
Priority: | P2 | Keywords: | InRadar |
Version: | Other | ||
Hardware: | iPhone / iPad | ||
OS: | Other |
Mike Hartington
Inside of WKWebview, mediaDevices and getUserMedia are not implemented, but are there in Webkit/Safari.
var videoTag = document.querySelector('video');
var getVideoStream = function() {
navigator.mediaDevices
.getUserMedia({ video: true })
.then(streamRes => (videoTag.srcObject = streamRes));
};
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
jcesarmobile
Any plans on adding this? WKWebView apps are very limited without this kind of features that are already in Safari.
Radar WebKit Bug Importer
<rdar://problem/56541639>
Jerome @ Neareo
We have a html-based chatbot platform that requires a QR scanner. We urgently need WebRTC (getUserMedia) to work in apps using WKWebView.
I've seen that SFSafariViewController is now working with iOS 13. Any plans to support getUserMedia in WKWebView ?
Alejandro Silva
Hi! I've read something about getting released in iOS 13.4. Can you deny/confirm it? Thank you so much!
krak1
I really don't like you apple. You don't deserve the number of customers you have. Fix it quickly!
zn
I can’t even describe how infuriating it is that getUserMedia and thus WebRTC isn’t supported. So many things are much easier to implement in JavaScript when it comes to WebRTC instead of jumping through a million hoops in Obj-C and the garbage environment that is iOS native. Apple is ridiculous.
Mike Hartington
Let's keep comments professional and civil folks.
Dag-Inge Aas
With the advent of new default browsers in iOS 14, this will become a bigger UX problem for WebRTC services. I have tested iOS 14 Developer Beta 3, and neither Chrome nor Firefox can complete a simple getUserMedia call (fails with TypeError in samples).
Since users now can select these browsers as default, WebRTC services must implement specific UX to teach users how to copy the link, change to Safari, and open it in Safari for WebRTC to work.
Having support for getUserMedia/WebRTC in WKWebView is now critical for WebRTC as a whole on iOS. Users won't be able to understand why their default browser does not support WebRTC.
Are there any details to share on the timeline for support, or are there talks with browser vendors to avoid this problem? What should us application developers do?
molnar.timi7
Finally there is a solution! Check this comment: https://bugs.webkit.org/show_bug.cgi?id=183201#c31
There is a brand new WebRTC library for WKWebView, and it works like a charm! https://github.com/OpenTelecom/WKWebViewRTC
Silvia Pfeiffer
It would be really good to have WKWebView support getUserMedia for pwa - is getUserMedia functionality planned to be available for WKWebView?
Vitalii
In Info.plist add:
`Privacy - Camera Usage Description`
https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_ios
And in order video element could play from your camera:
```
let webConfiguration = WKWebViewConfiguration()
webConfiguration.allowsInlineMediaPlayback = true
```
How to play: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
youenn fablet
Marking as configuration changed now that getUserMedia is exposed in WKWebView.