【问题标题】:Safari WebRTC support in IOS 11IOS 11 中的 Safari WebRTC 支持
【发布时间】:2017-10-04 10:00:07
【问题描述】:

我们在iOS 11 中使用WebRTC 开发了一个应用程序,它说它支持WebRTC,但该应用程序在Safari 上的iOS 11 上无法运行。我们需要做些什么来在Safari 浏览器上支持这一点吗?我们必须对脚本进行任何更改吗?请帮忙。

【问题讨论】:

标签: ios webrtc ios11


【解决方案1】:

您是否获得了假定浏览器兼容性的最后一个 adapter.js ?

问候

【讨论】:

【解决方案2】:

这是一个对我有用的示例代码

// create video element first 
var video = document.createElement('video');
video.style.width = document.width + 'px';
video.style.height = document.height + 'px';
video.setAttribute('autoplay', '');
video.setAttribute('muted', '');
video.setAttribute('playsinline', '');
document.body.appendChild(video);

 //setup your constraints 
  constraints = {
     audio: false,
     video: {
       facingMode: front
      }
   }

  //ask navigator to allow access 
 navigator.mediaDevices.getUserMedia(constraints).then(function 
 success(stream) {
   video.srcObject = stream; 
 });
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-12-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多