File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 312
312
document . getElementById ( "mesh-draw-time-max" ) . innerText = meshRendererStats . getMaximum ( ) . toFixed ( 2 ) . toString ( ) ;
313
313
} , 100 ) ;
314
314
315
- const warmupInterval = setInterval ( ( ) => {
315
+ const warmupInterval = setInterval ( async ( ) => {
316
316
if ( bodyDetector . isReady ( ) && faceDetector . isReady ( ) && handDetector . isReady ( ) ) {
317
317
clearInterval ( warmupInterval ) ;
318
318
319
319
document . getElementById ( "body-detector-ready" ) . innerText = "True" ;
320
320
document . getElementById ( "face-detector-ready" ) . innerText = "True" ;
321
321
document . getElementById ( "hand-detector-ready" ) . innerText = "True" ;
322
- document . getElementById ( "video-input-device-select" ) . disabled = false ;
322
+ ( await Camera . getSelectElement ( ) ) . disabled = false ;
323
323
}
324
324
} , 100 ) ;
325
325
Original file line number Diff line number Diff line change @@ -89,8 +89,12 @@ export class Camera {
89
89
}
90
90
91
91
// Automatically update the select element when the camera permissions are changed.
92
- const cameraPermissionStatus = await navigator . permissions . query ( { name : "camera" } ) ;
93
- cameraPermissionStatus . onchange = async ( ) => await Camera . updateSelectElement ( ) ;
92
+ try {
93
+ const cameraPermissionStatus = await navigator . permissions . query ( { name : "camera" } ) ;
94
+ cameraPermissionStatus . onchange = async ( ) => await Camera . updateSelectElement ( ) ;
95
+ } catch ( e ) {
96
+ // The browser does not support the Permissions API.
97
+ }
94
98
95
99
// Automatically update the select element when the set of available devices changes.
96
100
// todo Test this.
You can’t perform that action at this time.
0 commit comments