DOMException: can't start audio source error handling

Sometimes getting this error:

How should i catch this one in JS? Thanks in advance!

That is probably triggered when initializing a Publisher object, because the microphone cannot be accessed. Use OpenVidu.initPublisherAsync:

var openvidu = new OpenVidu();
openvidu.initPublisherAsync('myHtmlElement', {})
    .then(pulisher => { /* You can publish now */ })
    .catch(error => { /* Here you catch the error*/ });
1 Like