File tree Expand file tree Collapse file tree
desktop/src/renderer/src/libs/media Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,12 @@ class Camera {
4040 this . width = width ;
4141 this . height = height ;
4242 if ( audioId ) this . audioId = audioId ;
43- this . stream = await navigator . mediaDevices . getUserMedia ( { video, audio } ) ;
43+
44+ try {
45+ this . stream = await navigator . mediaDevices . getUserMedia ( { video, audio } ) ;
46+ } catch {
47+ this . stream = await navigator . mediaDevices . getUserMedia ( { video, audio : false } ) ;
48+ }
4449 }
4550
4651 public async updateResolution ( width : number , height : number ) {
Original file line number Diff line number Diff line change @@ -40,7 +40,12 @@ class Camera {
4040 this . width = width
4141 this . height = height
4242 if ( audioId ) this . audioId = audioId
43- this . stream = await navigator . mediaDevices . getUserMedia ( { video, audio } )
43+
44+ try {
45+ this . stream = await navigator . mediaDevices . getUserMedia ( { video, audio } )
46+ } catch {
47+ this . stream = await navigator . mediaDevices . getUserMedia ( { video, audio : false } )
48+ }
4449 }
4550
4651 public async updateResolution ( width : number , height : number ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments