From e15ad22c7b35bdc6dcf556974a0f260db7882a9f Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Tue, 10 Dec 2024 20:32:55 +0530 Subject: [PATCH] fix: use retry for decode error --- packages/hms-video-store/src/device-manager/DeviceManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/hms-video-store/src/device-manager/DeviceManager.ts b/packages/hms-video-store/src/device-manager/DeviceManager.ts index 60939a00f2..3898560b06 100644 --- a/packages/hms-video-store/src/device-manager/DeviceManager.ts +++ b/packages/hms-video-store/src/device-manager/DeviceManager.ts @@ -483,7 +483,8 @@ export class DeviceManager implements HMSDeviceManager { */ // eslint-disable-next-line complexity public autoSelectAudioOutput = async () => { - if ('ondevicechange' in navigator.mediaDevices || !this.audioInputChanged) { + // do this only after join so the earpiece would be selected at the right time + if ('ondevicechange' in navigator.mediaDevices || !this.store.getLocalPeer()?.joinedAt) { return; } const { bluetoothDevice, earpiece, speakerPhone, wired } = this.categorizeAudioInputDevices();