Class: TextTrack

TextTrack

A representation of a single TextTrack.


new TextTrack(options)

Create an instance of this class.

Parameters:
Name Type Default Description
options Object {}

Object of option names and values

Properties
Name Type Argument Default Description
tech Tech

A reference to the tech that owns this TextTrack.

kind TextTrack~Kind <optional>
'subtitles'

A valid text track kind.

mode TextTrack~Mode <optional>
'disabled'

A valid text track mode.

id string <optional>
'vjs_track_' + Guid.newGUID()

A unique id for this TextTrack.

label string <optional>
''

The menu label for this track.

language string <optional>
''

A valid two character language code.

srclang string <optional>
''

A valid two character language code. An alternative, but deprioritized vesion of options.language

src string <optional>

A url to TextTrack cues.

default boolean <optional>

If this track should default to on or off.

Source:
tracks/text-track.js
See:

Extends

Members


allowedEvents_

cuechange - One or more cues in the track have become active or stopped being active.

Source:
tracks/text-track.js

<inner> Kind

All possible TextTrackKinds

Source:
tracks/track-enums.js
See:

<inner> Mode

All possible TextTrackModes

Source:
tracks/track-enums.js
See:

Methods


addCue(cue)

Add a cue to the internal list of cues.

Parameters:
Name Type Description
cue TextTrack~Cue

The cue to add to our internal list

Source:
tracks/text-track.js

removeCue(removeCue)

Remove a cue from our internal list

Parameters:
Name Type Description
removeCue TextTrack~Cue

The cue to remove from our internal list

Source:
tracks/text-track.js

Events


modechange

An event that fires when mode changes on this track. This allows the TextTrackList that holds this track to act accordingly.

Note: This is not part of the spec!

Type: EventTarget~Event
Source:
tracks/text-track.js