Class: shaka.media.SegmentReference

Constructor

new SegmentReference(startTime, endTimenullable, urlnon-null)

Creates a SegmentReference, which is a reference to some media segment.
Parameters:
Name Type Attributes Description
startTime number The time, in seconds, that the segment begins.
endTime number <nullable>
The time, in seconds, that the segment ends. The segment ends immediately before this time. A null value indicates that the segment continues to the end of the stream.
url shaka.util.FailoverUri The failover url of the media segment.
Source:

Members

(constant, nullable) endTime :number

The time, in seconds, that the segment ends. The segment ends immediately before this time. A null value indicates that the segment continues to the end of the stream.
Type:
  • number
Source:

(constant) startTime :number

The time, in seconds, that the segment begins.
Type:
  • number
Source:

(constant, non-null) url :shaka.util.FailoverUri

The segment's location.
Type:
Source:

Methods

(static) assertCorrectReferences(referencesnon-null)

Asserts that |references| are sorted by their start times without gaps and have unique start times. For debugging purposes.
Parameters:
Name Type Description
references Array.<!shaka.media.SegmentReference>
Source:

(static) find(referencesnon-null, time) → {number}

Gets the index into |references| of the SegmentReference corresponding to the specified time.
Parameters:
Name Type Description
references Array.<!shaka.media.SegmentReference>
time number The time in seconds.
Source:
Returns:
The index of the SegmentReference for the specified time, or -1 if no such SegmentReference exists.
Type
number

(static) shift(referencesnon-null, delta) → (non-null) {Array.<!shaka.media.SegmentReference>}

Shifts each SegmentReference in time by |delta| seconds.
Parameters:
Name Type Description
references Array.<!shaka.media.SegmentReference>
delta number
Source:
Returns:
The shifted SegmentReferences.
Type
Array.<!shaka.media.SegmentReference>

adjust(startTime, endTimenullable) → (non-null) {shaka.media.SegmentReference}

Creates a new SegmentReference with an adjusted start time and an adjusted end time.
Parameters:
Name Type Attributes Description
startTime number
endTime number <nullable>
Source:
Returns:
Type
shaka.media.SegmentReference