Skip to content

Commit

Permalink
Return live playlist end for interstitialManager primary/playout/inte…
Browse files Browse the repository at this point in the history
…grated duration

(cherry picked from commit 161bf44d0186a263bc82299fc09e52b913f2d2f8)
  • Loading branch information
robwalch committed Jul 31, 2024
1 parent 0b09b6f commit 5842cc2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/controller/interstitials-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,13 @@ export default class InterstitialsController
}
return 0;
};
const getMappedDuration = (timelineType: TimelineType): number => {
if (c.primaryDetails?.live) {
// return end of last event item or playlist
return c.primaryDetails.edge;
}
return c.schedule.durations[timelineType];
};
const seekTo = (time: number, timelineType: TimelineType) => {
const item = effectivePlayingItem();
if (item?.event?.restrictions.skip) {
Expand Down Expand Up @@ -417,7 +424,7 @@ export default class InterstitialsController
return timelinePos > 0 ? timelinePos : 0;
},
get duration() {
return c.schedule.durations.primary;
return getMappedDuration('primary');
},
seekTo: (time) => seekTo(time, 'primary'),
},
Expand All @@ -441,7 +448,7 @@ export default class InterstitialsController
);
},
get duration() {
return c.schedule.durations.playout;
return getMappedDuration('playout');
},
seekTo: (time) => seekTo(time, 'playout'),
},
Expand All @@ -465,7 +472,7 @@ export default class InterstitialsController
);
},
get duration() {
return c.schedule.durations.integrated;
return getMappedDuration('integrated');
},
seekTo: (time) => seekTo(time, 'integrated'),
},
Expand Down

0 comments on commit 5842cc2

Please sign in to comment.