From bc42b2c664708a79a7dab775b86102c7dcb5c0c7 Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Mon, 9 Dec 2024 14:19:15 +0530 Subject: [PATCH] fix: show toast on error, re-subscribe --- .../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 49e9e97e34..60158f45e8 100644 --- a/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts +++ b/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts @@ -129,7 +129,7 @@ export class AudioSinkManager { audioEl.style.display = 'none'; audioEl.id = track.trackId; audioEl.addEventListener('pause', this.handleAudioPaused); - this.handleAudioElementError(audioEl, peer, track); + this.handleAudioElementError(audioEl, track); track.setAudioElement(audioEl); HMSLogger.d(this.TAG, 'Audio track added', `${track}`); this.init(); // call to create sink element if not already created @@ -141,7 +141,7 @@ export class AudioSinkManager { await this.handleAutoplayError(track); }; - private handleAudioElementError = (audioEl: HTMLAudioElement, peer: HMSRemotePeer, track: HMSRemoteAudioTrack) => { + private handleAudioElementError = (audioEl: HTMLAudioElement, track: HMSRemoteAudioTrack) => { audioEl.addEventListener('error', async () => { HMSLogger.e(this.TAG, 'error on audio element for track - ', track.trackId, 'error code', audioEl?.error?.code); const ex = ErrorFactory.TracksErrors.AudioPlaybackError(