Event listener that “camera and microphone blocked” is allowed

百般思念 提交于 2021-01-29 14:40:44

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!