Class: shaka.dash.MpdUtils

MPD processing utility functions.

Source:

Methods

(static) createTimeline(segmentTimelinenon-null, timescale, presentationTimeOffset, periodDuration) → (non-null) {Array.<shaka.dash.MpdUtils.TimeRange>}

Expands a SegmentTimeline into an array-based timeline. The results are in seconds.
Parameters:
Name Type Description
segmentTimeline Element
timescale number
presentationTimeOffset number
periodDuration number The Period's duration in seconds. Infinity indicates that the Period continues indefinitely.
Source:
Returns:
Type
Array.<shaka.dash.MpdUtils.TimeRange>

(static) fillUriTemplate(uriTemplate, representationIdnullable, numbernullable, bandwidthnullable, timenullable) → {string}

Fills a SegmentTemplate URI template. This function does not validate the resulting URI.
Parameters:
Name Type Attributes Description
uriTemplate string
representationId string <nullable>
number number <nullable>
bandwidth number <nullable>
time number <nullable>
Source:
See:
  • ISO/IEC 23009-1:2014 section 5.3.9.4.4
Returns:
A URI string.
Type
string

(static) inheritAttribute(context, callback, attribute) → (nullable) {string}

Searches the inheritance for a Segment* with the given attribute.
Parameters:
Name Type Description
context shaka.dash.DashParser.Context
callback function(?shaka.dash.DashParser.InheritanceFrame): Element Gets the Element that contains the attribute to inherit.
attribute string
Source:
Returns:
Type
string

(static) inheritChild(context, callback, child) → {Element}

Searches the inheritance for a Segment* with the given child.
Parameters:
Name Type Description
context shaka.dash.DashParser.Context
callback function(?shaka.dash.DashParser.InheritanceFrame): Element Gets the Element that contains the child to inherit.
child string
Source:
Returns:
Type
Element

(static) parseSegmentInfo(context, callback) → {shaka.dash.MpdUtils.SegmentInfo}

Parses common segment info for SegmentList and SegmentTemplate.
Parameters:
Name Type Description
context shaka.dash.DashParser.Context
callback function(?shaka.dash.DashParser.InheritanceFrame): Element Gets the element that contains the segment info.
Source:
Returns:
Type
shaka.dash.MpdUtils.SegmentInfo

Type Definitions

SegmentInfo

Contains common information between SegmentList and SegmentTemplate items.
Type:
  • {timescale: number, segmentDuration: ?number, startNumber: number, presentationTimeOffset: number, unscaledPresentationTimeOffset: number, timeline: Array.<shaka.dash.MpdUtils.TimeRange>}
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.
presentationTimeOffset number The presentationTimeOffset of the representation, in seconds.
unscaledPresentationTimeOffset number The presentationTimeOffset of the representation, in timescale units.
timeline Array.<shaka.dash.MpdUtils.TimeRange> The timeline of the representation, if given. Times in seconds.
Source:

TimeRange

Defines a time range of a media segment. Times are in seconds.
Type:
  • {start: number, unscaledStart: number, end: number}
Properties:
Name Type Description
start number The start time of the range.
unscaledStart number The start time of the range in representation timescale units.
end number The end time (exclusive) of the range.
Source: