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