Skip to content

Commit 9b5a741

Browse files
yaroslawwwgruhn
authored andcommitted
docs: Update demos/DecodeAll.vue
Added conditions.
1 parent c222293 commit 9b5a741

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/.vuepress/components/demos/DecodeAll.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default {
3232
await promise
3333
} catch (error) {
3434
if (error.name === 'NotAllowedError') {
35-
this.error = "ERROR: you need to grant camera access permisson"
35+
this.error = "ERROR: you need to grant camera access permission"
3636
} else if (error.name === 'NotFoundError') {
3737
this.error = "ERROR: no camera on this device"
3838
} else if (error.name === 'NotSupportedError') {
@@ -43,6 +43,10 @@ export default {
4343
this.error = "ERROR: installed cameras are not suitable"
4444
} else if (error.name === 'StreamApiNotSupportedError') {
4545
this.error = "ERROR: Stream API is not supported in this browser"
46+
} else if (error.name === 'InsecureContextError') {
47+
this.error = 'ERROR: Camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.';
48+
} else {
49+
this.error = `ERROR: Camera error (${error.name})`;
4650
}
4751
}
4852
}

0 commit comments

Comments
 (0)