Class: shaka.media.WebmSegmentIndexParser

Constructor

new WebmSegmentIndexParser()

Creates a WebM Cues element parser.
Source:

Members

(static, constant) CUE_CLUSTER_POSITION :number

Type:
  • number
Source:

(static, constant) CUE_POINT_ID :number

Type:
  • number
Source:

(static, constant) CUE_TIME_ID :number

Type:
  • number
Source:

(static, constant) CUE_TRACK_POSITIONS_ID :number

Type:
  • number
Source:

(static, constant) CUES_ID :number

Type:
  • number
Source:

(static, constant) DURATION_ID :number

Type:
  • number
Source:

(static, constant) EBML_ID :number

Type:
  • number
Source:

(static, constant) INFO_ID :number

Type:
  • number
Source:

(static, constant) SEGMENT_ID :number

Type:
  • number
Source:

(static, constant) TIMECODE_SCALE_ID :number

Type:
  • number
Source:

Methods

parse(cuesDatanon-null, initDatanon-null, urisnon-null, presentationTimeOffset) → (non-null) {Array.<!shaka.media.SegmentReference>}

Parses SegmentReferences from a WebM container.
Parameters:
Name Type Description
cuesData ArrayBuffer The WebM container's "Cueing Data" section.
initData ArrayBuffer The WebM container's headers.
uris Array.<string> The possible locations of the WebM file that contains the segments.
presentationTimeOffset number
Source:
See:
Throws:
Returns:
Type
Array.<!shaka.media.SegmentReference>

(private) parseCuePoint_(cuePointElement) → {{unscaledTime: number, relativeOffset: number}}

Parses a WebM CuePointElement to get an "unadjusted" segment reference.
Parameters:
Name Type Description
cuePointElement shaka.util.EbmlElement
Source:
Throws:
Returns:
The referenced segment's start time in units of [T] (see parseInfo_()), and the referenced segment's offset in bytes, relative to a WebM Segment element.
Type
{unscaledTime: number, relativeOffset: number}

(private) parseCues_(cuesElementnon-null, segmentOffset, timecodeScale, duration, urisnon-null, presentationTimeOffset) → (non-null) {Array.<!shaka.media.SegmentReference>}

Parses a WebM CuesElement.
Parameters:
Name Type Description
cuesElement shaka.util.EbmlElement
segmentOffset number
timecodeScale number
duration number
uris Array.<string>
presentationTimeOffset number
Source:
Throws:
Returns:
Type
Array.<!shaka.media.SegmentReference>

(private) parseInfo_(infoElementnon-null) → {{timecodeScale: number, duration: number}}

Parses a WebM Info element to get the segment's timecode scale and duration.
Parameters:
Name Type Description
infoElement shaka.util.EbmlElement
Source:
Throws:
Returns:
The segment's timecode scale in seconds and duration in seconds.
Type
{timecodeScale: number, duration: number}

(private) parseSegment_(segmentElementnon-null) → {{timecodeScale: number, duration: number}}

Parses a WebM Info element to get the segment's timecode scale and duration.
Parameters:
Name Type Description
segmentElement shaka.util.EbmlElement
Source:
Throws:
Returns:
The segment's timecode scale in seconds and duration in seconds.
Type
{timecodeScale: number, duration: number}

(private) parseWebmContainer_(initDatanon-null) → {{segmentOffset: number, timecodeScale: number, duration: number}}

Parses a WebM container to get the segment's offset, timecode scale, and duration.
Parameters:
Name Type Description
initData ArrayBuffer
Source:
Throws:
Returns:
The segment's offset in bytes, the segment's timecode scale in seconds, and the duration in seconds.
Type
{segmentOffset: number, timecodeScale: number, duration: number}