Members

activeCues :TextTrackCueList

The list text track cues that are currently active for this TextTrack.

cues :TextTrackCueList

The text track cue list for this TextTrack.

readonly default :boolean

If this track was set to be on or off by default. Cannot be changed after creation.

enabled :boolean

If this AudioTrack is enabled or not. When setting this will fire AudioTrack#enabledchange if the state of enabled is changed.

Fires:

readonly id :string

The id of this track. Cannot be changed after creation.

readonly kind :string

The kind of track that this is. Cannot be changed after creation.

readonly label :string

The label of this track. Cannot be changed after creation.

readonly language :string

The two letter language code for this track. Cannot be changed after creation.

length :number

The current number of Tracks in the this Trackist.

length :number

The current number of TextTrackCues in the TextTrackCueList.

length :number

The current number of Tracks in the this Trackist.

mode :string

Set the mode of this TextTrack to a valid TextTrack~Mode. Will not be set if setting to an invalid mode.

Fires:

constant NONE :HTMLTrackElement~ReadyState

readyState :HTMLTrackElement~ReadyState

The current ready state of the track element.

selected :boolean

If this VideoTrack is selected or not. When setting this will fire VideoTrack#selectedchange if the state of selected changed.

Fires:

track :TextTrack

The underlying TextTrack object.

Methods

createTrackHelper(self, kind, labelopt, languageopt, optionsopt) → {TextTrack}

A function used by Tech to create a new TextTrack.

Parameters:
Name Type Attributes Default Description
self Tech

An instance of the Tech class.

kind string

TextTrack kind (subtitles, captions, descriptions, chapters, or metadata)

label string <optional>

Label to identify the text track

language string <optional>

Two letter language abbreviation

options Object <optional>
{}

An object with additional text track options

Returns:
TextTrack -

The text track that was created.

currentSrc() → {Tech~SourceObject}

Get the current source

Returns:
Tech~SourceObject -

The current source

emulateTextTracks()

Emulate texttracks

module:computed-style(el, prop)

A safe getComputedStyle with an IE8 fallback.

This is needed because in Firefox, if the player is loaded in an iframe with display:none, then getComputedStyle returns null, so, we do a null-check to make sure that the player doesn't break in these cases.

Parameters:
Name Type Description
el Element

The element you want the computed style of

prop string

The property name you want

See:

module:merge-options(sources) → {Object}

Deep-merge one or more options objects, recursively merging only plain object properties.

Parameters:
Name Type Description
sources Array.<Object>

One or more objects to merge into a new object.

Returns:
Object -

A new object that is the merged result of all sources.

tryUpdateStyle(el, style, rule)

Try to update the style of a DOM element. Some style changes will throw an error, particularly in IE8. Those should be noops.

Parameters:
Name Type Description
el Element

The DOM element to be styled.

style string

The CSS property on the element that should be styled.

rule string

The style rule that should be applied to the property.

Type Definitions

TextTrackCue

Properties:
Name Type Description
id string

The unique id for this text track cue

startTime number

The start time for this text track cue

endTime number

The end time for this text track cue

pauseOnExit boolean

Pause when the end time is reached if true.

See: