Constructor
new SegmentReference(startTime, endTime, uris, startByte, endBytenullable, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferencesopt, non-null)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
startTime |
number | The segment's start time in seconds. | |
endTime |
number | The segment's end time in seconds. The segment ends the instant before this time, so |endTime| must be strictly greater than |startTime|. | |
uris |
function | A function that creates the URIs of the resource containing the segment. | |
startByte |
number | The offset from the start of the resource to the start of the segment. | |
endByte |
number |
<nullable> |
The offset from the start of the resource to the end of the segment, inclusive. A value of null indicates that the segment extends to the end of the resource. |
initSegmentReference |
shaka.media.InitSegmentReference | The segment's initialization segment metadata, or null if the segments are self-initializing. | |
timestampOffset |
number | The amount of time, in seconds, that must be added to the segment's
internal timestamps to align it to the presentation timeline.
For DASH, this value should equal the Period start time minus the first presentation timestamp of the first frame/sample in the Period. For example, for MP4 based streams, this value should equal Period start minus the first segment's tfdt box's 'baseMediaDecodeTime' field (after it has been converted to seconds). For HLS, this value should be 0 to keep the presentation time at the most recent discontinuity minus the corresponding media time. |
|
appendWindowStart |
number | The start of the append window for this reference, relative to the presentation. Any content from before this time will be removed by MediaSource. | |
appendWindowEnd |
number | The end of the append window for this reference, relative to the presentation. Any content from after this time will be removed by MediaSource. | |
partialReferences |
Array.<!shaka.media.SegmentReference> |
<optional> |
A list of SegmentReferences for the partial segments. |
- Source:
Members
getUrisInner :function(): !Array.<string>
Type:
- function(): !Array.<string>
- Source:
partialReferences :Array.<!shaka.media.SegmentReference>
Type:
- Array.<!shaka.media.SegmentReference>
- Source:
trueEndTime :number
The "true" end time of the segment, without considering the period end
time. This is necessary for thumbnail segments, where timing requires us
to know the original segment duration as described in the manifest.
Type:
- number
- Source:
Methods
getEndByte() → {number}
Returns the offset from the start of the resource to the end of the
segment, inclusive. A value of null indicates that the segment extends to
the end of the resource.
- Source:
Returns:
- Type
- number
getEndTime() → {number}
Returns the segment's end time in seconds.
- Source:
Returns:
- Type
- number
getSize() → {number}
Returns the size of the segment.
- Source:
Returns:
- Type
- number
getStartByte() → {number}
Returns the offset from the start of the resource to the
start of the segment.
- Source:
Returns:
- Type
- number
getStartTime() → {number}
Returns the segment's start time in seconds.
- Source:
Returns:
- Type
- number
getUris() → {Array.<string>}
Creates and returns the URIs of the resource containing the segment.
- Source:
Returns:
- Type
- Array.<string>
hasPartialSegments() → {boolean}
Returns true if it contains partial SegmentReferences.
- Source:
Returns:
- Type
- boolean