Constructor
new TextEngine(displayer)
Manages text parsers and cues.
Parameters:
- Implements:
- Source:
Members
(private) appendWindowEnd_ :number
Type:
- Source:
(private) appendWindowStart_ :number
Type:
- Source:
(private, nullable) bufferEnd_ :number
Type:
- Source:
(private, nullable) bufferStart_ :number
Type:
- Source:
(private) timestampOffset_ :number
Type:
- Source:
Methods
(static) isTypeSupported(mimeType) → {boolean}
Parameters:
Name |
Type |
Description |
mimeType |
string
|
|
- Source:
Returns:
-
Type
-
boolean
(export, static) registerParser(mimeType, pluginnon-null)
Parameters:
- Source:
(export, static) unregisterParser(mimeType)
Parameters:
Name |
Type |
Description |
mimeType |
string
|
|
- Source:
appendBuffer(buffernon-null, startTimenullable, endTimenullable) → (non-null) {Promise}
Parameters:
Name |
Type |
Attributes |
Description |
buffer |
ArrayBuffer
|
|
|
startTime |
number
|
<nullable>
|
|
endTime |
number
|
<nullable>
|
|
- Source:
Returns:
-
Type
-
Promise
(export) appendCues(cuesnon-null)
Append cues to text displayer.
Parameters:
- Source:
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
(export) 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
getStartTime(buffernon-null) → {number}
Parse the start time from the text media segment, if possible.
Parameters:
Name |
Type |
Description |
buffer |
ArrayBuffer
|
|
- Source:
Throws:
-
on failure
-
-
Type
-
shaka.util.Error
Returns:
-
Type
-
number
initParser(mimeType)
Initialize the parser. This can be called multiple times, but must be called
at least once before appendBuffer.
Parameters:
Name |
Type |
Description |
mimeType |
string
|
|
- Source:
isBuffered(t) → {boolean}
Parameters:
Name |
Type |
Description |
t |
number
|
A timestamp |
- Source:
Returns:
-
Type
-
boolean
remove(start, end) → (non-null) {Promise}
Parameters:
Name |
Type |
Description |
start |
number
|
|
end |
number
|
|
- Source:
Returns:
-
Type
-
Promise
setAppendWindow(appendWindowStart, appendWindowEnd)
Parameters:
Name |
Type |
Description |
appendWindowStart |
number
|
|
appendWindowEnd |
number
|
|
- Source:
(export) setDisplayer(displayer)
Parameters:
- Source:
setTimestampOffset(timestampOffset)
Parameters:
Name |
Type |
Description |
timestampOffset |
number
|
|
- Source: