admin管理员组文章数量:1289392
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.
Affected browsers' versions Firefox - 57.0.4 , Chrome - 63.0.3239.132
Example code:
navigator.getUserMedia({ "audio": true, "video": false }, function (stream) {
console.log(stream);
localStream = stream;
},logError);
Also check this if anyone is getting this error in google sample code /
Is there any work around for this issue? Need help. Thanks
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.
Affected browsers' versions Firefox - 57.0.4 , Chrome - 63.0.3239.132
Example code:
navigator.getUserMedia({ "audio": true, "video": false }, function (stream) {
console.log(stream);
localStream = stream;
},logError);
Also check this if anyone is getting this error in google sample code https://webrtc.github.io/samples/src/content/getusermedia/gum/
Is there any work around for this issue? Need help. Thanks
Share Improve this question edited Jan 22, 2018 at 10:31 Akshay komarla asked Jan 22, 2018 at 9:54 Akshay komarlaAkshay komarla 7441 gold badge11 silver badges20 bronze badges 2- 2 Please post your code so we can see what causes the error.... "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers." – Reinstate Monica Cellio Commented Jan 22, 2018 at 9:56
- example code added. – Akshay komarla Commented Jan 22, 2018 at 10:13
1 Answer
Reset to default 9I 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 */
});
本文标签: javascriptgetusermedia DevicesNotFoundError thrown in latest browsersStack Overflow
版权声明:本文标题:javascript - getusermedia DevicesNotFoundError thrown in latest browsers - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741401622a2376698.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论