Describes the format required when loading a subtitle.

interface TimedTextReference {
    cues?: TimedTextCue[];
    enabled?: boolean;
    format?: string;
    id: string;
    label?: string;
    metadata?: TimedTextMetadata;
    offset?: TimeCode;
    parserFormat?: string;
    parserSettings?: Partial<{
        [key: string]: unknown;
    } & WebVTTParserSettings & TimedTextParserTextSettings & PACParserSettings>;
    rendererFormat?: string;
    rendererSettings?: Partial<{
        [key: string]: unknown;
    } & TrackElementRendererSettings & IMSCRendererSettings & STLRendererSettings>;
    src?: string | SubtitleSource;
    startTime?: TimeCode;
}

Properties

cues?: TimedTextCue[]

Cues to load

enabled?: boolean

Initial enabled state, toggles the visibility of the subtitle

format?: string

Indicates what parser and renderer to use for this subtitle

id: string

The id of the subtitle (unique)

label?: string

The label of the subtitle, used for display in player controls

metadata?: TimedTextMetadata

Additional metadata.

offset?: TimeCode

Offset to apply to the cues in the subtitle

parserFormat?: string

Indicates what parser to use for this subtitle, falls back to "format" if not specified

parserSettings?: Partial<{
    [key: string]: unknown;
} & WebVTTParserSettings & TimedTextParserTextSettings & PACParserSettings>

Extra settings to pass to the parser

rendererFormat?: string

Indicates what renderer to use for this subtitle, falls back to "format" if not specified

rendererSettings?: Partial<{
    [key: string]: unknown;
} & TrackElementRendererSettings & IMSCRendererSettings & STLRendererSettings>

Extra options to pass to the renderer

src?: string | SubtitleSource

The src url to the subtitle file (sidecar), or SubtitleSource object (streaming subtitles)

startTime?: TimeCode

Start time of the cues in the subtitle, assumes to be 0 if not set