shaka-player 4.3.13 → 4.3.14

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 (124) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
  2. package/.github/ISSUE_TEMPLATE/question.md +7 -0
  3. package/.github/workflows/release-please.yaml +2 -27
  4. package/AUTHORS +5 -0
  5. package/CHANGELOG.md +87 -0
  6. package/CODE_OF_CONDUCT.md +1 -1
  7. package/CONTRIBUTORS +6 -0
  8. package/README.md +2 -0
  9. package/demo/common/asset.js +0 -1
  10. package/demo/common/assets.js +0 -1
  11. package/demo/custom.js +2 -0
  12. package/dist/demo.compiled.debug.js +1 -1
  13. package/dist/demo.compiled.debug.map +1 -1
  14. package/dist/demo.compiled.js +1 -1
  15. package/dist/demo.compiled.map +1 -1
  16. package/dist/deps.js +6 -6
  17. package/dist/locales.js +29 -29
  18. package/dist/receiver.compiled.debug.map +1 -1
  19. package/dist/receiver.compiled.map +1 -1
  20. package/dist/shaka-player.compiled.d.ts +25 -5
  21. package/dist/shaka-player.compiled.debug.d.ts +25 -5
  22. package/dist/shaka-player.compiled.debug.externs.js +73 -45
  23. package/dist/shaka-player.compiled.debug.js +414 -396
  24. package/dist/shaka-player.compiled.debug.map +4 -4
  25. package/dist/shaka-player.compiled.externs.js +73 -45
  26. package/dist/shaka-player.compiled.js +912 -903
  27. package/dist/shaka-player.compiled.map +4 -4
  28. package/dist/shaka-player.ui.d.ts +37 -6
  29. package/dist/shaka-player.ui.debug.d.ts +37 -6
  30. package/dist/shaka-player.ui.debug.externs.js +74 -45
  31. package/dist/shaka-player.ui.debug.js +438 -418
  32. package/dist/shaka-player.ui.debug.map +4 -4
  33. package/dist/shaka-player.ui.externs.js +74 -45
  34. package/dist/shaka-player.ui.js +1060 -1051
  35. package/dist/shaka-player.ui.map +4 -4
  36. package/docs/tutorials/ad_monetization.md +54 -0
  37. package/docs/tutorials/fairplay.md +2 -2
  38. package/docs/tutorials/index.json +1 -0
  39. package/docs/tutorials/plugins.md +4 -0
  40. package/docs/tutorials/text-displayer.md +15 -0
  41. package/docs/tutorials/ui-customization.md +29 -0
  42. package/docs/tutorials/ui.md +4 -1
  43. package/externs/lcevc.js +6 -0
  44. package/externs/shaka/manifest_parser.js +8 -0
  45. package/externs/shaka/player.js +1 -1
  46. package/externs/shaka/text.js +3 -1
  47. package/lib/abr/simple_abr_manager.js +1 -1
  48. package/lib/ads/client_side_ad.js +9 -0
  49. package/lib/ads/client_side_ad_manager.js +7 -2
  50. package/lib/ads/server_side_ad_manager.js +4 -0
  51. package/lib/cast/cast_proxy.js +18 -0
  52. package/lib/cea/cea608_memory.js +1 -1
  53. package/lib/cea/cea_decoder.js +11 -1
  54. package/lib/dash/dash_parser.js +75 -41
  55. package/lib/dash/mpd_utils.js +39 -27
  56. package/lib/hls/hls_parser.js +90 -27
  57. package/lib/hls/hls_utils.js +5 -5
  58. package/lib/media/content_workarounds.js +30 -0
  59. package/lib/media/drm_engine.js +16 -12
  60. package/lib/media/media_source_engine.js +4 -2
  61. package/lib/media/play_rate_controller.js +1 -0
  62. package/lib/media/presentation_timeline.js +11 -0
  63. package/lib/media/quality_observer.js +1 -1
  64. package/lib/media/segment_reference.js +5 -2
  65. package/lib/media/streaming_engine.js +50 -30
  66. package/lib/media/transmuxer.js +1 -1
  67. package/lib/media/video_wrapper.js +4 -3
  68. package/lib/offline/offline_manifest_parser.js +5 -0
  69. package/lib/offline/session_deleter.js +0 -8
  70. package/lib/offline/storage.js +4 -1
  71. package/lib/player.js +79 -18
  72. package/lib/polyfill/media_capabilities.js +23 -3
  73. package/lib/text/mp4_ttml_parser.js +2 -2
  74. package/lib/text/simple_text_displayer.js +7 -6
  75. package/lib/text/srt_text_parser.js +2 -2
  76. package/lib/text/text_engine.js +3 -2
  77. package/lib/text/ttml_text_parser.js +33 -5
  78. package/lib/text/ui_text_displayer.js +81 -15
  79. package/lib/text/vtt_text_parser.js +15 -2
  80. package/lib/util/buffer_utils.js +26 -4
  81. package/lib/util/cmcd_manager.js +10 -0
  82. package/lib/util/fairplay_utils.js +1 -1
  83. package/lib/util/manifest_parser_utils.js +14 -8
  84. package/lib/util/object_utils.js +1 -1
  85. package/lib/util/periods.js +91 -36
  86. package/lib/util/platform.js +39 -2
  87. package/lib/util/player_configuration.js +5 -3
  88. package/lib/util/stream_utils.js +36 -28
  89. package/lib/util/xml_utils.js +5 -0
  90. package/package.json +2 -2
  91. package/test/cea/cea_decoder_unit.js +40 -0
  92. package/test/dash/dash_parser_live_unit.js +5 -8
  93. package/test/hls/hls_parser_unit.js +50 -3
  94. package/test/media/buffering_observer_unit.js +13 -0
  95. package/test/media/content_workarounds_unit.js +1 -1
  96. package/test/media/drm_engine_unit.js +30 -3
  97. package/test/media/media_source_engine_unit.js +1 -1
  98. package/test/media/transmuxer_integration.js +2 -2
  99. package/test/offline/storage_integration.js +3 -0
  100. package/test/player_integration.js +40 -40
  101. package/test/player_unit.js +31 -0
  102. package/test/polyfill/media_capabilities_unit.js +12 -6
  103. package/test/test/util/fake_drm_engine.js +7 -0
  104. package/test/test/util/layout_tests.js +2 -1
  105. package/test/test/util/simple_fakes.js +2 -2
  106. package/test/test/util/test_scheme.js +3 -0
  107. package/test/test/util/waiter.js +5 -0
  108. package/test/text/mp4_ttml_parser_unit.js +4 -4
  109. package/test/text/simple_text_displayer_unit.js +1 -1
  110. package/test/text/srt_text_parser_unit.js +1 -1
  111. package/test/text/text_engine_unit.js +6 -0
  112. package/test/text/ttml_text_parser_unit.js +49 -18
  113. package/test/text/ui_text_displayer_unit.js +9 -0
  114. package/test/util/buffer_utils_unit.js +1 -1
  115. package/test/util/periods_unit.js +113 -0
  116. package/third_party/closure-uri/uri.js +1 -1
  117. package/ui/externs/ui.js +24 -0
  118. package/ui/language_utils.js +11 -5
  119. package/ui/play_button.js +20 -0
  120. package/ui/playback_rate_selection.js +4 -0
  121. package/ui/presentation_time.js +5 -5
  122. package/ui/small_play_button.js +2 -2
  123. package/ui/volume_bar.js +10 -6
  124. /package/.github/{config.yml → ISSUE_TEMPLATE/config.yml} +0 -0
@@ -944,6 +944,18 @@ shaka.util.BufferUtils = class {
944
944
  * @return {!Uint8Array}
945
945
  */
946
946
  static toUint8(data, offset, length) {}
947
+ /**
948
+ * Creates a new Uint16Array view on the same buffer. This clamps the values
949
+ * to be within the same view (i.e. you can't use this to move past the end
950
+ * of the view, even if the underlying buffer is larger). However, you can
951
+ * pass a negative offset to access the data before the view.
952
+ * @param {BufferSource} data
953
+ * @param {number=} offset The offset from the beginning of this data's view
954
+ * to start the new view at.
955
+ * @param {number=} length The byte length of the new view.
956
+ * @return {!Uint16Array}
957
+ */
958
+ static toUint16(data, offset, length) {}
947
959
  /**
948
960
  * Creates a DataView over the given buffer.
949
961
  * @see toUint8
@@ -2091,6 +2103,11 @@ shaka.media.PresentationTimeline = class {
2091
2103
  * windows to jump around on updates.
2092
2104
  */
2093
2105
  lockStartTime() {}
2106
+ /**
2107
+ * Returns if the presentation timeline's start time is locked.
2108
+ * @return {boolean}
2109
+ */
2110
+ isStartTimeLocked() {}
2094
2111
  /**
2095
2112
  * Gives PresentationTimeline a Stream's minimum segment start time.
2096
2113
  * @param {number} startTime
@@ -2355,13 +2372,56 @@ shaka.media.MetaSegmentIndex = class extends shaka.media.SegmentIndex {
2355
2372
  */
2356
2373
  updateEvery(interval, updateCallback) {}
2357
2374
  };
2375
+ /**
2376
+ * @typedef {{
2377
+ * type: string,
2378
+ * init: boolean,
2379
+ * duration: number,
2380
+ * mimeType: string,
2381
+ * codecs: string,
2382
+ * bandwidth: (number|undefined)
2383
+ * }}
2384
+ * @property {string} type
2385
+ * The media type
2386
+ * @property {boolean} init
2387
+ * Flag indicating whether the segment is an init segment
2388
+ * @property {number} duration
2389
+ * The duration of the segment in seconds
2390
+ * @property {string} mimeType
2391
+ * The segment's mime type
2392
+ * @property {string} codecs
2393
+ * The segment's codecs
2394
+ * @property {(number|undefined)} bandwidth
2395
+ * The segment's variation bandwidth
2396
+ */
2397
+ shaka.util.CmcdManager.SegmentInfo;
2398
+ /**
2399
+ * @typedef {{
2400
+ * format: shaka.util.CmcdManager.StreamingFormat
2401
+ * }}
2402
+ * @property {shaka.util.CmcdManager.StreamingFormat} format
2403
+ * The manifest's stream format
2404
+ */
2405
+ shaka.util.CmcdManager.ManifestInfo;
2406
+ /**
2407
+ * @enum {string}
2408
+ */
2409
+ shaka.util.CmcdManager.StreamingFormat = {
2410
+ DASH: 'd',
2411
+ HLS: 'h',
2412
+ SMOOTH: 's',
2413
+ OTHER: 'o'
2414
+ };
2358
2415
  /**
2359
2416
  * A text displayer plugin using the browser's native VTTCue interface.
2360
2417
  * @implements {shaka.extern.TextDisplayer}
2361
2418
  */
2362
2419
  shaka.text.SimpleTextDisplayer = class {
2363
- /** @param {HTMLMediaElement} video */
2364
- constructor(video) {}
2420
+ /**
2421
+ * @param {HTMLMediaElement} video
2422
+ * @param {string} label
2423
+ */
2424
+ constructor(video, label) {}
2365
2425
  /**
2366
2426
  * @override
2367
2427
  */
@@ -2430,46 +2490,6 @@ shaka.text.UITextDisplayer = class {
2430
2490
  */
2431
2491
  shaka.text.WebVttGenerator = class {
2432
2492
  };
2433
- /**
2434
- * @typedef {{
2435
- * type: string,
2436
- * init: boolean,
2437
- * duration: number,
2438
- * mimeType: string,
2439
- * codecs: string,
2440
- * bandwidth: (number|undefined)
2441
- * }}
2442
- * @property {string} type
2443
- * The media type
2444
- * @property {boolean} init
2445
- * Flag indicating whether the segment is an init segment
2446
- * @property {number} duration
2447
- * The duration of the segment in seconds
2448
- * @property {string} mimeType
2449
- * The segment's mime type
2450
- * @property {string} codecs
2451
- * The segment's codecs
2452
- * @property {(number|undefined)} bandwidth
2453
- * The segment's variation bandwidth
2454
- */
2455
- shaka.util.CmcdManager.SegmentInfo;
2456
- /**
2457
- * @typedef {{
2458
- * format: shaka.util.CmcdManager.StreamingFormat
2459
- * }}
2460
- * @property {shaka.util.CmcdManager.StreamingFormat} format
2461
- * The manifest's stream format
2462
- */
2463
- shaka.util.CmcdManager.ManifestInfo;
2464
- /**
2465
- * @enum {string}
2466
- */
2467
- shaka.util.CmcdManager.StreamingFormat = {
2468
- DASH: 'd',
2469
- HLS: 'h',
2470
- SMOOTH: 's',
2471
- OTHER: 'o'
2472
- };
2473
2493
  /** */
2474
2494
  shaka.util.ConfigUtils = class {
2475
2495
  /**
@@ -3737,6 +3757,10 @@ shaka.dash.DashParser = class {
3737
3757
  * @override
3738
3758
  */
3739
3759
  onExpirationUpdated(sessionId, expiration) {}
3760
+ /**
3761
+ * @override
3762
+ */
3763
+ onInitialVariantChosen(variant) {}
3740
3764
  };
3741
3765
  /**
3742
3766
  * @summary A networking plugin to handle data URIs.
@@ -3782,6 +3806,10 @@ shaka.hls.HlsParser = class {
3782
3806
  * @override
3783
3807
  */
3784
3808
  onExpirationUpdated(sessionId, expiration) {}
3809
+ /**
3810
+ * @override
3811
+ */
3812
+ onInitialVariantChosen(variant) {}
3785
3813
  };
3786
3814
  /**
3787
3815
  * @summary A networking plugin to handle http and https URIs via the Fetch API.
@@ -4237,7 +4265,7 @@ shaka.text.TtmlTextParser = class {
4237
4265
  /**
4238
4266
  * @override
4239
4267
  */
4240
- parseMedia(data, time) {}
4268
+ parseMedia(data, time, uri) {}
4241
4269
  };
4242
4270
  /**
4243
4271
  * @implements {shaka.extern.TextParser}
@@ -4256,7 +4284,7 @@ shaka.text.Mp4TtmlParser = class {
4256
4284
  /**
4257
4285
  * @override
4258
4286
  */
4259
- parseMedia(data, time) {}
4287
+ parseMedia(data, time, uri) {}
4260
4288
  };
4261
4289
  /**
4262
4290
  * @implements {shaka.extern.TextParser}
@@ -4330,7 +4358,7 @@ shaka.text.SrtTextParser = class {
4330
4358
  /**
4331
4359
  * @override
4332
4360
  */
4333
- parseMedia(data, time) {}
4361
+ parseMedia(data, time, uri) {}
4334
4362
  /**
4335
4363
  * Convert a SRT format to WebVTT
4336
4364
  * @param {string} data
@@ -4428,6 +4456,7 @@ shaka.ui.AdPosition = class extends shaka.ui.Element {
4428
4456
  };
4429
4457
  /**
4430
4458
  * @extends {shaka.ui.Element}
4459
+ * @implements {shaka.extern.IUIPlayButton}
4431
4460
  */
4432
4461
  shaka.ui.PlayButton = class extends shaka.ui.Element {
4433
4462
  /**