Interface: shaka.extern.TextDisplayer

An interface for plugins that display text.
This should handle displaying the text cues on the page. This is given the cues to display and told when to start and stop displaying. This should only display the cues it is given and remove cues when told to.

This should only change whether it is displaying the cues through the setTextVisibility function; the app should not change the text visibility outside the top-level Player methods. If you really want to control text visibility outside the Player methods, you must set the streaming.alwaysStreamText Player configuration value to true.

Implementations:
Extends:
Source:

Extends

Methods

append(cuesnon-null)

Append given text cues to the list of cues to be displayed.
Parameters:
Name Type Description
cues Array.<!shaka.text.Cue> Text cues to be appended.
Source:

configure(config)

Sets the TextDisplayer configuration.
Parameters:
Name Type Description
config shaka.extern.TextDisplayerConfiguration
Source:

destroy() → {Promise}

Request that this object be destroyed, releasing all resources and shutting down all operations. Returns a Promise which is resolved when destruction is complete. This Promise should never be rejected.
Overrides:
Source:
Returns:
Type
Promise

isTextVisible() → {boolean}

Returns true if text is currently visible.
Source:
Returns:
Type
boolean

remove(startTime, endTime) → {boolean}

Remove all cues that are fully contained by the given time range (relative to the presentation). endTime will be greater to equal to startTime. remove should only return false if the displayer has been destroyed. If the displayer has not been destroyed remove should return true.
Parameters:
Name Type Description
startTime number
endTime number
Source:
Returns:
Type
boolean

setTextVisibility(on)

Set text visibility.
Parameters:
Name Type Description
on boolean
Source:

Type Definitions

Factory

A factory for creating a TextDisplayer.
Type:
  • function():!shaka.extern.TextDisplayer
Source: