From a71332fa1cbfb22efa45e543e58ecbbfa5754c77 Mon Sep 17 00:00:00 2001 From: Rob Walch Date: Fri, 13 Dec 2024 16:25:55 -0800 Subject: [PATCH] Fix additional asset player creation between assets at start Fix uncaught play() Promise --- src/controller/interstitials-controller.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/controller/interstitials-controller.ts b/src/controller/interstitials-controller.ts index c1679eccd8c..32fc16b809f 100644 --- a/src/controller/interstitials-controller.ts +++ b/src/controller/interstitials-controller.ts @@ -75,7 +75,9 @@ export type PlayheadTimes = { }; function playWithCatch(media: HTMLMediaElement | null) { - media?.play().catch(/* no-op */); + media?.play().catch(() => { + /* no-op */ + }); } export default class InterstitialsController @@ -1383,7 +1385,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`, const { playingItem } = this; if ( playingItem && - playingItem !== this.bufferingItem && + !this.itemsMatch(playingItem, this.bufferingItem) && !this.isInterstitial(playingItem) ) { const timelinePos = this.timelinePos; @@ -1644,7 +1646,7 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))}`, } else if ( bufferIsEmpty && playingItem && - bufferingItem !== playingItem && + !this.itemsMatch(playingItem, bufferingItem) && bufferEndIndex === playingIndex ) { this.bufferedToItem(playingItem);