dashboardphilippines / react-webcam-barcode-scanner

[UNMAINTAINED -- PLEASE USE https://github.com/jamenamcinteer/react-qr-barcode-scanner INSTEAD] A simple React Component using the client's webcam to read barcodes.
45 stars 32 forks source link

Not able to pass facingMode to BarcodeScannerComponent #15

Open jaas0301 opened 3 years ago

jaas0301 commented 3 years ago

I am trying to pass in facingMode option to the Barcode Scanner Component and it seems to not honor the value.

This is what I have tried so far:

<BarcodeScannerComponent width={420} height={420} onUpdate={(err, result) => { ... }} videoConstraints={{ facingMode: 'user' }} />

Can someone suggest what is wrong here?

ajaypillay commented 3 years ago

According to what's in BarcodeScannerComponent.tsx it appears that facingMode is hardcoded to environment as it hasn't been configured in a way that it accepts a parent argument.