Class: shaka.dash.SegmentTemplate

A set of functions for parsing SegmentTemplate elements.

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, aesKey) → {shaka.media.InitSegmentReference}

Creates an init segment reference from a context object.
Parameters:
Name Type Description
context shaka.dash.DashParser.Context
aesKey shaka.extern.aesKey | undefined
Source:
Returns:
Type
shaka.media.InitSegmentReference

createStreamInfo(context, requestSegment, streamMapnon-null, isUpdate, segmentLimit, periodDurationMapnon-null, aesKey, lastSegmentNumbernullable, isPatchUpdate) → {shaka.dash.DashParser.StreamInfo}

Creates a new StreamInfo object. Updates the existing SegmentIndex, if any.
Parameters:
Name Type Attributes 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>
aesKey shaka.extern.aesKey | undefined
lastSegmentNumber number <nullable>
isPatchUpdate boolean
Source:
Returns:
Type
shaka.dash.DashParser.StreamInfo

fromInheritance_(framenullable) → {shaka.extern.xml.Node}

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

generateSegmentIndexFromDuration_(context, info, segmentLimit, initSegmentReference, periodDurationMapnon-null, aesKey, lastSegmentNumbernullable) → {Promise.<shaka.media.SegmentIndex>}

Generates a SegmentIndex from fixed-duration segments.
Parameters:
Name Type Attributes 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>
aesKey shaka.extern.aesKey | undefined
lastSegmentNumber number <nullable>
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>

modifyTimepoints(contextnon-null, patchNode)

Ingests Patch MPD segments into timeline.
Parameters:
Name Type Description
context shaka.dash.DashParser.Context
patchNode shaka.extern.xml.Node
Source:

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

removeTimepoints(contextnon-null)

Removes all segments from timeline.
Parameters:
Name Type Description
context shaka.dash.DashParser.Context
Source:

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: