Skip to content

Commit

Permalink
fix: revert audiosink maager code
Browse files Browse the repository at this point in the history
  • Loading branch information
amar-1995 committed Sep 17, 2024
1 parent 352ff8c commit 7fbaf6c
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,12 @@ export class AudioSinkManager {
};

private removeAudioElement = (audioEl: HTMLAudioElement, track: HMSRemoteAudioTrack) => {
HMSLogger.d(this.TAG, 'removing audio element', `${track}`);
audioEl.removeEventListener('pause', this.handleAudioPaused);
audioEl.srcObject = null;
audioEl.remove();
track.setAudioElement(null);
if (audioEl) {
HMSLogger.d(this.TAG, 'removing audio element', `${track}`);
audioEl.removeEventListener('pause', this.handleAudioPaused);
audioEl.srcObject = null;
audioEl.remove();
track.setAudioElement(null);
}
};
}

0 comments on commit 7fbaf6c

Please sign in to comment.