From a9627c9421bd66302ab731352f5b7d65d5c873f8 Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Mon, 23 Dec 2024 15:07:18 +0530 Subject: [PATCH] fix: await on device change --- .../src/audio-sink-manager/AudioSinkManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts b/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts index 2d45dc0431..16e74d3437 100644 --- a/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts +++ b/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts @@ -186,12 +186,12 @@ export class AudioSinkManager { await this.playAudioFor(track); }; - private handleAudioDeviceChange = (event: HMSDeviceChangeEvent) => { + private handleAudioDeviceChange = async (event: HMSDeviceChangeEvent) => { // if there is no selection that means this is an init request. No need to do anything if (event.isUserSelection || event.error || !event.selection || event.type === 'video') { return; } - this.unpauseAudioTracks(); + await this.unpauseAudioTracks(); }; /**