admin管理员组文章数量:1026989
i have a problem when accessing my webcam through my web app. i following the example code to how to accessing webcam in MDN web doc. but when i try to run my web app, it shows error NotReadableError: Could not start video source
in chrome console.
my web app run with https, on desktop google chrome version 81.04 and chromium rasbian version 78.0. it doesn't work with my built in laptop webcam and my raspberry pi with logitech webcam
does anyone has a solution ? thanks in advance !
this is my code.
<html>
<head>
</head>
<body>
<video id="video-input"></video>
<script type="text/javascript">
var video = document.getElementById('video-input');
navigator.mediaDevices.getUserMedia({ video:true, audio:false})
.then(function(stream){
video.srcObject = stream;
video.play();
})
.catch(function(err) {
console.log("An error occurred! " + err);
});
</script>
</body>
</html>
i have a problem when accessing my webcam through my web app. i following the example code to how to accessing webcam in MDN web doc. but when i try to run my web app, it shows error NotReadableError: Could not start video source
in chrome console.
my web app run with https, on desktop google chrome version 81.04 and chromium rasbian version 78.0. it doesn't work with my built in laptop webcam and my raspberry pi with logitech webcam
does anyone has a solution ? thanks in advance !
this is my code.
<html>
<head>
</head>
<body>
<video id="video-input"></video>
<script type="text/javascript">
var video = document.getElementById('video-input');
navigator.mediaDevices.getUserMedia({ video:true, audio:false})
.then(function(stream){
video.srcObject = stream;
video.play();
})
.catch(function(err) {
console.log("An error occurred! " + err);
});
</script>
</body>
</html>
Share
Improve this question
asked May 2, 2020 at 9:26
Farhan RabbaaniiFarhan Rabbaanii
4631 gold badge9 silver badges16 bronze badges
2 Answers
Reset to default 3From MDN, in the page you linked in your question:
NotReadableError
Although the user granted permission to use the matching devices, a hardware error occurred at the operating system, browser, or Web page level which prevented access to the device.
This is a problem that happens between the browser and the device. It might be because of the driver. Your example works for me (not in the Stack Snippet), so I can't tell you what's exactly happening and how to solve it.
I would remend you updating your drivers.
It may be the camera is already being used by another process
i have a problem when accessing my webcam through my web app. i following the example code to how to accessing webcam in MDN web doc. but when i try to run my web app, it shows error NotReadableError: Could not start video source
in chrome console.
my web app run with https, on desktop google chrome version 81.04 and chromium rasbian version 78.0. it doesn't work with my built in laptop webcam and my raspberry pi with logitech webcam
does anyone has a solution ? thanks in advance !
this is my code.
<html>
<head>
</head>
<body>
<video id="video-input"></video>
<script type="text/javascript">
var video = document.getElementById('video-input');
navigator.mediaDevices.getUserMedia({ video:true, audio:false})
.then(function(stream){
video.srcObject = stream;
video.play();
})
.catch(function(err) {
console.log("An error occurred! " + err);
});
</script>
</body>
</html>
i have a problem when accessing my webcam through my web app. i following the example code to how to accessing webcam in MDN web doc. but when i try to run my web app, it shows error NotReadableError: Could not start video source
in chrome console.
my web app run with https, on desktop google chrome version 81.04 and chromium rasbian version 78.0. it doesn't work with my built in laptop webcam and my raspberry pi with logitech webcam
does anyone has a solution ? thanks in advance !
this is my code.
<html>
<head>
</head>
<body>
<video id="video-input"></video>
<script type="text/javascript">
var video = document.getElementById('video-input');
navigator.mediaDevices.getUserMedia({ video:true, audio:false})
.then(function(stream){
video.srcObject = stream;
video.play();
})
.catch(function(err) {
console.log("An error occurred! " + err);
});
</script>
</body>
</html>
Share
Improve this question
asked May 2, 2020 at 9:26
Farhan RabbaaniiFarhan Rabbaanii
4631 gold badge9 silver badges16 bronze badges
2 Answers
Reset to default 3From MDN, in the page you linked in your question:
NotReadableError
Although the user granted permission to use the matching devices, a hardware error occurred at the operating system, browser, or Web page level which prevented access to the device.
This is a problem that happens between the browser and the device. It might be because of the driver. Your example works for me (not in the Stack Snippet), so I can't tell you what's exactly happening and how to solve it.
I would remend you updating your drivers.
It may be the camera is already being used by another process
本文标签:
版权声明:本文标题:javascript - navigator.mediaDevices.getUserMedia return NotReadableError: Could not start video source - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745656140a2161607.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论