Constructor
new SegmentTemplate()
A set of functions for parsing SegmentTemplate elements.
- Source:
Methods
checkSegmentTemplateInfo_(context, info)
Verifies a SegmentTemplate info object.
Parameters:
Name | Type | Description |
---|---|---|
context |
shaka.dash.DashParser.Context | |
info |
shaka.dash.SegmentTemplate.SegmentTemplateInfo |
- Source:
createInitSegment_(context, aes128Key) → {shaka.media.InitSegmentReference}
Creates an init segment reference from a context object.
Parameters:
Name | Type | Description |
---|---|---|
context |
shaka.dash.DashParser.Context | |
aes128Key |
shaka.extern.aes128Key | undefined |
- Source:
Returns:
createStreamInfo(context, requestSegment, streamMapnon-null, isUpdate, segmentLimit, periodDurationMapnon-null, aes128Key) → {shaka.dash.DashParser.StreamInfo}
Creates a new StreamInfo object.
Updates the existing SegmentIndex, if any.
Parameters:
Name | Type | Description |
---|---|---|
context |
shaka.dash.DashParser.Context | |
requestSegment |
shaka.dash.DashParser.RequestSegmentCallback | |
streamMap |
Object.<string, !shaka.extern.Stream> | |
isUpdate |
boolean | True if the manifest is being updated. |
segmentLimit |
number | The maximum number of segments to generate for a SegmentTemplate with fixed duration. |
periodDurationMap |
Object.<string, number> | |
aes128Key |
shaka.extern.aes128Key | undefined |
- Source:
Returns:
fromInheritance_(framenullable) → {Element}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
frame |
shaka.dash.DashParser.InheritanceFrame |
<nullable> |
- Source:
Returns:
- Type
- Element
generateSegmentIndexFromDuration_(context, info, segmentLimit, initSegmentReference, periodDurationMapnon-null, aes128Key) → {Promise.<shaka.media.SegmentIndex>}
Generates a SegmentIndex from fixed-duration segments.
Parameters:
Name | Type | Description |
---|---|---|
context |
shaka.dash.DashParser.Context | |
info |
shaka.dash.SegmentTemplate.SegmentTemplateInfo | |
segmentLimit |
number | The maximum number of segments to generate. |
initSegmentReference |
shaka.media.InitSegmentReference | |
periodDurationMap |
Object.<string, number> | |
aes128Key |
shaka.extern.aes128Key | undefined |
- Source:
Returns:
- Type
- Promise.<shaka.media.SegmentIndex>
generateSegmentIndexFromIndexTemplate_(context, requestSegment, init, info) → {Promise.<shaka.media.SegmentIndex>}
Generates a SegmentIndex from an index URL template.
Parameters:
Name | Type | Description |
---|---|---|
context |
shaka.dash.DashParser.Context | |
requestSegment |
shaka.dash.DashParser.RequestSegmentCallback | |
init |
shaka.media.InitSegmentReference | |
info |
shaka.dash.SegmentTemplate.SegmentTemplateInfo |
- Source:
Returns:
- Type
- Promise.<shaka.media.SegmentIndex>
parseSegmentTemplateInfo_(context) → {shaka.dash.SegmentTemplate.SegmentTemplateInfo}
Parses a SegmentTemplate element into an info object.
Parameters:
Name | Type | Description |
---|---|---|
context |
shaka.dash.DashParser.Context |
- Source:
Returns:
Type Definitions
SegmentTemplateInfo
Contains information about a SegmentTemplate.
Type:
- {timescale: number, segmentDuration: ?number, startNumber: number, scaledPresentationTimeOffset: number, unscaledPresentationTimeOffset: number, timeline: Array.<shaka.media.PresentationTimeline.TimeRange>, mediaTemplate: ?string, indexTemplate: ?string, mimeType: string, codecs: string}
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
timescale |
number | The time-scale of the representation. | |
segmentDuration |
number |
<nullable> |
The duration of the segments in seconds, if given. |
startNumber |
number | The start number of the segments; 1 or greater. | |
scaledPresentationTimeOffset |
number | The presentation time offset of the representation, in seconds. | |
unscaledPresentationTimeOffset |
number | The presentation time offset of the representation, in timescale units. | |
timeline |
Array.<shaka.media.PresentationTimeline.TimeRange> | The timeline of the representation, if given. Times in seconds. | |
mediaTemplate |
string |
<nullable> |
The media URI template, if given. |
indexTemplate |
string |
<nullable> |
The index URI template, if given. |
mimeType |
string | The mimeType. | |
codecs |
string | The codecs. |
- Source: