Skip to content

Commit

Permalink
fix: handle audio decode error
Browse files Browse the repository at this point in the history
  • Loading branch information
amar-1995 committed Sep 26, 2024
1 parent 35e0778 commit a421fab
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,14 @@ export class AudioSinkManager {
);
this.eventBus.analytics.publish(AnalyticsEventFactory.audioPlaybackError(ex));
if (audioEl?.error?.code === MediaError.MEDIA_ERR_DECODE) {
this.removeAudioElement(audioEl, track);
// try to wait for main execution to complete.
await sleep(500);
this.removeAudioElement(audioEl, track);
await this.handleTrackAdd({ track, peer, callListener: false });
}
};
track.setAudioElement(audioEl);
track.setVolume(this.volume);
await track.setVolume(this.volume);
HMSLogger.d(this.TAG, 'Audio track added', `${track}`);
this.init(); // call to create sink element if not already created
this.audioSink?.append(audioEl);
Expand Down

0 comments on commit a421fab

Please sign in to comment.