Looking for the old docs? Go here

Display

Track

This component is used to add text tracks.

INFO

See the loading text tracks guide for how to load and manage them, and API reference below for basic usage and props.

Creates a new TextTrack object and adds it to the player.

import { Track, type TrackProps } from "@vidstack/react";
<MediaPlayer>
  <MediaProvider>
    <Track
      src="english.vtt"
      kind="subtitles"
      label="English"
      lang="en-US"
      default
    />
  </MediaProvider>
</MediaPlayer>
PropTypeDefault
id
string
undefined
src
string
undefined
content
string
undefined
type
string
'vtt'
encoding
string
'utf-8'
default
boolean
false
kind
TextTrackKind
undefined
label
string
undefined
language
string
undefined
lang
string
undefined
key
string
undefined

Previous