[PWA QR Code Scanner] Use rear camera instead of front camera
Reactive icon
Forge component by Jay Parnau
Application Type

How can I make this component use the rear camera instead of the front camera?



When using this on a mobile phone it will work with the rear camera, however on desktop/laptop it will work on front camera only, I did give a try On IOS and it is working fine for it and it is using the rare camera only, Did you tried it with the sample that is attached, if you Scan this QR code and open the application on mobile it works fine - 

I hope this helps

Tousif Khan

You will have to modify the javascript. 

I've mainly tested this on an iPhone, so I don't know which camera number you need to use, but you can try different ones here:

Try changing the var cameraId = cameras[1].id; from [1] to other values. 

I just posted a new version that allows you to supply a camera number. 
This should give you the ability to use the front of back camera.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.