schmich / instascan

HTML5 QR code scanner using your webcam
https://schmich.github.io/instascan/
MIT License
2.97k stars 867 forks source link

Cannot access video stream when the first camera is already used #240

Closed panbak closed 4 years ago

panbak commented 4 years ago

When the first of the cameras returned by Instascan.Camera.getCameras() is not available(is already used), there is an exception. In the following image,I am running two instances of my code. At the first one Instascan.Camera.getCameras() works fine but on the second one I get the exception: Error: Cannot access video stream (NotReadableError). image

I hope what I'm describing is clear. Any work-around for this?

note: I noticed that the live demo has also the same issue https://schmich.github.io/instascan

panbak commented 4 years ago

It seems that this is not an issue of Instascan, but it is how navigator.mediaDevices.enumerateDevices(); called in getCameras() function works.