Class: shaka.dash.SegmentTemplate

A set of functions for parsing SegmentTemplate elements.

Methods

(private, static) checkSegmentTemplateInfo_(context, info)

Verifies a SegmentTemplate info object.
Parameters:
Name Type Description
context shaka.dash.DashParser.Context
info shaka.dash.SegmentTemplate.SegmentTemplateInfo
Source:
Throws:
shaka.util.Error When there is a parsing error.

(private, static) createFromDuration_(context, info) → {shaka.dash.DashParser.SegmentIndexFunctions}

Creates segment index functions from a segment duration.
Parameters:
Name Type Description
context shaka.dash.DashParser.Context
info shaka.dash.SegmentTemplate.SegmentTemplateInfo
Source:
Returns:
Type
shaka.dash.DashParser.SegmentIndexFunctions

(private, static) createFromIndexTemplate_(context, requestInitSegment, init, info) → {shaka.dash.DashParser.SegmentIndexFunctions}

Creates segment index functions from a 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:
Throws:
shaka.util.Error When there is a parsing error.
Returns:
Type
shaka.dash.DashParser.SegmentIndexFunctions

(private, static) createFromTimeline_(context, info) → (non-null) {Array.<!shaka.media.SegmentReference>}

Creates segment references from a timeline.
Parameters:
Name Type Description
context shaka.dash.DashParser.Context
info shaka.dash.SegmentTemplate.SegmentTemplateInfo
Source:
Returns:
Type
Array.<!shaka.media.SegmentReference>

(private, static) 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:
Type
shaka.media.InitSegmentReference

(static) createStream(context, requestInitSegment, segmentIndexMapnon-null, isUpdate) → {shaka.dash.DashParser.StreamInfo}

Creates a new Stream object or updates the Stream in the manifest.
Parameters:
Name Type Description
context shaka.dash.DashParser.Context
requestInitSegment shaka.dash.DashParser.RequestInitSegmentCallback
segmentIndexMap Object.<string, !shaka.media.SegmentIndex>
isUpdate boolean True if the manifest is being updated.
Source:
Throws:
shaka.util.Error When there is a parsing error.
Returns:
Type
shaka.dash.DashParser.StreamInfo

(private, static) fromInheritance_(framenullable) → {Element}

Parameters:
Name Type Attributes Description
frame shaka.dash.DashParser.InheritanceFrame <nullable>
Source:
Returns:
Type
Element

(private, static) 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
shaka.dash.SegmentTemplate.SegmentTemplateInfo

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: