Class: shaka.ui.TextDisplayer

Constructor

(export) new TextDisplayer(video, videoContainer)

Constructor.
Parameters:
Name Type Description
video HTMLMediaElement
videoContainer HTMLElement
Implements:
Source:

Members

(private) captionsTimer_ :shaka.util.Timer

Type:
Source:

(private, non-null) cues_ :Array.<!shaka.extern.Cue>

Type:
Source:

currentCuesMap_

private {Map.}
Source:

(private) isTextVisible_ :boolean

Type:
  • boolean
Source:

textContainer_ :HTMLElement

Type:
  • HTMLElement
Source:

(private) videoContainer_ :HTMLElement

Type:
  • HTMLElement
Source:

Methods

(export) 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.
Implements:
Source:

(private) displayCue_(container, cuenon-null)

Displays a cue
Parameters:
Name Type Description
container Element
cue shaka.extern.Cue
Source:

(private) displayNestedCue_(container, cuenon-null) → {Element}

Displays a nested cue
Parameters:
Name Type Description
container Element
cue shaka.extern.Cue
Source:
Returns:
the created captions container
Type
Element

(export) isTextVisible() → {boolean}

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

(export) 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
Implements:
Source:
Returns:
Type
boolean

(private) setCaptionStyles_(captionsnon-null, cuenon-null)

Parameters:
Name Type Description
captions HTMLElement
cue shaka.extern.Cue
Source:

(export) setTextVisibility(on)

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

(private) updateCaptions_()

Display the current captions.
Source: