mebjas / html5-qrcode

A cross platform HTML5 QR code reader. See end to end implementation at: https://scanapp.org
https://qrcode.minhazav.dev
Apache License 2.0
5.06k stars 976 forks source link

Error on start camera after cache is cleared #368

Closed onuh closed 2 years ago

onuh commented 2 years ago

When cache is cleared, the scanner displays error on attempt to scan with camera.

mebjas commented 2 years ago

what do you mean by cache is cleared?

onuh commented 2 years ago

When web browser cache is cleared, the scanner experiences error. On Android Google chrome, view history and clear it. Or on Android APK, clear app cache

On Mon, Dec 13, 2021, 12:14 PM minhaz @.***> wrote:

what do you mean by cache is cleared?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mebjas/html5-qrcode/issues/368#issuecomment-992357576, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGJMHBU7UJSPJBBAA3NGLITUQXIQPANCNFSM5J5LTVKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

onuh commented 2 years ago

Check out APK app here: https://smartchurchattendance.com.ng/smartChurch/downloads/Smart_Church_Mobile_1_2.0.apk

On Mon, Dec 13, 2021, 12:16 PM Victor Onuh @.***> wrote:

When web browser cache is cleared, the scanner experiences error. On Android Google chrome, view history and clear it. Or on Android APK, clear app cache

On Mon, Dec 13, 2021, 12:14 PM minhaz @.***> wrote:

what do you mean by cache is cleared?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mebjas/html5-qrcode/issues/368#issuecomment-992357576, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGJMHBU7UJSPJBBAA3NGLITUQXIQPANCNFSM5J5LTVKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mebjas commented 2 years ago

Can you share, what is the stack trace of the error in this case (in the console)?

onuh commented 2 years ago

NotReadableError: Could not start video source

On Mon, Dec 20, 2021, 6:36 AM minhaz @.***> wrote:

Can you share, what is the stack trace of the error in this case (in the console)?

— Reply to this email directly, view it on GitHub https://github.com/mebjas/html5-qrcode/issues/368#issuecomment-997612143, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGJMHBX4MR6M6ZKLVJFEPMTUR26ELANCNFSM5J5LTVKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

onuh commented 2 years ago

On Mon, Dec 20, 2021, 6:42 AM Victor Onuh @.***> wrote:

NotReadableError: Could not start video source

On Mon, Dec 20, 2021, 6:36 AM minhaz @.***> wrote:

Can you share, what is the stack trace of the error in this case (in the console)?

— Reply to this email directly, view it on GitHub https://github.com/mebjas/html5-qrcode/issues/368#issuecomment-997612143, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGJMHBX4MR6M6ZKLVJFEPMTUR26ELANCNFSM5J5LTVKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

leocharrua commented 2 years ago

Hello. I have the same error periodically in a PWA. Anyone has a clue? IMG-20211210-WA0055

mebjas commented 2 years ago

I can reproduce this, the API seem to show error when run directly on the PWA. Need to check if there is a workaround or platform specific issue.

onuh commented 2 years ago

Ok thanks for this confirmation.

Regards.

On Sun, Dec 26, 2021, 7:06 AM minhaz @.***> wrote:

I can reproduce this, the API seem to show error when run directly on the PWA. Need to check if there is a workaround or platform specific issue.

— Reply to this email directly, view it on GitHub https://github.com/mebjas/html5-qrcode/issues/368#issuecomment-1001111239, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGJMHBRJLVUB4XG5R7Z5RYTUS2WE3ANCNFSM5J5LTVKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were assigned.Message ID: @.***>

leocharrua commented 2 years ago

Hello. Any news about this? I have a PWA in production and this error is very frustraiting for the user. Is there any work around or something? Thanks

leocharrua commented 2 years ago

Hello. I think I could solve it. I had a error in a if condition when close the page and the "clear" part never run. Now:

 if (this.html5QrcodeScanner.getState() === Html5QrcodeScannerState.SCANNING) {
      this.html5QrcodeScanner.clear().then(async _ =>  { 
        ...

Doing the clear the error does not occur.

Thanks