Browse Source

Device selection now always shows the device that it managed to open. (#4384)

* Device selection now always shows the device that managed to open.

* Simplifies implementation, skips using state.
j8
Дамян Минков 6 years ago
parent
commit
9c1b802997
No account linked to committer's email address
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      react/features/device-selection/components/DeviceSelection.js

+ 4
- 2
react/features/device-selection/components/DeviceSelection.js View File

372
                 label: 'settings.selectCamera',
372
                 label: 'settings.selectCamera',
373
                 onSelect: selectedVideoInputId =>
373
                 onSelect: selectedVideoInputId =>
374
                     super._onChange({ selectedVideoInputId }),
374
                     super._onChange({ selectedVideoInputId }),
375
-                selectedDeviceId: this.props.selectedVideoInputId
375
+                selectedDeviceId: this.state.previewVideoTrack
376
+                    ? this.state.previewVideoTrack.getDeviceId() : null
376
             },
377
             },
377
             {
378
             {
378
                 devices: availableDevices.audioInput,
379
                 devices: availableDevices.audioInput,
384
                 label: 'settings.selectMic',
385
                 label: 'settings.selectMic',
385
                 onSelect: selectedAudioInputId =>
386
                 onSelect: selectedAudioInputId =>
386
                     super._onChange({ selectedAudioInputId }),
387
                     super._onChange({ selectedAudioInputId }),
387
-                selectedDeviceId: this.props.selectedAudioInputId
388
+                selectedDeviceId: this.state.previewAudioTrack
389
+                    ? this.state.previewAudioTrack.getDeviceId() : null
388
             }
390
             }
389
         ];
391
         ];
390
 
392
 

Loading…
Cancel
Save