cozmo/jsQR

QR scanner is lagging on Android devices

novicellrhj opened this issue · 2 comments

We recently updated to version 1.3.0 to try to battle that the scanner is lagging on several tested Android devices.
That is also the case for the jsQR demo. On iOS devices the scanner is running smoothly. Upon testing I narrowed it down to that it is in fact the jsQR() function that makes the scanner lag on Android devices.

@novicellrhj this is because processing power can't keep up with cameras frame rate.
Look towards web workers to do processing on a separate thread.

If you're interested, there's already a lib built on top of jsQR that makes use of a web worker and uses the device's native BarcodeDecetor if available: https://github.com/nimiq/qr-scanner.
It's using a fork of jsQR which I somewhat try to maintain, as cozmo is unfortunately not very active anymore lately.