Constructor
new PresentationTimeline(duration, presentationStartTimenullable, segmentAvailabilityDurationnullable, maxSegmentDuration, clockOffset)
Creates a PresentationTimeline.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
duration |
number | The presentation's duration in seconds. POSITIVE_INFINITY indicates that the presentation continues indefinitely. | |
presentationStartTime |
number |
<nullable> |
The wall-clock time, in seconds, when the presentation started or will start. Only required for live. |
segmentAvailabilityDuration |
number |
<nullable> |
The amount of time, in seconds, that the start of a segment remains available after the live-edge moves past the end of the segment. POSITIVE_INFINITY indicates that segments remain available indefinitely. For example, if your live presentation has a 5 minute DVR window and your segments are typically 10 seconds long then you should set this value to 4 minutes and 50 seconds. Only required for live. |
maxSegmentDuration |
number | The maximum duration, in seconds, of any one segment in the presentation. | |
clockOffset |
number | The difference between the client clock and the media server time, in milliseconds (i.e. ServerTime = Date.now() + clockOffset). |
- Source:
- See:
Members
-
(private) clockOffset_ :number
-
Type:
- number
-
(private) duration_ :number
-
Type:
- number
-
(private) maxSegmentDuration_ :number
-
Type:
- number
-
(private, nullable) presentationStartTime_ :number
-
Type:
- number
-
(private, nullable) segmentAvailabilityDuration_ :number
-
Type:
- number
Methods
-
getDuration() → {number}
-
Returns:
The presentation's duration in seconds. POSITIVE_INFINITY indicates that the presentation continues indefinitely.- Type
- number
-
(private) getLiveEdge_() → {number}
-
Returns:
The current presentation time in seconds.- Type
- number
-
getSegmentAvailabilityDuration() → (nullable) {number}
-
Returns:
The presentation's segment availability duration. Always returns null for video-on-demand, and never returns null for live.- Type
- number
-
getSegmentAvailabilityEnd() → {number}
-
Gets the presentation's current segment availability end time. Segments starting after this time should be assumed to be unavailable.
Returns:
The current segment availability end time, in seconds, relative to the start of the presentation. Always returns the presentation's duration for video-on-demand.- Type
- number
-
getSegmentAvailabilityStart() → {number}
-
Gets the presentation's current segment availability start time. Segments ending at or before this time should be assumed to be unavailable.
Returns:
The current segment availability start time, in seconds, relative to the start of the presentation. Always returns 0 for video-on-demand.- Type
- number
-
setDuration(duration)
-
Sets the presentation's duration. The duration may be updated at any time.
Parameters:
Name Type Description duration
number The presentation's duration in seconds. POSITIVE_INFINITY indicates that the presentation continues indefinitely. -
setSegmentAvailabiliyDuration(segmentAvailabilityDurationnullable)
-
Updates the presentation's segment availability duration. The segment availability duration can only be updated for live.
Parameters:
Name Type Attributes Description segmentAvailabilityDuration
number <nullable>
The presentation's new segment availability duration in seconds.