react-native-wkwebview icon indicating copy to clipboard operation
react-native-wkwebview copied to clipboard

Integrate getUserMedia shim for iOS?

Open henrylearn2rock opened this issue 7 years ago • 3 comments

My app uses getUserMedia but I realized that wkwebview does not support getUserMedia.

The project looks interesting: https://github.com/common-tater/wkwebview-getusermedia-shim/

Any idea if it's possible to integrate this into react-native-wkwebview?

Thanks!

henrylearn2rock avatar Aug 14 '18 17:08 henrylearn2rock

getUserMedia has been deprecated. And since this project aims to be a thin wrapper around WkWebView, it's not likely to be integrated into this repo. Feel free to fork and add the shim yourself though.

insraq avatar Aug 14 '18 17:08 insraq

MediaDevices.getUserMedia is not deprecated. https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia

I would love to try the shim but I am not sure how. Any pointer? :) Thanks.

henrylearn2rock avatar Aug 14 '18 18:08 henrylearn2rock

This shim adds the method to navigator.getUserMedia which is deprecated.

The Objective C implementation actually uses WKUserscript. which should be quite easy to integrate. You do need to change the Objective C part of this repo: https://github.com/CRAlpha/react-native-wkwebview/tree/master/ios/RCTWKWebView

insraq avatar Aug 14 '18 18:08 insraq