diff --git a/src/main_thread/tracks_store/tracks_store.ts b/src/main_thread/tracks_store/tracks_store.ts index 1c9f44c46b..a2f0b83540 100644 --- a/src/main_thread/tracks_store/tracks_store.ts +++ b/src/main_thread/tracks_store/tracks_store.ts @@ -405,7 +405,7 @@ export default class TracksStore extends EventEmitter { nextAdaptation === undefined && bufferType === "audio" && this.onAudioTracksNotPlayable === "continue" && - findNextPlayableAdaptation(period, "video") + findNextPlayableAdaptation(period, "video") !== undefined ) { // Audio is not playable but video is playable, let's continue the playback. log.warn(`TS: No playable audio, continuing with video only`); @@ -413,7 +413,7 @@ export default class TracksStore extends EventEmitter { nextAdaptation === undefined && bufferType === "video" && this.onVideoTracksNotPlayable === "continue" && - findNextPlayableAdaptation(period, "audio") + findNextPlayableAdaptation(period, "audio") !== undefined ) { // Video is not playable but audio is playable, let's continue the playback. log.warn(`TS: No playable video, continuing with audio only`); @@ -433,15 +433,16 @@ export default class TracksStore extends EventEmitter { } const switchingMode = bufferType === "audio" ? this._defaultAudioTrackSwitchingMode : "reload"; - const storedSettings = nextAdaptation - ? { - adaptation: nextAdaptation, - switchingMode, - lockedRepresentations: new SharedReference( - null, - ), - } - : null; + const storedSettings = + nextAdaptation !== undefined + ? { + adaptation: nextAdaptation, + switchingMode, + lockedRepresentations: new SharedReference( + null, + ), + } + : null; typeInfo.storedSettings = storedSettings; this.trigger("trackUpdate", { period: toExposedPeriod(period),