我们有一个应用程序,使用 WebRTC
在 iOS 11
它说它支持 WebRTC
但该应用程序无法在 Safari
关于 iOS 11
. 有什么需要我们去做的吗?Safari
浏览器?我们必须在脚本中做任何修改吗?请帮助我们。
你得到了最后的适配器.js,假设浏览器的兼容性?
祝贺
下面是一个对我有用的示例代码
// 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;
});
});