shaka-player 4.3.13 → 4.3.15

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 (137) 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/.github/workflows/shaka-bot-commands/lib.sh +37 -12
  5. package/.github/workflows/shaka-bot-commands/main.sh +4 -2
  6. package/.github/workflows/talk-to-shaka-bot.yaml +1 -0
  7. package/AUTHORS +5 -0
  8. package/CHANGELOG.md +96 -0
  9. package/CODE_OF_CONDUCT.md +1 -1
  10. package/CONTRIBUTORS +6 -0
  11. package/README.md +2 -0
  12. package/demo/common/asset.js +0 -1
  13. package/demo/common/assets.js +0 -1
  14. package/demo/custom.js +2 -0
  15. package/dist/controls.css +1 -1
  16. package/dist/controls.css.map +1 -1
  17. package/dist/demo.compiled.debug.js +1 -1
  18. package/dist/demo.compiled.debug.map +1 -1
  19. package/dist/demo.compiled.js +1 -1
  20. package/dist/demo.compiled.map +1 -1
  21. package/dist/deps.js +6 -6
  22. package/dist/locales.js +30 -30
  23. package/dist/receiver.compiled.debug.map +1 -1
  24. package/dist/receiver.compiled.map +1 -1
  25. package/dist/shaka-player.compiled.d.ts +25 -5
  26. package/dist/shaka-player.compiled.debug.d.ts +25 -5
  27. package/dist/shaka-player.compiled.debug.externs.js +73 -45
  28. package/dist/shaka-player.compiled.debug.js +426 -406
  29. package/dist/shaka-player.compiled.debug.map +4 -4
  30. package/dist/shaka-player.compiled.externs.js +73 -45
  31. package/dist/shaka-player.compiled.js +912 -903
  32. package/dist/shaka-player.compiled.map +4 -4
  33. package/dist/shaka-player.ui.d.ts +37 -6
  34. package/dist/shaka-player.ui.debug.d.ts +37 -6
  35. package/dist/shaka-player.ui.debug.externs.js +74 -45
  36. package/dist/shaka-player.ui.debug.js +449 -428
  37. package/dist/shaka-player.ui.debug.map +4 -4
  38. package/dist/shaka-player.ui.externs.js +74 -45
  39. package/dist/shaka-player.ui.js +1060 -1051
  40. package/dist/shaka-player.ui.map +4 -4
  41. package/docs/tutorials/ad_monetization.md +54 -0
  42. package/docs/tutorials/fairplay.md +2 -2
  43. package/docs/tutorials/index.json +1 -0
  44. package/docs/tutorials/plugins.md +4 -0
  45. package/docs/tutorials/text-displayer.md +15 -0
  46. package/docs/tutorials/ui-customization.md +29 -0
  47. package/docs/tutorials/ui.md +4 -1
  48. package/externs/lcevc.js +6 -0
  49. package/externs/shaka/manifest_parser.js +8 -0
  50. package/externs/shaka/player.js +1 -1
  51. package/externs/shaka/text.js +3 -1
  52. package/lib/abr/simple_abr_manager.js +1 -1
  53. package/lib/ads/client_side_ad.js +9 -0
  54. package/lib/ads/client_side_ad_manager.js +7 -2
  55. package/lib/ads/server_side_ad_manager.js +4 -0
  56. package/lib/cast/cast_proxy.js +18 -0
  57. package/lib/cea/cea608_memory.js +1 -1
  58. package/lib/cea/cea_decoder.js +11 -1
  59. package/lib/dash/dash_parser.js +75 -41
  60. package/lib/dash/mpd_utils.js +39 -27
  61. package/lib/deprecate/deprecate.js +1 -1
  62. package/lib/hls/hls_parser.js +106 -28
  63. package/lib/hls/hls_utils.js +5 -5
  64. package/lib/media/content_workarounds.js +30 -0
  65. package/lib/media/drm_engine.js +16 -12
  66. package/lib/media/manifest_parser.js +2 -1
  67. package/lib/media/media_source_engine.js +4 -2
  68. package/lib/media/play_rate_controller.js +1 -0
  69. package/lib/media/presentation_timeline.js +11 -0
  70. package/lib/media/quality_observer.js +1 -1
  71. package/lib/media/segment_reference.js +5 -2
  72. package/lib/media/streaming_engine.js +50 -30
  73. package/lib/media/transmuxer.js +1 -1
  74. package/lib/media/video_wrapper.js +4 -3
  75. package/lib/offline/offline_manifest_parser.js +5 -0
  76. package/lib/offline/session_deleter.js +0 -8
  77. package/lib/offline/storage.js +4 -1
  78. package/lib/player.js +80 -19
  79. package/lib/polyfill/media_capabilities.js +23 -3
  80. package/lib/polyfill/mediasource.js +5 -36
  81. package/lib/text/mp4_ttml_parser.js +2 -2
  82. package/lib/text/simple_text_displayer.js +7 -6
  83. package/lib/text/srt_text_parser.js +2 -2
  84. package/lib/text/text_engine.js +3 -2
  85. package/lib/text/ttml_text_parser.js +33 -5
  86. package/lib/text/ui_text_displayer.js +81 -15
  87. package/lib/text/vtt_text_parser.js +17 -3
  88. package/lib/util/buffer_utils.js +26 -4
  89. package/lib/util/cmcd_manager.js +10 -0
  90. package/lib/util/error.js +1 -0
  91. package/lib/util/fairplay_utils.js +1 -1
  92. package/lib/util/manifest_parser_utils.js +14 -8
  93. package/lib/util/object_utils.js +1 -1
  94. package/lib/util/periods.js +91 -36
  95. package/lib/util/platform.js +39 -2
  96. package/lib/util/player_configuration.js +5 -3
  97. package/lib/util/stream_utils.js +36 -28
  98. package/lib/util/xml_utils.js +5 -0
  99. package/package.json +3 -3
  100. package/test/cea/cea_decoder_unit.js +40 -0
  101. package/test/dash/dash_parser_live_unit.js +5 -8
  102. package/test/hls/hls_parser_unit.js +78 -3
  103. package/test/media/buffering_observer_unit.js +13 -0
  104. package/test/media/content_workarounds_unit.js +1 -1
  105. package/test/media/drm_engine_unit.js +30 -3
  106. package/test/media/media_source_engine_unit.js +1 -1
  107. package/test/media/transmuxer_integration.js +2 -2
  108. package/test/offline/storage_integration.js +3 -0
  109. package/test/player_integration.js +49 -41
  110. package/test/player_load_graph_integration.js +13 -7
  111. package/test/player_src_equals_integration.js +2 -2
  112. package/test/player_unit.js +40 -3
  113. package/test/polyfill/media_capabilities_unit.js +12 -6
  114. package/test/test/util/fake_drm_engine.js +7 -0
  115. package/test/test/util/layout_tests.js +2 -1
  116. package/test/test/util/simple_fakes.js +2 -2
  117. package/test/test/util/test_scheme.js +3 -0
  118. package/test/test/util/waiter.js +5 -0
  119. package/test/text/mp4_ttml_parser_unit.js +4 -4
  120. package/test/text/simple_text_displayer_unit.js +1 -1
  121. package/test/text/srt_text_parser_unit.js +1 -1
  122. package/test/text/text_engine_unit.js +6 -0
  123. package/test/text/ttml_text_parser_unit.js +49 -18
  124. package/test/text/ui_text_displayer_unit.js +9 -0
  125. package/test/text/vtt_text_parser_unit.js +31 -0
  126. package/test/util/buffer_utils_unit.js +1 -1
  127. package/test/util/periods_unit.js +113 -0
  128. package/third_party/closure-uri/uri.js +1 -1
  129. package/ui/externs/ui.js +24 -0
  130. package/ui/language_utils.js +11 -5
  131. package/ui/less/containers.less +1 -0
  132. package/ui/play_button.js +20 -0
  133. package/ui/playback_rate_selection.js +4 -0
  134. package/ui/presentation_time.js +5 -5
  135. package/ui/small_play_button.js +2 -2
  136. package/ui/volume_bar.js +10 -6
  137. /package/.github/{config.yml → ISSUE_TEMPLATE/config.yml} +0 -0
@@ -424,6 +424,18 @@ shaka.util.BufferUtils = class {
424
424
  * @return {!Uint8Array}
425
425
  */
426
426
  static toUint8(data, offset, length) {}
427
+ /**
428
+ * Creates a new Uint16Array view on the same buffer. This clamps the values
429
+ * to be within the same view (i.e. you can't use this to move past the end
430
+ * of the view, even if the underlying buffer is larger). However, you can
431
+ * pass a negative offset to access the data before the view.
432
+ * @param {BufferSource} data
433
+ * @param {number=} offset The offset from the beginning of this data's view
434
+ * to start the new view at.
435
+ * @param {number=} length The byte length of the new view.
436
+ * @return {!Uint16Array}
437
+ */
438
+ static toUint16(data, offset, length) {}
427
439
  /**
428
440
  * Creates a DataView over the given buffer.
429
441
  * @see toUint8
@@ -1984,6 +1996,11 @@ shaka.media.PresentationTimeline = class {
1984
1996
  * windows to jump around on updates.
1985
1997
  */
1986
1998
  lockStartTime() {}
1999
+ /**
2000
+ * Returns if the presentation timeline's start time is locked.
2001
+ * @return {boolean}
2002
+ */
2003
+ isStartTimeLocked() {}
1987
2004
  /**
1988
2005
  * Gives PresentationTimeline a Stream's minimum segment start time.
1989
2006
  * @param {number} startTime
@@ -2248,13 +2265,56 @@ shaka.media.MetaSegmentIndex = class extends shaka.media.SegmentIndex {
2248
2265
  */
2249
2266
  updateEvery(interval, updateCallback) {}
2250
2267
  };
2268
+ /**
2269
+ * @typedef {{
2270
+ * type: string,
2271
+ * init: boolean,
2272
+ * duration: number,
2273
+ * mimeType: string,
2274
+ * codecs: string,
2275
+ * bandwidth: (number|undefined)
2276
+ * }}
2277
+ * @property {string} type
2278
+ * The media type
2279
+ * @property {boolean} init
2280
+ * Flag indicating whether the segment is an init segment
2281
+ * @property {number} duration
2282
+ * The duration of the segment in seconds
2283
+ * @property {string} mimeType
2284
+ * The segment's mime type
2285
+ * @property {string} codecs
2286
+ * The segment's codecs
2287
+ * @property {(number|undefined)} bandwidth
2288
+ * The segment's variation bandwidth
2289
+ */
2290
+ shaka.util.CmcdManager.SegmentInfo;
2291
+ /**
2292
+ * @typedef {{
2293
+ * format: shaka.util.CmcdManager.StreamingFormat
2294
+ * }}
2295
+ * @property {shaka.util.CmcdManager.StreamingFormat} format
2296
+ * The manifest's stream format
2297
+ */
2298
+ shaka.util.CmcdManager.ManifestInfo;
2299
+ /**
2300
+ * @enum {string}
2301
+ */
2302
+ shaka.util.CmcdManager.StreamingFormat = {
2303
+ DASH: 'd',
2304
+ HLS: 'h',
2305
+ SMOOTH: 's',
2306
+ OTHER: 'o'
2307
+ };
2251
2308
  /**
2252
2309
  * A text displayer plugin using the browser's native VTTCue interface.
2253
2310
  * @implements {shaka.extern.TextDisplayer}
2254
2311
  */
2255
2312
  shaka.text.SimpleTextDisplayer = class {
2256
- /** @param {HTMLMediaElement} video */
2257
- constructor(video) {}
2313
+ /**
2314
+ * @param {HTMLMediaElement} video
2315
+ * @param {string} label
2316
+ */
2317
+ constructor(video, label) {}
2258
2318
  /**
2259
2319
  * @override
2260
2320
  */
@@ -2323,46 +2383,6 @@ shaka.text.UITextDisplayer = class {
2323
2383
  */
2324
2384
  shaka.text.WebVttGenerator = class {
2325
2385
  };
2326
- /**
2327
- * @typedef {{
2328
- * type: string,
2329
- * init: boolean,
2330
- * duration: number,
2331
- * mimeType: string,
2332
- * codecs: string,
2333
- * bandwidth: (number|undefined)
2334
- * }}
2335
- * @property {string} type
2336
- * The media type
2337
- * @property {boolean} init
2338
- * Flag indicating whether the segment is an init segment
2339
- * @property {number} duration
2340
- * The duration of the segment in seconds
2341
- * @property {string} mimeType
2342
- * The segment's mime type
2343
- * @property {string} codecs
2344
- * The segment's codecs
2345
- * @property {(number|undefined)} bandwidth
2346
- * The segment's variation bandwidth
2347
- */
2348
- shaka.util.CmcdManager.SegmentInfo;
2349
- /**
2350
- * @typedef {{
2351
- * format: shaka.util.CmcdManager.StreamingFormat
2352
- * }}
2353
- * @property {shaka.util.CmcdManager.StreamingFormat} format
2354
- * The manifest's stream format
2355
- */
2356
- shaka.util.CmcdManager.ManifestInfo;
2357
- /**
2358
- * @enum {string}
2359
- */
2360
- shaka.util.CmcdManager.StreamingFormat = {
2361
- DASH: 'd',
2362
- HLS: 'h',
2363
- SMOOTH: 's',
2364
- OTHER: 'o'
2365
- };
2366
2386
  /** */
2367
2387
  shaka.util.ConfigUtils = class {
2368
2388
  /**
@@ -3630,6 +3650,10 @@ shaka.dash.DashParser = class {
3630
3650
  * @override
3631
3651
  */
3632
3652
  onExpirationUpdated(sessionId, expiration) {}
3653
+ /**
3654
+ * @override
3655
+ */
3656
+ onInitialVariantChosen(variant) {}
3633
3657
  };
3634
3658
  /**
3635
3659
  * @summary A networking plugin to handle data URIs.
@@ -3675,6 +3699,10 @@ shaka.hls.HlsParser = class {
3675
3699
  * @override
3676
3700
  */
3677
3701
  onExpirationUpdated(sessionId, expiration) {}
3702
+ /**
3703
+ * @override
3704
+ */
3705
+ onInitialVariantChosen(variant) {}
3678
3706
  };
3679
3707
  /**
3680
3708
  * @summary A networking plugin to handle http and https URIs via the Fetch API.
@@ -4130,7 +4158,7 @@ shaka.text.TtmlTextParser = class {
4130
4158
  /**
4131
4159
  * @override
4132
4160
  */
4133
- parseMedia(data, time) {}
4161
+ parseMedia(data, time, uri) {}
4134
4162
  };
4135
4163
  /**
4136
4164
  * @implements {shaka.extern.TextParser}
@@ -4149,7 +4177,7 @@ shaka.text.Mp4TtmlParser = class {
4149
4177
  /**
4150
4178
  * @override
4151
4179
  */
4152
- parseMedia(data, time) {}
4180
+ parseMedia(data, time, uri) {}
4153
4181
  };
4154
4182
  /**
4155
4183
  * @implements {shaka.extern.TextParser}
@@ -4223,7 +4251,7 @@ shaka.text.SrtTextParser = class {
4223
4251
  /**
4224
4252
  * @override
4225
4253
  */
4226
- parseMedia(data, time) {}
4254
+ parseMedia(data, time, uri) {}
4227
4255
  /**
4228
4256
  * Convert a SRT format to WebVTT
4229
4257
  * @param {string} data