WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
Bug 188360
mediaDevices in WKWebview is undefined
https://bugs.webkit.org/show_bug.cgi?id=188360
Summary
mediaDevices in WKWebview is undefined
Mike Hartington
Reported
2018-08-06 14:34:08 PDT
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
Comment 1
2019-10-23 08:36:59 PDT
Any plans on adding this? WKWebView apps are very limited without this kind of features that are already in Safari.
Radar WebKit Bug Importer
Comment 2
2019-10-23 09:26:43 PDT
<
rdar://problem/56541639
>
Jerome @ Neareo
Comment 3
2020-02-17 23:57:34 PST
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
Comment 4
2020-02-27 07:00:11 PST
Hi! I've read something about getting released in iOS 13.4. Can you deny/confirm it? Thank you so much!
krak1
Comment 5
2020-05-07 06:53:45 PDT
I really don't like you apple. You don't deserve the number of customers you have. Fix it quickly!
zn
Comment 6
2020-05-11 01:24:32 PDT
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
Comment 7
2020-05-11 06:41:26 PDT
Let's keep comments professional and civil folks.
Dag-Inge Aas
Comment 8
2020-07-24 01:44:27 PDT
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
Comment 9
2020-07-24 15:18:13 PDT
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
Comment 10
2020-07-29 00:36:57 PDT
It would be really good to have WKWebView support getUserMedia for pwa - is getUserMedia functionality planned to be available for WKWebView?
Vitalii
Comment 11
2021-12-09 01:52:57 PST
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
Comment 12
2021-12-09 02:50:20 PST
Marking as configuration changed now that getUserMedia is exposed in WKWebView.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug