shaka-player 4.12.8 → 4.13.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.
Files changed (261) hide show
  1. package/AUTHORS +1 -0
  2. package/CONTRIBUTORS +4 -0
  3. package/README.md +22 -21
  4. package/cspell.config.yaml +18 -0
  5. package/dist/controls.css +1 -1
  6. package/dist/controls.css.map +1 -1
  7. package/dist/deps.js +29 -24
  8. package/dist/locales.js +33 -33
  9. package/dist/shaka-player.compiled.d.ts +138 -36
  10. package/dist/shaka-player.compiled.debug.d.ts +138 -36
  11. package/dist/shaka-player.compiled.debug.externs.js +367 -107
  12. package/dist/shaka-player.compiled.debug.js +828 -765
  13. package/dist/shaka-player.compiled.debug.map +4 -4
  14. package/dist/shaka-player.compiled.externs.js +367 -107
  15. package/dist/shaka-player.compiled.js +1451 -1416
  16. package/dist/shaka-player.compiled.map +4 -4
  17. package/dist/shaka-player.ui.d.ts +172 -38
  18. package/dist/shaka-player.ui.debug.d.ts +172 -38
  19. package/dist/shaka-player.ui.debug.externs.js +406 -113
  20. package/dist/shaka-player.ui.debug.js +842 -766
  21. package/dist/shaka-player.ui.debug.map +4 -4
  22. package/dist/shaka-player.ui.externs.js +406 -113
  23. package/dist/shaka-player.ui.js +1670 -1628
  24. package/dist/shaka-player.ui.map +4 -4
  25. package/eslint.config.mjs +343 -0
  26. package/externs/airplay.js +1 -1
  27. package/externs/audiotrack.js +1 -1
  28. package/externs/awesomplete.js +1 -1
  29. package/externs/cast-sdk-v2.js +2 -2
  30. package/externs/cmcd.js +16 -1
  31. package/externs/device_sensor_event.js +1 -1
  32. package/externs/ima.js +8 -8
  33. package/externs/isoboxer.js +31 -31
  34. package/externs/jwk_set.js +1 -1
  35. package/externs/lcevc.js +8 -8
  36. package/externs/mediakeys.js +1 -1
  37. package/externs/mediasession.js +3 -2
  38. package/externs/mediatailor.js +18 -18
  39. package/externs/pictureinpicture.js +41 -1
  40. package/externs/playstation.js +2 -2
  41. package/externs/prefixed_eme.js +1 -1
  42. package/externs/shaka/abortable.js +4 -4
  43. package/externs/shaka/abr_manager.js +1 -1
  44. package/externs/shaka/ads.js +45 -6
  45. package/externs/shaka/cea.js +2 -2
  46. package/externs/shaka/codecs.js +4 -4
  47. package/externs/shaka/drm_info.js +6 -6
  48. package/externs/shaka/error.js +5 -5
  49. package/externs/shaka/manifest.js +51 -56
  50. package/externs/shaka/manifest_parser.js +3 -9
  51. package/externs/shaka/net.js +23 -20
  52. package/externs/shaka/offline.js +37 -37
  53. package/externs/shaka/offline_compat_v1.js +10 -10
  54. package/externs/shaka/offline_compat_v2.js +10 -10
  55. package/externs/shaka/player.js +139 -109
  56. package/externs/shaka/text.js +10 -3
  57. package/externs/shaka/transmuxer.js +1 -1
  58. package/externs/videotrack.js +1 -1
  59. package/lib/abr/ewma.js +1 -1
  60. package/lib/abr/simple_abr_manager.js +70 -22
  61. package/lib/ads/ad_manager.js +43 -18
  62. package/lib/ads/ad_utils.js +160 -58
  63. package/lib/ads/ads_stats.js +1 -1
  64. package/lib/ads/client_side_ad_manager.js +2 -2
  65. package/lib/ads/interstitial_ad.js +16 -11
  66. package/lib/ads/interstitial_ad_manager.js +419 -72
  67. package/lib/ads/interstitial_static_ad.js +299 -0
  68. package/lib/ads/media_tailor_ad.js +1 -0
  69. package/lib/ads/media_tailor_ad_manager.js +37 -36
  70. package/lib/ads/server_side_ad_manager.js +7 -6
  71. package/lib/cast/cast_receiver.js +5 -3
  72. package/lib/cast/cast_sender.js +2 -2
  73. package/lib/cast/cast_utils.js +20 -13
  74. package/lib/cea/cea608_data_channel.js +53 -53
  75. package/lib/cea/cea708_service.js +42 -40
  76. package/lib/cea/cea708_window.js +5 -2
  77. package/lib/cea/cea_decoder.js +5 -7
  78. package/lib/cea/mp4_cea_parser.js +1 -1
  79. package/lib/cea/sei_processor.js +1 -1
  80. package/lib/dash/content_protection.js +62 -192
  81. package/lib/dash/dash_parser.js +119 -119
  82. package/lib/dash/mpd_utils.js +14 -13
  83. package/lib/dash/segment_base.js +5 -5
  84. package/lib/dash/segment_list.js +10 -10
  85. package/lib/dash/segment_template.js +55 -53
  86. package/lib/debug/log.js +2 -2
  87. package/lib/dependencies/all.js +2 -1
  88. package/lib/{media → drm}/drm_engine.js +274 -143
  89. package/lib/{util → drm}/drm_utils.js +20 -11
  90. package/lib/drm/playready.js +233 -0
  91. package/lib/hls/hls_classes.js +14 -14
  92. package/lib/hls/hls_parser.js +257 -196
  93. package/lib/hls/hls_utils.js +14 -14
  94. package/lib/hls/manifest_text_parser.js +10 -10
  95. package/lib/media/adaptation_set.js +6 -5
  96. package/lib/media/adaptation_set_criteria.js +51 -379
  97. package/lib/media/buffering_observer.js +5 -4
  98. package/lib/media/closed_caption_parser.js +2 -2
  99. package/lib/media/content_workarounds.js +2 -2
  100. package/lib/media/example_based_criteria.js +69 -0
  101. package/lib/media/gap_jumping_controller.js +14 -1
  102. package/lib/media/manifest_filterer.js +8 -8
  103. package/lib/media/manifest_parser.js +2 -2
  104. package/lib/media/media_source_capabilities.js +20 -1
  105. package/lib/media/media_source_engine.js +84 -35
  106. package/lib/media/mp4_segment_index_parser.js +5 -5
  107. package/lib/media/playhead.js +2 -8
  108. package/lib/media/playhead_observer.js +1 -1
  109. package/lib/media/preference_based_criteria.js +333 -0
  110. package/lib/media/preload_manager.js +53 -37
  111. package/lib/media/presentation_timeline.js +2 -2
  112. package/lib/media/quality_observer.js +35 -35
  113. package/lib/media/region_observer.js +2 -2
  114. package/lib/media/region_timeline.js +3 -3
  115. package/lib/media/segment_index.js +14 -14
  116. package/lib/media/segment_prefetch.js +17 -13
  117. package/lib/media/segment_reference.js +7 -7
  118. package/lib/media/segment_utils.js +9 -9
  119. package/lib/media/streaming_engine.js +77 -38
  120. package/lib/media/time_ranges_utils.js +1 -1
  121. package/lib/media/video_wrapper.js +1 -1
  122. package/lib/media/webm_segment_index_parser.js +4 -4
  123. package/lib/mss/content_protection.js +17 -222
  124. package/lib/mss/mss_parser.js +23 -24
  125. package/lib/net/data_uri_plugin.js +1 -0
  126. package/lib/net/http_fetch_plugin.js +8 -7
  127. package/lib/net/http_plugin_utils.js +5 -2
  128. package/lib/net/http_xhr_plugin.js +4 -3
  129. package/lib/net/networking_engine.js +72 -17
  130. package/lib/net/networking_utils.js +5 -2
  131. package/lib/offline/download_info.js +5 -1
  132. package/lib/offline/download_manager.js +15 -4
  133. package/lib/offline/download_progress_estimator.js +1 -1
  134. package/lib/offline/indexeddb/base_storage_cell.js +9 -9
  135. package/lib/offline/indexeddb/db_connection.js +1 -1
  136. package/lib/offline/indexeddb/db_operation.js +2 -2
  137. package/lib/offline/indexeddb/eme_session_storage_cell.js +1 -1
  138. package/lib/offline/indexeddb/storage_mechanism.js +1 -1
  139. package/lib/offline/indexeddb/v1_storage_cell.js +3 -3
  140. package/lib/offline/indexeddb/v2_storage_cell.js +2 -2
  141. package/lib/offline/manifest_converter.js +11 -12
  142. package/lib/offline/offline_scheme.js +8 -4
  143. package/lib/offline/session_deleter.js +11 -11
  144. package/lib/offline/storage.js +137 -88
  145. package/lib/offline/storage_muxer.js +8 -8
  146. package/lib/offline/stored_content_utils.js +3 -3
  147. package/lib/offline/stream_bandwidth_estimator.js +1 -1
  148. package/lib/player.js +291 -207
  149. package/lib/polyfill/all.js +1 -1
  150. package/lib/polyfill/media_capabilities.js +5 -5
  151. package/lib/polyfill/patchedmediakeys_apple.js +6 -6
  152. package/lib/polyfill/patchedmediakeys_webkit.js +8 -8
  153. package/lib/polyfill/video_play_promise.js +0 -1
  154. package/lib/text/cue.js +3 -2
  155. package/lib/text/lrc_text_parser.js +1 -1
  156. package/lib/text/mp4_ttml_parser.js +1 -1
  157. package/lib/text/mp4_vtt_parser.js +3 -3
  158. package/lib/text/sbv_text_parser.js +1 -1
  159. package/lib/text/simple_text_displayer.js +37 -10
  160. package/lib/text/ssa_text_parser.js +3 -1
  161. package/lib/text/stub_text_displayer.js +12 -5
  162. package/lib/text/text_engine.js +5 -4
  163. package/lib/text/text_utils.js +4 -4
  164. package/lib/text/ttml_text_parser.js +21 -20
  165. package/lib/text/ui_text_displayer.js +20 -13
  166. package/lib/text/vtt_text_parser.js +10 -10
  167. package/lib/text/web_vtt_generator.js +2 -2
  168. package/lib/transmuxer/aac_transmuxer.js +2 -2
  169. package/lib/transmuxer/ac3_transmuxer.js +2 -2
  170. package/lib/transmuxer/adts.js +2 -0
  171. package/lib/transmuxer/ec3.js +3 -3
  172. package/lib/transmuxer/ec3_transmuxer.js +2 -2
  173. package/lib/transmuxer/h264.js +5 -5
  174. package/lib/transmuxer/h265.js +3 -3
  175. package/lib/transmuxer/mp3_transmuxer.js +2 -2
  176. package/lib/transmuxer/mpeg_audio.js +6 -6
  177. package/lib/transmuxer/mss_transmuxer.js +2 -0
  178. package/lib/transmuxer/transmuxer_engine.js +1 -1
  179. package/lib/transmuxer/ts_transmuxer.js +10 -10
  180. package/lib/util/abortable_operation.js +10 -10
  181. package/lib/util/array_utils.js +6 -6
  182. package/lib/util/cmcd_manager.js +149 -18
  183. package/lib/util/cmsd_manager.js +11 -11
  184. package/lib/util/config_utils.js +3 -3
  185. package/lib/util/content_steering_manager.js +17 -17
  186. package/lib/util/data_view_reader.js +3 -3
  187. package/lib/util/ebml_parser.js +1 -1
  188. package/lib/util/error.js +11 -6
  189. package/lib/util/event_manager.js +1 -1
  190. package/lib/util/exp_golomb.js +1 -1
  191. package/lib/util/fairplay_utils.js +6 -1
  192. package/lib/util/fake_event.js +3 -2
  193. package/lib/util/fake_event_target.js +1 -1
  194. package/lib/util/functional.js +8 -8
  195. package/lib/util/id3_utils.js +1 -1
  196. package/lib/util/iterables.js +6 -6
  197. package/lib/util/language_utils.js +17 -17
  198. package/lib/util/manifest_parser_utils.js +13 -13
  199. package/lib/util/map_utils.js +6 -6
  200. package/lib/util/media_ready_state_utils.js +1 -1
  201. package/lib/util/mime_utils.js +15 -4
  202. package/lib/util/mp4_box_parsers.js +5 -5
  203. package/lib/util/mp4_generator.js +31 -30
  204. package/lib/util/mp4_parser.js +2 -2
  205. package/lib/util/multi_map.js +5 -5
  206. package/lib/util/mutex.js +1 -1
  207. package/lib/util/networking.js +1 -1
  208. package/lib/util/object_utils.js +5 -1
  209. package/lib/util/operation_manager.js +1 -1
  210. package/lib/util/periods.js +24 -24
  211. package/lib/util/platform.js +8 -4
  212. package/lib/util/player_configuration.js +50 -17
  213. package/lib/util/pssh.js +34 -6
  214. package/lib/util/public_promise.js +2 -2
  215. package/lib/util/state_history.js +2 -2
  216. package/lib/util/stream_utils.js +138 -120
  217. package/lib/util/string_utils.js +4 -3
  218. package/lib/util/switch_history.js +2 -2
  219. package/lib/util/tXml.js +22 -17
  220. package/lib/util/text_parser.js +2 -2
  221. package/lib/util/timer.js +1 -1
  222. package/lib/util/ts_parser.js +22 -22
  223. package/lib/util/xml_utils.js +1 -0
  224. package/package.json +7 -4
  225. package/project-words.txt +485 -0
  226. package/shaka-player.uncompiled.js +1 -1
  227. package/third_party/closure-uri/uri.js +2 -2
  228. package/third_party/closure-uri/utils.js +2 -2
  229. package/third_party/language-mapping-list/language-mapping-list.js +1 -1
  230. package/ui/ad_statistics_button.js +9 -5
  231. package/ui/airplay_button.js +1 -0
  232. package/ui/audio_language_selection.js +2 -1
  233. package/ui/context_menu.js +2 -2
  234. package/ui/controls.js +7 -7
  235. package/ui/externs/ui.js +29 -21
  236. package/ui/externs/watermark.js +64 -0
  237. package/ui/fast_forward_button.js +1 -1
  238. package/ui/gl_matrix/matrix_4x4.js +11 -5
  239. package/ui/hidden_fast_forward_button.js +1 -1
  240. package/ui/hidden_seek_button.js +1 -1
  241. package/ui/language_utils.js +27 -26
  242. package/ui/less/buttons.less +2 -2
  243. package/ui/localization.js +21 -21
  244. package/ui/loop_button.js +2 -2
  245. package/ui/overflow_menu.js +2 -2
  246. package/ui/playback_rate_selection.js +1 -1
  247. package/ui/presentation_time.js +4 -1
  248. package/ui/range_element.js +2 -2
  249. package/ui/resolution_selection.js +42 -6
  250. package/ui/rewind_button.js +1 -1
  251. package/ui/seek_bar.js +5 -5
  252. package/ui/statistics_button.js +8 -4
  253. package/ui/text_selection.js +3 -2
  254. package/ui/ui.js +32 -2
  255. package/ui/vr_manager.js +3 -3
  256. package/ui/vr_utils.js +14 -14
  257. package/ui/vr_webgl.js +5 -5
  258. package/ui/watermark.js +313 -0
  259. package/.eslintignore +0 -4
  260. package/.eslintrc.js +0 -310
  261. package/lib/polyfill/patchedmediakeys_nop.js +0 -148
@@ -58,7 +58,7 @@ shaka.util.CmcdManager = {};
58
58
  shaka.util.FakeEvent = class {
59
59
  /**
60
60
  * @param {string} type
61
- * @param {Map.<string, Object>=} dict
61
+ * @param {Map<string, Object>=} dict
62
62
  */
63
63
  constructor(type, dict) {}
64
64
  };
@@ -365,6 +365,7 @@ shaka.util.Error.Code = {
365
365
  'SERVER_CERTIFICATE_REQUEST_FAILED': 6017,
366
366
  'MIN_HDCP_VERSION_NOT_MATCH': 6018,
367
367
  'ERROR_CHECKING_HDCP_VERSION': 6019,
368
+ 'MISSING_EME_SUPPORT': 6020,
368
369
  'LOAD_INTERRUPTED': 7000,
369
370
  'OPERATION_ABORTED': 7001,
370
371
  'NO_VIDEO_ELEMENT': 7002,
@@ -671,7 +672,7 @@ shaka.util.LanguageUtils = class {
671
672
  * Find the locale in |searchSpace| that comes closest to |target|. If no
672
673
  * locale is found to be close to |target|, then |null| will be returned.
673
674
  * @param {string} target
674
- * @param {!Iterable.<string>} searchSpace
675
+ * @param {!Iterable<string>} searchSpace
675
676
  * @return {?string}
676
677
  */
677
678
  static findClosestLocale(target, searchSpace) {}
@@ -700,7 +701,7 @@ shaka.ui.Localization = class extends shaka.util.FakeEventTarget {
700
701
  * of the preferred locales cannot be found, the localization system will fire
701
702
  * an event identifying which locales it does not know. The localization
702
703
  * system will then continue to operate using the closest matches it has.
703
- * @param {!Iterable.<string>} locales
704
+ * @param {!Iterable<string>} locales
704
705
  * The locale codes for the requested locales in order of preference.
705
706
  */
706
707
  changeLocale(locales) {}
@@ -709,7 +710,7 @@ shaka.ui.Localization = class extends shaka.util.FakeEventTarget {
709
710
  * existing localizations for the given locale.
710
711
  * @param {string} locale
711
712
  * The locale that the localizations should be added to.
712
- * @param {!Map.<string, string>} localizations
713
+ * @param {!Map<string, string>} localizations
713
714
  * A mapping of id to localized text that should used to modify the internal
714
715
  * collection of localizations.
715
716
  * @param {shaka.ui.Localization.ConflictResolution=} conflictResolution
@@ -727,7 +728,7 @@ shaka.ui.Localization = class extends shaka.util.FakeEventTarget {
727
728
  * for (const key of dictionary.keys()) {
728
729
  * dictionary.set(key, localization.resolve(key));
729
730
  * }
730
- * @param {!Map.<string, string>} dictionary
731
+ * @param {!Map<string, string>} dictionary
731
732
  */
732
733
  resolveDictionary(dictionary) {}
733
734
  /**
@@ -741,7 +742,7 @@ shaka.ui.Localization = class extends shaka.util.FakeEventTarget {
741
742
  resolve(id) {}
742
743
  /**
743
744
  * The locales currently used. An empty set means "no preference".
744
- * @return {!Set.<string>}
745
+ * @return {!Set<string>}
745
746
  */
746
747
  getCurrentLocales() {}
747
748
  };
@@ -843,7 +844,7 @@ shaka.util.EventManager.ListenerType;
843
844
  * The IClosedCaptionParser defines the interface to provide all operations for
844
845
  * parsing the closed captions embedded in Dash videos streams.
845
846
  * TODO: Remove this interface and move method definitions
846
- * directly to ClosedCaptonParser.
847
+ * directly to ClosedCaptionParser.
847
848
  * @interface
848
849
  */
849
850
  shaka.media.IClosedCaptionParser = class {
@@ -1156,7 +1157,7 @@ shaka.text.Cue.prototype.textCombineUpright;
1156
1157
  /**
1157
1158
  * Text decoration. A combination of underline, overline
1158
1159
  * and line through. Empty array means no decoration.
1159
- * @type {!Array.<!shaka.text.Cue.textDecoration>}
1160
+ * @type {!Array<!shaka.text.Cue.textDecoration>}
1160
1161
  */
1161
1162
  shaka.text.Cue.prototype.textDecoration;
1162
1163
  /**
@@ -1188,7 +1189,7 @@ shaka.text.Cue.prototype.id;
1188
1189
  * Nested cues, which should be laid out horizontally in one block.
1189
1190
  * Top-level cues are blocks, and nested cues are inline elements.
1190
1191
  * Cues can be nested arbitrarily deeply.
1191
- * @type {!Array.<!shaka.text.Cue>}
1192
+ * @type {!Array<!shaka.text.Cue>}
1192
1193
  */
1193
1194
  shaka.text.Cue.prototype.nestedCues;
1194
1195
  /**
@@ -1543,30 +1544,23 @@ shaka.config.AutoShowText = {
1543
1544
  'IF_PREFERRED_TEXT_LANGUAGE': 2,
1544
1545
  'IF_SUBTITLES_MAY_BE_NEEDED': 3
1545
1546
  };
1546
- /**
1547
- * @enum {string}
1548
- */
1549
- shaka.config.CodecSwitchingStrategy = {
1550
- 'RELOAD': 'reload',
1551
- 'SMOOTH': 'smooth'
1552
- };
1553
1547
  /**
1554
1548
  * A utility to wrap abortable operations. Note that these are not cancelable.
1555
- * Cancelation implies undoing what has been done so far, whereas aborting only
1549
+ * Cancellation implies undoing what has been done so far, whereas aborting only
1556
1550
  * means that further work is stopped.
1557
- * @implements {shaka.extern.IAbortableOperation.<T>}
1551
+ * @implements {shaka.extern.IAbortableOperation<T>}
1558
1552
  * @template T
1559
1553
  */
1560
1554
  shaka.util.AbortableOperation = class {
1561
1555
  /**
1562
- * @param {!Promise.<T>} promise
1556
+ * @param {!Promise<T>} promise
1563
1557
  * A Promise which represents the underlying operation. It is resolved when
1564
1558
  * the operation is complete, and rejected if the operation fails or is
1565
1559
  * aborted. Aborted operations should be rejected with a shaka.util.Error
1566
1560
  * object using the error code OPERATION_ABORTED.
1567
1561
  * @param {function():!Promise} onAbort
1568
1562
  * Will be called by this object to abort the underlying operation.
1569
- * This is not cancelation, and will not necessarily result in any work
1563
+ * This is not cancellation, and will not necessarily result in any work
1570
1564
  * being undone. abort() should return a Promise which is resolved when the
1571
1565
  * underlying operation has been aborted. The returned Promise should never
1572
1566
  * be rejected.
@@ -1595,7 +1589,7 @@ shaka.util.AbortableOperation = class {
1595
1589
  */
1596
1590
  static completed(value) {}
1597
1591
  /**
1598
- * @param {!Promise.<U>} promise
1592
+ * @param {!Promise<U>} promise
1599
1593
  * @return {!shaka.util.AbortableOperation.<U>} An operation which cannot be
1600
1594
  * aborted. It will be completed when the given Promise is resolved, or
1601
1595
  * will be failed when the given Promise is rejected.
@@ -1607,7 +1601,7 @@ shaka.util.AbortableOperation = class {
1607
1601
  */
1608
1602
  abort() {}
1609
1603
  /**
1610
- * @param {!Array.<!shaka.util.AbortableOperation>} operations
1604
+ * @param {!Array<!shaka.util.AbortableOperation>} operations
1611
1605
  * @return {!shaka.util.AbortableOperation} An operation which is resolved
1612
1606
  * when all operations are successful and fails when any operation fails.
1613
1607
  * For this operation, abort() aborts all given operations.
@@ -1620,7 +1614,7 @@ shaka.util.AbortableOperation = class {
1620
1614
  /**
1621
1615
  * @param {(undefined|
1622
1616
  * function(T):U|
1623
- * function(T):!Promise.<U>|
1617
+ * function(T):!Promise<U>|
1624
1618
  * function(T):!shaka.util.AbortableOperation.<U>)} onSuccess
1625
1619
  * A callback to be invoked after this operation is complete, to chain to
1626
1620
  * another operation. The callback can return a plain value, a Promise to
@@ -1637,7 +1631,7 @@ shaka.util.AbortableOperation = class {
1637
1631
  chain(onSuccess, onError) {}
1638
1632
  };
1639
1633
  /**
1640
- * @const {!Promise.<T>}
1634
+ * @const {!Promise<T>}
1641
1635
  */
1642
1636
  shaka.util.AbortableOperation.prototype.promise;
1643
1637
  /**
@@ -1655,6 +1649,8 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
1655
1649
  * of whether the switching is allowed.
1656
1650
  * @param {shaka.net.NetworkingEngine.OnHeadersReceived=} onHeadersReceived
1657
1651
  * Called when the headers are received for a download.
1652
+ * @param {shaka.net.NetworkingEngine.OnDownloadCompleted=
1653
+ * } onDownloadCompleted Called when a download completed successfully.
1658
1654
  * @param {shaka.net.NetworkingEngine.OnDownloadFailed=} onDownloadFailed
1659
1655
  * Called when a download fails, for any reason.
1660
1656
  * @param {shaka.net.NetworkingEngine.OnRequest=} onRequest
@@ -1664,7 +1660,7 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
1664
1660
  * @param {shaka.net.NetworkingEngine.OnResponse=} onResponse
1665
1661
  * Called when receive the response
1666
1662
  */
1667
- constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed, onRequest, onRetry, onResponse) {}
1663
+ constructor(onProgressUpdated, onHeadersReceived, onDownloadCompleted, onDownloadFailed, onRequest, onRetry, onResponse) {}
1668
1664
  /**
1669
1665
  * @param {boolean} forceHTTP
1670
1666
  */
@@ -1720,6 +1716,10 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
1720
1716
  * Clears all response filters.
1721
1717
  */
1722
1718
  clearAllResponseFilters() {}
1719
+ /**
1720
+ * Clears Common Access Token map.
1721
+ */
1722
+ clearCommonAccessTokenMap() {}
1723
1723
  /**
1724
1724
  * Gets a copy of the default retry parameters.
1725
1725
  * @return {shaka.extern.RetryParameters}
@@ -1729,7 +1729,7 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
1729
1729
  static defaultRetryParameters() {}
1730
1730
  /**
1731
1731
  * Makes a simple network request for the given URIs.
1732
- * @param {!Array.<string>} uris
1732
+ * @param {!Array<string>} uris
1733
1733
  * @param {shaka.extern.RetryParameters} retryParams
1734
1734
  * @param {?function(BufferSource):!Promise=} streamDataCallback
1735
1735
  * @return {shaka.extern.Request}
@@ -1776,12 +1776,12 @@ shaka.net.NetworkingEngine.PendingRequest = class extends shaka.util.AbortableOp
1776
1776
  * shaka.util.Error object using the error code OPERATION_ABORTED.
1777
1777
  * @param {function():!Promise} onAbort
1778
1778
  * Will be called by this object to abort the underlying operation. This
1779
- * is not cancelation, and will not necessarily result in any work being
1779
+ * is not cancellation, and will not necessarily result in any work being
1780
1780
  * undone. abort() should return a Promise which is resolved when the
1781
1781
  * underlying operation has been aborted. The returned Promise should
1782
1782
  * never be rejected.
1783
- * @param {shaka.net.NetworkingEngine.NumBytesRemainingClass}
1784
- * numBytesRemainingObj
1783
+ * @param {shaka.net.NetworkingEngine.NumBytesRemainingClass
1784
+ * } numBytesRemainingObj
1785
1785
  */
1786
1786
  constructor(promise, onAbort, numBytesRemainingObj) {}
1787
1787
  };
@@ -1836,7 +1836,7 @@ shaka.net.NetworkingEngine.PluginPriority = {
1836
1836
  };
1837
1837
  /**
1838
1838
  * @typedef {function(
1839
- * !Object.<string, string>,
1839
+ * !Object<string, string>,
1840
1840
  * !shaka.extern.Request,
1841
1841
  * !shaka.net.NetworkingEngine.RequestType)}
1842
1842
  * @description
@@ -1857,6 +1857,15 @@ shaka.net.NetworkingEngine.OnHeadersReceived;
1857
1857
  * original request.
1858
1858
  */
1859
1859
  shaka.net.NetworkingEngine.onProgressUpdated;
1860
+ /**
1861
+ * @typedef {function(
1862
+ * !shaka.extern.Request,
1863
+ * !shaka.extern.Response)}
1864
+ * @description
1865
+ * A callback function that notifies the player when a download completed
1866
+ * successfully.
1867
+ */
1868
+ shaka.net.NetworkingEngine.OnDownloadCompleted;
1860
1869
  /**
1861
1870
  * @typedef {function(
1862
1871
  * !shaka.extern.Request,
@@ -1898,8 +1907,8 @@ shaka.net.NetworkingEngine.OnRetry;
1898
1907
  */
1899
1908
  shaka.net.NetworkingEngine.OnResponse;
1900
1909
  /**
1901
- * @summary DataViewReader abstracts a DataView object.
1902
- */
1910
+ * @summary DataViewReader abstracts a DataView object.
1911
+ */
1903
1912
  shaka.util.DataViewReader = class {
1904
1913
  /**
1905
1914
  * @param {BufferSource} data
@@ -2083,6 +2092,91 @@ shaka.util.Mp4Parser = class {
2083
2092
  * @typedef {function(!shaka.extern.ParsedBox)}
2084
2093
  */
2085
2094
  shaka.util.Mp4Parser.CallbackType;
2095
+ /**
2096
+ * A set of variants that we want to adapt between.
2097
+ * @final
2098
+ */
2099
+ shaka.media.AdaptationSet = class {
2100
+ /**
2101
+ * @param {shaka.extern.Variant} root
2102
+ * The variant that all other variants will be tested against when being
2103
+ * added to the adaptation set. If a variant is not compatible with the
2104
+ * root, it will not be added.
2105
+ * @param {!Iterable<shaka.extern.Variant>=} candidates
2106
+ * Variants that may be compatible with the root and should be added if
2107
+ * compatible. If a candidate is not compatible, it will not end up in the
2108
+ * adaptation set.
2109
+ * @param {boolean=} compareCodecs
2110
+ */
2111
+ constructor(root, candidates, compareCodecs) {}
2112
+ };
2113
+ /**
2114
+ * @enum {string}
2115
+ */
2116
+ shaka.config.CodecSwitchingStrategy = {
2117
+ 'RELOAD': 'reload',
2118
+ 'SMOOTH': 'smooth'
2119
+ };
2120
+ /**
2121
+ * An adaptation set criteria is a unit of logic that can take a set of
2122
+ * variants and return a subset of variants that should (and can) be
2123
+ * adapted between.
2124
+ * @interface
2125
+ */
2126
+ shaka.media.AdaptationSetCriteria = class {
2127
+ /**
2128
+ * Take a set of variants, and return a subset of variants that can be
2129
+ * adapted between.
2130
+ * @param {!Array<shaka.extern.Variant>} variants
2131
+ * @return {!shaka.media.AdaptationSet}
2132
+ */
2133
+ create(variants) {}
2134
+ /**
2135
+ * Sets the AdaptationSetCriteria configuration.
2136
+ * @param {shaka.media.AdaptationSetCriteria.Configuration} config
2137
+ */
2138
+ configure(config) {}
2139
+ };
2140
+ /**
2141
+ * A factory for creating the AdaptationSetCriteria.
2142
+ * @typedef {function():!shaka.media.AdaptationSetCriteria}
2143
+ */
2144
+ shaka.media.AdaptationSetCriteria.Factory;
2145
+ /**
2146
+ * @typedef {{
2147
+ * language: string,
2148
+ * role: string,
2149
+ * channelCount: number,
2150
+ * hdrLevel: string,
2151
+ * spatialAudio: boolean,
2152
+ * videoLayout: string,
2153
+ * audioLabel: string,
2154
+ * videoLabel: string,
2155
+ * codecSwitchingStrategy: shaka.config.CodecSwitchingStrategy,
2156
+ * audioCodec: string
2157
+ * }}
2158
+ * @property {string} language
2159
+ * The language used to filter variants.
2160
+ * @property {string} role
2161
+ * The adaptation role used to filter variants.
2162
+ * @property {string} channelCount
2163
+ * The audio channel count used to filter variants.
2164
+ * @property {string} hdrLevel
2165
+ * The HDR level used to filter variants.
2166
+ * @property {boolean} spatialAudio
2167
+ * Whether should prefer audio tracks with spatial audio.
2168
+ * @property {string} videoLayout
2169
+ * The video layout used to filter variants.
2170
+ * @property {string} audioLabel
2171
+ * The audio label used to filter variants.
2172
+ * @property {string} videoLabel
2173
+ * The video label used to filter variants.
2174
+ * @property {shaka.config.CodecSwitchingStrategy} codecSwitchingStrategy
2175
+ * The codec switching strategy used to filter variants.
2176
+ * @property {string} audioCodec
2177
+ * The audio codec used to filter variants.
2178
+ */
2179
+ shaka.media.AdaptationSetCriteria.Configuration;
2086
2180
  /**
2087
2181
  * @summary An interface to register manifest parsers.
2088
2182
  */
@@ -2120,7 +2214,7 @@ shaka.media.ManifestParser.AccessibilityPurpose = {
2120
2214
  */
2121
2215
  shaka.media.InitSegmentReference = class {
2122
2216
  /**
2123
- * @param {function():!Array.<string>} uris A function that creates the URIs
2217
+ * @param {function(): !Array<string>} uris A function that creates the URIs
2124
2218
  * of the resource containing the segment.
2125
2219
  * @param {number} startByte The offset from the start of the resource to the
2126
2220
  * start of the segment.
@@ -2159,7 +2253,7 @@ shaka.media.SegmentReference = class {
2159
2253
  * @param {number} endTime The segment's end time in seconds. The segment
2160
2254
  * ends the instant before this time, so |endTime| must be strictly greater
2161
2255
  * than |startTime|.
2162
- * @param {function():!Array.<string>} uris
2256
+ * @param {function(): !Array<string>} uris
2163
2257
  * A function that creates the URIs of the resource containing the segment.
2164
2258
  * @param {number} startByte The offset from the start of the resource to the
2165
2259
  * start of the segment.
@@ -2190,7 +2284,7 @@ shaka.media.SegmentReference = class {
2190
2284
  * The end of the append window for this reference, relative to the
2191
2285
  * presentation. Any content from after this time will be removed by
2192
2286
  * MediaSource.
2193
- * @param {!Array.<!shaka.media.SegmentReference>=} partialReferences
2287
+ * @param {!Array<!shaka.media.SegmentReference>=} partialReferences
2194
2288
  * A list of SegmentReferences for the partial segments.
2195
2289
  * @param {?string=} tilesLayout
2196
2290
  * The value is a grid-item-dimension consisting of two positive decimal
@@ -2215,7 +2309,7 @@ shaka.media.SegmentReference = class {
2215
2309
  constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration, syncTime, status, aesKey, allPartialSegments) {}
2216
2310
  /**
2217
2311
  * Creates and returns the URIs of the resource containing the segment.
2218
- * @return {!Array.<string>}
2312
+ * @return {!Array<string>}
2219
2313
  */
2220
2314
  getUris() {}
2221
2315
  /**
@@ -2383,7 +2477,7 @@ shaka.util.Id3Utils = class {
2383
2477
  /**
2384
2478
  * Returns an array of ID3 frames found in all the ID3 tags in the id3Data
2385
2479
  * @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags
2386
- * @return {!Array.<shaka.extern.MetadataFrame>}
2480
+ * @return {!Array<shaka.extern.MetadataFrame>}
2387
2481
  */
2388
2482
  static getID3Frames(id3Data) {}
2389
2483
  /**
@@ -2397,7 +2491,7 @@ shaka.util.Id3Utils = class {
2397
2491
  };
2398
2492
  /**
2399
2493
  * @summary
2400
- * Parser for exponential Golomb codes, a variable-bitwidth number encoding
2494
+ * Parser for exponential Golomb codes, a variable-bit width number encoding
2401
2495
  * scheme used by h264.
2402
2496
  * Based on https://github.com/videojs/mux.js/blob/main/lib/utils/exp-golomb.js
2403
2497
  */
@@ -2430,7 +2524,7 @@ shaka.util.TsParser = class {
2430
2524
  * Credit to https://github.com/video-dev/hls.js/blob/master/src/demux/tsdemuxer.ts
2431
2525
  * @param {shaka.extern.MPEG_PES} pes
2432
2526
  * @param {?shaka.extern.MPEG_PES=} nextPes
2433
- * @return {!Array.<shaka.extern.VideoNalu>}
2527
+ * @return {!Array<shaka.extern.VideoNalu>}
2434
2528
  */
2435
2529
  parseAvcNalus(pes, nextPes) {}
2436
2530
  /**
@@ -2439,23 +2533,23 @@ shaka.util.TsParser = class {
2439
2533
  * Credit to https://github.com/video-dev/hls.js/blob/master/src/demux/tsdemuxer.ts
2440
2534
  * @param {shaka.extern.MPEG_PES} pes
2441
2535
  * @param {{nalu: ?shaka.extern.VideoNalu, state: ?number}} lastInfo
2442
- * @return {!Array.<shaka.extern.VideoNalu>}
2536
+ * @return {!Array<shaka.extern.VideoNalu>}
2443
2537
  */
2444
2538
  parseNalus(pes, lastInfo) {}
2445
2539
  /**
2446
2540
  * Return the ID3 metadata
2447
- * @return {!Array.<shaka.extern.ID3Metadata>}
2541
+ * @return {!Array<shaka.extern.ID3Metadata>}
2448
2542
  */
2449
2543
  getMetadata() {}
2450
2544
  /**
2451
2545
  * Return the audio data
2452
- * @return {!Array.<shaka.extern.MPEG_PES>}
2546
+ * @return {!Array<shaka.extern.MPEG_PES>}
2453
2547
  */
2454
2548
  getAudioData() {}
2455
2549
  /**
2456
2550
  * Return the video data
2457
2551
  * @param {boolean=} naluProcessing
2458
- * @return {!Array.<shaka.extern.MPEG_PES>}
2552
+ * @return {!Array<shaka.extern.MPEG_PES>}
2459
2553
  */
2460
2554
  getVideoData(naluProcessing) {}
2461
2555
  /**
@@ -2471,7 +2565,7 @@ shaka.util.TsParser = class {
2471
2565
  getCodecs() {}
2472
2566
  /**
2473
2567
  * Return the video data
2474
- * @return {!Array.<shaka.extern.VideoNalu>}
2568
+ * @return {!Array<shaka.extern.VideoNalu>}
2475
2569
  */
2476
2570
  getVideoNalus() {}
2477
2571
  /**
@@ -2604,7 +2698,7 @@ shaka.media.PresentationTimeline = class {
2604
2698
  * Gives PresentationTimeline a Stream's timeline so it can size and position
2605
2699
  * the segment availability window, and account for missing segment
2606
2700
  * information.
2607
- * @param {!Array.<shaka.media.PresentationTimeline.TimeRange>} timeline
2701
+ * @param {!Array<shaka.media.PresentationTimeline.TimeRange>} timeline
2608
2702
  * @param {number} startOffset
2609
2703
  */
2610
2704
  notifyTimeRange(timeline, startOffset) {}
@@ -2613,7 +2707,7 @@ shaka.media.PresentationTimeline = class {
2613
2707
  * the segment availability window, and account for missing segment
2614
2708
  * information. These segments do not necessarily need to all be from the
2615
2709
  * same stream.
2616
- * @param {!Array.<!shaka.media.SegmentReference>} references
2710
+ * @param {!Array<!shaka.media.SegmentReference>} references
2617
2711
  */
2618
2712
  notifySegments(references) {}
2619
2713
  /**
@@ -2775,11 +2869,11 @@ shaka.media.PresentationTimeline.TimeRange;
2775
2869
  * SegmentIndex.
2776
2870
  * @implements {shaka.extern.SegmentIndex}
2777
2871
  * @implements {shaka.util.IReleasable}
2778
- * @implements {Iterable.<!shaka.media.SegmentReference>}
2872
+ * @implements {Iterable<!shaka.media.SegmentReference>}
2779
2873
  */
2780
2874
  shaka.media.SegmentIndex = class {
2781
2875
  /**
2782
- * @param {!Array.<!shaka.media.SegmentReference>} references The list of
2876
+ * @param {!Array<!shaka.media.SegmentReference>} references The list of
2783
2877
  * SegmentReferences, which must be sorted first by their start times
2784
2878
  * (ascending) and second by their end times (ascending).
2785
2879
  */
@@ -2824,7 +2918,7 @@ shaka.media.SegmentIndex = class {
2824
2918
  * Used, for example, by the DASH and HLS parser, where manifests may not list
2825
2919
  * all available references, so we must keep available references in memory to
2826
2920
  * fill the availability window.
2827
- * @param {!Array.<!shaka.media.SegmentReference>} references The list of
2921
+ * @param {!Array<!shaka.media.SegmentReference>} references The list of
2828
2922
  * SegmentReferences, which must be sorted first by their start times
2829
2923
  * (ascending) and second by their end times (ascending).
2830
2924
  * @param {number} windowStart The start of the availability window to filter
@@ -2852,7 +2946,7 @@ shaka.media.SegmentIndex = class {
2852
2946
  * Updates the references every so often. Stops when the references list
2853
2947
  * returned by the callback is null.
2854
2948
  * @param {number} interval The interval in seconds.
2855
- * @param {function():Array.<shaka.media.SegmentReference>} updateCallback
2949
+ * @param {function(): Array<shaka.media.SegmentReference>} updateCallback
2856
2950
  */
2857
2951
  updateEvery(interval, updateCallback) {}
2858
2952
  /**
@@ -2866,24 +2960,24 @@ shaka.media.SegmentIndex = class {
2866
2960
  * RFC 8216 rev 13, section 8.1: "Each (non-Partial) Media Segment in a Media
2867
2961
  * Playlist will contain at least one independent frame."
2868
2962
  * @param {number} time
2869
- * @param {boolean=} allowNonIndepedent
2963
+ * @param {boolean=} allowNonIndependent
2870
2964
  * @param {boolean=} reverse
2871
2965
  * @return {?shaka.media.SegmentIterator}
2872
2966
  */
2873
- getIteratorForTime(time, allowNonIndepedent, reverse) {}
2967
+ getIteratorForTime(time, allowNonIndependent, reverse) {}
2874
2968
  /**
2875
2969
  * Create a SegmentIndex for a single segment of the given start time and
2876
2970
  * duration at the given URIs.
2877
2971
  * @param {number} startTime
2878
2972
  * @param {number} duration
2879
- * @param {!Array.<string>} uris
2973
+ * @param {!Array<string>} uris
2880
2974
  * @return {!shaka.media.SegmentIndex}
2881
2975
  */
2882
2976
  static forSingleSegment(startTime, duration, uris) {}
2883
2977
  };
2884
2978
  /**
2885
2979
  * An iterator over a SegmentIndex's references.
2886
- * @implements {Iterator.<shaka.media.SegmentReference>}
2980
+ * @implements {Iterator<shaka.media.SegmentReference>}
2887
2981
  */
2888
2982
  shaka.media.SegmentIterator = class {
2889
2983
  /**
@@ -2918,7 +3012,7 @@ shaka.media.SegmentIterator = class {
2918
3012
  * Used in constructing multi-Period Streams for DASH.
2919
3013
  * @extends shaka.media.SegmentIndex
2920
3014
  * @implements {shaka.util.IReleasable}
2921
- * @implements {Iterable.<!shaka.media.SegmentReference>}
3015
+ * @implements {Iterable<!shaka.media.SegmentReference>}
2922
3016
  */
2923
3017
  shaka.media.MetaSegmentIndex = class extends shaka.media.SegmentIndex {
2924
3018
  /** */
@@ -3010,7 +3104,7 @@ shaka.util.ConfigUtils = class {
3010
3104
  shaka.util.FairPlayUtils = class {
3011
3105
  /**
3012
3106
  * Check if FairPlay is supported.
3013
- * @return {!Promise.<boolean>}
3107
+ * @return {!Promise<boolean>}
3014
3108
  */
3015
3109
  static isFairPlaySupported() {}
3016
3110
  /**
@@ -3042,6 +3136,7 @@ shaka.util.FairPlayUtils = class {
3042
3136
  * @param {!Uint8Array} initData
3043
3137
  * @param {string} initDataType
3044
3138
  * @param {?shaka.extern.DrmInfo} drmInfo
3139
+ * @return {!Uint8Array}
3045
3140
  */
3046
3141
  static verimatrixInitDataTransform(initData, initDataType, drmInfo) {}
3047
3142
  /**
@@ -3049,6 +3144,7 @@ shaka.util.FairPlayUtils = class {
3049
3144
  * @param {!Uint8Array} initData
3050
3145
  * @param {string} initDataType
3051
3146
  * @param {?shaka.extern.DrmInfo} drmInfo
3147
+ * @return {!Uint8Array}
3052
3148
  */
3053
3149
  static ezdrmInitDataTransform(initData, initDataType, drmInfo) {}
3054
3150
  /**
@@ -3056,6 +3152,7 @@ shaka.util.FairPlayUtils = class {
3056
3152
  * @param {!Uint8Array} initData
3057
3153
  * @param {string} initDataType
3058
3154
  * @param {?shaka.extern.DrmInfo} drmInfo
3155
+ * @return {!Uint8Array}
3059
3156
  */
3060
3157
  static conaxInitDataTransform(initData, initDataType, drmInfo) {}
3061
3158
  /**
@@ -3063,6 +3160,7 @@ shaka.util.FairPlayUtils = class {
3063
3160
  * @param {!Uint8Array} initData
3064
3161
  * @param {string} initDataType
3065
3162
  * @param {?shaka.extern.DrmInfo} drmInfo
3163
+ * @return {!Uint8Array}
3066
3164
  */
3067
3165
  static expressplayInitDataTransform(initData, initDataType, drmInfo) {}
3068
3166
  /**
@@ -3109,6 +3207,10 @@ shaka.util.PlayerConfiguration = class {
3109
3207
  * @return {shaka.extern.PlayerConfiguration}
3110
3208
  */
3111
3209
  static createDefault() {}
3210
+ /**
3211
+ * @return {!Object}
3212
+ */
3213
+ static createDefaultForLL() {}
3112
3214
  /**
3113
3215
  * Merges the given configuration changes into the given destination. This
3114
3216
  * uses the default Player configurations as the template.
@@ -3179,11 +3281,15 @@ shaka.text.SimpleTextDisplayer = class {
3179
3281
  * @override
3180
3282
  */
3181
3283
  setTextLanguage(language) {}
3284
+ /**
3285
+ * @override
3286
+ */
3287
+ enableTextDisplayer() {}
3182
3288
  };
3183
3289
  /**
3184
- * A stub text displayer plugin that does nothing
3185
- * @implements {shaka.extern.TextDisplayer}
3186
- */
3290
+ * A stub text displayer plugin that does nothing
3291
+ * @implements {shaka.extern.TextDisplayer}
3292
+ */
3187
3293
  shaka.text.StubTextDisplayer = class {
3188
3294
  /**
3189
3295
  * @override
@@ -3213,6 +3319,10 @@ shaka.text.StubTextDisplayer = class {
3213
3319
  * @override
3214
3320
  */
3215
3321
  setTextLanguage(language) {}
3322
+ /**
3323
+ * @override
3324
+ */
3325
+ enableTextDisplayer() {}
3216
3326
  };
3217
3327
  /**
3218
3328
  * The text displayer plugin for the Shaka Player UI. Can also be used directly
@@ -3255,6 +3365,10 @@ shaka.text.UITextDisplayer = class {
3255
3365
  * @override
3256
3366
  */
3257
3367
  setTextLanguage(language) {}
3368
+ /**
3369
+ * @override
3370
+ */
3371
+ enableTextDisplayer() {}
3258
3372
  };
3259
3373
  /**
3260
3374
  * @summary Manage the conversion to WebVTT.
@@ -3344,7 +3458,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3344
3458
  static registerSupportPlugin(name, callback) {}
3345
3459
  /**
3346
3460
  * Set a factory to create an ad manager during player construction time.
3347
- * This method needs to be called bafore instantiating the Player class.
3461
+ * This method needs to be called before instantiating the Player class.
3348
3462
  * @param {!shaka.extern.IAdManager.Factory} factory
3349
3463
  */
3350
3464
  static setAdManagerFactory(factory) {}
@@ -3363,7 +3477,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3363
3477
  * NOTE: This may show a request to the user for permission.
3364
3478
  * @see https://bit.ly/2ywccmH
3365
3479
  * @param {boolean=} promptsOkay
3366
- * @return {!Promise.<shaka.extern.SupportType>}
3480
+ * @return {!Promise<shaka.extern.SupportType>}
3367
3481
  */
3368
3482
  static probeSupport(promptsOkay) {}
3369
3483
  /**
@@ -3423,7 +3537,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3423
3537
  * When in src= mode, this unloads but does not make a PreloadManager.
3424
3538
  * @param {boolean=} initializeMediaSource
3425
3539
  * @param {boolean=} keepAdManager
3426
- * @return {!Promise.<?shaka.media.PreloadManager>}
3540
+ * @return {!Promise<?shaka.media.PreloadManager>}
3427
3541
  */
3428
3542
  unloadAndSavePreload(initializeMediaSource, keepAdManager) {}
3429
3543
  /**
@@ -3435,7 +3549,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3435
3549
  * attached to something else.
3436
3550
  * @param {boolean=} keepAdManager
3437
3551
  * @param {boolean=} saveLivePosition
3438
- * @return {!Promise.<?shaka.media.PreloadManager>}
3552
+ * @return {!Promise<?shaka.media.PreloadManager>}
3439
3553
  */
3440
3554
  detachAndSavePreload(keepAdManager, saveLivePosition) {}
3441
3555
  /**
@@ -3457,7 +3571,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3457
3571
  * <code>undefined</code>, playback will start at the default start time (0
3458
3572
  * for VOD and liveEdge for LIVE).
3459
3573
  * @param {?string=} mimeType
3460
- * @return {!Promise.<?shaka.media.PreloadManager>}
3574
+ * @return {!Promise<?shaka.media.PreloadManager>}
3461
3575
  */
3462
3576
  preload(assetUri, startTime, mimeType) {}
3463
3577
  /**
@@ -3491,6 +3605,13 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3491
3605
  * there were invalid entries.
3492
3606
  */
3493
3607
  configure(config, value) {}
3608
+ /**
3609
+ * Changes low latency configuration settings on the Player.
3610
+ * @param {!Object} config This object should follow the
3611
+ * {@link shaka.extern.PlayerConfiguration} object. Not all fields
3612
+ * need to be set; unset fields retain their old values.
3613
+ */
3614
+ configurationForLowLatency(config) {}
3494
3615
  /**
3495
3616
  * Return a copy of the current configuration. Modifications of the returned
3496
3617
  * value will not affect the Player's active configuration. You must call
@@ -3498,6 +3619,11 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3498
3619
  * @return {shaka.extern.PlayerConfiguration}
3499
3620
  */
3500
3621
  getConfiguration() {}
3622
+ /**
3623
+ * Return a copy of the current configuration for low latency.
3624
+ * @return {!Object}
3625
+ */
3626
+ getConfigurationForLowLatency() {}
3501
3627
  /**
3502
3628
  * Return a copy of the current non default configuration. Modifications of
3503
3629
  * the returned value will not affect the Player's active configuration.
@@ -3611,7 +3737,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3611
3737
  getExpiration() {}
3612
3738
  /**
3613
3739
  * Returns the active sessions metadata
3614
- * @return {!Array.<shaka.extern.DrmSessionMetadata>}
3740
+ * @return {!Array<shaka.extern.DrmSessionMetadata>}
3615
3741
  */
3616
3742
  getActiveSessionsMetadata() {}
3617
3743
  /**
@@ -3662,27 +3788,27 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3662
3788
  * Return a list of variant tracks that can be switched to.
3663
3789
  * <p>
3664
3790
  * If the player has not loaded content, this will return an empty list.
3665
- * @return {!Array.<shaka.extern.Track>}
3791
+ * @return {!Array<shaka.extern.Track>}
3666
3792
  */
3667
3793
  getVariantTracks() {}
3668
3794
  /**
3669
3795
  * Return a list of text tracks that can be switched to.
3670
3796
  * <p>
3671
3797
  * If the player has not loaded content, this will return an empty list.
3672
- * @return {!Array.<shaka.extern.Track>}
3798
+ * @return {!Array<shaka.extern.Track>}
3673
3799
  */
3674
3800
  getTextTracks() {}
3675
3801
  /**
3676
3802
  * Return a list of image tracks that can be switched to.
3677
3803
  * If the player has not loaded content, this will return an empty list.
3678
- * @return {!Array.<shaka.extern.Track>}
3804
+ * @return {!Array<shaka.extern.Track>}
3679
3805
  */
3680
3806
  getImageTracks() {}
3681
3807
  /**
3682
3808
  * Returns Thumbnail objects for each thumbnail for a given image track ID.
3683
3809
  * If the player has not loaded content, this will return a null.
3684
3810
  * @param {number} trackId
3685
- * @return {!Promise.<?Array<!shaka.extern.Thumbnail>>}
3811
+ * @return {!Promise<?Array<!shaka.extern.Thumbnail>>}
3686
3812
  */
3687
3813
  getAllThumbnails(trackId) {}
3688
3814
  /**
@@ -3690,7 +3816,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3690
3816
  * If the player has not loaded content, this will return a null.
3691
3817
  * @param {number} trackId
3692
3818
  * @param {number} time
3693
- * @return {!Promise.<?shaka.extern.Thumbnail>}
3819
+ * @return {!Promise<?shaka.extern.Thumbnail>}
3694
3820
  */
3695
3821
  getThumbnails(trackId, time) {}
3696
3822
  /**
@@ -3731,25 +3857,25 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3731
3857
  /**
3732
3858
  * Return a list of audio language-role combinations available. If the
3733
3859
  * player has not loaded any content, this will return an empty list.
3734
- * @return {!Array.<shaka.extern.LanguageRole>}
3860
+ * @return {!Array<shaka.extern.LanguageRole>}
3735
3861
  */
3736
3862
  getAudioLanguagesAndRoles() {}
3737
3863
  /**
3738
3864
  * Return a list of text language-role combinations available. If the player
3739
3865
  * has not loaded any content, this will be return an empty list.
3740
- * @return {!Array.<shaka.extern.LanguageRole>}
3866
+ * @return {!Array<shaka.extern.LanguageRole>}
3741
3867
  */
3742
3868
  getTextLanguagesAndRoles() {}
3743
3869
  /**
3744
3870
  * Return a list of audio languages available. If the player has not loaded
3745
3871
  * any content, this will return an empty list.
3746
- * @return {!Array.<string>}
3872
+ * @return {!Array<string>}
3747
3873
  */
3748
3874
  getAudioLanguages() {}
3749
3875
  /**
3750
3876
  * Return a list of text languages available. If the player has not loaded
3751
3877
  * any content, this will return an empty list.
3752
- * @return {!Array.<string>}
3878
+ * @return {!Array<string>}
3753
3879
  */
3754
3880
  getTextLanguages() {}
3755
3881
  /**
@@ -3793,13 +3919,13 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3793
3919
  isTextTrackVisible() {}
3794
3920
  /**
3795
3921
  * Return a list of chapters tracks.
3796
- * @return {!Array.<shaka.extern.Track>}
3922
+ * @return {!Array<shaka.extern.Track>}
3797
3923
  */
3798
3924
  getChaptersTracks() {}
3799
3925
  /**
3800
3926
  * This returns the list of chapters.
3801
3927
  * @param {string} language
3802
- * @return {!Array.<shaka.extern.Chapter>}
3928
+ * @return {!Array<shaka.extern.Chapter>}
3803
3929
  */
3804
3930
  getChapters(language) {}
3805
3931
  /**
@@ -3850,7 +3976,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3850
3976
  * @param {string=} codec
3851
3977
  * @param {string=} label
3852
3978
  * @param {boolean=} forced
3853
- * @return {!Promise.<shaka.extern.Track>}
3979
+ * @return {!Promise<shaka.extern.Track>}
3854
3980
  */
3855
3981
  addTextTrackAsync(uri, language, kind, mimeType, codec, label, forced) {}
3856
3982
  /**
@@ -3861,7 +3987,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3861
3987
  * application.
3862
3988
  * @param {string} uri
3863
3989
  * @param {string=} mimeType
3864
- * @return {!Promise.<shaka.extern.Track>}
3990
+ * @return {!Promise<shaka.extern.Track>}
3865
3991
  */
3866
3992
  addThumbnailsTrack(uri, mimeType) {}
3867
3993
  /**
@@ -3871,7 +3997,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3871
3997
  * @param {string} uri
3872
3998
  * @param {string} language
3873
3999
  * @param {string=} mimeType
3874
- * @return {!Promise.<shaka.extern.Track>}
4000
+ * @return {!Promise<shaka.extern.Track>}
3875
4001
  */
3876
4002
  addChaptersTrack(uri, language, mimeType) {}
3877
4003
  /**
@@ -4293,15 +4419,156 @@ shaka.ads.Utils.AD_CONTENT_ATTACH_REQUESTED;
4293
4419
  shaka.ads.InterstitialAd = class {
4294
4420
  /**
4295
4421
  * @param {HTMLMediaElement} video
4296
- * @param {boolean} isSkippable
4297
- * @param {?number} skipOffset
4298
- * @param {?number} skipFor
4422
+ * @param {shaka.extern.AdInterstitial} interstitial
4299
4423
  * @param {function()} onSkip
4300
4424
  * @param {number} sequenceLength
4301
4425
  * @param {number} adPosition
4302
4426
  * @param {boolean} isUsingAnotherMediaElement
4303
4427
  */
4304
- constructor(video, isSkippable, skipOffset, skipFor, onSkip, sequenceLength, adPosition, isUsingAnotherMediaElement) {}
4428
+ constructor(video, interstitial, onSkip, sequenceLength, adPosition, isUsingAnotherMediaElement) {}
4429
+ /**
4430
+ * @override
4431
+ */
4432
+ needsSkipUI() {}
4433
+ /**
4434
+ * @override
4435
+ */
4436
+ isClientRendering() {}
4437
+ /**
4438
+ * @override
4439
+ */
4440
+ isUsingAnotherMediaElement() {}
4441
+ /**
4442
+ * @override
4443
+ */
4444
+ getDuration() {}
4445
+ /**
4446
+ * @override
4447
+ */
4448
+ getMinSuggestedDuration() {}
4449
+ /**
4450
+ * @override
4451
+ */
4452
+ getRemainingTime() {}
4453
+ /**
4454
+ * @override
4455
+ */
4456
+ isPaused() {}
4457
+ /**
4458
+ * @override
4459
+ */
4460
+ isSkippable() {}
4461
+ /**
4462
+ * @override
4463
+ */
4464
+ getTimeUntilSkippable() {}
4465
+ /**
4466
+ * @override
4467
+ */
4468
+ canSkipNow() {}
4469
+ /**
4470
+ * @override
4471
+ */
4472
+ skip() {}
4473
+ /**
4474
+ * @override
4475
+ */
4476
+ pause() {}
4477
+ /**
4478
+ * @override
4479
+ */
4480
+ play() {}
4481
+ /**
4482
+ * @override
4483
+ */
4484
+ getVolume() {}
4485
+ /**
4486
+ * @override
4487
+ */
4488
+ setVolume(volume) {}
4489
+ /**
4490
+ * @override
4491
+ */
4492
+ isMuted() {}
4493
+ /**
4494
+ * @override
4495
+ */
4496
+ isLinear() {}
4497
+ /**
4498
+ * @override
4499
+ */
4500
+ resize(width, height) {}
4501
+ /**
4502
+ * @override
4503
+ */
4504
+ setMuted(muted) {}
4505
+ /**
4506
+ * @override
4507
+ */
4508
+ getSequenceLength() {}
4509
+ /**
4510
+ * @override
4511
+ */
4512
+ getPositionInSequence() {}
4513
+ /**
4514
+ * @override
4515
+ */
4516
+ getTitle() {}
4517
+ /**
4518
+ * @override
4519
+ */
4520
+ getDescription() {}
4521
+ /**
4522
+ * @override
4523
+ */
4524
+ getVastMediaBitrate() {}
4525
+ /**
4526
+ * @override
4527
+ */
4528
+ getVastMediaHeight() {}
4529
+ /**
4530
+ * @override
4531
+ */
4532
+ getVastMediaWidth() {}
4533
+ /**
4534
+ * @override
4535
+ */
4536
+ getAdId() {}
4537
+ /**
4538
+ * @override
4539
+ */
4540
+ getCreativeAdId() {}
4541
+ /**
4542
+ * @override
4543
+ */
4544
+ getAdvertiserName() {}
4545
+ /**
4546
+ * @override
4547
+ */
4548
+ getMediaUrl() {}
4549
+ /**
4550
+ * @override
4551
+ */
4552
+ getTimeOffset() {}
4553
+ /**
4554
+ * @override
4555
+ */
4556
+ getPodIndex() {}
4557
+ /**
4558
+ * @override
4559
+ */
4560
+ release() {}
4561
+ };
4562
+ /**
4563
+ * @implements {shaka.extern.IAd}
4564
+ */
4565
+ shaka.ads.InterstitialStaticAd = class {
4566
+ /**
4567
+ * @param {shaka.extern.AdInterstitial} interstitial
4568
+ * @param {number} sequenceLength
4569
+ * @param {number} adPosition
4570
+ */
4571
+ constructor(interstitial, sequenceLength, adPosition) {}
4305
4572
  /**
4306
4573
  * @override
4307
4574
  */
@@ -4443,6 +4710,7 @@ shaka.ads.MediaTailorAd = class {
4443
4710
  * @param {mediaTailor.Ad} mediaTailorAd
4444
4711
  * @param {number} adPosition
4445
4712
  * @param {number} totalAds
4713
+ * @param {boolean} isLinear
4446
4714
  * @param {HTMLMediaElement} video
4447
4715
  */
4448
4716
  constructor(mediaTailorAd, adPosition, totalAds, isLinear, video) {}
@@ -4750,8 +5018,8 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
4750
5018
  */
4751
5019
  release() {}
4752
5020
  /**
4753
- * @override
4754
- */
5021
+ * @override
5022
+ */
4755
5023
  onAssetUnload() {}
4756
5024
  /**
4757
5025
  * @override
@@ -4769,7 +5037,7 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
4769
5037
  * @param {string} url
4770
5038
  * @param {Object} adsParams
4771
5039
  * @param {string=} backupUrl
4772
- * @return {!Promise.<string>}
5040
+ * @return {!Promise<string>}
4773
5041
  * @override
4774
5042
  */
4775
5043
  requestMediaTailorStream(url, adsParams, backupUrl) {}
@@ -4785,7 +5053,7 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
4785
5053
  /**
4786
5054
  * @param {!google.ima.dai.api.StreamRequest} imaRequest
4787
5055
  * @param {string=} backupUrl
4788
- * @return {!Promise.<string>}
5056
+ * @return {!Promise<string>}
4789
5057
  * @override
4790
5058
  */
4791
5059
  requestServerSideStream(imaRequest, backupUrl) {}
@@ -4794,12 +5062,12 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
4794
5062
  */
4795
5063
  replaceServerSideAdTagParameters(adTagParameters) {}
4796
5064
  /**
4797
- * @return {!Array.<!shaka.extern.AdCuePoint>}
5065
+ * @return {!Array<!shaka.extern.AdCuePoint>}
4798
5066
  * @override
4799
5067
  */
4800
5068
  getServerSideCuePoints() {}
4801
5069
  /**
4802
- * @return {!Array.<!shaka.extern.AdCuePoint>}
5070
+ * @return {!Array<!shaka.extern.AdCuePoint>}
4803
5071
  * @override
4804
5072
  */
4805
5073
  getCuePoints() {}
@@ -4840,6 +5108,10 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
4840
5108
  * @override
4841
5109
  */
4842
5110
  addAdUrlInterstitial(url) {}
5111
+ /**
5112
+ * @override
5113
+ */
5114
+ getInterstitialPlayer() {}
4843
5115
  };
4844
5116
  /**
4845
5117
  * The event name for when a sequence of ads has been loaded.
@@ -5266,15 +5538,15 @@ shaka.util.PeriodCombiner = class {
5266
5538
  /** */
5267
5539
  constructor() {}
5268
5540
  /**
5269
- * @return {!Array.<shaka.extern.Variant>}
5541
+ * @return {!Array<shaka.extern.Variant>}
5270
5542
  */
5271
5543
  getVariants() {}
5272
5544
  /**
5273
- * @return {!Array.<shaka.extern.Stream>}
5274
- */
5545
+ * @return {!Array<shaka.extern.Stream>}
5546
+ */
5275
5547
  getTextStreams() {}
5276
5548
  /**
5277
- * @return {!Array.<shaka.extern.Stream>}
5549
+ * @return {!Array<shaka.extern.Stream>}
5278
5550
  */
5279
5551
  getImageStreams() {}
5280
5552
  /**
@@ -5284,7 +5556,7 @@ shaka.util.PeriodCombiner = class {
5284
5556
  */
5285
5557
  deleteStream(stream, periodId) {}
5286
5558
  /**
5287
- * @param {!Array.<shaka.extern.Period>} periods
5559
+ * @param {!Array<shaka.extern.Period>} periods
5288
5560
  * @param {boolean} isDynamic
5289
5561
  * @param {boolean=} isPatchUpdate
5290
5562
  * @return {!Promise}
@@ -5297,7 +5569,7 @@ shaka.util.PeriodCombiner = class {
5297
5569
  setAllowMultiTypeVariants(allowed) {}
5298
5570
  /**
5299
5571
  * @param {boolean} useOnce if true, stream will be used only once in period
5300
- * flattening algoritnm.
5572
+ * flattening algorithm.
5301
5573
  */
5302
5574
  setUseStreamOnce(useOnce) {}
5303
5575
  };
@@ -5631,9 +5903,9 @@ shaka.offline.Storage = class {
5631
5903
  * refer to {@link https://bit.ly/StructClone}
5632
5904
  * @param {?string=} mimeType
5633
5905
  * The mime type for the content |manifestUri| points to.
5634
- * @param {?Array.<string>=} externalThumbnails
5906
+ * @param {?Array<string>=} externalThumbnails
5635
5907
  * The external thumbnails to store along the main content.
5636
- * @param {?Array.<shaka.extern.ExtraText>=} externalText
5908
+ * @param {?Array<shaka.extern.ExtraText>=} externalText
5637
5909
  * The external text to store along the main content.
5638
5910
  * @return {!shaka.extern.IAbortableOperation.<shaka.extern.StoredContent>}
5639
5911
  * An AbortableOperation that resolves with a structure representing what
@@ -5654,12 +5926,12 @@ shaka.offline.Storage = class {
5654
5926
  /**
5655
5927
  * Removes any EME sessions that were not successfully removed before. This
5656
5928
  * returns whether all the sessions were successfully removed.
5657
- * @return {!Promise.<boolean>}
5929
+ * @return {!Promise<boolean>}
5658
5930
  */
5659
5931
  removeEmeSessions() {}
5660
5932
  /**
5661
5933
  * Lists all the stored content available.
5662
- * @return {!Promise.<!Array.<shaka.extern.StoredContent>>} A Promise to an
5934
+ * @return {!Promise<!Array<shaka.extern.StoredContent>>} A Promise to an
5663
5935
  * array of structures representing all stored content. The "offlineUri"
5664
5936
  * member of the structure is the URI that should be given to Player.load()
5665
5937
  * to play this piece of content offline. The "appMetadata" member is the
@@ -5803,18 +6075,6 @@ shaka.polyfill.PatchedMediaKeysCert = class {
5803
6075
  */
5804
6076
  static install() {}
5805
6077
  };
5806
- /**
5807
- * @summary A polyfill to stub out
5808
- * {@link https://bit.ly/EmeMar15 EME draft 12 March 2015} on browsers without
5809
- * EME.
5810
- * All methods will fail.
5811
- */
5812
- shaka.polyfill.PatchedMediaKeysNop = class {
5813
- /**
5814
- * Installs the polyfill if needed.
5815
- */
5816
- static install() {}
5817
- };
5818
6078
  /**
5819
6079
  * @summary A polyfill to implement
5820
6080
  * {@link https://bit.ly/EmeMar15 EME draft 12 March 2015} on top of
@@ -6452,8 +6712,8 @@ shaka.ui.RangeElement = class extends shaka.ui.Element {
6452
6712
  /**
6453
6713
  * @param {!HTMLElement} parent
6454
6714
  * @param {!shaka.ui.Controls} controls
6455
- * @param {!Array.<string>} containerClassNames
6456
- * @param {!Array.<string>} barClassNames
6715
+ * @param {!Array<string>} containerClassNames
6716
+ * @param {!Array<string>} barClassNames
6457
6717
  */
6458
6718
  constructor(parent, controls, containerClassNames, barClassNames) {}
6459
6719
  /**
@@ -6770,6 +7030,31 @@ shaka.ui.AirPlayButton = class extends shaka.ui.Element {
6770
7030
  */
6771
7031
  constructor(parent, controls) {}
6772
7032
  };
7033
+ /**
7034
+ * A UI component that adds watermark functionality to the Shaka Player.
7035
+ * Allows adding text watermarks with various customization options.
7036
+ * @extends {shaka.ui.Element}
7037
+ * @final
7038
+ */
7039
+ shaka.ui.Watermark = class extends shaka.ui.Element {
7040
+ /**
7041
+ * Creates a new Watermark instance.
7042
+ * @param {!HTMLElement} parent The parent element for the watermark canvas
7043
+ * @param {!shaka.ui.Controls} controls The controls instance
7044
+ */
7045
+ constructor(parent, controls) {}
7046
+ /**
7047
+ * Sets a text watermark on the video with customizable options.
7048
+ * The watermark can be either static (fixed position) or dynamic (moving).
7049
+ * @param {string} text The text to display as watermark
7050
+ * @param {?shaka.ui.Watermark.Options=} options configuration options
7051
+ */
7052
+ setTextWatermark(text, options) {}
7053
+ /**
7054
+ * Removes the current watermark from the video and stops any animations.
7055
+ */
7056
+ removeWatermark() {}
7057
+ };
6773
7058
  /**
6774
7059
  * @implements {shaka.util.IDestroyable}
6775
7060
  */
@@ -6812,6 +7097,14 @@ shaka.ui.Overlay = class {
6812
7097
  * @param {boolean} enabled
6813
7098
  */
6814
7099
  setEnabled(enabled) {}
7100
+ /**
7101
+ * @param {string} text
7102
+ * @param {?shaka.ui.Watermark.Options=} options
7103
+ */
7104
+ setTextWatermark(text, options) {}
7105
+ /**
7106
+ */
7107
+ removeWatermark() {}
6815
7108
  };
6816
7109
  /**
6817
7110
  * Describes what information should show up in labels for selecting audio