Skip to content

Commit 7e19f21

Browse files
committed
Cherry-pick changes from #7799
1 parent 1596a02 commit 7e19f21

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/controller/interstitials-controller.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,9 @@ export default class InterstitialsController
10421042
if (timelinePos === -1) {
10431043
const startPosition = this.hls.startPosition;
10441044
this.timelinePos = startPosition;
1045-
if (interstitialEvents.length && interstitialEvents[0].cue.pre) {
1045+
if (interstitialEvents.length === 0) {
1046+
this.setSchedulePosition(0);
1047+
} else if (interstitialEvents[0].cue.pre) {
10461048
this.log(timelineMessage('checkStart (preroll)', startPosition));
10471049
const index = schedule.findEventIndex(interstitialEvents[0].identifier);
10481050
this.setSchedulePosition(index);
@@ -1052,6 +1054,8 @@ export default class InterstitialsController
10521054
startPosition > 0 ? startPosition : 0);
10531055
const index = schedule.findItemIndexAtTime(start);
10541056
this.setSchedulePosition(index);
1057+
} else if (this.hls.liveSyncPosition === 0) {
1058+
this.setSchedulePosition(0);
10551059
} else {
10561060
this.log('[checkStart] waiting for live start');
10571061
}

0 commit comments

Comments
 (0)