Skip to content

Commit

Permalink
fix: mute audio when device change throws an error in preview
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 authored Oct 23, 2024
1 parent e8da8fd commit 3ab79c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/hms-video-store/src/interfaces/preview-listener.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,7 @@ export class HMSSDKActions<T extends HMSGenericTypes = { sessionStore: Record<st
onRoomUpdate: this.onRoomUpdate.bind(this),
onPeerUpdate: this.onPeerUpdate.bind(this),
onNetworkQuality: this.onNetworkQuality.bind(this),
onTrackUpdate: this.onTrackUpdate.bind(this),
});
this.sdk.addAudioListener({
onAudioLevelUpdate: this.onAudioLevelUpdate.bind(this),
Expand Down

0 comments on commit 3ab79c3

Please sign in to comment.