@zenvor/hls.js 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +28 -0
- package/README.md +472 -0
- package/dist/hls-demo.js +26995 -0
- package/dist/hls-demo.js.map +1 -0
- package/dist/hls.d.mts +4204 -0
- package/dist/hls.d.ts +4204 -0
- package/dist/hls.js +40050 -0
- package/dist/hls.js.d.ts +4204 -0
- package/dist/hls.js.map +1 -0
- package/dist/hls.light.js +27145 -0
- package/dist/hls.light.js.map +1 -0
- package/dist/hls.light.min.js +2 -0
- package/dist/hls.light.min.js.map +1 -0
- package/dist/hls.light.mjs +26392 -0
- package/dist/hls.light.mjs.map +1 -0
- package/dist/hls.min.js +2 -0
- package/dist/hls.min.js.map +1 -0
- package/dist/hls.mjs +38956 -0
- package/dist/hls.mjs.map +1 -0
- package/dist/hls.worker.js +2 -0
- package/dist/hls.worker.js.map +1 -0
- package/package.json +143 -0
- package/src/config.ts +794 -0
- package/src/controller/abr-controller.ts +1019 -0
- package/src/controller/algo-data-controller.ts +794 -0
- package/src/controller/audio-stream-controller.ts +1099 -0
- package/src/controller/audio-track-controller.ts +454 -0
- package/src/controller/base-playlist-controller.ts +438 -0
- package/src/controller/base-stream-controller.ts +2526 -0
- package/src/controller/buffer-controller.ts +2015 -0
- package/src/controller/buffer-operation-queue.ts +159 -0
- package/src/controller/cap-level-controller.ts +367 -0
- package/src/controller/cmcd-controller.ts +422 -0
- package/src/controller/content-steering-controller.ts +622 -0
- package/src/controller/eme-controller.ts +1617 -0
- package/src/controller/error-controller.ts +627 -0
- package/src/controller/fps-controller.ts +146 -0
- package/src/controller/fragment-finders.ts +256 -0
- package/src/controller/fragment-tracker.ts +567 -0
- package/src/controller/gap-controller.ts +719 -0
- package/src/controller/id3-track-controller.ts +488 -0
- package/src/controller/interstitial-player.ts +302 -0
- package/src/controller/interstitials-controller.ts +2895 -0
- package/src/controller/interstitials-schedule.ts +698 -0
- package/src/controller/latency-controller.ts +294 -0
- package/src/controller/level-controller.ts +776 -0
- package/src/controller/stream-controller.ts +1597 -0
- package/src/controller/subtitle-stream-controller.ts +508 -0
- package/src/controller/subtitle-track-controller.ts +617 -0
- package/src/controller/timeline-controller.ts +677 -0
- package/src/crypt/aes-crypto.ts +36 -0
- package/src/crypt/aes-decryptor.ts +339 -0
- package/src/crypt/decrypter-aes-mode.ts +4 -0
- package/src/crypt/decrypter.ts +225 -0
- package/src/crypt/fast-aes-key.ts +39 -0
- package/src/define-plugin.d.ts +17 -0
- package/src/demux/audio/aacdemuxer.ts +126 -0
- package/src/demux/audio/ac3-demuxer.ts +170 -0
- package/src/demux/audio/adts.ts +249 -0
- package/src/demux/audio/base-audio-demuxer.ts +205 -0
- package/src/demux/audio/dolby.ts +21 -0
- package/src/demux/audio/mp3demuxer.ts +85 -0
- package/src/demux/audio/mpegaudio.ts +177 -0
- package/src/demux/chunk-cache.ts +42 -0
- package/src/demux/dummy-demuxed-track.ts +13 -0
- package/src/demux/inject-worker.ts +75 -0
- package/src/demux/mp4demuxer.ts +234 -0
- package/src/demux/sample-aes.ts +198 -0
- package/src/demux/transmuxer-interface.ts +449 -0
- package/src/demux/transmuxer-worker.ts +221 -0
- package/src/demux/transmuxer.ts +560 -0
- package/src/demux/tsdemuxer.ts +1256 -0
- package/src/demux/video/avc-video-parser.ts +401 -0
- package/src/demux/video/base-video-parser.ts +198 -0
- package/src/demux/video/exp-golomb.ts +153 -0
- package/src/demux/video/hevc-video-parser.ts +736 -0
- package/src/empty-es.js +5 -0
- package/src/empty.js +3 -0
- package/src/errors.ts +107 -0
- package/src/events.ts +548 -0
- package/src/exports-default.ts +3 -0
- package/src/exports-named.ts +81 -0
- package/src/hls.ts +1613 -0
- package/src/is-supported.ts +54 -0
- package/src/loader/date-range.ts +207 -0
- package/src/loader/fragment-loader.ts +403 -0
- package/src/loader/fragment.ts +487 -0
- package/src/loader/interstitial-asset-list.ts +162 -0
- package/src/loader/interstitial-event.ts +337 -0
- package/src/loader/key-loader.ts +439 -0
- package/src/loader/level-details.ts +203 -0
- package/src/loader/level-key.ts +259 -0
- package/src/loader/load-stats.ts +17 -0
- package/src/loader/m3u8-parser.ts +1072 -0
- package/src/loader/playlist-loader.ts +839 -0
- package/src/polyfills/number.ts +15 -0
- package/src/remux/aac-helper.ts +81 -0
- package/src/remux/mp4-generator.ts +1380 -0
- package/src/remux/mp4-remuxer.ts +1261 -0
- package/src/remux/passthrough-remuxer.ts +434 -0
- package/src/task-loop.ts +130 -0
- package/src/types/algo.ts +44 -0
- package/src/types/buffer.ts +105 -0
- package/src/types/component-api.ts +20 -0
- package/src/types/demuxer.ts +208 -0
- package/src/types/events.ts +574 -0
- package/src/types/fragment-tracker.ts +23 -0
- package/src/types/level.ts +268 -0
- package/src/types/loader.ts +198 -0
- package/src/types/media-playlist.ts +92 -0
- package/src/types/network-details.ts +3 -0
- package/src/types/remuxer.ts +104 -0
- package/src/types/track.ts +12 -0
- package/src/types/transmuxer.ts +46 -0
- package/src/types/tuples.ts +6 -0
- package/src/types/vtt.ts +11 -0
- package/src/utils/arrays.ts +22 -0
- package/src/utils/attr-list.ts +192 -0
- package/src/utils/binary-search.ts +46 -0
- package/src/utils/buffer-helper.ts +173 -0
- package/src/utils/cea-608-parser.ts +1413 -0
- package/src/utils/chunker.ts +41 -0
- package/src/utils/codecs.ts +314 -0
- package/src/utils/cues.ts +96 -0
- package/src/utils/discontinuities.ts +174 -0
- package/src/utils/encryption-methods-util.ts +21 -0
- package/src/utils/error-helper.ts +95 -0
- package/src/utils/event-listener-helper.ts +16 -0
- package/src/utils/ewma-bandwidth-estimator.ts +97 -0
- package/src/utils/ewma.ts +43 -0
- package/src/utils/fetch-loader.ts +331 -0
- package/src/utils/global.ts +2 -0
- package/src/utils/hash.ts +10 -0
- package/src/utils/hdr.ts +67 -0
- package/src/utils/hex.ts +32 -0
- package/src/utils/imsc1-ttml-parser.ts +261 -0
- package/src/utils/keysystem-util.ts +45 -0
- package/src/utils/level-helper.ts +629 -0
- package/src/utils/logger.ts +120 -0
- package/src/utils/media-option-attributes.ts +49 -0
- package/src/utils/mediacapabilities-helper.ts +301 -0
- package/src/utils/mediakeys-helper.ts +210 -0
- package/src/utils/mediasource-helper.ts +37 -0
- package/src/utils/mp4-tools.ts +1473 -0
- package/src/utils/number.ts +3 -0
- package/src/utils/numeric-encoding-utils.ts +26 -0
- package/src/utils/output-filter.ts +46 -0
- package/src/utils/rendition-helper.ts +505 -0
- package/src/utils/safe-json-stringify.ts +22 -0
- package/src/utils/texttrack-utils.ts +164 -0
- package/src/utils/time-ranges.ts +17 -0
- package/src/utils/timescale-conversion.ts +46 -0
- package/src/utils/utf8-utils.ts +18 -0
- package/src/utils/variable-substitution.ts +105 -0
- package/src/utils/vttcue.ts +384 -0
- package/src/utils/vttparser.ts +497 -0
- package/src/utils/webvtt-parser.ts +166 -0
- package/src/utils/xhr-loader.ts +337 -0
- package/src/version.ts +1 -0
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2013 vtt.js Contributors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the 'License');
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an 'AS IS' BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { optionalSelf } from './global';
|
|
18
|
+
|
|
19
|
+
declare interface VTTCuePolyfill extends VTTCue {
|
|
20
|
+
new (...args): VTTCuePolyfill;
|
|
21
|
+
hasBeenReset: boolean;
|
|
22
|
+
displayState: void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default (function () {
|
|
26
|
+
if (optionalSelf?.VTTCue) {
|
|
27
|
+
return self.VTTCue;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const AllowedDirections = ['', 'lr', 'rl'] as const;
|
|
31
|
+
type Direction = (typeof AllowedDirections)[number];
|
|
32
|
+
|
|
33
|
+
const AllowedAlignments = [
|
|
34
|
+
'start',
|
|
35
|
+
'middle',
|
|
36
|
+
'end',
|
|
37
|
+
'left',
|
|
38
|
+
'right',
|
|
39
|
+
] as const;
|
|
40
|
+
type Alignment = (typeof AllowedAlignments)[number];
|
|
41
|
+
|
|
42
|
+
function isAllowedValue<T, A>(allowed: T, value: string): A | false {
|
|
43
|
+
if (typeof value !== 'string') {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
// necessary for assuring the generic conforms to the Array interface
|
|
47
|
+
if (!Array.isArray(allowed)) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
// reset the type so that the next narrowing works well
|
|
51
|
+
const lcValue = value.toLowerCase() as any;
|
|
52
|
+
// use the allow list to narrow the type to a specific subset of strings
|
|
53
|
+
if (~allowed.indexOf(lcValue)) {
|
|
54
|
+
return lcValue;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function findDirectionSetting(value: string) {
|
|
61
|
+
return isAllowedValue<typeof AllowedDirections, Direction>(
|
|
62
|
+
AllowedDirections,
|
|
63
|
+
value,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function findAlignSetting(value: string) {
|
|
68
|
+
return isAllowedValue<typeof AllowedAlignments, Alignment>(
|
|
69
|
+
AllowedAlignments,
|
|
70
|
+
value,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function extend(obj: Record<string, any>, ...rest: Record<string, any>[]) {
|
|
75
|
+
let i = 1;
|
|
76
|
+
for (; i < arguments.length; i++) {
|
|
77
|
+
const cobj = arguments[i];
|
|
78
|
+
for (const p in cobj) {
|
|
79
|
+
obj[p] = cobj[p];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return obj;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function VTTCue(startTime: number, endTime: number, text: string) {
|
|
87
|
+
const cue = this as VTTCuePolyfill;
|
|
88
|
+
const baseObj = { enumerable: true };
|
|
89
|
+
/**
|
|
90
|
+
* Shim implementation specific properties. These properties are not in
|
|
91
|
+
* the spec.
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
// Lets us know when the VTTCue's data has changed in such a way that we need
|
|
95
|
+
// to recompute its display state. This lets us compute its display state
|
|
96
|
+
// lazily.
|
|
97
|
+
cue.hasBeenReset = false;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* VTTCue and TextTrackCue properties
|
|
101
|
+
* http://dev.w3.org/html5/webvtt/#vttcue-interface
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
let _id = '';
|
|
105
|
+
let _pauseOnExit = false;
|
|
106
|
+
let _startTime = startTime;
|
|
107
|
+
let _endTime = endTime;
|
|
108
|
+
let _text = text;
|
|
109
|
+
let _region = null;
|
|
110
|
+
let _vertical: Direction = '';
|
|
111
|
+
let _snapToLines = true;
|
|
112
|
+
let _line: number | 'auto' = 'auto';
|
|
113
|
+
let _lineAlign: Alignment = 'start';
|
|
114
|
+
let _position = 50;
|
|
115
|
+
let _positionAlign: Alignment = 'middle';
|
|
116
|
+
let _size = 50;
|
|
117
|
+
let _align: Alignment = 'middle';
|
|
118
|
+
|
|
119
|
+
Object.defineProperty(
|
|
120
|
+
cue,
|
|
121
|
+
'id',
|
|
122
|
+
extend({}, baseObj, {
|
|
123
|
+
get: function () {
|
|
124
|
+
return _id;
|
|
125
|
+
},
|
|
126
|
+
set: function (value: string) {
|
|
127
|
+
_id = '' + value;
|
|
128
|
+
},
|
|
129
|
+
}),
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
Object.defineProperty(
|
|
133
|
+
cue,
|
|
134
|
+
'pauseOnExit',
|
|
135
|
+
extend({}, baseObj, {
|
|
136
|
+
get: function () {
|
|
137
|
+
return _pauseOnExit;
|
|
138
|
+
},
|
|
139
|
+
set: function (value: boolean) {
|
|
140
|
+
_pauseOnExit = !!value;
|
|
141
|
+
},
|
|
142
|
+
}),
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
Object.defineProperty(
|
|
146
|
+
cue,
|
|
147
|
+
'startTime',
|
|
148
|
+
extend({}, baseObj, {
|
|
149
|
+
get: function () {
|
|
150
|
+
return _startTime;
|
|
151
|
+
},
|
|
152
|
+
set: function (value: number) {
|
|
153
|
+
if (typeof value !== 'number') {
|
|
154
|
+
throw new TypeError('Start time must be set to a number.');
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
_startTime = value;
|
|
158
|
+
this.hasBeenReset = true;
|
|
159
|
+
},
|
|
160
|
+
}),
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
Object.defineProperty(
|
|
164
|
+
cue,
|
|
165
|
+
'endTime',
|
|
166
|
+
extend({}, baseObj, {
|
|
167
|
+
get: function () {
|
|
168
|
+
return _endTime;
|
|
169
|
+
},
|
|
170
|
+
set: function (value: number) {
|
|
171
|
+
if (typeof value !== 'number') {
|
|
172
|
+
throw new TypeError('End time must be set to a number.');
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
_endTime = value;
|
|
176
|
+
this.hasBeenReset = true;
|
|
177
|
+
},
|
|
178
|
+
}),
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
Object.defineProperty(
|
|
182
|
+
cue,
|
|
183
|
+
'text',
|
|
184
|
+
extend({}, baseObj, {
|
|
185
|
+
get: function () {
|
|
186
|
+
return _text;
|
|
187
|
+
},
|
|
188
|
+
set: function (value: string) {
|
|
189
|
+
_text = '' + value;
|
|
190
|
+
this.hasBeenReset = true;
|
|
191
|
+
},
|
|
192
|
+
}),
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
// todo: implement VTTRegion polyfill?
|
|
196
|
+
Object.defineProperty(
|
|
197
|
+
cue,
|
|
198
|
+
'region',
|
|
199
|
+
extend({}, baseObj, {
|
|
200
|
+
get: function () {
|
|
201
|
+
return _region;
|
|
202
|
+
},
|
|
203
|
+
set: function (value: any) {
|
|
204
|
+
_region = value;
|
|
205
|
+
this.hasBeenReset = true;
|
|
206
|
+
},
|
|
207
|
+
}),
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
Object.defineProperty(
|
|
211
|
+
cue,
|
|
212
|
+
'vertical',
|
|
213
|
+
extend({}, baseObj, {
|
|
214
|
+
get: function () {
|
|
215
|
+
return _vertical;
|
|
216
|
+
},
|
|
217
|
+
set: function (value: string) {
|
|
218
|
+
const setting = findDirectionSetting(value);
|
|
219
|
+
// Have to check for false because the setting an be an empty string.
|
|
220
|
+
if (setting === false) {
|
|
221
|
+
throw new SyntaxError(
|
|
222
|
+
'An invalid or illegal string was specified.',
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
_vertical = setting;
|
|
227
|
+
this.hasBeenReset = true;
|
|
228
|
+
},
|
|
229
|
+
}),
|
|
230
|
+
);
|
|
231
|
+
|
|
232
|
+
Object.defineProperty(
|
|
233
|
+
cue,
|
|
234
|
+
'snapToLines',
|
|
235
|
+
extend({}, baseObj, {
|
|
236
|
+
get: function () {
|
|
237
|
+
return _snapToLines;
|
|
238
|
+
},
|
|
239
|
+
set: function (value: boolean) {
|
|
240
|
+
_snapToLines = !!value;
|
|
241
|
+
this.hasBeenReset = true;
|
|
242
|
+
},
|
|
243
|
+
}),
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
Object.defineProperty(
|
|
247
|
+
cue,
|
|
248
|
+
'line',
|
|
249
|
+
extend({}, baseObj, {
|
|
250
|
+
get: function () {
|
|
251
|
+
return _line;
|
|
252
|
+
},
|
|
253
|
+
set: function (value: number | 'auto') {
|
|
254
|
+
if (typeof value !== 'number' && value !== 'auto') {
|
|
255
|
+
throw new SyntaxError(
|
|
256
|
+
'An invalid number or illegal string was specified.',
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
_line = value;
|
|
261
|
+
this.hasBeenReset = true;
|
|
262
|
+
},
|
|
263
|
+
}),
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
Object.defineProperty(
|
|
267
|
+
cue,
|
|
268
|
+
'lineAlign',
|
|
269
|
+
extend({}, baseObj, {
|
|
270
|
+
get: function () {
|
|
271
|
+
return _lineAlign;
|
|
272
|
+
},
|
|
273
|
+
set: function (value: string) {
|
|
274
|
+
const setting = findAlignSetting(value);
|
|
275
|
+
if (!setting) {
|
|
276
|
+
throw new SyntaxError(
|
|
277
|
+
'An invalid or illegal string was specified.',
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
_lineAlign = setting;
|
|
282
|
+
this.hasBeenReset = true;
|
|
283
|
+
},
|
|
284
|
+
}),
|
|
285
|
+
);
|
|
286
|
+
|
|
287
|
+
Object.defineProperty(
|
|
288
|
+
cue,
|
|
289
|
+
'position',
|
|
290
|
+
extend({}, baseObj, {
|
|
291
|
+
get: function () {
|
|
292
|
+
return _position;
|
|
293
|
+
},
|
|
294
|
+
set: function (value: number) {
|
|
295
|
+
if (value < 0 || value > 100) {
|
|
296
|
+
throw new Error('Position must be between 0 and 100.');
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
_position = value;
|
|
300
|
+
this.hasBeenReset = true;
|
|
301
|
+
},
|
|
302
|
+
}),
|
|
303
|
+
);
|
|
304
|
+
|
|
305
|
+
Object.defineProperty(
|
|
306
|
+
cue,
|
|
307
|
+
'positionAlign',
|
|
308
|
+
extend({}, baseObj, {
|
|
309
|
+
get: function () {
|
|
310
|
+
return _positionAlign;
|
|
311
|
+
},
|
|
312
|
+
set: function (value: string) {
|
|
313
|
+
const setting = findAlignSetting(value);
|
|
314
|
+
if (!setting) {
|
|
315
|
+
throw new SyntaxError(
|
|
316
|
+
'An invalid or illegal string was specified.',
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
_positionAlign = setting;
|
|
321
|
+
this.hasBeenReset = true;
|
|
322
|
+
},
|
|
323
|
+
}),
|
|
324
|
+
);
|
|
325
|
+
|
|
326
|
+
Object.defineProperty(
|
|
327
|
+
cue,
|
|
328
|
+
'size',
|
|
329
|
+
extend({}, baseObj, {
|
|
330
|
+
get: function () {
|
|
331
|
+
return _size;
|
|
332
|
+
},
|
|
333
|
+
set: function (value: number) {
|
|
334
|
+
if (value < 0 || value > 100) {
|
|
335
|
+
throw new Error('Size must be between 0 and 100.');
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
_size = value;
|
|
339
|
+
this.hasBeenReset = true;
|
|
340
|
+
},
|
|
341
|
+
}),
|
|
342
|
+
);
|
|
343
|
+
|
|
344
|
+
Object.defineProperty(
|
|
345
|
+
cue,
|
|
346
|
+
'align',
|
|
347
|
+
extend({}, baseObj, {
|
|
348
|
+
get: function () {
|
|
349
|
+
return _align;
|
|
350
|
+
},
|
|
351
|
+
set: function (value: string) {
|
|
352
|
+
const setting = findAlignSetting(value);
|
|
353
|
+
if (!setting) {
|
|
354
|
+
throw new SyntaxError(
|
|
355
|
+
'An invalid or illegal string was specified.',
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
_align = setting;
|
|
360
|
+
this.hasBeenReset = true;
|
|
361
|
+
},
|
|
362
|
+
}),
|
|
363
|
+
);
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Other <track> spec defined properties
|
|
367
|
+
*/
|
|
368
|
+
|
|
369
|
+
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state
|
|
370
|
+
cue.displayState = undefined;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* VTTCue methods
|
|
375
|
+
*/
|
|
376
|
+
|
|
377
|
+
VTTCue.prototype.getCueAsHTML = function () {
|
|
378
|
+
// Assume WebVTT.convertCueToDOMTree is on the global.
|
|
379
|
+
const WebVTT = (self as any).WebVTT;
|
|
380
|
+
return WebVTT.convertCueToDOMTree(self, this.text);
|
|
381
|
+
};
|
|
382
|
+
// this is a polyfill hack
|
|
383
|
+
return VTTCue as any as VTTCuePolyfill;
|
|
384
|
+
})();
|