react-native-theoplayer
Version:
A THEOplayer video component for react-native.
190 lines • 6.6 kB
TypeScript
import type { Track } from './Track';
import type { TextTrackCue } from './TextTrackCue';
/**
* The content type of a text track, represented by a value from the following list:
* <br/> - `'srt'`: The track contains SRT (SubRip Text) content.
* <br/> - `'ttml'`: The track contains TTML (Timed Text Markup Language) content.
* <br/> - `'webvtt'`: The track contains WebVTT (Web Video Text Tracks) content.
* <br/> - `'emsg'`: The track contains emsg (Event Message) content.
* <br/> - `'eventstream'`: The track contains Event Stream content.
* <br/> - `'id3'`: The track contains ID3 content.
* <br/> - `'cea608'`: The track contains CEA608 content.
* <br/> - `'daterange'`: The track contains HLS EXT-X-DATERANGE content.
*
* @category Media and Text Tracks
* @public
*/
export declare enum TextTrackType {
cea608 = "cea608",
id3 = "id3",
srt = "srt",
ttml = "ttml",
webvtt = "webvtt",
daterange = "daterange",
eventstream = "eventstream",
emsg = "emsg"
}
/**
* The kind of the text track, represented by a value from the following list:
* <br/> - `'subtitles'`: The track contains subtitles.
* <br/> - `'captions'`: The track contains closed captions, a translation of dialogue and sound effects.
* <br/> - `'descriptions'`: The track contains descriptions, a textual description of the video.
* <br/> - `'chapters'`: The track contains chapter titles.
* <br/> - `'metadata'`: The track contains metadata. This track will not serve display purposes.
*
* @category Media and Text Tracks
* @public
*/
export declare enum TextTrackKind {
captions = "captions",
chapters = "chapters",
descriptions = "descriptions",
metadata = "metadata",
subtitles = "subtitles",
thumbnails = "thumbnails"
}
/**
* The mode of the text track, represented by a value from the following list:
* <br/> - `'disabled'`: The track is disabled.
* <br/> - `'hidden'`: The track is hidden.
* <br/> - `'showing'`: The track is showing.
*
* @remarks
* <br/> - A disabled track is not displayed and exposes no active cues, nor fires cue events.
* <br/> - A hidden track is not displayed but exposes active cues and fires cue events.
* <br/> - A showing track is displayed, exposes active cues and fires cue events.
*
* @category Media and Text Tracks
* @public
*/
export declare enum TextTrackMode {
disabled = "disabled",
showing = "showing",
hidden = "hidden"
}
/**
* Represents a text track of a media resource.
*
* @category Media and Text Tracks
* @public
*/
export interface TextTrack extends Track {
/**
* The kind of the text track, represented by a value from the following list:
* <br/> - `'subtitles'`: The track contains subtitles.
* <br/> - `'captions'`: The track contains closed captions, a translation of dialogue and sound effects.
* <br/> - `'descriptions'`: The track contains descriptions, a textual description of the video.
* <br/> - `'chapters'`: The track contains chapter titles.
* <br/> - `'metadata'`: The track contains metadata. This track will not serve display purposes.
*/
readonly kind: TextTrackKind;
/**
* The unlocalized label of the text track, as extracted from the manifest.
*
* @platform ios
*/
readonly unlocalizedLabel?: string;
/**
* The label of the text track.
*/
readonly label: string;
/**
* The language of the text track.
*/
readonly language: string;
/**
* The identifier of the text track.
*
* @remarks
* <br/> - This identifier can be used to distinguish between related tracks, e.g. tracks in the same list.
*/
readonly id: string;
/**
* A unique identifier of the text track.
*
* @remarks
* <br/> - This identifier is unique across tracks of a THEOplayer instance and can be used to distinguish between tracks.
*/
readonly uid: number;
/**
* The mode of the text track, represented by a value from the following list:
* <br/> - `'disabled'`: The track is disabled.
* <br/> - `'showing'`: The track is showing.
* <br/> - `'hidden'`: The track is enabled and loading cues, but not shown. (used for metadata tracks)
*/
mode: TextTrackMode;
/**
* The content type of the text track.
*/
readonly type: TextTrackType;
/**
* The list of cues of the track.
*
* @remarks
* <br/> - If the {@link TextTrack.mode} is `'disabled'`, this property is `null`.
*/
cues: TextTrackCue[] | null;
/**
* The source of the text track.
*/
readonly src: string;
/**
* Indicates whether the track contains Forced Narrative cues.
* This may only be true for subtitle tracks where
* <br/> - For DASH: the corresponding AdaptationSet contains a child Role with its value attribute equal to `'forced_subtitle'`
* <br/> - For HLS: the corresponding #EXT-X-MEDIA tag contains the attributes TYPE=SUBTITLES and FORCED=YES (not supported yet)
*/
readonly forced: boolean;
}
/**
* Retain renderable tracks.
*
* https://html.spec.whatwg.org/multipage/embedded-content.html#text-track-showing
*
* @category Media and Text Tracks
* @internal
*/
export declare function filterRenderableTracks(textTracks: TextTrack[] | undefined): TextTrack[] | undefined;
/**
* Retain first thumbnail track encountered in the textTracks list.
*
* @category Media and Text Tracks
* @internal
*/
export declare function filterThumbnailTracks(textTracks: TextTrack[] | undefined): TextTrack | undefined;
/**
* Query whether a track is a valid thumbnail track.
*
* @category Media and Text Tracks
* @internal
*/
export declare function isThumbnailTrack(textTrack: TextTrack | undefined): boolean;
/**
* Query whether a track is a given cue.
*
* @category Media and Text Tracks
* @internal
*/
export declare function hasTextTrackCue(textTrack: TextTrack, cue: TextTrackCue): boolean;
/**
* Removes a cue from a text track.
*
* @category Media and Text Tracks
* @internal
*/
export declare function removeTextTrackCue(textTrack?: TextTrack, cue?: TextTrackCue): void;
/**
* Adds a cue to a text track.
*
* @category Media and Text Tracks
* @internal
*/
export declare function addTextTrackCue(textTrack?: TextTrack, cue?: TextTrackCue): void;
/**
* Returns a cue from a text track by uid.
*
* @category Media and Text Tracks
* @internal
*/
export declare function findTextTrackByUid(textTracks: TextTrack[], uid: number): TextTrack | undefined;
//# sourceMappingURL=TextTrack.d.ts.map