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) 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, urlnon-null, networkCallback) → {Array.<!shaka.media.SegmentReference>}

Parses SegmentReferences from a WebM containeir.
Parameters:
Name Type Description
cuesData DataView The WebM container's "Cueing Data" section.
initData DataView The WebM container's headers.
url Array.<!goog.Uri> The location of each SegmentReference.
networkCallback shaka.util.FailoverUri.NetworkCallback
Source:
Returns:
SegmentReferences on success; otherwise, return null.
Type
Array.<!shaka.media.SegmentReference>

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

Parses a WebM CuePointElement to get an "unadjusted" segment reference.
Parameters:
Name Type Description
cuePointElement shaka.util.EbmlElement
Source:
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, urlnon-null, networkCallback) → (non-null) {Array.<!shaka.media.SegmentReference>}

Parses a WebM CuesElement.
Parameters:
Name Type Description
cuesElement shaka.util.EbmlElement
segmentOffset number
timecodeScale number
url Array.<!goog.Uri>
networkCallback shaka.util.FailoverUri.NetworkCallback
Source:
Returns:
Type
Array.<!shaka.media.SegmentReference>

(private) parseInfo_(infoElementnon-null) → {number}

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

(private) parseInternal_(cuesDatanon-null, initDatanon-null, urlnon-null, networkCallback) → {Array.<!shaka.media.SegmentReference>}

Parses SegmentReferences from a WebM container.
Parameters:
Name Type Description
cuesData DataView
initData DataView
url Array.<!goog.Uri> The location of each SegmentReference.
networkCallback shaka.util.FailoverUri.NetworkCallback
Source:
See:
Throws:
RangeError
Returns:
SegmentReferences on success; otherwise, return null.
Type
Array.<!shaka.media.SegmentReference>

(private) parseSegment_(segmentElementnon-null) → (nullable) {number}

Parses a WebM Info element to get the segment's timecode scale.
Parameters:
Name Type Description
segmentElement shaka.util.EbmlElement
Source:
Returns:
The segment's timecode scale in seconds, or null if an error occurred.
Type
number

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

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