special case default - CallMediaHandler can figure it out
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
3eb519b227
commit
46a9326607
3 changed files with 31 additions and 11 deletions
|
@ -53,12 +53,36 @@ export default {
|
|||
// });
|
||||
},
|
||||
|
||||
_findDefault: function(devices) {
|
||||
return devices.some((device) => device.deviceId === 'default') ? 'default' : undefined;
|
||||
},
|
||||
|
||||
setAudioInputDefault: async function() {
|
||||
const devices = await this.getDevices();
|
||||
const audioDefault = this._findDefault(devices.audioinput);
|
||||
this._setAudioInput(audioDefault);
|
||||
},
|
||||
|
||||
setAudioInput: function(deviceId) {
|
||||
this[deviceId === 'default' ? 'setAudioInputDefault' : '_setAudioInput'](deviceId);
|
||||
},
|
||||
|
||||
_setAudioInput: function(deviceId) {
|
||||
UserSettingsStore.setLocalSetting('webrtc_audioinput', deviceId);
|
||||
Matrix.setMatrixCallAudioInput(deviceId);
|
||||
},
|
||||
|
||||
setVideoInputDefault: async function() {
|
||||
const devices = await this.getDevices();
|
||||
const videoDefault = this._findDefault(devices.videoinput);
|
||||
this._setVideoInput(videoDefault);
|
||||
},
|
||||
|
||||
setVideoInput: function(deviceId) {
|
||||
this[deviceId === 'default' ? 'setVideoInputDefault' : '_setVideoInput']();
|
||||
},
|
||||
|
||||
_setVideoInput: function(deviceId) {
|
||||
UserSettingsStore.setLocalSetting('webrtc_videoinput', deviceId);
|
||||
Matrix.setMatrixCallVideoInput(deviceId);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue