小编Alv*_*ora的帖子

无需webRTC即可访问摄像头或摄像头

在我的网站上,它需要访问摄像头或网络摄像头。但是基于https://forums.developer.apple.com/thread/88052(请使用cmiiw)的ios webview尚不支持webRTC。因此,我试图找到一种无需webRTC即可访问它的方法。有没有?

  1. 以下代码是利用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)
  2. 如果是,那么不使用webRTC并可以在android webview,ios webview和Web浏览器上运行的解决方法是什么?

html javascript html5 webview webrtc

2
推荐指数
1
解决办法
1030
查看次数

标签 统计

html ×1

html5 ×1

javascript ×1

webrtc ×1

webview ×1