IVideoTrack

interface
Data Shapes

A single <track> declaration attached to the <video> element. Mirrors the HTML attributes of the native element 1:1 so consumers do not have to learn a new shape. The component renders one <track> per item.

TypeScript

Définition

La définition TypeScript de l'interface telle que trouvée dans le code source d'origam. Cliquez sur l'icône de copie pour copier l'extrait.

typescript

API

Propriétés

Chaque propriété déclarée par cette interface, avec son type, son caractère optionnel et sa valeur par défaut.

kind
requis
TVideoTrackKind
Kind of the track. captions is the default — used by the built-in captions switcher. subtitles is treated the same way; descriptions and chapters are declared but not surfaced in the default toolbar.
src
requis
string
URL of the WebVTT file. Same-origin or CORS-enabled, otherwise the browser silently rejects the track.
srclang
requis
string
BCP-47 language tag — "en", "fr", "pt-BR". Drives the language label in the captions switcher and is exposed to assistive technology via the underlying <track srclang>.
label
string
Human-readable label shown in the switcher ("English", "Francais"). Defaults to the uppercased srclang when omitted.
default
boolean
Marks this track as the one to enable on load. At most one track per kind should be flagged — if multiple are passed, the first one wins.

Écosystème

Utilisé par

Composants et composables qui étendent ou consomment cette interface.

Usage

Exemples

Extraits de code prêts à coller utilisant cette interface.

Attaching captions tracks to OrigamVideo

typescript