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.
This commit is contained in:
Дамян Минков 2019-06-27 17:04:47 +01:00 committed by GitHub
parent bb3a10b0fc
commit 9c1b802997
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -372,7 +372,8 @@ class DeviceSelection extends AbstractDialogTab<Props, State> {
label: 'settings.selectCamera', label: 'settings.selectCamera',
onSelect: selectedVideoInputId => onSelect: selectedVideoInputId =>
super._onChange({ selectedVideoInputId }), super._onChange({ selectedVideoInputId }),
selectedDeviceId: this.props.selectedVideoInputId selectedDeviceId: this.state.previewVideoTrack
? this.state.previewVideoTrack.getDeviceId() : null
}, },
{ {
devices: availableDevices.audioInput, devices: availableDevices.audioInput,
@ -384,7 +385,8 @@ class DeviceSelection extends AbstractDialogTab<Props, State> {
label: 'settings.selectMic', label: 'settings.selectMic',
onSelect: selectedAudioInputId => onSelect: selectedAudioInputId =>
super._onChange({ selectedAudioInputId }), super._onChange({ selectedAudioInputId }),
selectedDeviceId: this.props.selectedAudioInputId selectedDeviceId: this.state.previewAudioTrack
? this.state.previewAudioTrack.getDeviceId() : null
} }
]; ];