shaka-player 4.4.1 → 4.4.3

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.
Files changed (84) hide show
  1. package/.github/workflows/deflake.yaml +8 -5
  2. package/.github/workflows/release-please.yaml +47 -7
  3. package/.github/workflows/shaka-bot-commands/command-test.sh +1 -1
  4. package/CHANGELOG.md +43 -0
  5. package/CONTRIBUTORS +1 -0
  6. package/demo/common/asset.js +5 -0
  7. package/demo/common/assets.js +20 -5
  8. package/demo/common/message_ids.js +1 -1
  9. package/demo/custom.js +5 -5
  10. package/demo/locales/en.json +2 -1
  11. package/demo/locales/source.json +5 -1
  12. package/demo/main.js +1 -1
  13. package/demo/search.js +3 -3
  14. package/dist/demo.compiled.debug.js +75 -73
  15. package/dist/demo.compiled.debug.map +3 -3
  16. package/dist/demo.compiled.js +75 -73
  17. package/dist/demo.compiled.map +3 -3
  18. package/dist/deps.js +2 -2
  19. package/dist/locales.js +31 -31
  20. package/dist/receiver.compiled.debug.js +38 -36
  21. package/dist/receiver.compiled.debug.map +3 -3
  22. package/dist/receiver.compiled.js +38 -36
  23. package/dist/receiver.compiled.map +3 -3
  24. package/dist/shaka-player.compiled.d.ts +533 -296
  25. package/dist/shaka-player.compiled.debug.d.ts +533 -296
  26. package/dist/shaka-player.compiled.debug.externs.js +308 -1
  27. package/dist/shaka-player.compiled.debug.js +280 -265
  28. package/dist/shaka-player.compiled.debug.map +3 -3
  29. package/dist/shaka-player.compiled.externs.js +308 -1
  30. package/dist/shaka-player.compiled.js +1037 -1027
  31. package/dist/shaka-player.compiled.map +4 -4
  32. package/dist/shaka-player.ui.d.ts +577 -340
  33. package/dist/shaka-player.ui.debug.d.ts +577 -340
  34. package/dist/shaka-player.ui.debug.externs.js +308 -1
  35. package/dist/shaka-player.ui.debug.js +341 -326
  36. package/dist/shaka-player.ui.debug.map +3 -3
  37. package/dist/shaka-player.ui.externs.js +308 -1
  38. package/dist/shaka-player.ui.js +1149 -1141
  39. package/dist/shaka-player.ui.map +4 -4
  40. package/docs/tutorials/fairplay.md +8 -0
  41. package/docs/tutorials/faq.md +1 -1
  42. package/docs/tutorials/offline.md +1 -1
  43. package/externs/shaka/text.js +7 -0
  44. package/lib/dash/dash_parser.js +4 -1
  45. package/lib/dash/segment_template.js +3 -0
  46. package/lib/hls/hls_parser.js +68 -28
  47. package/lib/media/media_source_engine.js +1 -1
  48. package/lib/media/segment_index.js +4 -4
  49. package/lib/media/segment_reference.js +6 -1
  50. package/lib/media/streaming_engine.js +14 -24
  51. package/lib/player.js +8 -57
  52. package/lib/text/cue.js +47 -47
  53. package/lib/text/lrc_text_parser.js +8 -0
  54. package/lib/text/mp4_ttml_parser.js +8 -0
  55. package/lib/text/mp4_vtt_parser.js +8 -0
  56. package/lib/text/sbv_text_parser.js +8 -0
  57. package/lib/text/srt_text_parser.js +8 -0
  58. package/lib/text/ssa_text_parser.js +8 -0
  59. package/lib/text/text_engine.js +8 -1
  60. package/lib/text/ttml_text_parser.js +10 -1
  61. package/lib/text/ui_text_displayer.js +49 -3
  62. package/lib/text/vtt_text_parser.js +19 -3
  63. package/lib/transmuxer/ts_transmuxer.js +44 -43
  64. package/lib/util/cmcd_manager.js +6 -1
  65. package/lib/util/error.js +16 -10
  66. package/lib/util/manifest_parser_utils.js +10 -4
  67. package/lib/util/platform.js +14 -0
  68. package/lib/util/player_configuration.js +2 -2
  69. package/lib/util/stream_utils.js +13 -11
  70. package/lib/util/ts_parser.js +73 -16
  71. package/package.json +2 -2
  72. package/test/dash/dash_parser_manifest_unit.js +5 -0
  73. package/test/dash/dash_parser_segment_base_unit.js +5 -0
  74. package/test/dash/dash_parser_segment_list_unit.js +21 -17
  75. package/test/dash/dash_parser_segment_template_unit.js +47 -0
  76. package/test/hls/hls_live_unit.js +33 -0
  77. package/test/hls/hls_parser_unit.js +2 -57
  78. package/test/test/util/dash_parser_util.js +16 -7
  79. package/test/text/text_engine_unit.js +4 -2
  80. package/test/text/ttml_text_parser_unit.js +3 -4
  81. package/test/text/web_vtt_layout_integration.js +0 -1
  82. package/test/transmuxer/transmuxer_integration.js +4 -4
  83. package/test/util/ts_parser_unit.js +1 -1
  84. package/ui/language_utils.js +0 -15
@@ -173,6 +173,212 @@ shaka.text.Cue = class {
173
173
  */
174
174
  static equal(cue1, cue2) {}
175
175
  };
176
+ /**
177
+ * The start time of the cue in seconds, relative to the start of the
178
+ * presentation.
179
+ * @type {number}
180
+ */
181
+ shaka.text.Cue.prototype.startTime;
182
+ /**
183
+ * The end time of the cue in seconds, relative to the start of the
184
+ * presentation.
185
+ * @type {number}
186
+ */
187
+ shaka.text.Cue.prototype.endTime;
188
+ /**
189
+ * The text payload of the cue. If nestedCues is non-empty, this should be
190
+ * empty. Top-level block containers should have no payload of their own.
191
+ * @type {string}
192
+ */
193
+ shaka.text.Cue.prototype.payload;
194
+ /**
195
+ * The region to render the cue into. Only supported on top-level cues,
196
+ * because nested cues are inline elements.
197
+ * @type {shaka.text.CueRegion}
198
+ */
199
+ shaka.text.Cue.prototype.region;
200
+ /**
201
+ * The indent (in percent) of the cue box in the direction defined by the
202
+ * writing direction.
203
+ * @type {?number}
204
+ */
205
+ shaka.text.Cue.prototype.position;
206
+ /**
207
+ * Position alignment of the cue.
208
+ * @type {shaka.text.Cue.positionAlign}
209
+ */
210
+ shaka.text.Cue.prototype.positionAlign;
211
+ /**
212
+ * Size of the cue box (in percents), where 0 means "auto".
213
+ * @type {number}
214
+ */
215
+ shaka.text.Cue.prototype.size;
216
+ /**
217
+ * Alignment of the text inside the cue box.
218
+ * @type {shaka.text.Cue.textAlign}
219
+ */
220
+ shaka.text.Cue.prototype.textAlign;
221
+ /**
222
+ * Text direction of the cue.
223
+ * @type {shaka.text.Cue.direction}
224
+ */
225
+ shaka.text.Cue.prototype.direction;
226
+ /**
227
+ * Text writing mode of the cue.
228
+ * @type {shaka.text.Cue.writingMode}
229
+ */
230
+ shaka.text.Cue.prototype.writingMode;
231
+ /**
232
+ * The way to interpret line field. (Either as an integer line number or
233
+ * percentage from the display box).
234
+ * @type {shaka.text.Cue.lineInterpretation}
235
+ */
236
+ shaka.text.Cue.prototype.lineInterpretation;
237
+ /**
238
+ * The offset from the display box in either number of lines or
239
+ * percentage depending on the value of lineInterpretation.
240
+ * @type {?number}
241
+ */
242
+ shaka.text.Cue.prototype.line;
243
+ /**
244
+ * Separation between line areas inside the cue box in px or em
245
+ * (e.g. '100px'/'100em'). If not specified, this should be no less than
246
+ * the largest font size applied to the text in the cue.
247
+ * @type {string}.
248
+ */
249
+ shaka.text.Cue.prototype.lineHeight;
250
+ /**
251
+ * Line alignment of the cue box.
252
+ * Start alignment means the cue box’s top side (for horizontal cues), left
253
+ * side (for vertical growing right), or right side (for vertical growing
254
+ * left) is aligned at the line.
255
+ * Center alignment means the cue box is centered at the line.
256
+ * End alignment The cue box’s bottom side (for horizontal cues), right side
257
+ * (for vertical growing right), or left side (for vertical growing left) is
258
+ * aligned at the line.
259
+ * @type {shaka.text.Cue.lineAlign}
260
+ */
261
+ shaka.text.Cue.prototype.lineAlign;
262
+ /**
263
+ * Vertical alignments of the cues within their extents.
264
+ * 'BEFORE' means displaying the captions at the top of the text display
265
+ * container box, 'CENTER' means in the middle, 'AFTER' means at the bottom.
266
+ * @type {shaka.text.Cue.displayAlign}
267
+ */
268
+ shaka.text.Cue.prototype.displayAlign;
269
+ /**
270
+ * Text color as a CSS color, e.g. "#FFFFFF" or "white".
271
+ * @type {string}
272
+ */
273
+ shaka.text.Cue.prototype.color;
274
+ /**
275
+ * Text background color as a CSS color, e.g. "#FFFFFF" or "white".
276
+ * @type {string}
277
+ */
278
+ shaka.text.Cue.prototype.backgroundColor;
279
+ /**
280
+ * The URL of the background image, e.g. "data:[mime type];base64,[data]".
281
+ * @type {string}
282
+ */
283
+ shaka.text.Cue.prototype.backgroundImage;
284
+ /**
285
+ * The border around this cue as a CSS border.
286
+ * @type {string}
287
+ */
288
+ shaka.text.Cue.prototype.border;
289
+ /**
290
+ * Text font size in px or em (e.g. '100px'/'100em').
291
+ * @type {string}
292
+ */
293
+ shaka.text.Cue.prototype.fontSize;
294
+ /**
295
+ * Text font weight. Either normal or bold.
296
+ * @type {shaka.text.Cue.fontWeight}
297
+ */
298
+ shaka.text.Cue.prototype.fontWeight;
299
+ /**
300
+ * Text font style. Normal, italic or oblique.
301
+ * @type {shaka.text.Cue.fontStyle}
302
+ */
303
+ shaka.text.Cue.prototype.fontStyle;
304
+ /**
305
+ * Text font family.
306
+ * @type {string}
307
+ */
308
+ shaka.text.Cue.prototype.fontFamily;
309
+ /**
310
+ * Text letter spacing as a CSS letter-spacing value.
311
+ * @type {string}
312
+ */
313
+ shaka.text.Cue.prototype.letterSpacing;
314
+ /**
315
+ * Text line padding as a CSS line-padding value.
316
+ * @type {string}
317
+ */
318
+ shaka.text.Cue.prototype.linePadding;
319
+ /**
320
+ * Opacity of the cue element, from 0-1.
321
+ * @type {number}
322
+ */
323
+ shaka.text.Cue.prototype.opacity;
324
+ /**
325
+ * Text decoration. A combination of underline, overline
326
+ * and line through. Empty array means no decoration.
327
+ * @type {!Array.<!shaka.text.Cue.textDecoration>}
328
+ */
329
+ shaka.text.Cue.prototype.textDecoration;
330
+ /**
331
+ * Text shadow color as a CSS text-shadow value.
332
+ * @type {string}
333
+ */
334
+ shaka.text.Cue.prototype.textShadow;
335
+ /**
336
+ * Text stroke color as a CSS color, e.g. "#FFFFFF" or "white".
337
+ * @type {string}
338
+ */
339
+ shaka.text.Cue.prototype.textStrokeColor;
340
+ /**
341
+ * Text stroke width as a CSS stroke-width value.
342
+ * @type {string}
343
+ */
344
+ shaka.text.Cue.prototype.textStrokeWidth;
345
+ /**
346
+ * Whether or not line wrapping should be applied to the cue.
347
+ * @type {boolean}
348
+ */
349
+ shaka.text.Cue.prototype.wrapLine;
350
+ /**
351
+ * Id of the cue.
352
+ * @type {string}
353
+ */
354
+ shaka.text.Cue.prototype.id;
355
+ /**
356
+ * Nested cues, which should be laid out horizontally in one block.
357
+ * Top-level cues are blocks, and nested cues are inline elements.
358
+ * Cues can be nested arbitrarily deeply.
359
+ * @type {!Array.<!shaka.text.Cue>}
360
+ */
361
+ shaka.text.Cue.prototype.nestedCues;
362
+ /**
363
+ * If true, this represents a container element that is "above" the main
364
+ * cues. For example, the <body> and <div> tags that contain the <p> tags
365
+ * in a TTML file. This controls the flow of the final cues; any nested cues
366
+ * within an "isContainer" cue will be laid out as separate lines.
367
+ * @type {boolean}
368
+ */
369
+ shaka.text.Cue.prototype.isContainer;
370
+ /**
371
+ * Whether or not the cue only acts as a line break between two nested cues.
372
+ * Should only appear in nested cues.
373
+ * @type {boolean}
374
+ */
375
+ shaka.text.Cue.prototype.lineBreak;
376
+ /**
377
+ * The number of horizontal and vertical cells into which the Root Container
378
+ * Region area is divided.
379
+ * @type {{ columns: number, rows: number }}
380
+ */
381
+ shaka.text.Cue.prototype.cellResolution;
176
382
  /**
177
383
  * @enum {string}
178
384
  */
@@ -294,6 +500,68 @@ shaka.text.CueRegion = class {
294
500
  /** */
295
501
  constructor() {}
296
502
  };
503
+ /**
504
+ * Region identifier.
505
+ * @type {string}
506
+ */
507
+ shaka.text.CueRegion.prototype.id;
508
+ /**
509
+ * The X offset to start the rendering area in viewportAnchorUnits of the
510
+ * video width.
511
+ * @type {number}
512
+ */
513
+ shaka.text.CueRegion.prototype.viewportAnchorX;
514
+ /**
515
+ * The X offset to start the rendering area in viewportAnchorUnits of the
516
+ * video height.
517
+ * @type {number}
518
+ */
519
+ shaka.text.CueRegion.prototype.viewportAnchorY;
520
+ /**
521
+ * The X offset to start the rendering area in percentage (0-100) of this
522
+ * region width.
523
+ * @type {number}
524
+ */
525
+ shaka.text.CueRegion.prototype.regionAnchorX;
526
+ /**
527
+ * The Y offset to start the rendering area in percentage (0-100) of the
528
+ * region height.
529
+ * @type {number}
530
+ */
531
+ shaka.text.CueRegion.prototype.regionAnchorY;
532
+ /**
533
+ * The width of the rendering area in widthUnits.
534
+ * @type {number}
535
+ */
536
+ shaka.text.CueRegion.prototype.width;
537
+ /**
538
+ * The width of the rendering area in heightUnits.
539
+ * @type {number}
540
+ */
541
+ shaka.text.CueRegion.prototype.height;
542
+ /**
543
+ * The units (percentage, pixels or lines) the region height is in.
544
+ * @type {shaka.text.CueRegion.units}
545
+ */
546
+ shaka.text.CueRegion.prototype.heightUnits;
547
+ /**
548
+ * The units (percentage or pixels) the region width is in.
549
+ * @type {shaka.text.CueRegion.units}
550
+ */
551
+ shaka.text.CueRegion.prototype.widthUnits;
552
+ /**
553
+ * The units (percentage or pixels) the region viewportAnchors are in.
554
+ * @type {shaka.text.CueRegion.units}
555
+ */
556
+ shaka.text.CueRegion.prototype.viewportAnchorUnits;
557
+ /**
558
+ * If scroll=UP, it means that cues in the region will be added to the
559
+ * bottom of the region and will push any already displayed cues in the
560
+ * region up. Otherwise (scroll=NONE) cues will stay fixed at the location
561
+ * they were first painted in.
562
+ * @type {shaka.text.CueRegion.scrollMode}
563
+ */
564
+ shaka.text.CueRegion.prototype.scroll;
297
565
  /**
298
566
  * @enum {number}
299
567
  */
@@ -1625,8 +1893,10 @@ shaka.media.InitSegmentReference = class {
1625
1893
  * the quality of the media associated with this init segment.
1626
1894
  * @param {(null|number)=} timescale
1627
1895
  * @param {(null|BufferSource)=} segmentData
1896
+ * @param {?shaka.extern.HlsAes128Key=} aes128Key
1897
+ * The segment's AES-128-CBC full segment encryption key and iv.
1628
1898
  */
1629
- constructor(uris, startByte, endByte, mediaQuality, timescale, segmentData) {}
1899
+ constructor(uris, startByte, endByte, mediaQuality, timescale, segmentData, aes128Key) {}
1630
1900
  /**
1631
1901
  * Returns the offset from the start of the resource to the
1632
1902
  * start of the segment.
@@ -1921,6 +2191,11 @@ shaka.util.TsParser = class {
1921
2191
  * @return {{height: ?string, width: ?string}}
1922
2192
  */
1923
2193
  getVideoResolution() {}
2194
+ /**
2195
+ * Return the video information
2196
+ * @return {{height: ?string, width: ?string, codec: ?string}}
2197
+ */
2198
+ getVideoInfo() {}
1924
2199
  /**
1925
2200
  * Check if the passed data corresponds to an MPEG2-TS
1926
2201
  * @param {Uint8Array} data
@@ -4416,6 +4691,10 @@ shaka.text.LrcTextParser = class {
4416
4691
  * @override
4417
4692
  */
4418
4693
  setSequenceMode(sequenceMode) {}
4694
+ /**
4695
+ * @override
4696
+ */
4697
+ setManifestType(manifestType) {}
4419
4698
  /**
4420
4699
  * @override
4421
4700
  */
@@ -4433,6 +4712,10 @@ shaka.text.TtmlTextParser = class {
4433
4712
  * @override
4434
4713
  */
4435
4714
  setSequenceMode(sequenceMode) {}
4715
+ /**
4716
+ * @override
4717
+ */
4718
+ setManifestType(manifestType) {}
4436
4719
  /**
4437
4720
  * @override
4438
4721
  */
@@ -4452,6 +4735,10 @@ shaka.text.Mp4TtmlParser = class {
4452
4735
  * @override
4453
4736
  */
4454
4737
  setSequenceMode(sequenceMode) {}
4738
+ /**
4739
+ * @override
4740
+ */
4741
+ setManifestType(manifestType) {}
4455
4742
  /**
4456
4743
  * @override
4457
4744
  */
@@ -4471,6 +4758,10 @@ shaka.text.VttTextParser = class {
4471
4758
  * @override
4472
4759
  */
4473
4760
  setSequenceMode(sequenceMode) {}
4761
+ /**
4762
+ * @override
4763
+ */
4764
+ setManifestType(manifestType) {}
4474
4765
  /**
4475
4766
  * @override
4476
4767
  */
@@ -4490,6 +4781,10 @@ shaka.text.Mp4VttParser = class {
4490
4781
  * @override
4491
4782
  */
4492
4783
  setSequenceMode(sequenceMode) {}
4784
+ /**
4785
+ * @override
4786
+ */
4787
+ setManifestType(manifestType) {}
4493
4788
  /**
4494
4789
  * @override
4495
4790
  */
@@ -4507,6 +4802,10 @@ shaka.text.SbvTextParser = class {
4507
4802
  * @override
4508
4803
  */
4509
4804
  setSequenceMode(sequenceMode) {}
4805
+ /**
4806
+ * @override
4807
+ */
4808
+ setManifestType(manifestType) {}
4510
4809
  /**
4511
4810
  * @override
4512
4811
  */
@@ -4526,6 +4825,10 @@ shaka.text.SrtTextParser = class {
4526
4825
  * @override
4527
4826
  */
4528
4827
  setSequenceMode(sequenceMode) {}
4828
+ /**
4829
+ * @override
4830
+ */
4831
+ setManifestType(manifestType) {}
4529
4832
  /**
4530
4833
  * @override
4531
4834
  */
@@ -4551,6 +4854,10 @@ shaka.text.SsaTextParser = class {
4551
4854
  * @override
4552
4855
  */
4553
4856
  setSequenceMode(sequenceMode) {}
4857
+ /**
4858
+ * @override
4859
+ */
4860
+ setManifestType(manifestType) {}
4554
4861
  /**
4555
4862
  * @override
4556
4863
  */