in web-ui/src/components/chime/ChimeSdkWrapper.js [389:409]
audioOutputsChanged(freshAudioOutputDeviceList) {
let hasCurrentDevice = false;
this.audioOutputDevices = [];
freshAudioOutputDeviceList.forEach((mediaDeviceInfo) => {
if (
this.currentAudioOutputDevice &&
mediaDeviceInfo.deviceId === this.currentAudioOutputDevice.value
) {
hasCurrentDevice = true;
}
this.audioOutputDevices.push({
label: mediaDeviceInfo.label,
value: mediaDeviceInfo.deviceId,
});
});
if (!hasCurrentDevice) {
this.currentAudioOutputDevice =
this.audioOutputDevices.length > 0 ? this.audioOutputDevices[0] : null;
}
this.publishDevicesUpdated();
}