Class: shaka.text.SimpleTextDisplayer

Constructor

(export) new SimpleTextDisplayer(video)

This defines the default text displayer plugin. An instance of this class is used when no custom displayer is given.

This class simply converts shaka.text.Cue objects to TextTrackCues and feeds them to the browser.

Parameters:
Name Type Description
video HTMLMediaElement
Implements:
Source:

Members

(private, static, constant) TextTrackLabel_ :string

Type:
  • string
Source:

(private) textTrack_ :TextTrack

Type:
  • TextTrack
Source:

Methods

(private, static) convertToTextTrackCue_(shakaCuenon-null, regionsnon-null) → {TextTrackCue}

Parameters:
Name Type Description
shakaCue shaka.extern.Cue
regions Array.<!VTTRegion>
Source:
Returns:
Type
TextTrackCue

(private, static) convertToVttRegion_(shakaRegionnon-null, videoWidth, videoHeight) → {VTTRegion}

Parameters:
Name Type Description
shakaRegion shaka.extern.CueRegion
videoWidth number
videoHeight number
Source:
Returns:
Type
VTTRegion

(private, static) removeWhere_(tracknon-null, predicate)

Iterate over all the cues in a text track and remove all those for which |predicate(cue)| returns true.
Parameters:
Name Type Description
track TextTrack
predicate function(!TextTrackCue):boolean
Source:

(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:

(export) isTextVisible() → {boolean}

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

(export) remove(start, end) → {boolean}

Remove cues in a given time range.
Parameters:
Name Type Description
start number
end number
Implements:
Source:
Returns:
Type
boolean

(export) setTextVisibility(on)

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