Skip to content

Commit

Permalink
fix: show toast on error, re-subscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 committed Dec 9, 2024
1 parent 6e4aef8 commit bc42b2c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down

0 comments on commit bc42b2c

Please sign in to comment.