diff --git a/packages/hms-video-store/src/analytics/AnalyticsEventFactory.ts b/packages/hms-video-store/src/analytics/AnalyticsEventFactory.ts index 4197182456..6f0a278eb2 100644 --- a/packages/hms-video-store/src/analytics/AnalyticsEventFactory.ts +++ b/packages/hms-video-store/src/analytics/AnalyticsEventFactory.ts @@ -138,7 +138,7 @@ export default class AnalyticsEventFactory { static audioRecovered(message: string) { return new AnalyticsEvent({ name: 'audioRecovered', - level: AnalyticsEventLevel.VERBOSE, + level: AnalyticsEventLevel.INFO, properties: { message, }, 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 9359b0b88e..e61f53a60f 100644 --- a/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts +++ b/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts @@ -9,7 +9,6 @@ import { HMSRemoteAudioTrack } from '../media/tracks'; import { HMSRemotePeer } from '../sdk/models/peer'; import { Store } from '../sdk/store'; import HMSLogger from '../utils/logger'; -import { sleep } from '../utils/timer-utils'; /** * Following are the errors thrown when autoplay is blocked in different browsers @@ -138,15 +137,11 @@ export class AudioSinkManager { ); this.eventBus.analytics.publish(AnalyticsEventFactory.audioPlaybackError(ex)); if (audioEl?.error?.code === MediaError.MEDIA_ERR_DECODE) { - // try to wait for main execution to complete first - this.removeAudioElement(audioEl, track); - await sleep(500); - await this.handleTrackAdd({ track, peer, callListener: false }); - if (!this.state.autoplayFailed) { - this.eventBus.analytics.publish( - AnalyticsEventFactory.audioRecovered('Audio recovered after media decode error'), - ); - } + await track.setVolume(0); + await track.setVolume(this.volume); + this.eventBus.analytics.publish( + AnalyticsEventFactory.audioRecovered('Audio recovered after media decode error'), + ); } }; track.setAudioElement(audioEl);