Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chromium Issue 849636: Guideline for handling NotReadableError #325

Closed
katranci opened this issue Jun 15, 2018 · 7 comments
Closed

Chromium Issue 849636: Guideline for handling NotReadableError #325

katranci opened this issue Jun 15, 2018 · 7 comments
Labels
bug filed A bug has been filed upstream for this issue Chrome Issues related to Chrome question

Comments

@katranci
Copy link

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

@markandrus
Copy link
Contributor

markandrus commented Jun 15, 2018

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 name attribute 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

@markandrus markandrus added question bug filed A bug has been filed upstream for this issue Chrome Issues related to Chrome labels Jun 15, 2018
@markandrus markandrus changed the title Guideline for handling NotReadableError Chromium Issue 849636: Guideline for handling NotReadableError Jun 15, 2018
@katranci
Copy link
Author

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.

@katranci katranci closed this as completed Jul 3, 2018
@Kukunin
Copy link

Kukunin commented Jan 27, 2019

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

@hynsey
Copy link

hynsey commented Aug 19, 2019

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!

@jeferbc
Copy link

jeferbc commented Aug 11, 2020

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

@ranneyd
Copy link

ranneyd commented Apr 21, 2021

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.

@vashramb
Copy link

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

Thanks, it's working fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug filed A bug has been filed upstream for this issue Chrome Issues related to Chrome question
Projects
None yet
Development

No branches or pull requests

7 participants