serratus/quaggaJS

Huawei mobile phone calls front camera

Closed this issue · 1 comments

When using quagga.js, the front camera will be called in Huawei mobile phone. How can I solve this problem?

You'll need to use https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/enumerateDevices which you can access via Quagga.CameraAccess.enumerateVideoDevices() .. get the deviceId for the device you want to use, and then use that in your constraints rather than facingMode

The "live_w_locator" sample has demonstration code to do this sort of thing, also
https://github.com/ericblade/quagga2/blob/master/example/live_w_locator.js#L85