From 3ab79c301a40b2084853fd3d1566329df306a15e Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Wed, 23 Oct 2024 16:45:43 +0530 Subject: [PATCH] fix: mute audio when device change throws an error in preview --- packages/hms-video-store/src/interfaces/preview-listener.ts | 4 +++- packages/hms-video-store/src/reactive-store/HMSSDKActions.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/hms-video-store/src/interfaces/preview-listener.ts b/packages/hms-video-store/src/interfaces/preview-listener.ts index 56ac6019ff..4c88d21b2a 100644 --- a/packages/hms-video-store/src/interfaces/preview-listener.ts +++ b/packages/hms-video-store/src/interfaces/preview-listener.ts @@ -1,7 +1,7 @@ import { DeviceChangeListener } from './devices'; import { HMSPeer } from './peer'; import { HMSRoom } from './room'; -import { HMSPeerUpdate, HMSRoomUpdate } from './update-listener'; +import { HMSPeerUpdate, HMSRoomUpdate, HMSTrackUpdate } from './update-listener'; import { HMSException } from '../error/HMSException'; import { HMSTrack } from '../media/tracks/HMSTrack'; @@ -13,4 +13,6 @@ export interface HMSPreviewListener extends DeviceChangeListener { onRoomUpdate(type: HMSRoomUpdate, room: HMSRoom): void; onPeerUpdate(type: HMSPeerUpdate, peer: HMSPeer | HMSPeer[] | null): void; onNetworkQuality?(score: number): void; + // This is needed to mute audio when there is an error in device change + onTrackUpdate(type: HMSTrackUpdate, track: HMSTrack, peer: HMSPeer): void; } diff --git a/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts b/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts index fae041cb22..a6f77818a4 100644 --- a/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts +++ b/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts @@ -932,6 +932,7 @@ export class HMSSDKActions