diff --git a/api-extractor/report/hls.js.api.md b/api-extractor/report/hls.js.api.md index c71b06cb980..b6ad34c29ef 100644 --- a/api-extractor/report/hls.js.api.md +++ b/api-extractor/report/hls.js.api.md @@ -4045,7 +4045,7 @@ export type PlayheadTimes = { bufferedEnd: number; currentTime: number; duration: number; - slidingStart: number; + seekableStart: number; seekTo: (time: number) => void; }; diff --git a/docs/API.md b/docs/API.md index 720bc64e95b..e9e5007ad76 100644 --- a/docs/API.md +++ b/docs/API.md @@ -1973,28 +1973,29 @@ Use `skip()` to skip the current interstitial. Use `primary`, `playout`, and `in ```ts interface InterstitialsManager { - events: InterstitialEvent[]; - schedule: InterstitialScheduleItem[]; - playerQueue: HlsAssetPlayer[]; - bufferingPlayer: HlsAssetPlayer | null; - bufferingAsset: InterstitialAssetItem | null; - bufferingItem: InterstitialScheduleItem | null; - bufferingIndex: number; - playingAsset: InterstitialAssetItem | null; - playingItem: InterstitialScheduleItem | null; - playingIndex: number; - waitingIndex: number; - primary: PlayheadTimes; - playout: PlayheadTimes; - integrated: PlayheadTimes; - skip: () => void; + events: InterstitialEvent[]; // An array of Interstitials (events) parsed from the latest media playlist update + schedule: InterstitialScheduleItem[]; // An array of primary and event items with start and end times representing the scheduled program + playerQueue: HlsAssetPlayer[]; // And array of child Hls instances created to preload and stream Interstitial asset content + bufferingPlayer: HlsAssetPlayer | null; // The child Hls instance assigned to streaming media at the edge of the forward buffer + bufferingAsset: InterstitialAssetItem | null; // The Interstitial asset currently being streamed + bufferingItem: InterstitialScheduleItem | null; // The primary item or event item currently being streamed + bufferingIndex: number; // The index of `bufferingItem` in the `schedule` array + playingAsset: InterstitialAssetItem | null; // The Interstitial asset currently being streamed + playingItem: InterstitialScheduleItem | null; // The primary item or event item currently being played + playingIndex: number; // The index of `playingItem` in the `schedule` array + waitingIndex: number; // The index of the item whose asset list is being loaded in the `schedule` array + primary: PlayheadTimes; // playhead mapping and seekTo method based on the primary content + playout: PlayheadTimes; // playhead mapping and seekTo method based on playout of all items in the `schedule` array + integrated: PlayheadTimes; // playhead mapping and seekTo method that applies the X-TIMELINE-OCCUPIES attribute to each event item + skip: () => void; // A method for skipping the currently playing event item, provided it is not jump restricted } type PlayheadTimes = { - bufferedEnd: number; - currentTime: number; - duration: number; - seekTo: (time: number) => void; + bufferedEnd: number; // The buffer end time relative to the playhead in the scheduled program + currentTime: number; // The current playhead time in the scheduled program + duration: number; // The time at the end of the scheduled program + seekableStart: number; // The earliest available time where media is available (maps to the start of the first segment in primary media playlists) + seekTo: (time: number) => void; // A method for seeking to the designated time the scheduled program }; ``` diff --git a/src/controller/interstitials-controller.ts b/src/controller/interstitials-controller.ts index 7bba732f12e..e1aefb244f2 100644 --- a/src/controller/interstitials-controller.ts +++ b/src/controller/interstitials-controller.ts @@ -70,7 +70,7 @@ export type PlayheadTimes = { bufferedEnd: number; currentTime: number; duration: number; - slidingStart: number; + seekableStart: number; seekTo: (time: number) => void; }; @@ -494,7 +494,7 @@ export default class InterstitialsController get duration() { return getMappedDuration('primary'); }, - get slidingStart() { + get seekableStart() { return c.primaryDetails?.fragmentStart || 0; }, seekTo: (time) => seekTo(time, 'primary'), @@ -521,7 +521,7 @@ export default class InterstitialsController get duration() { return getMappedDuration('playout'); }, - get slidingStart() { + get seekableStart() { return findMappedTime( c.primaryDetails?.fragmentStart || 0, 'playout', @@ -551,7 +551,7 @@ export default class InterstitialsController get duration() { return getMappedDuration('integrated'); }, - get slidingStart() { + get seekableStart() { return findMappedTime( c.primaryDetails?.fragmentStart || 0, 'integrated',