y_a*_*arl 2 javascript firefox twilio webrtc
目前在firefox中localhost上的屏幕共享会引发以下错误:
The request is not allowed by the user agent or the platform in the current context..
这是我的代码:
navigator.mediaDevices.getUserMedia({ video: { mediaSource: 'screen' } })
.then((stream) => {
console.log('stream', stream)
})
.catch((err) => {
console.log('err', err)
})
Run Code Online (Sandbox Code Playgroud)
如果您正在使用它进行测试,请media.navigator.permission.disabled在about:config中设置为true,跳过对话框和错误.