Skip to content

Commit

Permalink
Rename slidingStart > seekableStart
Browse files Browse the repository at this point in the history
Add comments describing each field in `InterstitialsManager` API markdown

(cherry picked from commit bcb2db84d1ffba18befd658b284695fb0a69f7d4)
  • Loading branch information
robwalch committed Sep 9, 2024
1 parent e5915a7 commit e88a6a9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion api-extractor/report/hls.js.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4045,7 +4045,7 @@ export type PlayheadTimes = {
bufferedEnd: number;
currentTime: number;
duration: number;
slidingStart: number;
seekableStart: number;
seekTo: (time: number) => void;
};

Expand Down
39 changes: 20 additions & 19 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
```
Expand Down
8 changes: 4 additions & 4 deletions src/controller/interstitials-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export type PlayheadTimes = {
bufferedEnd: number;
currentTime: number;
duration: number;
slidingStart: number;
seekableStart: number;
seekTo: (time: number) => void;
};

Expand Down Expand Up @@ -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'),
Expand All @@ -521,7 +521,7 @@ export default class InterstitialsController
get duration() {
return getMappedDuration('playout');
},
get slidingStart() {
get seekableStart() {
return findMappedTime(
c.primaryDetails?.fragmentStart || 0,
'playout',
Expand Down Expand Up @@ -551,7 +551,7 @@ export default class InterstitialsController
get duration() {
return getMappedDuration('integrated');
},
get slidingStart() {
get seekableStart() {
return findMappedTime(
c.primaryDetails?.fragmentStart || 0,
'integrated',
Expand Down

0 comments on commit e88a6a9

Please sign in to comment.