From c6835aa6b1f096877861093f6580b5c09658eee7 Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Thu, 27 Feb 2025 15:25:40 +0530 Subject: [PATCH] fix: delay in device auto selection on mweb --- packages/hms-video-store/src/sdk/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/hms-video-store/src/sdk/index.ts b/packages/hms-video-store/src/sdk/index.ts index f98139cef5..46d69a1507 100644 --- a/packages/hms-video-store/src/sdk/index.ts +++ b/packages/hms-video-store/src/sdk/index.ts @@ -1388,16 +1388,17 @@ export class HMSSdk implements HMSInterface { ); this.listener?.onError(error); } - this.setLocalPeerTrack(track); + await this.setLocalPeerTrack(track); this.listener?.onTrackUpdate(HMSTrackUpdate.TRACK_ADDED, track, this.localPeer!); } } - private setLocalPeerTrack(track: HMSLocalTrack) { + private async setLocalPeerTrack(track: HMSLocalTrack) { track.peerId = this.localPeer?.peerId; switch (track.type) { case HMSTrackType.AUDIO: this.localPeer!.audioTrack = track as HMSLocalAudioTrack; + await this.deviceManager.autoSelectAudioOutput(); break; case HMSTrackType.VIDEO: