shaka-player 3.2.2 → 3.3.2

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 (188) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
  2. package/.github/ISSUE_TEMPLATE/feature_request.md +1 -1
  3. package/.github/ISSUE_TEMPLATE/question.md +1 -1
  4. package/.github/workflows/build_and_test.yaml +73 -0
  5. package/.github/workflows/release.yaml +53 -0
  6. package/AUTHORS +6 -5
  7. package/CHANGELOG.md +314 -1
  8. package/CONTRIBUTORS +4 -2
  9. package/build/checkversion.py +1 -1
  10. package/build/conformance.textproto +183 -169
  11. package/build/test.py +6 -0
  12. package/build/types/core +3 -0
  13. package/build/types/offline +1 -0
  14. package/build/types/polyfill +1 -0
  15. package/build/types/ui +2 -0
  16. package/demo/common/assets.js +18 -0
  17. package/demo/common/message_ids.js +13 -1
  18. package/demo/config.js +31 -1
  19. package/demo/index.html +1 -1
  20. package/demo/locales/en.json +12 -0
  21. package/demo/locales/source.json +48 -0
  22. package/dist/controls.css +26 -2
  23. package/dist/controls.css.map +1 -1
  24. package/dist/demo.compiled.debug.js +19 -16
  25. package/dist/demo.compiled.debug.map +3 -3
  26. package/dist/demo.compiled.js +19 -16
  27. package/dist/demo.compiled.map +3 -3
  28. package/dist/deps.js +21 -14
  29. package/dist/locales.js +31 -29
  30. package/dist/receiver.compiled.debug.js +11 -9
  31. package/dist/receiver.compiled.debug.map +3 -3
  32. package/dist/receiver.compiled.js +11 -9
  33. package/dist/receiver.compiled.map +3 -3
  34. package/dist/shaka-player.compiled.d.ts +232 -18
  35. package/dist/shaka-player.compiled.debug.d.ts +232 -18
  36. package/dist/shaka-player.compiled.debug.externs.js +293 -17
  37. package/dist/shaka-player.compiled.debug.js +481 -422
  38. package/dist/shaka-player.compiled.debug.map +4 -4
  39. package/dist/shaka-player.compiled.externs.js +293 -17
  40. package/dist/shaka-player.compiled.js +846 -817
  41. package/dist/shaka-player.compiled.map +4 -4
  42. package/dist/shaka-player.ui.d.ts +250 -30
  43. package/dist/shaka-player.ui.debug.d.ts +250 -30
  44. package/dist/shaka-player.ui.debug.externs.js +322 -28
  45. package/dist/shaka-player.ui.debug.js +630 -553
  46. package/dist/shaka-player.ui.debug.map +4 -4
  47. package/dist/shaka-player.ui.externs.js +322 -28
  48. package/dist/shaka-player.ui.js +1048 -1006
  49. package/dist/shaka-player.ui.map +4 -4
  50. package/docs/design/bg-fetch-after.gv +29 -0
  51. package/docs/design/bg-fetch-after.gv.png +0 -0
  52. package/docs/design/bg-fetch-before.gv +18 -0
  53. package/docs/design/bg-fetch-before.gv.png +0 -0
  54. package/docs/design/bg-fetch.md +134 -0
  55. package/docs/tutorials/blob-url.md +15 -0
  56. package/docs/tutorials/index.json +1 -0
  57. package/docs/tutorials/ui-customization.md +66 -0
  58. package/docs/tutorials/ui.md +5 -5
  59. package/externs/cmcd.js +186 -0
  60. package/externs/ima.js +3 -0
  61. package/externs/shaka/ads.js +5 -0
  62. package/externs/shaka/manifest.js +12 -1
  63. package/externs/shaka/manifest_parser.js +10 -1
  64. package/externs/shaka/net.js +20 -4
  65. package/externs/shaka/offline.js +31 -2
  66. package/externs/shaka/player.js +138 -5
  67. package/externs/shaka/text.js +24 -0
  68. package/externs/webcrypto.js +18 -0
  69. package/karma.conf.js +19 -15
  70. package/lib/abr/ewma.js +14 -0
  71. package/lib/abr/ewma_bandwidth_estimator.js +16 -2
  72. package/lib/abr/simple_abr_manager.js +6 -0
  73. package/lib/ads/ad_manager.js +1 -0
  74. package/lib/ads/client_side_ad.js +8 -0
  75. package/lib/ads/client_side_ad_manager.js +8 -4
  76. package/lib/ads/server_side_ad.js +7 -0
  77. package/lib/cast/cast_proxy.js +3 -0
  78. package/lib/cast/cast_receiver.js +3 -0
  79. package/lib/cast/cast_utils.js +1 -0
  80. package/lib/dash/dash_parser.js +79 -33
  81. package/lib/dash/segment_base.js +25 -1
  82. package/lib/dash/segment_list.js +18 -9
  83. package/lib/dash/segment_template.js +23 -10
  84. package/lib/hls/hls_parser.js +116 -23
  85. package/lib/hls/manifest_text_parser.js +1 -0
  86. package/lib/media/quality_observer.js +274 -0
  87. package/lib/media/region_observer.js +39 -33
  88. package/lib/media/region_timeline.js +17 -19
  89. package/lib/media/segment_index.js +8 -1
  90. package/lib/media/segment_reference.js +37 -4
  91. package/lib/media/streaming_engine.js +47 -6
  92. package/lib/net/http_fetch_plugin.js +31 -11
  93. package/lib/net/http_plugin_utils.js +1 -0
  94. package/lib/net/http_xhr_plugin.js +40 -14
  95. package/lib/net/networking_engine.js +85 -18
  96. package/lib/offline/download_info.js +68 -0
  97. package/lib/offline/download_manager.js +13 -5
  98. package/lib/offline/indexeddb/base_storage_cell.js +35 -0
  99. package/lib/offline/indexeddb/storage_mechanism.js +1 -1
  100. package/lib/offline/indexeddb/v5_storage_cell.js +5 -0
  101. package/lib/offline/storage.js +401 -293
  102. package/lib/offline/stored_content_utils.js +2 -0
  103. package/lib/player.js +254 -27
  104. package/lib/polyfill/media_capabilities.js +30 -15
  105. package/lib/polyfill/random_uuid.js +52 -0
  106. package/lib/text/cue.js +18 -0
  107. package/lib/text/ttml_text_parser.js +109 -60
  108. package/lib/text/ui_text_displayer.js +19 -13
  109. package/lib/util/cmcd_manager.js +672 -0
  110. package/lib/util/error.js +6 -0
  111. package/lib/util/fake_event_target.js +21 -1
  112. package/lib/util/language_utils.js +12 -0
  113. package/lib/util/mutex.js +52 -0
  114. package/lib/util/periods.js +98 -64
  115. package/lib/util/player_configuration.js +18 -0
  116. package/lib/util/stream_utils.js +86 -10
  117. package/lib/util/xml_utils.js +19 -0
  118. package/package.json +3 -6
  119. package/shaka-player.uncompiled.js +3 -0
  120. package/test/dash/dash_parser_content_protection_unit.js +2 -0
  121. package/test/dash/dash_parser_live_unit.js +144 -1
  122. package/test/dash/dash_parser_manifest_unit.js +37 -2
  123. package/test/dash/dash_parser_segment_base_unit.js +2 -0
  124. package/test/dash/dash_parser_segment_list_unit.js +2 -1
  125. package/test/dash/dash_parser_segment_template_unit.js +2 -1
  126. package/test/hls/hls_live_unit.js +2 -0
  127. package/test/hls/hls_parser_unit.js +76 -0
  128. package/test/media/drm_engine_unit.js +3 -3
  129. package/test/media/quality_observer_unit.js +142 -0
  130. package/test/media/region_observer_unit.js +40 -5
  131. package/test/media/region_timeline_unit.js +40 -22
  132. package/test/media/segment_reference_unit.js +16 -1
  133. package/test/media/streaming_engine_integration.js +4 -2
  134. package/test/media/streaming_engine_unit.js +147 -0
  135. package/test/net/http_plugin_unit.js +20 -15
  136. package/test/offline/storage_integration.js +108 -4
  137. package/test/player_integration.js +140 -8
  138. package/test/player_src_equals_integration.js +41 -8
  139. package/test/player_unit.js +19 -9
  140. package/test/test/assets/chapters.vtt +2 -2
  141. package/test/test/assets/chapters2.vtt +10 -0
  142. package/test/test/util/dash_parser_util.js +4 -0
  143. package/test/test/util/fake_ad.js +7 -0
  144. package/test/test/util/fake_drm_engine.js +9 -2
  145. package/test/test/util/manifest_generator.js +3 -2
  146. package/test/test/util/test_scheme.js +14 -1
  147. package/test/test/util/ttml_utils.js +81 -0
  148. package/test/test/util/util.js +10 -7
  149. package/test/text/mp4_ttml_parser_unit.js +11 -18
  150. package/test/text/ttml_text_parser_unit.js +544 -228
  151. package/test/ui/text_displayer_layout_unit.js +8 -7
  152. package/test/ui/ui_unit.js +250 -0
  153. package/test/util/cmcd_manager_unit.js +291 -0
  154. package/test/util/stream_utils_unit.js +36 -30
  155. package/third_party/closure-uri/uri.js +21 -0
  156. package/ui/airplay_button.js +1 -0
  157. package/ui/audio_language_selection.js +7 -0
  158. package/ui/cast_button.js +1 -0
  159. package/ui/context_menu.js +109 -0
  160. package/ui/controls.js +44 -7
  161. package/ui/controls.less +1 -0
  162. package/ui/enums.js +4 -0
  163. package/ui/externs/ui.js +28 -1
  164. package/ui/fast_forward_button.js +14 -5
  165. package/ui/fullscreen_button.js +1 -0
  166. package/ui/less/buttons.less +0 -4
  167. package/ui/less/containers.less +74 -0
  168. package/ui/less/overflow_menu.less +0 -10
  169. package/ui/less/tooltip.less +97 -0
  170. package/ui/locales/en.json +1 -0
  171. package/ui/locales/source.json +4 -0
  172. package/ui/localization.js +12 -36
  173. package/ui/loop_button.js +5 -0
  174. package/ui/mute_button.js +2 -1
  175. package/ui/overflow_menu.js +5 -25
  176. package/ui/pip_button.js +5 -0
  177. package/ui/play_button.js +2 -2
  178. package/ui/playback_rate_selection.js +8 -9
  179. package/ui/resolution_selection.js +7 -0
  180. package/ui/rewind_button.js +15 -6
  181. package/ui/seek_bar.js +4 -2
  182. package/ui/settings_menu.js +36 -4
  183. package/ui/small_play_button.js +1 -0
  184. package/ui/statistics_button.js +253 -0
  185. package/ui/text_selection.js +12 -4
  186. package/ui/ui.js +30 -0
  187. package/ui/volume_bar.js +1 -1
  188. package/externs/media_capabilities.js +0 -16
@@ -35,6 +35,8 @@ shaka.text = {};
35
35
  shaka.ui = {};
36
36
  /** @const */
37
37
  shaka.util = {};
38
+ /** @const */
39
+ shaka.util.CmcdManager = {};
38
40
 
39
41
  /**
40
42
  * @summary Create an Event work-alike object based on the provided dictionary.
@@ -48,11 +50,24 @@ shaka.util.FakeEvent = class {
48
50
  */
49
51
  constructor(type, dict) {}
50
52
  };
53
+ /**
54
+ * An interface to standardize how objects release internal references
55
+ * synchronously. If an object needs to asynchronously release references, then
56
+ * it should use 'shaka.util.IDestroyable'.
57
+ * @interface
58
+ */
59
+ shaka.util.IReleasable = class {
60
+ /**
61
+ * Request that this object release all internal references.
62
+ */
63
+ release() {}
64
+ };
51
65
  /**
52
66
  * @summary A work-alike for EventTarget. Only DOM elements may be true
53
67
  * EventTargets, but this can be used as a base class to provide event dispatch
54
68
  * to non-DOM classes. Only FakeEvents should be dispatched.
55
69
  * @implements {EventTarget}
70
+ * @implements {shaka.util.IReleasable}
56
71
  */
57
72
  shaka.util.FakeEventTarget = class {
58
73
  /** */
@@ -90,6 +105,10 @@ shaka.util.FakeEventTarget = class {
90
105
  * @override
91
106
  */
92
107
  dispatchEvent(event) {}
108
+ /**
109
+ * @override
110
+ */
111
+ release() {}
93
112
  };
94
113
  /**
95
114
  * These are the listener types defined in the closure extern for EventTarget.
@@ -287,22 +306,165 @@ shaka.util.Error.Code = {
287
306
  'MISSING_STORAGE_CELL': 9013,
288
307
  'STORAGE_LIMIT_REACHED': 9014,
289
308
  'DOWNLOAD_SIZE_CALLBACK_ERROR': 9015,
309
+ 'MODIFY_OPERATION_NOT_SUPPORTED': 9016,
290
310
  'CS_IMA_SDK_MISSING': 10000,
291
311
  'CS_AD_MANAGER_NOT_INITIALIZED': 10001,
292
312
  'SS_IMA_SDK_MISSING': 10002,
293
313
  'SS_AD_MANAGER_NOT_INITIALIZED': 10003,
294
314
  'CURRENT_DAI_REQUEST_NOT_FINISHED': 10004
295
315
  };
316
+ /**
317
+ * @summary A set of language utility functions.
318
+ * @final
319
+ */
320
+ shaka.util.LanguageUtils = class {
321
+ /**
322
+ * Check if |locale1| and |locale2| are locale-compatible.
323
+ * Locale-compatible is defined as all components in each locale match. Since
324
+ * we only respect the language and region components, we only check that
325
+ * the language and region components match.
326
+ * Examples:
327
+ * Locale A | Locale B | Locale Compatible
328
+ * ---------------------------------------
329
+ * en-US | en-US | true
330
+ * en | en-US | false
331
+ * en-US | en-CA | false
332
+ * @param {string} locale1
333
+ * @param {string} locale2
334
+ * @return {boolean}
335
+ */
336
+ static areLocaleCompatible(locale1, locale2) {}
337
+ /**
338
+ * Check if |locale1| and |locale2| are language-compatible.
339
+ * Language compatible is when the language component of each locale matches.
340
+ * This means that no matter what region they have (or don't have) as long as
341
+ * the language components match, they are language-compatible.
342
+ * Examples:
343
+ * Locale A | Locale B | Language-Compatible
344
+ * -----------------------------------------
345
+ * en-US | en-US | true
346
+ * en-US | en | true
347
+ * en-US | en-CA | true
348
+ * en-CA | fr-CA | false
349
+ * @param {string} locale1
350
+ * @param {string} locale2
351
+ * @return {boolean}
352
+ */
353
+ static areLanguageCompatible(locale1, locale2) {}
354
+ /**
355
+ * Check if |possibleParent| is the parent locale of |possibleChild|. Because
356
+ * we do not support dialects, the parent-child relationship is a lot simpler.
357
+ * In a parent child relationship:
358
+ * - The parent and child have the same language-component
359
+ * - The parent has no region-component
360
+ * - The child has a region-component
361
+ * Example:
362
+ * Locale A | Locale B | Is A The parent of B?
363
+ * --------------------------------------------
364
+ * en-US | en-US | no
365
+ * en-US | en | no
366
+ * en | en-US | yes
367
+ * en | en | no
368
+ * en | fr | no
369
+ * @param {string} possibleParent
370
+ * @param {string} possibleChild
371
+ * @return {boolean}
372
+ */
373
+ static isParentOf(possibleParent, possibleChild) {}
374
+ /**
375
+ * Check if |localeA| shares the same parent with |localeB|. Since we don't
376
+ * support dialect, we will only look at language and region. For two locales
377
+ * to be siblings:
378
+ * - Both must have language-components
379
+ * - Both must have region-components
380
+ * - Both must have the same language-component
381
+ * Example:
382
+ * Locale A | Locale B | Siblings?
383
+ * --------------------------------------------
384
+ * en-US | en-US | yes
385
+ * en-US | en-CA | yes
386
+ * en-US | en | no
387
+ * en | en-US | no
388
+ * en | en | no
389
+ * en | fr | no
390
+ * @param {string} localeA
391
+ * @param {string} localeB
392
+ * @return {boolean}
393
+ */
394
+ static isSiblingOf(localeA, localeB) {}
395
+ /**
396
+ * Normalize a locale. This will take a locale and canonicalize it to a state
397
+ * that we are prepared to work with.
398
+ * We only support with:
399
+ * - language
400
+ * - language-REGION
401
+ * If given a dialect, we will discard it. We will convert any 3-character
402
+ * codes to 2-character codes. We will force language codes to lowercase and
403
+ * region codes to uppercase.
404
+ * @param {string} locale
405
+ * @return {string}
406
+ */
407
+ static normalize(locale) {}
408
+ /**
409
+ * Check if two language codes are siblings. Language codes are siblings if
410
+ * they share the same base language while neither one is the base language.
411
+ * For example, "en-US" and "en-CA" are siblings but "en-US" and "en" are not
412
+ * siblings.
413
+ * @param {string} a
414
+ * @param {string} b
415
+ * @return {boolean}
416
+ */
417
+ static areSiblings(a, b) {}
418
+ /**
419
+ * Compute a numerical relatedness for language codes. Language codes with a
420
+ * higher relatedness are a better match. Unrelated language codes have a
421
+ * relatedness score of 0.
422
+ * @param {string} target
423
+ * @param {string} candidate
424
+ * @return {number}
425
+ */
426
+ static relatedness(target, candidate) {}
427
+ /**
428
+ * Get the normalized base language for a language code.
429
+ * @param {string} lang
430
+ * @return {string}
431
+ */
432
+ static getBase(lang) {}
433
+ /**
434
+ * Get the normalized language of the given text stream. Will return 'und' if
435
+ * a language is not found on the text stream.
436
+ * This should always be used to get the language from a text stream.
437
+ * @param {shaka.extern.Stream} stream
438
+ * @return {string}
439
+ */
440
+ static getLocaleForText(stream) {}
441
+ /**
442
+ * Get the normalized locale for the given variant. This will look through
443
+ * the variant to find the locale that represents the content in the variant.
444
+ * This will return 'und' if no language can be found.
445
+ * This should always be used to get the locale from a variant.
446
+ * @param {shaka.extern.Variant} variant
447
+ * @return {string}
448
+ */
449
+ static getLocaleForVariant(variant) {}
450
+ /**
451
+ * Find the locale in |searchSpace| that comes closest to |target|. If no
452
+ * locale is found to be close to |target|, then |null| will be returned.
453
+ * @param {string} target
454
+ * @param {!Iterable.<string>} searchSpace
455
+ * @return {?string}
456
+ */
457
+ static findClosestLocale(target, searchSpace) {}
458
+ };
296
459
  /**
297
460
  * Localization system provided by the shaka ui library.
298
461
  * It can be used to store the various localized forms of
299
462
  * strings that are expected to be displayed to the user.
300
463
  * If a string is not available, it will return the localized
301
464
  * form in the closest related locale.
302
- * @implements {EventTarget}
303
465
  * @final
304
466
  */
305
- shaka.ui.Localization = class {
467
+ shaka.ui.Localization = class extends shaka.util.FakeEventTarget {
306
468
  /**
307
469
  * @param {string} fallbackLocale
308
470
  * The fallback locale that should be used. It will be assumed that this
@@ -312,15 +474,7 @@ shaka.ui.Localization = class {
312
474
  /**
313
475
  * @override
314
476
  */
315
- addEventListener(type, listener, options) {}
316
- /**
317
- * @override
318
- */
319
- removeEventListener(type, listener, options) {}
320
- /**
321
- * @override
322
- */
323
- dispatchEvent(event) {}
477
+ release() {}
324
478
  /**
325
479
  * Request the localization system to change which locale it serves. If any of
326
480
  * of the preferred locales cannot be found, the localization system will fire
@@ -497,6 +651,14 @@ shaka.text.Cue.prototype.backgroundImage;
497
651
  * @override
498
652
  */
499
653
  shaka.text.Cue.prototype.border;
654
+ /**
655
+ * @override
656
+ */
657
+ shaka.text.Cue.prototype.textStrokeColor;
658
+ /**
659
+ * @override
660
+ */
661
+ shaka.text.Cue.prototype.textStrokeWidth;
500
662
  /**
501
663
  * @override
502
664
  */
@@ -541,6 +703,10 @@ shaka.text.Cue.prototype.id;
541
703
  * @override
542
704
  */
543
705
  shaka.text.Cue.prototype.nestedCues;
706
+ /**
707
+ * @override
708
+ */
709
+ shaka.text.Cue.prototype.isContainer;
544
710
  /**
545
711
  * @override
546
712
  */
@@ -1137,8 +1303,12 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
1137
1303
  * @param {function(number, number)=} onProgressUpdated Called when a progress
1138
1304
  * event is triggered. Passed the duration, in milliseconds, that the
1139
1305
  * request took, and the number of bytes transferred.
1306
+ * @param {shaka.net.NetworkingEngine.OnHeadersReceived=} onHeadersReceived
1307
+ * Called when the headers are received for a download.
1308
+ * @param {shaka.net.NetworkingEngine.OnDownloadFailed=} onDownloadFailed
1309
+ * Called when a download fails, for any reason.
1140
1310
  */
1141
- constructor(onProgressUpdated) {}
1311
+ constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed) {}
1142
1312
  /**
1143
1313
  * @param {boolean} forceHTTPS
1144
1314
  */
@@ -1278,17 +1448,26 @@ shaka.net.NetworkingEngine.PluginPriority = {
1278
1448
  'APPLICATION': 3
1279
1449
  };
1280
1450
  /**
1281
- * An interface to standardize how objects release internal references
1282
- * synchronously. If an object needs to asynchronously release references, then
1283
- * it should use 'shaka.util.IDestroyable'.
1284
- * @interface
1451
+ * @typedef {function(
1452
+ * !Object.<string, string>,
1453
+ * !shaka.extern.Request,
1454
+ * !shaka.net.NetworkingEngine.RequestType)}
1455
+ * @description
1456
+ * A callback function that passes the shaka.extern.HeadersReceived along to
1457
+ * the player, plus some extra data.
1285
1458
  */
1286
- shaka.util.IReleasable = class {
1287
- /**
1288
- * Request that this object release all internal references.
1289
- */
1290
- release() {}
1291
- };
1459
+ shaka.net.NetworkingEngine.OnHeadersReceived;
1460
+ /**
1461
+ * @typedef {function(
1462
+ * !shaka.extern.Request,
1463
+ * ?shaka.util.Error,
1464
+ * number,
1465
+ * boolean)}
1466
+ * @description
1467
+ * A callback function that notifies the player when a download fails, for any
1468
+ * reason (e.g. even if the download was aborted).
1469
+ */
1470
+ shaka.net.NetworkingEngine.OnDownloadFailed;
1292
1471
  /**
1293
1472
  * @summary
1294
1473
  * An EventManager maintains a collection of "event
@@ -1575,11 +1754,13 @@ shaka.media.InitSegmentReference = class {
1575
1754
  * of the resource containing the segment.
1576
1755
  * @param {number} startByte The offset from the start of the resource to the
1577
1756
  * start of the segment.
1578
- * @param {?number} endByte The offset from the start of the resource to the
1579
- * end of the segment, inclusive. A value of null indicates that the
1757
+ * @param {?number} endByte The offset from the start of the resource
1758
+ * to the end of the segment, inclusive. A value of null indicates that the
1580
1759
  * segment extends to the end of the resource.
1760
+ * @param {null|shaka.extern.MediaQualityInfo=} mediaQuality Information about
1761
+ * the quality of the media associated with this init segment.
1581
1762
  */
1582
- constructor(uris, startByte, endByte) {}
1763
+ constructor(uris, startByte, endByte, mediaQuality) {}
1583
1764
  /**
1584
1765
  * Returns the offset from the start of the resource to the
1585
1766
  * start of the segment.
@@ -1640,8 +1821,12 @@ shaka.media.SegmentReference = class {
1640
1821
  * The value is a grid-item-dimension consisting of two positive decimal
1641
1822
  * integers in the format: column-x-row ('4x3'). It describes the
1642
1823
  * arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
1824
+ * @param {?number=} tileDuration
1825
+ * The explicit duration of an individual tile within the tiles grid.
1826
+ * If not provided, the duration should be automatically calculated based on
1827
+ * the duration of the reference.
1643
1828
  */
1644
- constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout) {}
1829
+ constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration) {}
1645
1830
  /**
1646
1831
  * Creates and returns the URIs of the resource containing the segment.
1647
1832
  * @return {!Array.<string>}
@@ -1675,6 +1860,12 @@ shaka.media.SegmentReference = class {
1675
1860
  * @return {?string}
1676
1861
  */
1677
1862
  getTilesLayout() {}
1863
+ /**
1864
+ * Returns the segment's explicit tile duration.
1865
+ * Only defined in image segments.
1866
+ * @return {?number}
1867
+ */
1868
+ getTileDuration() {}
1678
1869
  };
1679
1870
  /**
1680
1871
  * PresentationTimeline.
@@ -2110,6 +2301,46 @@ shaka.text.UITextDisplayer = class {
2110
2301
  */
2111
2302
  shaka.text.WebVttGenerator = class {
2112
2303
  };
2304
+ /**
2305
+ * @typedef {{
2306
+ * type: string,
2307
+ * init: boolean,
2308
+ * duration: number,
2309
+ * mimeType: string,
2310
+ * codecs: string,
2311
+ * bandwidth: (number|undefined)
2312
+ * }}
2313
+ * @property {string} type
2314
+ * The media type
2315
+ * @property {boolean} init
2316
+ * Flag indicating whether the segment is an init segment
2317
+ * @property {number} duration
2318
+ * The duration of the segment in seconds
2319
+ * @property {string} mimeType
2320
+ * The segment's mime type
2321
+ * @property {string} codecs
2322
+ * The segment's codecs
2323
+ * @property {(number|undefined)} bandwidth
2324
+ * The segment's variation bandwidth
2325
+ */
2326
+ shaka.util.CmcdManager.SegmentInfo;
2327
+ /**
2328
+ * @typedef {{
2329
+ * format: shaka.util.CmcdManager.StreamingFormat
2330
+ * }}
2331
+ * @property {shaka.util.CmcdManager.StreamingFormat} format
2332
+ * The manifest's stream format
2333
+ */
2334
+ shaka.util.CmcdManager.ManifestInfo;
2335
+ /**
2336
+ * @enum {string}
2337
+ */
2338
+ shaka.util.CmcdManager.StreamingFormat = {
2339
+ DASH: 'd',
2340
+ HLS: 'h',
2341
+ SMOOTH: 's',
2342
+ OTHER: 'o'
2343
+ };
2113
2344
  /** */
2114
2345
  shaka.util.ConfigUtils = class {
2115
2346
  /**
@@ -2249,6 +2480,14 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2249
2480
  * @return {!Promise}
2250
2481
  */
2251
2482
  unload(initializeMediaSource) {}
2483
+ /**
2484
+ * Provides a way to update the stream start position during the media loading
2485
+ * process. Can for example be called from the <code>manifestparsed</code>
2486
+ * event handler to update the start position based on information in the
2487
+ * manifest.
2488
+ * @param {number} startTime
2489
+ */
2490
+ updateStartTime(startTime) {}
2252
2491
  /**
2253
2492
  * Tell the player to load the content at <code>assetUri</code> and start
2254
2493
  * playback at <code>startTime</code>. Before calling <code>load</code>,
@@ -2758,6 +2997,10 @@ shaka.ads.ClientSideAd = class {
2758
2997
  * @override
2759
2998
  */
2760
2999
  isMuted() {}
3000
+ /**
3001
+ * @override
3002
+ */
3003
+ isLinear() {}
2761
3004
  /**
2762
3005
  * @override
2763
3006
  */
@@ -2840,6 +3083,10 @@ shaka.ads.ServerSideAd = class {
2840
3083
  * @override
2841
3084
  */
2842
3085
  isMuted() {}
3086
+ /**
3087
+ * @override
3088
+ */
3089
+ isLinear() {}
2843
3090
  /**
2844
3091
  * @override
2845
3092
  */
@@ -3310,9 +3557,11 @@ shaka.net.HttpFetchPlugin = class {
3310
3557
  * @param {shaka.net.NetworkingEngine.RequestType} requestType
3311
3558
  * @param {shaka.extern.ProgressUpdated} progressUpdated Called when a
3312
3559
  * progress event happened.
3560
+ * @param {shaka.extern.HeadersReceived} headersReceived Called when the
3561
+ * headers for the download are received, but before the body is.
3313
3562
  * @return {!shaka.extern.IAbortableOperation.<shaka.extern.Response>}
3314
3563
  */
3315
- static parse(uri, request, requestType, progressUpdated) {}
3564
+ static parse(uri, request, requestType, progressUpdated, headersReceived) {}
3316
3565
  /**
3317
3566
  * Determine if the Fetch API is supported in the browser. Note: this is
3318
3567
  * deliberately exposed as a method to allow the client app to use the same
@@ -3331,9 +3580,11 @@ shaka.net.HttpXHRPlugin = class {
3331
3580
  * @param {shaka.net.NetworkingEngine.RequestType} requestType
3332
3581
  * @param {shaka.extern.ProgressUpdated} progressUpdated Called when a
3333
3582
  * progress event happened.
3583
+ * @param {shaka.extern.HeadersReceived} headersReceived Called when the
3584
+ * headers for the download are received, but before the body is.
3334
3585
  * @return {!shaka.extern.IAbortableOperation.<shaka.extern.Response>}
3335
3586
  */
3336
- static parse(uri, request, requestType, progressUpdated) {}
3587
+ static parse(uri, request, requestType, progressUpdated, headersReceived) {}
3337
3588
  };
3338
3589
  /**
3339
3590
  * StorageMuxer is responsible for managing StorageMechanisms and addressing
@@ -3585,6 +3836,13 @@ shaka.polyfill.MediaCapabilities = class {
3585
3836
  */
3586
3837
  static install() {}
3587
3838
  };
3839
+ /**
3840
+ * A copy of the MediaCapabilities instance, to prevent Safari from
3841
+ * garbage-collecting the polyfilled method on it. We make it public and export
3842
+ * it to ensure that it is not stripped out by the compiler.
3843
+ * @type {MediaCapabilities}
3844
+ */
3845
+ shaka.polyfill.MediaCapabilities.originalMcap;
3588
3846
  /**
3589
3847
  * @summary A polyfill to patch MSE bugs.
3590
3848
  */
@@ -3660,6 +3918,15 @@ shaka.polyfill.PiPWebkit = class {
3660
3918
  */
3661
3919
  static install() {}
3662
3920
  };
3921
+ /**
3922
+ * @summary A polyfill to provide window.crypto.randomUUID in all browsers.
3923
+ */
3924
+ shaka.polyfill.RandomUUID = class {
3925
+ /**
3926
+ * Install the polyfill if needed.
3927
+ */
3928
+ static install() {}
3929
+ };
3663
3930
  /**
3664
3931
  * @summary A polyfill to provide navigator.storage.estimate in old
3665
3932
  * webkit browsers.
@@ -3909,6 +4176,22 @@ shaka.ui.BigPlayButton = class extends shaka.ui.PlayButton {
3909
4176
  */
3910
4177
  constructor(parent, controls) {}
3911
4178
  };
4179
+ /**
4180
+ * @extends {shaka.ui.Element}
4181
+ * @final
4182
+ */
4183
+ shaka.ui.ContextMenu = class extends shaka.ui.Element {
4184
+ /**
4185
+ * @param {!HTMLElement} parent
4186
+ * @param {!shaka.ui.Controls} controls
4187
+ */
4188
+ constructor(parent, controls) {}
4189
+ /**
4190
+ * @param {string} name
4191
+ * @param {!shaka.extern.IUIElement.Factory} factory
4192
+ */
4193
+ static registerElement(name, factory) {}
4194
+ };
3912
4195
  /**
3913
4196
  * A range element, built to work across browsers.
3914
4197
  * In particular, getting styles to work right on IE requires a specific
@@ -4372,6 +4655,17 @@ shaka.ui.Spacer = class extends shaka.ui.Element {
4372
4655
  */
4373
4656
  constructor(parent, controls) {}
4374
4657
  };
4658
+ /**
4659
+ * @extends {shaka.ui.Element}
4660
+ * @final
4661
+ */
4662
+ shaka.ui.StatisticsButton = class extends shaka.ui.Element {
4663
+ /**
4664
+ * @param {!HTMLElement} parent
4665
+ * @param {!shaka.ui.Controls} controls
4666
+ */
4667
+ constructor(parent, controls) {}
4668
+ };
4375
4669
  /**
4376
4670
  * @extends {shaka.ui.SettingsMenu}
4377
4671
  * @final