-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(QrcodeStream): throw timeout error when camera won't load
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
- Loading branch information
Showing
18 changed files
with
2,568 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,7 @@ out | |
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
dev-dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ button { | |
top: 10px; | ||
} | ||
button img { | ||
with: 50px; | ||
width: 50px; | ||
height: 50px; | ||
} | ||
.error { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ button { | |
top: 10px; | ||
} | ||
button img { | ||
with: 50px; | ||
width: 50px; | ||
height: 50px; | ||
} | ||
.error { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# Decode Continuously | ||
# Handle Errors | ||
|
||
Hold a QR code in the camera and see what happens. Note, you can't scan the same | ||
QR code multiple time in a row. | ||
|
||
<ClientOnly> | ||
<DemoWrapper :component="DecodeAll" /> | ||
<DemoWrapper :component="HandleErrors" /> | ||
</ClientOnly> | ||
|
||
<script setup lang="ts"> | ||
import DemoWrapper from '@/components/DemoWrapper.vue' | ||
import DecodeAll from '@/components/demos/DecodeAll.vue' | ||
import HandleErrors from '@/components/demos/HandleErrors.vue' | ||
</script> | ||
|
||
### Source | ||
|
||
<<< @/.vitepress/components/demos/DecodeAll.vue | ||
<<< @/.vitepress/components/demos/HandleErrors.vue |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.