Search code examples
javascriptwebwebrtcopentok

WebRTC listen if it requests access to microphone


I am currently using a service called OpenTok which relies on WebRTC for communicating peer to peer online with video and audio.

In the browser it then asks for permission for using the camera.

I am wondering if it's possible to listen to when this ask for permission is triggered? I essentially want to give users more help that they actually need to give the browser access to the camera, by for instance pointing to the button etc.

Any help would be appreciated!


Solution

  • Look at the OpenTok documentation: https://tokbox.com/opentok/libraries/client/js/reference/Publisher.html

    You have some events: accessDialogOpened/accessDialogClosed/accessDenied