Definition of a subtitle/caption track.

interface SubtitleTrack {
    enabled?: boolean;
    forced?: boolean;
    id: string;
    isFragmented?: boolean;
    isSideloaded?: boolean;
    kind: string;
    label: string;
    lang: string;
    role?: MediaTrackRole[];
    url?: string;
}

Hierarchy (view full)

Properties

enabled?: boolean

Tells if a subtitle track is enabled or disabled. If set to true, the track will be enabled by default.

forced?: boolean

Tells if a subtitle track is forced. If set to true it means that the player should automatically select and switch this subtitle according to the selected audio language.

id: string

The id of the media track that is used to identify and set the track.

isFragmented?: boolean

Indicates whether the subtitle is fragmented.

isSideloaded?: boolean

Indicates whether the subtitle is sideloaded, i.e. it has been added through PlayerSubtitlesAPI.add or SourceConfig.subtitleTracks.

Since

8.177.0

kind: string

The subtitle type, either "caption" or "subtitle" (default: "subtitle").

label: string

The text used to represent this track to the user (e.g. in the UI).

lang: string

The language of the subtitle/caption track.

The optional roles of the track.

url?: string

The URL to the associated file.