Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(QrcodeStream): throw timeout error when camera won't load #351

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

gruhn
Copy link
Owner

@gruhn gruhn commented Jul 17, 2023

On iOS devices in PWA mode, QrcodeStream works initially, but after
killing and restarting the PWA, all video elements fail to display
camera streams. Looks like this is related to this WebKit issue:

https://bugs.webkit.org/show_bug.cgi?id=252465

No workarounds at the time of writing. But as suggested in the
thread we can put a timeout on the video elements to start loading.
That way we can at least detect when the error occurs and throw an
error event.

Also this PR:

  1. Makes the demo page PWA installable to reproduce this problem.
  2. Renames the "DecodeAll" demo to "HandleErrors". The demo already
    is focused on error handling because it renders the error message
    instead of just printing to the console, which is particularly
    useful on mobile devices. Renaming the demo emphasizes that and
    hints user to use this demo for debugging.

See #298

@netlify
Copy link

netlify bot commented Jul 17, 2023

Deploy Preview for vue-qrcode-reader ready!

Name Link
🔨 Latest commit 4c8b6c5
🔍 Latest deploy log https://app.netlify.com/sites/vue-qrcode-reader/deploys/64b6c9ac4bf7d30008d6d3d8
😎 Deploy Preview https://deploy-preview-351--vue-qrcode-reader.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@gruhn gruhn force-pushed the fix-ios-pwa branch 3 times, most recently from 3c210e6 to 411e45f Compare July 18, 2023 17:03
@gruhn gruhn changed the title fix(QrcodeStream): iOS PWA background stream kill feat(QrcodeStream): throw timeout error when camera won't load Jul 18, 2023
On iOS devices in PWA mode, QrcodeStream works initially, but after
killing and restarting the PWA, all video elements fail to display
camera streams. Looks like this is related to this WebKit issue:

  https://bugs.webkit.org/show_bug.cgi?id=252465

No workarounds at the time of writing. But as suggested in the
thread we can put a timeout on the video elements to start loading.
That way we can at least detect when the error occurs and throw an
error event.

Also this commit:

 1. Makes the demo page PWA installable to reproduce this problem.
 2. Renames the "DecodeAll" demo to "HandleErrors". The demo already
    is focused on error handling because it renders the error message
    instead of just printing to the console, which is particularly
    useful on mobile devices. Renaming the demo emphasizes that and
    hints user to use this demo for debugging.

See #298
@gruhn gruhn marked this pull request as ready for review July 18, 2023 17:29
@gruhn gruhn merged commit a8d5da0 into master Jul 18, 2023
@gruhn gruhn deleted the fix-ios-pwa branch July 18, 2023 17:29
@github-actions
Copy link

🎉 This PR is included in version 5.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant