Hello,
We've captured the following error while a user was trying to turn on their webcam:
WARN in [createLocalTracks #1]: Call to getUserMedia failed: NotReadableError: Could not start video source
Do you have any recommendation on how to guide users suffering from this problem?
Thanks
Hi @katranci,
Media Capture and Streams defines when NotReadableError can be raised by getUserMedia:
If the user grants permission but a hardware error such as an OS/program/webpage lock prevents access, reject _p_ with a new DOMException object whose
nameattribute has the value NotReadableError and abort these steps.
MDN restates it as
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.
So this error can be raised if there is a hardware issue (or an issue between the browser and the OS interacting with the hardware). It can also be raised on Windows and Linux if another application is using the webcam (see WebRTC Issue 65190). If you encounter this issue, it may make sense to alert the user in the app to say something like,
We weren't able to access the microphone and/or webcam. Please make sure no other application is currently accessing it, then press "Try again."
You could then allow the user to click "Try again" when they are ready.
By the way, do you notice an up-tick in the number of NotReadableErrors and do you have a breakdown by platform? There is a recent Chromium Issue 849636 tracking an uptick in NotReadableErrors.
Please let me know if this helps,
Mark
Thanks @markandrus, really appreciate your assistance. We haven't had more occurrences of this issue on our platform. I'll keep an eye on the Chromium issue.
Just to fulfill the info.
I got this error in Chrome Android when a user tried to switch cameras. In my case the fix was to stop all tracks of the active stream before trying to acquire a new one:
if(this.lastStream) {
this.lastStream.getTracks().forEach(track => track.stop())
}
After that the error has gone
Just to fulfill the info.
I got this error in Chrome Android when a user tried to switch cameras. In my case the fix was to stop all tracks of the active stream before trying to acquire a new one:
if(this.lastStream) { this.lastStream.getTracks().forEach(track => track.stop()) }After that the error has gone
Yep - this resolved issue for me also, was only stopping the first track on the stream [0]. Thanks!
I was facing the same NorReadableError on windows 8, no other apps using the cam. My error was defining the video constrainst, I was using { audio: true, video: { height: 720, frameRate: 24, width: 1280 }, maxAudioBitrate: 16000 } for PC. But an specific PC don't support this dimensions. I fixed using this constrains
{ audio: true, video: { height: { min: 480, max: 720 }, frameRate: 24, width: { min: 640, max: 1280 } }, maxAudioBitrate: 16000 }
Greetings
I was facing the same NorReadableError on windows 8, no other apps using the cam. My error was defining the video constrainst, I was using { audio: true, video: { height: 720, frameRate: 24, width: 1280 }, maxAudioBitrate: 16000 } for PC. But an specific PC don't support this dimensions. I fixed using this constrains
{ audio: true, video: { height: { min: 480, max: 720 }, frameRate: 24, width: { min: 640, max: 1280 } }, maxAudioBitrate: 16000 }Greetings
This guy is a genius FYI. Totally it.
Most helpful comment
I was facing the same NorReadableError on windows 8, no other apps using the cam. My error was defining the video constrainst, I was using { audio: true, video: { height: 720, frameRate: 24, width: 1280 }, maxAudioBitrate: 16000 } for PC. But an specific PC don't support this dimensions. I fixed using this constrains
{ audio: true, video: { height: { min: 480, max: 720 }, frameRate: 24, width: { min: 640, max: 1280 } }, maxAudioBitrate: 16000 }
Greetings