## TextTrack

A representation of a single `TextTrack`.

## Constructor

#### new TextTrack(options)
`tracks/text-track.js`, `line 115`

  Create an instance of this class.

  ##### Parameters:

  Name | Type | Default | Description
  --- | --- | --- | ---
  `options` | Object | {} | Object of option names and values ###### Properties
  Name | Type | Attributes | 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.

  See:

    - Spec

### Extends

- Track

### Members

#### activeCues :TextTrackCueList
`tracks/text-track.js`, `line 277`

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

#### allowedEvents_
`tracks/text-track.js`, `line 398`

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

#### cues :TextTrackCueList
`tracks/text-track.js`, `line 260`

  The text track cue list for this TextTrack.

#### readonly default :boolean
`tracks/text-track.js`, `line 206`

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

#### readonly id :string
`tracks/track.js`, `line 62`

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

  Inherited From:
    - Track#id

#### readonly kind :string
`tracks/track.js`, `line 71`

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

  Inherited From:
    - Track#kind

#### readonly label :string
`tracks/track.js`, `line 80`

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

  Inherited From:
    - Track#label

#### readonly language :string
`tracks/track.js`, `line 89`

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

  Inherited From:
    - Track#language

#### mode :string
`tracks/text-track.js`, `line 222`

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

  ##### Fires:

  - TextTrack#event:modechange

#### inner Kind
`tracks/track-enums.js`, `line 37`

  All possible `TextTrackKind`s

  See:
    - https://html.spec.whatwg.org/multipage/embedded-content.html#dom-texttrack-kind

#### inner Mode
`tracks/track-enums.js`, `line 52`

  All possible `TextTrackMode`s

  See:
    - https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackmode

### Methods

#### addCue(cue)
`tracks/text-track.js`, `line 345`

  Add a cue to the internal list of cues.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `cue` | TextTrack~Cue | The cue to add to our internal list

#### removeCue(removeCue)
`tracks/text-track.js`, `line 380`

  Remove a cue from our internal list

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `removeCue` | TextTrack~Cue | The cue to remove from our internal list

### Events

#### modechange
`tracks/text-track.js`, `line 246`

  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