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:
createFromTimeline_(context, info, initSegmentReference) → {Array.<!shaka.media.SegmentReference>}
Creates segment references from a timeline.
Parameters:
Name | Type | Description |
---|---|---|
context |
shaka.dash.DashParser.Context | |
info |
shaka.dash.SegmentTemplate.SegmentTemplateInfo | |
initSegmentReference |
shaka.media.InitSegmentReference |
- Source:
Returns:
- Type
- Array.<!shaka.media.SegmentReference>
createInitSegment_(context) → {shaka.media.InitSegmentReference}
Creates an init segment reference from a context object.
Parameters:
Name | Type | Description |
---|---|---|
context |
shaka.dash.DashParser.Context |
- Source:
Returns:
createStreamInfo(context, requestInitSegment, streamMapnon-null, isUpdate, segmentLimit, periodDurationMapnon-null) → {shaka.dash.DashParser.StreamInfo}
Creates a new StreamInfo object.
Updates the existing SegmentIndex, if any.
Parameters:
Name | Type | Description |
---|---|---|
context |
shaka.dash.DashParser.Context | |
requestInitSegment |
shaka.dash.DashParser.RequestInitSegmentCallback | |
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> |
- 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) → {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> |
- Source:
Returns:
- Type
- Promise.<shaka.media.SegmentIndex>
generateSegmentIndexFromIndexTemplate_(context, requestInitSegment, init, info) → {Promise.<shaka.media.SegmentIndex>}
Generates a SegmentIndex from an index URL template.
Parameters:
Name | Type | Description |
---|---|---|
context |
shaka.dash.DashParser.Context | |
requestInitSegment |
shaka.dash.DashParser.RequestInitSegmentCallback | |
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.dash.MpdUtils.TimeRange>, mediaTemplate: ?string, indexTemplate: ?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.dash.MpdUtils.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. |
- Source: