问题
Currently screensharing on localhost in firefox throws the following error:
The request is not allowed by the user agent or the platform in the current context..
Here's my code:
navigator.mediaDevices.getUserMedia({ video: { mediaSource: 'screen' } })
.then((stream) => {
console.log('stream', stream)
})
.catch((err) => {
console.log('err', err)
})
回答1:
If you are using it for testing, setting media.navigator.permission.disabled to true in about:config skips the dialog and the error.
来源:https://stackoverflow.com/questions/46497849/twilio-screensharing-on-localhost-in-firefox