dwa012 / html5-qrcode

A cross platform HTML5 QR code reader.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

change camera

jappyjan opened this issue · comments

I really like this plugin, but i would really love to see the possibility to use the rear camera of my phone instead of the front camera.

commented

You can change the following line in html5-qrcode.js from:

navigator.getUserMedia({video: true}, successCallback, function(error) { ...
to
navigator.getUserMedia({video: {facingMode:"environment"}}, successCallback, function(error) { ...

There is also a "user" facingMode for the front/selfie camera