question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Video Error , error = Error getting userMedia, error = NotReadableError:Could not start video source on low end Android devices

See original GitHub issue

Describe the bug When you press request permission button. It will run navigator.mediaDevices.getUserMedia({ audio: false, video: true }).then(_ => from static getCameras() method

  • which causes the browser to already start accessing the video input. Causing NotReadableError when pressing start scanning after selecting the REAR CAMERA (Front camera has no issues)
  • But do note that ONLY slow phones will be affected. Any phones that are slow enough can reproduce this issue in the demo website.

To Reproduce Steps to reproduce the behavior:

  1. Go to the demo website https://blog.minhazav.dev/research/html5-qrcode.html
  2. Click on Request Permission and scroll down your notification bar. You will see chrome is already accessing your video input. If your phone is slow enough. Quickly go to point 3
  3. Select REAR camera and Press Start scanning while chrome still accessing your video input
  4. See error Video Error , error = Error getting userMedia, error = NotReadableError:Could not start video source

To avoid the NonReadableError

  1. You have to wait chrome browser to stop accessing the video input after pressing the (request permission button) for around 5 seconds or even more for the notification of chrome accessing your video input is gone at the notification bar! the range of time depends the phone’s performance
  2. Then you press start scanning after selecting the REAR CAMERA

Expected behavior See error Video Error , error = Error getting userMedia, error = NotReadableError:Could not start video source

The Fix Just comment the code shown in the screenshot. //navigator.mediaDevices.getUserMedia({ audio: false, video: true }) // .then(_ => { **content //.catch(err => { // reject(${err.name} : ${err.message}); //}) the fix

Screenshots Request Permission The error message

Desktop (please complete the following information): Desktop basically have no issue because PCs are too fast

Smartphone (please complete the following information):

  • Device: Huawei Nova 3i, Huawei Honor 10
  • OS: EMUI 9.1 for both phones
  • Browser [Chrome- 81.0.4044.117 (latest version)]

Additional context I’m sorry if I raised a wrong issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kenfookchoongcommented, May 11, 2020

hi @mebjas

It is fixed! nice one !

Thanks! This is my first time raising an issue on github. Glad it was fruitful!

Regards, Ken

0reactions
mebjascommented, May 11, 2020

Thanks @kenfookchoong for raising the issue and suggesting the fix!

@OneDivZero thanks again for validating the issue and fix - this has been super helpful in getting the issue to be fixed.

@keanwalker Thanks for validating the issue resolution!

This kind of open source collaboration is really fun 😃 Closing this issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix this error : NotReadableError: Could not start video ...
You need to stop the previous mediaStreamObj before calling getUserMedia again. This happens when your other(front/back) is already in use.
Read more >
NotReadableError: could not start video source - Google Groups
I am trying to develop Video Recording from Front as well as Rear Camera using WebRTC. ... the NotReadableError: could not start video...
Read more >
MediaDevices.getUserMedia() - Web APIs | MDN
The MediaDevices.getUserMedia() method prompts the user for permission to use a media input which produces a MediaStream with tracks ...
Read more >
What are the common error messages to expect in Web ...
After integrating the Agora Web SDK into your web app, you can debug your code using the console log. This document lists the...
Read more >
Troubleshooting Telehealth appointment issues
This guide will provide next steps to resolve video or audio ... access for Telehealth in the Getting started with Telehealth guide for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found