diff --git a/packages/qr-code-scanner/src/qr-code-scanner.js b/packages/qr-code-scanner/src/qr-code-scanner.js index e58f4a8ee2629a342c91bf21ad6c26976fcbb1d5..28b9d15f0002955f618fbcff30172c6b362c4ad8 100644 --- a/packages/qr-code-scanner/src/qr-code-scanner.js +++ b/packages/qr-code-scanner/src/qr-code-scanner.js @@ -210,7 +210,7 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) { } const that = this; - let lastVideoTime = -1; + let lastVideoScanTime = -1; let lastCode = null; let lastSentData = null; @@ -307,9 +307,9 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) { let code = null; // We only check for QR codes 5 times a second to improve performance - let shouldAnalyze = Math.abs(lastVideoTime - video.currentTime) >= 1/5; + let shouldAnalyze = Math.abs(lastVideoScanTime - video.currentTime) >= 1/3; if (shouldAnalyze) { - lastVideoTime = video.currentTime; + lastVideoScanTime = video.currentTime; code = jsQR(imageData.data, imageData.width, imageData.height, { inversionAttempts: "dontInvert", });