File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -350,11 +350,19 @@ export class DeviceManager {
350350 ) ;
351351 }
352352
353+ if ( ! unUsedDevice ) {
354+ return {
355+ success : true ,
356+ code : 0 ,
357+ } ;
358+ }
359+
360+ const deviceId = type === 'screen' ? unUsedDevice . id : unUsedDevice . deviceId ;
353361 const device : Device = {
354- id : unUsedDevice . deviceId ,
362+ id : deviceId ,
355363 name : unUsedDevice . label ,
356364 type : type ,
357- classId : this . getOrCreateClassId ( unUsedDevice . deviceId , type ) ,
365+ classId : this . getOrCreateClassId ( deviceId , type ) ,
358366 enabled : true ,
359367 isDefault : false ,
360368 } ;
@@ -375,6 +383,7 @@ export class DeviceManager {
375383 removeDevice ( device : Device ) {
376384 const index = this . userDevices . indexOf ( device ) ;
377385 if ( index > - 1 ) {
386+ this . stopDeviceStream ( device ) ;
378387 this . userDevices . splice ( index , 1 ) ;
379388 this . updateCanAddState ( ) ;
380389 }
You can’t perform that action at this time.
0 commit comments