Display
Track
This component is used to add text tracks.
See the loading text tracks guide for how to load and manage them, and API reference below for basic usage and props.
API Reference
Section titled API ReferenceCreates 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> Props
Section titled Props| Prop | Type | Default |
|---|---|---|
| string | undefined |
| string | undefined |
| string | undefined |
| string | 'vtt' |
| string | 'utf-8' |
| boolean | false |
| TextTrackKind | undefined |
| string | undefined |
| string | undefined |
| string | undefined |
| string | undefined |