android/chrome: Could not start video source, NotReadableError

See original GitHub issue

I get the following error when trying to getCameras() on chrome/android

I’m using a localhost without https.

Uncaught (in promise) {name: "NotReadableError", message: "Could not start video source", constraint: undefined, toString: ƒ}constraint: undefinedmessage: "Could not start video source"name: "NotReadableError"toString: ƒ ()__proto__: constructor: ƒ Object()hasOwnProperty: ƒ hasOwnProperty()isPrototypeOf: ƒ isPrototypeOf()propertyIsEnumerable: ƒ propertyIsEnumerable()toLocaleString: ƒ toLocaleString()toString: ƒ toString()valueOf: ƒ valueOf()__defineGetter__: ƒ __defineGetter__()__defineSetter__: ƒ __defineSetter__()__lookupGetter__: ƒ __lookupGetter__()__lookupSetter__: ƒ __lookupSetter__()get __proto__: ƒ __proto__()set __proto__: ƒ __proto__()
step @ instascan.js:44
(anonymous) @ instascan.js:54
Promise.then (async)
step @ instascan.js:51
(anonymous) @ instascan.js:59
F @ instascan.js:416
(anonymous) @ instascan.js:38
start @ instascan.js:23709
getCameras @ QRScan.vue?54e3:51
Promise.then (async)
mounted @ QRScan.vue?54e3:68
callHook @ vue.esm.js?65d7:2921
insert @ vue.esm.js?65d7:4158
invokeInsertHook @ vue.esm.js?65d7:5960
patch @ vue.esm.js?65d7:6179
Vue._update @ vue.esm.js?65d7:2670
updateComponent @ vue.esm.js?65d7:2788
get @ vue.esm.js?65d7:3142
run @ vue.esm.js?65d7:3219
flushSchedulerQueue @ vue.esm.js?65d7:2981
(anonymous) @ vue.esm.js?65d7:1837
flushCallbacks @ vue.esm.js?65d7:1758

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:6
  • Comments:7

github_iconTop GitHub Comments

8reactions
Kukunincommented, Jan 27, 2019

I had a similar error in my project (not related to instascan) in Chrome Android. The error happened when I tried to switch cameras. The solution for me was to stop all tracks in an active stream before acquiring a new one

if(this.lastStream) {
  this.lastStream.getTracks().forEach(track => track.stop()) 
}

after that the error has gone

4reactions
lcssanchescommented, May 23, 2019

I had a similar error in my project (not related to instascan) in Chrome Android. The error happened when I tried to switch cameras. The solution for me was to stop all tracks in an active stream before acquiring a new one

if(this.lastStream) {
  this.lastStream.getTracks().forEach(track => track.stop()) 
}

after that the error has gone

For those wondering where stop tracks, it’s right before navigator.mediaDevices.getUserMedia.

Thanks @Kukunin.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix this error : NotReadableError: Could not start video ...
Does this answer your question? · This error usually occurs when either your camera is being used by some other application or you...
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. Front camera recording & saving video works...
Read more >
DOMException: Could not start video source on Android ...
Hi: I don't know where to share this solution, so sorry if in wrong place. But a USEFULL solution for some Android 6.0...
Read more >
MediaDevices.getUserMedia() - Web APIs | MDN
That stream can include, for example, a video track (produced by either a hardware or virtual video source such as a camera, video...
Read more >
What does "NotReadableError: Could not initialize camera ...
A possible reason can be that the camera is used by some other app or website in the background. If it's an occasional...
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