在我的网站上,它需要访问摄像头或网络摄像头。但是基于https://forums.developer.apple.com/thread/88052(请使用cmiiw)的ios webview尚不支持webRTC。因此,我试图找到一种无需webRTC即可访问它的方法。有没有?
以下代码是利用webRTC的一部分吗?因为console.log显示在ios Webview上
function hasGetUserMedia() {
return !!(navigator.getUserMedia || navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia || navigator.msGetUserMedia);
}
//then, somewhere in the code
if (!hasGetUserMedia()) {
console.log( "webRTC is not supported in your browser" );//it shows up on ios webview
}
//other code
navigator.mediaDevices.getUserMedia({
audio: false, //no audio
video: {deviceId: {exact: videoSource.camera_id} }
})
Run Code Online (Sandbox Code Playgroud)如果是,那么不使用webRTC并可以在android webview,ios webview和Web浏览器上运行的解决方法是什么?