-
Notifications
You must be signed in to change notification settings - Fork 12
/
subtitleTrack.ts
75 lines (73 loc) · 1.79 KB
/
subtitleTrack.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* Supported subtitle/caption file formats.
* @platform Android, iOS, tvOS
*/
export enum SubtitleFormat {
/**
* Closed Captioning (CEA) subtitle format.
* @platform Android, iOS, tvOS
*/
CEA = 'cea',
/**
* Timed Text Markup Language (TTML) subtitle format.
* @platform Android, iOS, tvOS
*/
TTML = 'ttml',
/**
* Web Video Text Tracks Format (WebVTT) subtitle format.
* @platform Android, iOS, tvOS
*/
VTT = 'vtt',
/**
* SubRip (SRT) subtitle format.
* @platform Android, iOS, tvOS
*/
SRT = 'srt',
}
/**
* Describes a subtitle track.
* @platform Android, iOS, tvOS
*/
export interface SubtitleTrack {
/**
* The URL to the timed file, e.g. WebVTT file.
*/
url?: string;
/**
* The label for this track.
*/
label?: string;
/**
* The unique identifier for this track. If no value is provided, a random UUIDv4 will be generated for it.
*/
identifier?: string;
/**
* Specifies the file format to be used by this track.
*/
format?: SubtitleFormat;
/**
* If set to true, this track would be considered as default. Default is `false`.
*/
isDefault?: 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. Forced subtitles do
* not appear in `Player.getAvailableSubtitles`.
*
* Default is `false`.
*/
isForced?: boolean;
/**
* The IETF BCP 47 language tag associated with this track, e.g. `pt`, `en`, `es` etc.
*/
language?: string;
}
/**
* A subtitle track that can be added to `SourceConfig.subtitleTracks`.
*/
export interface SideLoadedSubtitleTrack extends SubtitleTrack {
url: string;
label: string;
language: string;
format: SubtitleFormat;
}