I have been using getUserMedia() for WebRtc for a while now but since the latest update of browsers I have not been able to use this. On previous versions worked fine.
I found the solution. In newer versions when we specify the constraints { audio: true, video: true }
either of which ever we specify as true that corresponding hardware need to be present. otherwise it will throw DevicesNotFoundError
.
Here is the code i used. i don't have a web cam in local machine so specified video as false.
navigator.mediaDevices.getUserMedia({ audio: true, video: false})
.then(function(stream) {
/* use the stream */
})
.catch(function(err) {
/* handle the error */
});