Open jeznag opened 3 years ago
Browsers now have native support for QR code detection: https://developer.mozilla.org/en-US/docs/Web/API/BarcodeDetector
Would be helpful to use this if it is available.
At the time of writing, Firefox and Safari don't support the Barcode Detection API yet, but it is an interesting alternative indeed.
If you are interested in a lib that uses the BarcodeDetector if available and otherwise falls back to jsQR, have a look at this lib: https://github.com/nimiq/qr-scanner
Hello everyone. I have also made my own shim library. It uses the BarcodeDetector interface and falls back to jsQR. If you decide to implement my library now, it should be very easy to remove my library and move to BarcodeDetector in the future (when BarcodeDetector has become widely supported in browsers).
Package: https://www.npmjs.com/package/qr-detector
Please also consider using zbar.wasm (see https://github.com/undecaf/zbar-wasm, and https://github.com/samsam2310/zbar.wasm).
Here is my live sample with zbar.wasm https://output.jsbin.com/zevavin
@fengdh Thanks a lot for sharing your code, this has significantly improved QR detection in my app. You are a Life saver!
Browsers now have native support for QR code detection: https://developer.mozilla.org/en-US/docs/Web/API/BarcodeDetector
Would be helpful to use this if it is available.