在我的网站中,需要访问相机或网络摄像头。但是根据https://forums.developer.apple.com/thread/88052(请指正),iOS Webview尚不支持WebRTC。因此,我正在尝试找到一种无需WebRTC即可访问它的方法。是否有任何解决方案?
And is this following code, a part of utilizing webRTC? Because the console.log shows up on 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} } })
If yes, so what's the workaround which not using webRTC, and can be run on android webview, ios webview, and web browsers?
getUserMedia
。WebRTC 对此并不重要。因此,没有一种方法可以访问摄像头流。 - deceze