File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -876,8 +876,18 @@ export class AVInterface {
876876 console . log ( 'getAVDevices, getUserMedia...' , error )
877877 }
878878 }
879- this . devices = ( await navigator . mediaDevices . enumerateDevices ( ) ) . filter (
880- ( el ) => el . deviceId !== 'default' && el . deviceId !== 'communications'
879+ const enumDevices = await navigator . mediaDevices . enumerateDevices ( )
880+ const unfiltered = { }
881+ enumDevices . forEach ( ( el ) => {
882+ if ( el . deviceId !== 'default' && el . deviceId !== 'communications' ) {
883+ // this will not be filtered
884+ unfiltered [ el . kind ] = ( unfiltered [ el . kind ] || 0 ) + 1
885+ }
886+ } )
887+ this . devices = enumDevices . filter (
888+ ( el ) =>
889+ ( el . deviceId !== 'default' && el . deviceId !== 'communications' ) ||
890+ ! unfiltered [ el . kind ]
881891 )
882892 return this . devices
883893 }
You can’t perform that action at this time.
0 commit comments