Class: shaka.media.TextEngine

Constructor

new TextEngine(track, mimeType)

Manages text parsers and cues.
Parameters:
Name Type Description
track TextTrack
mimeType string
Implements:
Source:

Members

(private, static) CueConstructor_ :function(new:TextTrackCue, number, number, string)

Type:
  • function(new:TextTrackCue, number, number, string)
Source:

(private, static, non-null) parserMap_ :Object.<string, !shaka.media.TextEngine.TextParser>

Type:
Source:

(private) appendWindowEnd_ :number

Type:
  • number
Source:

(private, nullable) bufferEnd_ :number

Type:
  • number
Source:

(private, nullable) bufferStart_ :number

Type:
  • number
Source:

(private, nullable) parser_ :shaka.media.TextEngine.TextParser

Type:
Source:

(private) timestampOffset_ :number

Type:
  • number
Source:

(private) track_ :TextTrack

Type:
  • TextTrack
Source:

Methods

(static) isTypeSupported(mimeType) → {boolean}

Parameters:
Name Type Description
mimeType string
Source:
Returns:
Type
boolean

(static) makeCue(startTime, endTime, payload) → {TextTrackCue}

Creates a cue using the best platform-specific interface available.
Parameters:
Name Type Description
startTime number
endTime number
payload string
Source:
Returns:
or null if the parameters were invalid.
Type
TextTrackCue

(static) registerParser(mimeType, parsernon-null)

Parameters:
Name Type Description
mimeType string
parser shaka.media.TextEngine.TextParser
Source:

(static) unregisterParser(mimeType)

Parameters:
Name Type Description
mimeType string
Source:

appendBuffer(buffer, startTimenullable, endTimenullable) → (non-null) {Promise}

Parameters:
Name Type Attributes Description
buffer ArrayBuffer
startTime number <nullable>
endTime number <nullable>
Source:
Returns:
Type
Promise

bufferedAheadOf(t) → {number}

Parameters:
Name Type Description
t number A timestamp
Source:
Returns:
Number of seconds ahead of 't' we have buffered
Type
number

bufferEnd() → (nullable) {number}

Source:
Returns:
Time in seconds of the end of the buffered range, or null if nothing is buffered.
Type
number

bufferStart() → (nullable) {number}

Source:
Returns:
Time in seconds of the beginning of the buffered range, or null if nothing is buffered.
Type
number

destroy() → (non-null) {Promise}

Destroys the object, releasing all resources and shutting down all operations. Returns a Promise which is resolved when destruction is complete. This Promise should never be rejected.
Implements:
Source:
Returns:
Type
Promise

remove(start, end) → (non-null) {Promise}

Parameters:
Name Type Description
start number
end number
Source:
Returns:
Type
Promise

(private) removeWhere_(predicate)

Remove all cues for which the matching function returns true.
Parameters:
Name Type Description
predicate function(!TextTrackCue): boolean
Source:

setAppendWindowEnd(windowEnd)

Parameters:
Name Type Description
windowEnd number
Source:

setTimestampOffset(timestampOffset)

Parameters:
Name Type Description
timestampOffset number
Source:

Type Definitions

TextParser

Parses a text buffer into an array of cues.
Type:
  • function(ArrayBuffer, number, ?number, ?number): !Array.<!TextTrackCue>
Source: