问题
By getUserMedia, it is possible that UserMedia is blocked by user.
navigator.mediaDevices.getUserMedia({ audio: true })
.then((stream) => {
...
})
.catch(() => {
this.usermedia_blocked = true;
});
When the setting is changed to "always allow", I want to continue the subsequent task. But how can I detect that "always allow & done" is clicked?
Appear.in start video call after "always allow & done " is clicked. I want to do the same thing.
回答1:
appear.in developer here. What do is to poll navigator.mediaDevices.enumerateDevices(), check if we have device labels on the camera and microphone (which implies permission has been re-granted) and then call getUserMedia again.
来源:https://stackoverflow.com/questions/53095851/event-listener-that-camera-and-microphone-blocked-is-allowed