shaka-player 4.12.9 → 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 (259) 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 +36 -36
  9. package/dist/shaka-player.compiled.d.ts +131 -36
  10. package/dist/shaka-player.compiled.debug.d.ts +131 -36
  11. package/dist/shaka-player.compiled.debug.externs.js +355 -107
  12. package/dist/shaka-player.compiled.debug.js +799 -742
  13. package/dist/shaka-player.compiled.debug.map +4 -4
  14. package/dist/shaka-player.compiled.externs.js +355 -107
  15. package/dist/shaka-player.compiled.js +1456 -1423
  16. package/dist/shaka-player.compiled.map +4 -4
  17. package/dist/shaka-player.ui.d.ts +165 -38
  18. package/dist/shaka-player.ui.debug.d.ts +165 -38
  19. package/dist/shaka-player.ui.debug.externs.js +394 -113
  20. package/dist/shaka-player.ui.debug.js +808 -738
  21. package/dist/shaka-player.ui.debug.map +4 -4
  22. package/dist/shaka-player.ui.externs.js +394 -113
  23. package/dist/shaka-player.ui.js +1671 -1632
  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 +137 -108
  56. package/externs/shaka/text.js +3 -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 +34 -24
  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 +98 -108
  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 +14 -14
  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/manifest_filterer.js +8 -8
  102. package/lib/media/manifest_parser.js +2 -2
  103. package/lib/media/media_source_capabilities.js +20 -1
  104. package/lib/media/media_source_engine.js +71 -26
  105. package/lib/media/mp4_segment_index_parser.js +5 -5
  106. package/lib/media/playhead.js +2 -8
  107. package/lib/media/playhead_observer.js +1 -1
  108. package/lib/media/preference_based_criteria.js +333 -0
  109. package/lib/media/preload_manager.js +53 -37
  110. package/lib/media/presentation_timeline.js +2 -2
  111. package/lib/media/quality_observer.js +35 -35
  112. package/lib/media/region_observer.js +2 -2
  113. package/lib/media/region_timeline.js +3 -3
  114. package/lib/media/segment_index.js +14 -14
  115. package/lib/media/segment_prefetch.js +17 -13
  116. package/lib/media/segment_reference.js +7 -7
  117. package/lib/media/segment_utils.js +9 -9
  118. package/lib/media/streaming_engine.js +77 -38
  119. package/lib/media/time_ranges_utils.js +1 -1
  120. package/lib/media/video_wrapper.js +1 -1
  121. package/lib/media/webm_segment_index_parser.js +4 -4
  122. package/lib/mss/content_protection.js +17 -222
  123. package/lib/mss/mss_parser.js +23 -24
  124. package/lib/net/data_uri_plugin.js +1 -0
  125. package/lib/net/http_fetch_plugin.js +8 -7
  126. package/lib/net/http_plugin_utils.js +5 -2
  127. package/lib/net/http_xhr_plugin.js +4 -3
  128. package/lib/net/networking_engine.js +72 -17
  129. package/lib/net/networking_utils.js +5 -2
  130. package/lib/offline/download_info.js +5 -1
  131. package/lib/offline/download_manager.js +15 -4
  132. package/lib/offline/download_progress_estimator.js +1 -1
  133. package/lib/offline/indexeddb/base_storage_cell.js +9 -9
  134. package/lib/offline/indexeddb/db_connection.js +1 -1
  135. package/lib/offline/indexeddb/db_operation.js +2 -2
  136. package/lib/offline/indexeddb/eme_session_storage_cell.js +1 -1
  137. package/lib/offline/indexeddb/storage_mechanism.js +1 -1
  138. package/lib/offline/indexeddb/v1_storage_cell.js +3 -3
  139. package/lib/offline/indexeddb/v2_storage_cell.js +2 -2
  140. package/lib/offline/manifest_converter.js +11 -12
  141. package/lib/offline/offline_scheme.js +8 -4
  142. package/lib/offline/session_deleter.js +11 -11
  143. package/lib/offline/storage.js +137 -88
  144. package/lib/offline/storage_muxer.js +8 -8
  145. package/lib/offline/stored_content_utils.js +3 -3
  146. package/lib/offline/stream_bandwidth_estimator.js +1 -1
  147. package/lib/player.js +270 -207
  148. package/lib/polyfill/all.js +1 -1
  149. package/lib/polyfill/media_capabilities.js +5 -5
  150. package/lib/polyfill/patchedmediakeys_apple.js +6 -6
  151. package/lib/polyfill/patchedmediakeys_webkit.js +8 -8
  152. package/lib/polyfill/video_play_promise.js +0 -1
  153. package/lib/text/cue.js +3 -2
  154. package/lib/text/lrc_text_parser.js +1 -1
  155. package/lib/text/mp4_ttml_parser.js +1 -1
  156. package/lib/text/mp4_vtt_parser.js +3 -3
  157. package/lib/text/sbv_text_parser.js +1 -1
  158. package/lib/text/ssa_text_parser.js +3 -1
  159. package/lib/text/stub_text_displayer.js +5 -5
  160. package/lib/text/text_engine.js +5 -4
  161. package/lib/text/text_utils.js +4 -4
  162. package/lib/text/ttml_text_parser.js +21 -20
  163. package/lib/text/ui_text_displayer.js +13 -13
  164. package/lib/text/vtt_text_parser.js +10 -10
  165. package/lib/text/web_vtt_generator.js +2 -2
  166. package/lib/transmuxer/aac_transmuxer.js +2 -2
  167. package/lib/transmuxer/ac3_transmuxer.js +2 -2
  168. package/lib/transmuxer/adts.js +2 -0
  169. package/lib/transmuxer/ec3.js +3 -3
  170. package/lib/transmuxer/ec3_transmuxer.js +2 -2
  171. package/lib/transmuxer/h264.js +5 -5
  172. package/lib/transmuxer/h265.js +3 -3
  173. package/lib/transmuxer/mp3_transmuxer.js +2 -2
  174. package/lib/transmuxer/mpeg_audio.js +6 -6
  175. package/lib/transmuxer/mss_transmuxer.js +2 -0
  176. package/lib/transmuxer/transmuxer_engine.js +1 -1
  177. package/lib/transmuxer/ts_transmuxer.js +10 -10
  178. package/lib/util/abortable_operation.js +10 -10
  179. package/lib/util/array_utils.js +6 -6
  180. package/lib/util/cmcd_manager.js +149 -18
  181. package/lib/util/cmsd_manager.js +11 -11
  182. package/lib/util/config_utils.js +3 -3
  183. package/lib/util/content_steering_manager.js +17 -17
  184. package/lib/util/data_view_reader.js +3 -3
  185. package/lib/util/ebml_parser.js +1 -1
  186. package/lib/util/error.js +11 -6
  187. package/lib/util/event_manager.js +1 -1
  188. package/lib/util/exp_golomb.js +1 -1
  189. package/lib/util/fairplay_utils.js +6 -1
  190. package/lib/util/fake_event.js +3 -2
  191. package/lib/util/fake_event_target.js +1 -1
  192. package/lib/util/functional.js +8 -8
  193. package/lib/util/id3_utils.js +1 -1
  194. package/lib/util/iterables.js +6 -6
  195. package/lib/util/language_utils.js +17 -17
  196. package/lib/util/manifest_parser_utils.js +13 -13
  197. package/lib/util/map_utils.js +6 -6
  198. package/lib/util/media_ready_state_utils.js +1 -1
  199. package/lib/util/mime_utils.js +15 -4
  200. package/lib/util/mp4_box_parsers.js +5 -5
  201. package/lib/util/mp4_generator.js +31 -30
  202. package/lib/util/mp4_parser.js +2 -2
  203. package/lib/util/multi_map.js +5 -5
  204. package/lib/util/mutex.js +1 -1
  205. package/lib/util/networking.js +1 -1
  206. package/lib/util/object_utils.js +5 -1
  207. package/lib/util/operation_manager.js +1 -1
  208. package/lib/util/periods.js +24 -24
  209. package/lib/util/platform.js +8 -4
  210. package/lib/util/player_configuration.js +50 -17
  211. package/lib/util/pssh.js +34 -6
  212. package/lib/util/public_promise.js +2 -2
  213. package/lib/util/state_history.js +2 -2
  214. package/lib/util/stream_utils.js +138 -120
  215. package/lib/util/string_utils.js +4 -3
  216. package/lib/util/switch_history.js +2 -2
  217. package/lib/util/tXml.js +22 -17
  218. package/lib/util/text_parser.js +2 -2
  219. package/lib/util/timer.js +1 -1
  220. package/lib/util/ts_parser.js +22 -22
  221. package/lib/util/xml_utils.js +1 -0
  222. package/package.json +7 -4
  223. package/project-words.txt +485 -0
  224. package/shaka-player.uncompiled.js +1 -1
  225. package/third_party/closure-uri/uri.js +2 -2
  226. package/third_party/closure-uri/utils.js +2 -2
  227. package/third_party/language-mapping-list/language-mapping-list.js +1 -1
  228. package/ui/ad_statistics_button.js +9 -5
  229. package/ui/airplay_button.js +1 -0
  230. package/ui/audio_language_selection.js +2 -1
  231. package/ui/context_menu.js +2 -2
  232. package/ui/controls.js +7 -7
  233. package/ui/externs/ui.js +29 -21
  234. package/ui/externs/watermark.js +64 -0
  235. package/ui/fast_forward_button.js +1 -1
  236. package/ui/gl_matrix/matrix_4x4.js +11 -5
  237. package/ui/hidden_fast_forward_button.js +1 -1
  238. package/ui/hidden_seek_button.js +1 -1
  239. package/ui/language_utils.js +27 -26
  240. package/ui/less/buttons.less +2 -2
  241. package/ui/localization.js +21 -21
  242. package/ui/loop_button.js +2 -2
  243. package/ui/overflow_menu.js +2 -2
  244. package/ui/playback_rate_selection.js +1 -1
  245. package/ui/presentation_time.js +4 -1
  246. package/ui/range_element.js +2 -2
  247. package/ui/resolution_selection.js +42 -6
  248. package/ui/rewind_button.js +1 -1
  249. package/ui/seek_bar.js +5 -5
  250. package/ui/statistics_button.js +8 -4
  251. package/ui/text_selection.js +3 -2
  252. package/ui/ui.js +32 -2
  253. package/ui/vr_manager.js +3 -3
  254. package/ui/vr_utils.js +14 -14
  255. package/ui/vr_webgl.js +5 -5
  256. package/ui/watermark.js +313 -0
  257. package/.eslintignore +0 -4
  258. package/.eslintrc.js +0 -310
  259. package/lib/polyfill/patchedmediakeys_nop.js +0 -148
@@ -95,7 +95,7 @@ shaka.text.VttTextParser = class {
95
95
  }
96
96
 
97
97
  // Parse VTT regions.
98
- /* !Array.<!shaka.text.CueRegion> */
98
+ /* !Array<!shaka.text.CueRegion> */
99
99
  const regions = [];
100
100
  for (const line of blocks[0].split('\n')) {
101
101
  if (/^Region:/.test(line)) {
@@ -104,7 +104,7 @@ shaka.text.VttTextParser = class {
104
104
  }
105
105
  }
106
106
 
107
- /** @type {!Map.<string, !shaka.text.Cue>} */
107
+ /** @type {!Map<string, !shaka.text.Cue>} */
108
108
  const styles = new Map();
109
109
  shaka.text.Cue.addDefaultTextColor(styles);
110
110
 
@@ -207,8 +207,8 @@ shaka.text.VttTextParser = class {
207
207
  /**
208
208
  * Parses a style block into a Cue object.
209
209
  *
210
- * @param {!Array.<string>} text
211
- * @param {!Map.<string, !shaka.text.Cue>} styles
210
+ * @param {!Array<string>} text
211
+ * @param {!Map<string, !shaka.text.Cue>} styles
212
212
  * @private
213
213
  */
214
214
  static parseStyle_(text, styles) {
@@ -227,7 +227,7 @@ shaka.text.VttTextParser = class {
227
227
  return;
228
228
  }
229
229
 
230
- /** @type {!Array.<!Array.<string>>} */
230
+ /** @type {!Array<!Array<string>>} */
231
231
  const styleBlocks = [];
232
232
  let lastBlockIndex = -1;
233
233
  for (let i = 1; i < text.length; i++) {
@@ -352,10 +352,10 @@ shaka.text.VttTextParser = class {
352
352
  /**
353
353
  * Parses a text block into a Cue object.
354
354
  *
355
- * @param {!Array.<string>} text
355
+ * @param {!Array<string>} text
356
356
  * @param {number} timeOffset
357
- * @param {!Array.<!shaka.text.CueRegion>} regions
358
- * @param {!Map.<string, !shaka.text.Cue>} styles
357
+ * @param {!Array<!shaka.text.CueRegion>} regions
358
+ * @param {!Map<string, !shaka.text.Cue>} styles
359
359
  * @return {shaka.text.Cue}
360
360
  * @private
361
361
  */
@@ -437,7 +437,7 @@ shaka.text.VttTextParser = class {
437
437
  *
438
438
  * @param {!shaka.text.Cue} cue
439
439
  * @param {string} word
440
- * @param {!Array.<!shaka.text.CueRegion>} regions
440
+ * @param {!Array<!shaka.text.CueRegion>} regions
441
441
  * @return {boolean} True on success.
442
442
  */
443
443
  static parseCueSetting(cue, word, regions) {
@@ -471,7 +471,7 @@ shaka.text.VttTextParser = class {
471
471
 
472
472
  /**
473
473
  *
474
- * @param {!Array.<!shaka.text.CueRegion>} regions
474
+ * @param {!Array<!shaka.text.CueRegion>} regions
475
475
  * @param {string} id
476
476
  * @return {?shaka.text.CueRegion}
477
477
  * @private
@@ -16,8 +16,8 @@ goog.require('shaka.text.Utils');
16
16
  */
17
17
  shaka.text.WebVttGenerator = class {
18
18
  /**
19
- * @param {!Array.<!shaka.text.Cue>} cues
20
- * @param {!Array.<!shaka.extern.AdCuePoint>} adCuePoints
19
+ * @param {!Array<!shaka.text.Cue>} cues
20
+ * @param {!Array<!shaka.extern.AdCuePoint>} adCuePoints
21
21
  * @return {string}
22
22
  */
23
23
  static convert(cues, adCuePoints) {
@@ -33,7 +33,7 @@ shaka.transmuxer.AacTransmuxer = class {
33
33
  /** @private {number} */
34
34
  this.frameIndex_ = 0;
35
35
 
36
- /** @private {!Map.<string, !Uint8Array>} */
36
+ /** @private {!Map<string, !Uint8Array>} */
37
37
  this.initSegments = new Map();
38
38
 
39
39
  /** @private {?Uint8Array} */
@@ -150,7 +150,7 @@ shaka.transmuxer.AacTransmuxer = class {
150
150
  stream.audioSamplingRate = info.sampleRate;
151
151
  stream.channelsCount = info.channelCount;
152
152
 
153
- /** @type {!Array.<shaka.util.Mp4Generator.Mp4Sample>} */
153
+ /** @type {!Array<shaka.util.Mp4Generator.Mp4Sample>} */
154
154
  const samples = [];
155
155
 
156
156
  while (offset < uint8ArrayData.length) {
@@ -32,7 +32,7 @@ shaka.transmuxer.Ac3Transmuxer = class {
32
32
  /** @private {number} */
33
33
  this.frameIndex_ = 0;
34
34
 
35
- /** @private {!Map.<string, !Uint8Array>} */
35
+ /** @private {!Map<string, !Uint8Array>} */
36
36
  this.initSegments = new Map();
37
37
 
38
38
  /** @private {?Uint8Array} */
@@ -138,7 +138,7 @@ shaka.transmuxer.Ac3Transmuxer = class {
138
138
  /** @type {!Uint8Array} */
139
139
  let audioConfig = new Uint8Array([]);
140
140
 
141
- /** @type {!Array.<shaka.util.Mp4Generator.Mp4Sample>} */
141
+ /** @type {!Array<shaka.util.Mp4Generator.Mp4Sample>} */
142
142
  const samples = [];
143
143
 
144
144
  while (offset < uint8ArrayData.length) {
@@ -4,6 +4,8 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
+ // cspell:ignore lavfi aevalsrc libfdk hexdump
8
+
7
9
  goog.provide('shaka.transmuxer.ADTS');
8
10
 
9
11
 
@@ -87,9 +87,9 @@ shaka.transmuxer.Ec3 = class {
87
87
  * @return {boolean}
88
88
  */
89
89
  static probe(data, offset) {
90
- // search 16-bit 0x0B77 syncword
91
- const syncword = (data[offset] << 8) | (data[offset + 1] << 0);
92
- if (syncword === 0x0B77) {
90
+ // search 16-bit 0x0B77 sync word
91
+ const syncWord = (data[offset] << 8) | (data[offset + 1] << 0);
92
+ if (syncWord === 0x0B77) {
93
93
  return true;
94
94
  } else {
95
95
  return false;
@@ -32,7 +32,7 @@ shaka.transmuxer.Ec3Transmuxer = class {
32
32
  /** @private {number} */
33
33
  this.frameIndex_ = 0;
34
34
 
35
- /** @private {!Map.<string, !Uint8Array>} */
35
+ /** @private {!Map<string, !Uint8Array>} */
36
36
  this.initSegments = new Map();
37
37
 
38
38
  /** @private {?Uint8Array} */
@@ -138,7 +138,7 @@ shaka.transmuxer.Ec3Transmuxer = class {
138
138
  /** @type {!Uint8Array} */
139
139
  let audioConfig = new Uint8Array([]);
140
140
 
141
- /** @type {!Array.<shaka.util.Mp4Generator.Mp4Sample>} */
141
+ /** @type {!Array<shaka.util.Mp4Generator.Mp4Sample>} */
142
142
  const samples = [];
143
143
 
144
144
  while (offset < uint8ArrayData.length) {
@@ -19,7 +19,7 @@ shaka.transmuxer.H264 = class {
19
19
  * properties. A sequence parameter set is the H264 metadata that
20
20
  * describes the properties of upcoming video frames.
21
21
  *
22
- * @param {!Array.<shaka.extern.VideoNalu>} nalus
22
+ * @param {!Array<shaka.extern.VideoNalu>} nalus
23
23
  * @return {?{height: number, width: number, videoConfig: !Uint8Array,
24
24
  * hSpacing: number, vSpacing: number}}
25
25
  */
@@ -196,13 +196,13 @@ shaka.transmuxer.H264 = class {
196
196
  }
197
197
 
198
198
  /**
199
- * @param {!Array.<shaka.extern.MPEG_PES>} videoData
200
- * @return {!Array.<shaka.extern.VideoSample>}
199
+ * @param {!Array<shaka.extern.MPEG_PES>} videoData
200
+ * @return {!Array<shaka.extern.VideoSample>}
201
201
  */
202
202
  static getVideoSamples(videoData) {
203
203
  const H264 = shaka.transmuxer.H264;
204
204
 
205
- /** @type {!Array.<shaka.extern.VideoSample>} */
205
+ /** @type {!Array<shaka.extern.VideoSample>} */
206
206
  const videoSamples = [];
207
207
  /** @type {?shaka.extern.VideoSample} */
208
208
  let lastVideoSample = null;
@@ -418,7 +418,7 @@ shaka.transmuxer.H264.NALU_TYPE_FILLER_DATA_ = 0x0c;
418
418
  * see Recommendation ITU-T H.264 (4/2013)
419
419
  * 7.3.2.1.1 Sequence parameter set data syntax
420
420
  *
421
- * @const {!Array.<number>}
421
+ * @const {!Array<number>}
422
422
  * @private
423
423
  */
424
424
  shaka.transmuxer.H264.PROFILES_WITH_OPTIONAL_SPS_DATA_ =
@@ -19,7 +19,7 @@ shaka.transmuxer.H265 = class {
19
19
  * properties. A sequence parameter set is the H265 metadata that
20
20
  * describes the properties of upcoming video frames.
21
21
  *
22
- * @param {!Array.<shaka.extern.VideoNalu>} nalus
22
+ * @param {!Array<shaka.extern.VideoNalu>} nalus
23
23
  * @return {?{height: number, width: number, videoConfig: !Uint8Array,
24
24
  * hSpacing: number, vSpacing: number}}
25
25
  */
@@ -139,7 +139,7 @@ shaka.transmuxer.H265 = class {
139
139
  let bottomOffset = 0;
140
140
 
141
141
  // SPS
142
- gb.readBits(4); // video_paramter_set_id
142
+ gb.readBits(4); // video_parameter_set_id
143
143
  const maxSubLayersMinus1 = gb.readBits(3);
144
144
  gb.readBoolean(); // temporal_id_nesting_flag
145
145
 
@@ -600,7 +600,7 @@ shaka.transmuxer.H265 = class {
600
600
  }
601
601
 
602
602
  /**
603
- * @param {!Array.<shaka.extern.VideoNalu>} nalus
603
+ * @param {!Array<shaka.extern.VideoNalu>} nalus
604
604
  * @return {?{data: !Uint8Array, isKeyframe: boolean}}
605
605
  */
606
606
  static parseFrame(nalus) {
@@ -32,7 +32,7 @@ shaka.transmuxer.Mp3Transmuxer = class {
32
32
  /** @private {number} */
33
33
  this.frameIndex_ = 0;
34
34
 
35
- /** @private {!Map.<string, !Uint8Array>} */
35
+ /** @private {!Map<string, !Uint8Array>} */
36
36
  this.initSegments = new Map();
37
37
 
38
38
  /** @private {?Uint8Array} */
@@ -122,7 +122,7 @@ shaka.transmuxer.Mp3Transmuxer = class {
122
122
  const timescale = 90000;
123
123
  let firstHeader;
124
124
 
125
- /** @type {!Array.<shaka.util.Mp4Generator.Mp4Sample>} */
125
+ /** @type {!Array<shaka.util.Mp4Generator.Mp4Sample>} */
126
126
  const samples = [];
127
127
 
128
128
  while (offset < uint8ArrayData.length) {
@@ -40,7 +40,7 @@ shaka.transmuxer.MpegAudio = class {
40
40
  columnInBitrates * 14 + bitRateIndex - 1] * 1000;
41
41
  const columnInSampleRates =
42
42
  mpegVersion === 3 ? 0 : mpegVersion === 2 ? 1 : 2;
43
- const sampleRate = MpegAudio.SAMPLINGRATE_MAP_[
43
+ const sampleRate = MpegAudio.SAMPLING_RATE_MAP_[
44
44
  columnInSampleRates * 3 + sampleRateIndex];
45
45
  // If bits of channel mode are `11` then it is a single channel (Mono)
46
46
  const channelCount = channelMode === 3 ? 1 : 2;
@@ -128,7 +128,7 @@ shaka.transmuxer.MpegAudio = class {
128
128
 
129
129
 
130
130
  /**
131
- * @private {!Array.<number>}
131
+ * @private {!Array<number>}
132
132
  */
133
133
  shaka.transmuxer.MpegAudio.BITRATES_MAP_ = [
134
134
  32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 32, 48, 56,
@@ -139,14 +139,14 @@ shaka.transmuxer.MpegAudio.BITRATES_MAP_ = [
139
139
  ];
140
140
 
141
141
  /**
142
- * @private {!Array.<number>}
142
+ * @private {!Array<number>}
143
143
  */
144
- shaka.transmuxer.MpegAudio.SAMPLINGRATE_MAP_ = [
144
+ shaka.transmuxer.MpegAudio.SAMPLING_RATE_MAP_ = [
145
145
  44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000,
146
146
  ];
147
147
 
148
148
  /**
149
- * @private {!Array.<!Array.<number>>}
149
+ * @private {!Array<!Array<number>>}
150
150
  */
151
151
  shaka.transmuxer.MpegAudio.SAMPLES_COEFFICIENTS_ = [
152
152
  // MPEG 2.5
@@ -181,7 +181,7 @@ shaka.transmuxer.MpegAudio.SAMPLES_COEFFICIENTS_ = [
181
181
 
182
182
 
183
183
  /**
184
- * @private {!Array.<number>}
184
+ * @private {!Array<number>}
185
185
  */
186
186
  shaka.transmuxer.MpegAudio.BYTES_IN_SLOT_ = [
187
187
  0, // Reserved
@@ -30,6 +30,8 @@
30
30
  * POSSIBILITY OF SUCH DAMAGE.
31
31
  */
32
32
 
33
+ // cspell:words crypted usertype
34
+
33
35
  goog.provide('shaka.transmuxer.MssTransmuxer');
34
36
 
35
37
  goog.require('shaka.media.Capabilities');
@@ -139,7 +139,7 @@ shaka.transmuxer.TransmuxerEngine.PluginObject;
139
139
 
140
140
 
141
141
  /**
142
- * @private {!Object.<string, !shaka.transmuxer.TransmuxerEngine.PluginObject>}
142
+ * @private {!Object<string, !shaka.transmuxer.TransmuxerEngine.PluginObject>}
143
143
  */
144
144
  shaka.transmuxer.TransmuxerEngine.transmuxerMap_ = {};
145
145
 
@@ -44,7 +44,7 @@ shaka.transmuxer.TsTransmuxer = class {
44
44
  /** @private {number} */
45
45
  this.frameIndex_ = 0;
46
46
 
47
- /** @private {!Map.<string, !Uint8Array>} */
47
+ /** @private {!Map<string, !Uint8Array>} */
48
48
  this.initSegments = new Map();
49
49
 
50
50
  /** @private {?shaka.util.TsParser} */
@@ -322,7 +322,7 @@ shaka.transmuxer.TsTransmuxer = class {
322
322
  const timescale = shaka.util.TsParser.Timescale;
323
323
  const Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;
324
324
 
325
- /** @type {!Array.<shaka.util.Mp4Generator.Mp4Sample>} */
325
+ /** @type {!Array<shaka.util.Mp4Generator.Mp4Sample>} */
326
326
  const samples = [];
327
327
 
328
328
  let info;
@@ -509,7 +509,7 @@ shaka.transmuxer.TsTransmuxer = class {
509
509
  const Ac3 = shaka.transmuxer.Ac3;
510
510
  const timescale = shaka.util.TsParser.Timescale;
511
511
 
512
- /** @type {!Array.<shaka.util.Mp4Generator.Mp4Sample>} */
512
+ /** @type {!Array<shaka.util.Mp4Generator.Mp4Sample>} */
513
513
  const samples = [];
514
514
 
515
515
  /** @type {number} */
@@ -604,7 +604,7 @@ shaka.transmuxer.TsTransmuxer = class {
604
604
  const Ec3 = shaka.transmuxer.Ec3;
605
605
  const timescale = shaka.util.TsParser.Timescale;
606
606
 
607
- /** @type {!Array.<shaka.util.Mp4Generator.Mp4Sample>} */
607
+ /** @type {!Array<shaka.util.Mp4Generator.Mp4Sample>} */
608
608
  const samples = [];
609
609
 
610
610
  /** @type {number} */
@@ -699,7 +699,7 @@ shaka.transmuxer.TsTransmuxer = class {
699
699
  const MpegAudio = shaka.transmuxer.MpegAudio;
700
700
  const timescale = shaka.util.TsParser.Timescale;
701
701
 
702
- /** @type {!Array.<shaka.util.Mp4Generator.Mp4Sample>} */
702
+ /** @type {!Array<shaka.util.Mp4Generator.Mp4Sample>} */
703
703
  const samples = [];
704
704
 
705
705
  let firstHeader;
@@ -789,7 +789,7 @@ shaka.transmuxer.TsTransmuxer = class {
789
789
  const Opus = shaka.transmuxer.Opus;
790
790
  const timescale = shaka.util.TsParser.Timescale;
791
791
 
792
- /** @type {!Array.<shaka.util.Mp4Generator.Mp4Sample>} */
792
+ /** @type {!Array<shaka.util.Mp4Generator.Mp4Sample>} */
793
793
  const samples = [];
794
794
 
795
795
  let firstPts = null;
@@ -901,7 +901,7 @@ shaka.transmuxer.TsTransmuxer = class {
901
901
  const H264 = shaka.transmuxer.H264;
902
902
  const timescale = shaka.util.TsParser.Timescale;
903
903
 
904
- /** @type {!Array.<shaka.util.Mp4Generator.Mp4Sample>} */
904
+ /** @type {!Array<shaka.util.Mp4Generator.Mp4Sample>} */
905
905
  const samples = [];
906
906
 
907
907
  /** @type {?number} */
@@ -995,7 +995,7 @@ shaka.transmuxer.TsTransmuxer = class {
995
995
  const H265 = shaka.transmuxer.H265;
996
996
  const timescale = shaka.util.TsParser.Timescale;
997
997
 
998
- /** @type {!Array.<shaka.util.Mp4Generator.Mp4Sample>} */
998
+ /** @type {!Array<shaka.util.Mp4Generator.Mp4Sample>} */
999
999
  const samples = [];
1000
1000
 
1001
1001
  /** @type {?number} */
@@ -1083,7 +1083,7 @@ shaka.transmuxer.TsTransmuxer = class {
1083
1083
  * Supported audio codecs.
1084
1084
  *
1085
1085
  * @private
1086
- * @const {!Array.<string>}
1086
+ * @const {!Array<string>}
1087
1087
  */
1088
1088
  shaka.transmuxer.TsTransmuxer.SUPPORTED_AUDIO_CODECS_ = [
1089
1089
  'aac',
@@ -1097,7 +1097,7 @@ shaka.transmuxer.TsTransmuxer.SUPPORTED_AUDIO_CODECS_ = [
1097
1097
  * Supported audio codecs.
1098
1098
  *
1099
1099
  * @private
1100
- * @const {!Array.<string>}
1100
+ * @const {!Array<string>}
1101
1101
  */
1102
1102
  shaka.transmuxer.TsTransmuxer.SUPPORTED_VIDEO_CODECS_ = [
1103
1103
  'avc',
@@ -11,29 +11,29 @@ goog.require('shaka.util.PublicPromise');
11
11
 
12
12
  /**
13
13
  * A utility to wrap abortable operations. Note that these are not cancelable.
14
- * Cancelation implies undoing what has been done so far, whereas aborting only
14
+ * Cancellation implies undoing what has been done so far, whereas aborting only
15
15
  * means that further work is stopped.
16
16
  *
17
- * @implements {shaka.extern.IAbortableOperation.<T>}
17
+ * @implements {shaka.extern.IAbortableOperation<T>}
18
18
  * @template T
19
19
  * @export
20
20
  */
21
21
  shaka.util.AbortableOperation = class {
22
22
  /**
23
- * @param {!Promise.<T>} promise
23
+ * @param {!Promise<T>} promise
24
24
  * A Promise which represents the underlying operation. It is resolved when
25
25
  * the operation is complete, and rejected if the operation fails or is
26
26
  * aborted. Aborted operations should be rejected with a shaka.util.Error
27
27
  * object using the error code OPERATION_ABORTED.
28
28
  * @param {function():!Promise} onAbort
29
29
  * Will be called by this object to abort the underlying operation.
30
- * This is not cancelation, and will not necessarily result in any work
30
+ * This is not cancellation, and will not necessarily result in any work
31
31
  * being undone. abort() should return a Promise which is resolved when the
32
32
  * underlying operation has been aborted. The returned Promise should never
33
33
  * be rejected.
34
34
  */
35
35
  constructor(promise, onAbort) {
36
- /** @const {!Promise.<T>} */
36
+ /** @const {!Promise<T>} */
37
37
  this.promise = promise;
38
38
 
39
39
  /** @private {function():!Promise} */
@@ -98,7 +98,7 @@ shaka.util.AbortableOperation = class {
98
98
  }
99
99
 
100
100
  /**
101
- * @param {!Promise.<U>} promise
101
+ * @param {!Promise<U>} promise
102
102
  * @return {!shaka.util.AbortableOperation.<U>} An operation which cannot be
103
103
  * aborted. It will be completed when the given Promise is resolved, or
104
104
  * will be failed when the given Promise is rejected.
@@ -125,7 +125,7 @@ shaka.util.AbortableOperation = class {
125
125
  }
126
126
 
127
127
  /**
128
- * @param {!Array.<!shaka.util.AbortableOperation>} operations
128
+ * @param {!Array<!shaka.util.AbortableOperation>} operations
129
129
  * @return {!shaka.util.AbortableOperation} An operation which is resolved
130
130
  * when all operations are successful and fails when any operation fails.
131
131
  * For this operation, abort() aborts all given operations.
@@ -149,7 +149,7 @@ shaka.util.AbortableOperation = class {
149
149
  /**
150
150
  * @param {(undefined|
151
151
  * function(T):U|
152
- * function(T):!Promise.<U>|
152
+ * function(T):!Promise<U>|
153
153
  * function(T):!shaka.util.AbortableOperation.<U>)} onSuccess
154
154
  * A callback to be invoked after this operation is complete, to chain to
155
155
  * another operation. The callback can return a plain value, a Promise to
@@ -212,7 +212,7 @@ shaka.util.AbortableOperation = class {
212
212
 
213
213
  /**
214
214
  * @param {(function(T):U|
215
- * function(T):!Promise.<U>|
215
+ * function(T):!Promise<U>|
216
216
  * function(T):!shaka.util.AbortableOperation.<U>|
217
217
  * function(*))} callback
218
218
  * A callback to be invoked with the given value.
@@ -254,7 +254,7 @@ shaka.util.AbortableOperation = class {
254
254
  };
255
255
 
256
256
  /**
257
- * @const {!Promise.<T>}
257
+ * @const {!Promise<T>}
258
258
  * @exportInterface
259
259
  */
260
260
  // eslint-disable-next-line no-restricted-syntax
@@ -34,7 +34,7 @@ shaka.util.ArrayUtils = class {
34
34
 
35
35
  /**
36
36
  * Remove given element from array (assumes no duplicates).
37
- * @param {!Array.<T>} array
37
+ * @param {!Array<T>} array
38
38
  * @param {T} element
39
39
  * @template T
40
40
  */
@@ -48,7 +48,7 @@ shaka.util.ArrayUtils = class {
48
48
 
49
49
  /**
50
50
  * Count the number of items in the list that pass the check function.
51
- * @param {!Array.<T>} array
51
+ * @param {!Array<T>} array
52
52
  * @param {function(T):boolean} check
53
53
  * @return {number}
54
54
  * @template T
@@ -67,8 +67,8 @@ shaka.util.ArrayUtils = class {
67
67
  /**
68
68
  * Determines if the given arrays contain equal elements in any order.
69
69
  *
70
- * @param {!Array.<T>} a
71
- * @param {!Array.<T>} b
70
+ * @param {!Array<T>} a
71
+ * @param {!Array<T>} b
72
72
  * @param {function(T, T):boolean=} compareFn
73
73
  * @return {boolean}
74
74
  * @template T
@@ -100,8 +100,8 @@ shaka.util.ArrayUtils = class {
100
100
  /**
101
101
  * Determines if the given arrays contain equal elements in the same order.
102
102
  *
103
- * @param {!Array.<T>} a
104
- * @param {!Array.<T>} b
103
+ * @param {!Array<T>} a
104
+ * @param {!Array<T>} b
105
105
  * @param {function(T, T):boolean=} compareFn
106
106
  * @return {boolean}
107
107
  * @template T