CRAlpha / react-native-wkwebview

WKWebview Component for React Native
MIT License
642 stars 270 forks source link

Integrate getUserMedia shim for iOS? #183

Open henrylearn2rock opened 6 years ago

henrylearn2rock commented 6 years ago

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!

insraq commented 6 years ago

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.

henrylearn2rock commented 6 years ago

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.

insraq commented 6 years ago

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