Currently I use a video tag to read QR code:
<video id="preview" width="390" height="332"></video>
But the problem is that it activates the camera in selfie mode. What I want is that with the cell phone, I focus with the camera in normal mode, and not see myself in the video.
I would like to know if the video label has any option to give it away. Is the question understood?
Additional information: To read QR code I use the instascan.min.js library
The library itself gives you the solution :
Therefore, after creating an instance with
You can search the cameras and choose the one you want:
In your example what happens is that you use the first camera found (cameras[0]):
But nothing prevents you from getting the list of cameras, which are objects of the form:
And mount a select for the user to choose.
you can do it like this:
an example:
https://simpl.info/getusermedia/sources/
github project:
https://github.com/samdutton/simpl/blob/gh-pages/getusermedia/sources/js/main.js
I have done it in the following way and it works perfectly. I hope I can help you: