Issue 752458:
getUserMedia does not work in the WKWebview

Issue description

An important use case of WebRTC is the streaming of user media, which is done via navigator.mediaDevices.getUserMedia.
navigator.mediaDevices is available in Safari, but not in the WKWebview.
filed radar://33723040 about it.

>This bug has been closed as a Duplicate. The issue is being tracked under the original Bug ID# 29281220.
sorry if i'm asking an obvious question but where is this bug filed? i can't find it anywhere? is this apple's internal id? is there any more info on this btw?

This bug was filed in radar, which is Apple's bug tracking system. Unfortunately Apple does not allow access to bugs filed in its system other than the original bug reporter. We don't have any information on when the blocking bug will be fixed...

I managed to re-enable the API, in the context of cordova-plugin-wkwebview-engine, by using the private WebKit function: void WKPreferencesSetMediaDevicesEnabled(WKPreferences* preferencesRef, bool enabled)
Assuming you are using Objective C, to reproduce, you need 1. to declare this function, and 2 when you are setting up WKWebViewConfiguration, call it:
1.
void WKPreferencesSetMediaDevicesEnabled(WKPreferences* preferencesRef, bool enabled);
2.
WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init]; ... WKPreferencesSetMediaDevicesEnabled(configuration.preferences, true);
However, the call getUserMedia fails with the error "SecurityError: The operation is insecure.". I did not manage yet to work around it.