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
@@ -37,7 +37,7 @@ shaka.dash.MpdUtils = class {
37
37
  */
38
38
  static fillUriTemplate(
39
39
  uriTemplate, representationId, number, subNumber, bandwidth, time) {
40
- /** @type {!Object.<string, ?number|?string>} */
40
+ /** @type {!Object<string, ?number | ?string>} */
41
41
  const valueTable = {
42
42
  'RepresentationID': representationId,
43
43
  'Number': number,
@@ -46,6 +46,7 @@ shaka.dash.MpdUtils = class {
46
46
  'Time': time,
47
47
  };
48
48
 
49
+ // cspell: disable-next-line
49
50
  const re = /\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g; // eslint-disable-line max-len
50
51
  const uri = uriTemplate.replace(re, (match, name, widthStr, format) => {
51
52
  if (match == '$$') {
@@ -129,7 +130,7 @@ shaka.dash.MpdUtils = class {
129
130
  * @param {number} periodDuration The Period's duration in seconds.
130
131
  * Infinity indicates that the Period continues indefinitely.
131
132
  * @param {number} startNumber
132
- * @return {!Array.<shaka.media.PresentationTimeline.TimeRange>}
133
+ * @return {!Array<shaka.media.PresentationTimeline.TimeRange>}
133
134
  */
134
135
  static createTimeline(
135
136
  timePoints, timescale, unscaledPresentationTimeOffset,
@@ -143,7 +144,7 @@ shaka.dash.MpdUtils = class {
143
144
  // Alias.
144
145
  const TXml = shaka.util.TXml;
145
146
 
146
- /** @type {!Array.<shaka.media.PresentationTimeline.TimeRange>} */
147
+ /** @type {!Array<shaka.media.PresentationTimeline.TimeRange>} */
147
148
  const timeline = [];
148
149
  let lastEndTime = -unscaledPresentationTimeOffset;
149
150
 
@@ -186,7 +187,7 @@ shaka.dash.MpdUtils = class {
186
187
  return timeline;
187
188
  } else if (startTime >= nextStartTime) {
188
189
  shaka.log.warning(
189
- 'An "S" element cannot have a negative repeatif its start ',
190
+ 'An "S" element cannot have a negative repeat if its start ',
190
191
  'time exceeds the next "S" element\'s start time:',
191
192
  'ignoring the remaining "S" elements.', timePoint);
192
193
  return timeline;
@@ -207,7 +208,7 @@ shaka.dash.MpdUtils = class {
207
208
  shaka.log.warning(
208
209
  'The last "S" element cannot have a negative repeat',
209
210
  'if its start time exceeds the Period\'s duration:',
210
- 'igoring the last "S" element.', timePoint);
211
+ 'ignoring the last "S" element.', timePoint);
211
212
  return timeline;
212
213
  }
213
214
  repeat = Math.ceil((periodDuration * timescale - startTime) / d) - 1;
@@ -293,7 +294,7 @@ shaka.dash.MpdUtils = class {
293
294
  startNumber = 1;
294
295
  }
295
296
 
296
- /** @type {Array.<shaka.media.PresentationTimeline.TimeRange>} */
297
+ /** @type {Array<shaka.media.PresentationTimeline.TimeRange>} */
297
298
  let timeline = null;
298
299
  const timelineNode =
299
300
  MpdUtils.inheritChild(context, callback, 'SegmentTimeline');
@@ -322,8 +323,8 @@ shaka.dash.MpdUtils = class {
322
323
  * @param {shaka.dash.DashParser.Context} context
323
324
  * @param {function(?shaka.dash.DashParser.InheritanceFrame):
324
325
  * ?shaka.extern.xml.Node} callback
325
- * @return {!Array.<!shaka.extern.xml.Node>}
326
- */
326
+ * @return {!Array<!shaka.extern.xml.Node>}
327
+ */
327
328
  static getNodes(context, callback) {
328
329
  const Functional = shaka.util.Functional;
329
330
  goog.asserts.assert(
@@ -417,9 +418,9 @@ shaka.dash.MpdUtils = class {
417
418
  // Remove the xlink properties, so it won't download again
418
419
  // when re-processed.
419
420
  for (const key of Object.keys(element.attributes)) {
420
- const segs = key.split(':');
421
+ const segments = key.split(':');
421
422
  const namespace = shaka.util.TXml.getKnownNameSpace(NS);
422
- if (segs[0] == namespace) {
423
+ if (segments[0] == namespace) {
423
424
  delete element.attributes[key];
424
425
  }
425
426
  }
@@ -504,7 +505,7 @@ shaka.dash.MpdUtils = class {
504
505
  * @param {boolean} failGracefully
505
506
  * @param {string} baseUri
506
507
  * @param {!shaka.net.NetworkingEngine} networkingEngine
507
- * @param {number=} linkDepth, default set to 0
508
+ * @param {number=} linkDepth default set to 0
508
509
  * @return {!shaka.util.AbortableOperation.<!shaka.extern.xml.Node>}
509
510
  */
510
511
  static processXlinks(
@@ -569,7 +570,7 @@ shaka.dash.MpdUtils = class {
569
570
  * startNumber: number,
570
571
  * scaledPresentationTimeOffset: number,
571
572
  * unscaledPresentationTimeOffset: number,
572
- * timeline: Array.<shaka.media.PresentationTimeline.TimeRange>
573
+ * timeline: Array<shaka.media.PresentationTimeline.TimeRange>
573
574
  * }}
574
575
  *
575
576
  * @description
@@ -587,7 +588,7 @@ shaka.dash.MpdUtils = class {
587
588
  * The presentation time offset of the representation, in seconds.
588
589
  * @property {number} unscaledPresentationTimeOffset
589
590
  * The presentation time offset of the representation, in timescale units.
590
- * @property {Array.<shaka.media.PresentationTimeline.TimeRange>} timeline
591
+ * @property {Array<shaka.media.PresentationTimeline.TimeRange>} timeline
591
592
  * The timeline of the representation, if given. Times in seconds.
592
593
  */
593
594
  shaka.dash.MpdUtils.SegmentInfo;
@@ -136,11 +136,11 @@ shaka.dash.SegmentBase = class {
136
136
  * @param {shaka.dash.DashParser.Context} context
137
137
  * @param {shaka.dash.DashParser.RequestSegmentCallback} requestSegment
138
138
  * @param {shaka.media.InitSegmentReference} initSegmentReference
139
- * @param {!Array.<string>} uris
139
+ * @param {!Array<string>} uris
140
140
  * @param {number} startByte
141
141
  * @param {?number} endByte
142
142
  * @param {number} scaledPresentationTimeOffset
143
- * @return {!Promise.<shaka.media.SegmentIndex>}
143
+ * @return {!Promise<shaka.media.SegmentIndex>}
144
144
  */
145
145
  static async generateSegmentIndexFromUris(
146
146
  context, requestSegment, initSegmentReference, uris, startByte,
@@ -173,7 +173,7 @@ shaka.dash.SegmentBase = class {
173
173
  const results = await Promise.all(responses);
174
174
  const indexData = results[0];
175
175
  const initData = results[1] || null;
176
- /** @type {Array.<!shaka.media.SegmentReference>} */
176
+ /** @type {Array<!shaka.media.SegmentReference>} */
177
177
  let references = null;
178
178
 
179
179
  const timestampOffset = periodStart - scaledPresentationTimeOffset;
@@ -249,7 +249,7 @@ shaka.dash.SegmentBase = class {
249
249
  * Compute the URIs of the segment index from the container.
250
250
  *
251
251
  * @param {shaka.dash.DashParser.Context} context
252
- * @return {!Array.<string>}
252
+ * @return {!Array<string>}
253
253
  * @private
254
254
  */
255
255
  static computeIndexUris_(context) {
@@ -350,7 +350,7 @@ shaka.dash.SegmentBase = class {
350
350
  * @param {shaka.dash.DashParser.RequestSegmentCallback} requestSegment
351
351
  * @param {shaka.media.InitSegmentReference} initSegmentReference
352
352
  * @param {number} scaledPresentationTimeOffset
353
- * @return {!Promise.<shaka.media.SegmentIndex>}
353
+ * @return {!Promise<shaka.media.SegmentIndex>}
354
354
  * @private
355
355
  */
356
356
  static generateSegmentIndex_(
@@ -31,7 +31,7 @@ shaka.dash.SegmentList = class {
31
31
  * Updates the existing SegmentIndex, if any.
32
32
  *
33
33
  * @param {shaka.dash.DashParser.Context} context
34
- * @param {!Object.<string, !shaka.extern.Stream>} streamMap
34
+ * @param {!Object<string, !shaka.extern.Stream>} streamMap
35
35
  * @param {shaka.extern.aesKey|undefined} aesKey
36
36
  * @return {shaka.dash.DashParser.StreamInfo}
37
37
  */
@@ -197,7 +197,7 @@ shaka.dash.SegmentList = class {
197
197
  * @param {number} periodStart in seconds.
198
198
  * @param {?number} periodDuration in seconds.
199
199
  * @param {number} startNumber
200
- * @param {function():!Array.<string>} getBaseUris
200
+ * @param {function(): !Array<string>} getBaseUris
201
201
  * @param {shaka.dash.SegmentList.SegmentListInfo} info
202
202
  * @param {shaka.media.InitSegmentReference} initSegmentReference
203
203
  * @param {shaka.extern.aesKey|undefined} aesKey
@@ -205,7 +205,7 @@ shaka.dash.SegmentList = class {
205
205
  * @param {string} codecs
206
206
  * @param {number} bandwidth
207
207
  * @param {function():string} urlParams
208
- * @return {!Array.<!shaka.media.SegmentReference>}
208
+ * @return {!Array<!shaka.media.SegmentReference>}
209
209
  * @private
210
210
  */
211
211
  static createSegmentReferences_(
@@ -227,7 +227,7 @@ shaka.dash.SegmentList = class {
227
227
  const appendWindowEnd = periodDuration ?
228
228
  periodStart + periodDuration : Infinity;
229
229
 
230
- /** @type {!Array.<!shaka.media.SegmentReference>} */
230
+ /** @type {!Array<!shaka.media.SegmentReference>} */
231
231
  const references = [];
232
232
  let prevEndTime = info.startTime;
233
233
  for (let i = 0; i < max; i++) {
@@ -287,12 +287,12 @@ shaka.dash.SegmentList = class {
287
287
  * Parses the media URIs from the context.
288
288
  *
289
289
  * @param {shaka.dash.DashParser.Context} context
290
- * @return {!Array.<shaka.dash.SegmentList.MediaSegment>}
290
+ * @return {!Array<shaka.dash.SegmentList.MediaSegment>}
291
291
  * @private
292
292
  */
293
293
  static parseMediaSegments_(context) {
294
294
  const Functional = shaka.util.Functional;
295
- /** @type {!Array.<!shaka.extern.xml.Node>} */
295
+ /** @type {!Array<!shaka.extern.xml.Node>} */
296
296
  const segmentLists = [
297
297
  context.representation.segmentList,
298
298
  context.adaptationSet.segmentList,
@@ -347,8 +347,8 @@ shaka.dash.SegmentList.MediaSegment;
347
347
  * startTime: number,
348
348
  * startNumber: number,
349
349
  * scaledPresentationTimeOffset: number,
350
- * timeline: Array.<shaka.media.PresentationTimeline.TimeRange>,
351
- * mediaSegments: !Array.<shaka.dash.SegmentList.MediaSegment>
350
+ * timeline: Array<shaka.media.PresentationTimeline.TimeRange>,
351
+ * mediaSegments: !Array<shaka.dash.SegmentList.MediaSegment>
352
352
  * }}
353
353
  * @private
354
354
  *
@@ -363,9 +363,9 @@ shaka.dash.SegmentList.MediaSegment;
363
363
  * The start number of the segments; 1 or greater.
364
364
  * @property {number} scaledPresentationTimeOffset
365
365
  * The scaledPresentationTimeOffset of the representation, in seconds.
366
- * @property {Array.<shaka.media.PresentationTimeline.TimeRange>} timeline
366
+ * @property {Array<shaka.media.PresentationTimeline.TimeRange>} timeline
367
367
  * The timeline of the representation, if given. Times in seconds.
368
- * @property {!Array.<shaka.dash.SegmentList.MediaSegment>} mediaSegments
368
+ * @property {!Array<shaka.dash.SegmentList.MediaSegment>} mediaSegments
369
369
  * The URI and byte-ranges of the media segments.
370
370
  */
371
371
  shaka.dash.SegmentList.SegmentListInfo;
@@ -33,11 +33,11 @@ shaka.dash.SegmentTemplate = class {
33
33
  *
34
34
  * @param {shaka.dash.DashParser.Context} context
35
35
  * @param {shaka.dash.DashParser.RequestSegmentCallback} requestSegment
36
- * @param {!Object.<string, !shaka.extern.Stream>} streamMap
36
+ * @param {!Object<string, !shaka.extern.Stream>} streamMap
37
37
  * @param {boolean} isUpdate True if the manifest is being updated.
38
38
  * @param {number} segmentLimit The maximum number of segments to generate for
39
39
  * a SegmentTemplate with fixed duration.
40
- * @param {!Object.<string, number>} periodDurationMap
40
+ * @param {!Object<string, number>} periodDurationMap
41
41
  * @param {shaka.extern.aesKey|undefined} aesKey
42
42
  * @param {?number} lastSegmentNumber
43
43
  * @param {boolean} isPatchUpdate
@@ -302,7 +302,7 @@ shaka.dash.SegmentTemplate = class {
302
302
  shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);
303
303
  } else if (n != 1) {
304
304
  shaka.log.warning(
305
- 'SegmentTemplate containes multiple segment information sources:',
305
+ 'SegmentTemplate contains multiple segment information sources:',
306
306
  'the SegmentTemplate should only contain an index URL template,',
307
307
  'a SegmentTimeline or a segment duration.',
308
308
  context.representation);
@@ -338,7 +338,7 @@ shaka.dash.SegmentTemplate = class {
338
338
  * @param {shaka.dash.DashParser.RequestSegmentCallback} requestSegment
339
339
  * @param {shaka.media.InitSegmentReference} init
340
340
  * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info
341
- * @return {!Promise.<shaka.media.SegmentIndex>}
341
+ * @return {!Promise<shaka.media.SegmentIndex>}
342
342
  * @private
343
343
  */
344
344
  static generateSegmentIndexFromIndexTemplate_(
@@ -366,11 +366,11 @@ shaka.dash.SegmentTemplate = class {
366
366
  * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info
367
367
  * @param {number} segmentLimit The maximum number of segments to generate.
368
368
  * @param {shaka.media.InitSegmentReference} initSegmentReference
369
- * @param {!Object.<string, number>} periodDurationMap
369
+ * @param {!Object<string, number>} periodDurationMap
370
370
  * @param {shaka.extern.aesKey|undefined} aesKey
371
371
  * @param {?number} lastSegmentNumber
372
372
  * @param {number} segmentSequenceCadence
373
- * @return {!Promise.<shaka.media.SegmentIndex>}
373
+ * @return {!Promise<shaka.media.SegmentIndex>}
374
374
  * @private
375
375
  */
376
376
  static generateSegmentIndexFromDuration_(
@@ -682,7 +682,7 @@ shaka.dash.SegmentTemplate = class {
682
682
  const getBaseUris = context.representation.getBaseUris;
683
683
  const urlParams = context.urlParams;
684
684
  const getUris = () => {
685
- goog.asserts.assert(initialization, 'Should have returned earler');
685
+ goog.asserts.assert(initialization, 'Should have returned earlier');
686
686
  const filledTemplate = MpdUtils.fillUriTemplate(
687
687
  initialization, repId, null, null, bandwidth, null);
688
688
  const resolvedUris = ManifestParserUtils.resolveUris(
@@ -711,7 +711,7 @@ shaka.dash.SegmentTemplate = class {
711
711
  *
712
712
  * @extends shaka.media.SegmentIndex
713
713
  * @implements {shaka.util.IReleasable}
714
- * @implements {Iterable.<!shaka.media.SegmentReference>}
714
+ * @implements {Iterable<!shaka.media.SegmentReference>}
715
715
  *
716
716
  * @private
717
717
  *
@@ -722,14 +722,14 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
722
722
  * @param {!shaka.dash.SegmentTemplate.SegmentTemplateInfo} templateInfo
723
723
  * @param {?string} representationId
724
724
  * @param {number} bandwidth
725
- * @param {function():Array.<string>} getBaseUris
725
+ * @param {function(): Array<string>} getBaseUris
726
726
  * @param {function():string} urlParams
727
727
  * @param {number} periodStart
728
728
  * @param {number} periodEnd
729
729
  * @param {shaka.media.InitSegmentReference} initSegmentReference
730
730
  * @param {shaka.extern.aesKey|undefined} aesKey
731
731
  * @param {number} segmentSequenceCadence
732
- */
732
+ */
733
733
  constructor(templateInfo, representationId, bandwidth, getBaseUris,
734
734
  urlParams, periodStart, periodEnd, initSegmentReference,
735
735
  aesKey, segmentSequenceCadence) {
@@ -744,7 +744,7 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
744
744
  /** @private {number} */
745
745
  this.bandwidth_ = bandwidth;
746
746
 
747
- /** @private {function():Array.<string>} */
747
+ /** @private {function(): Array<string>} */
748
748
  this.getBaseUris_ = getBaseUris;
749
749
 
750
750
  /** @private {function():string} */
@@ -1148,7 +1148,7 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
1148
1148
  /**
1149
1149
  * Fill in a specific template with values to get the segment uris
1150
1150
  *
1151
- * @return {!Array.<string>}
1151
+ * @return {!Array<string>}
1152
1152
  * @private
1153
1153
  */
1154
1154
  static createUris_(mediaTemplate, repId, segmentReplacement,
@@ -1172,7 +1172,7 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
1172
1172
  * startNumber: number,
1173
1173
  * scaledPresentationTimeOffset: number,
1174
1174
  * unscaledPresentationTimeOffset: number,
1175
- * timeline: Array.<shaka.media.PresentationTimeline.TimeRange>,
1175
+ * timeline: Array<shaka.media.PresentationTimeline.TimeRange>,
1176
1176
  * mediaTemplate: ?string,
1177
1177
  * indexTemplate: ?string,
1178
1178
  * mimeType: string,
@@ -1196,7 +1196,7 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
1196
1196
  * The presentation time offset of the representation, in seconds.
1197
1197
  * @property {number} unscaledPresentationTimeOffset
1198
1198
  * The presentation time offset of the representation, in timescale units.
1199
- * @property {Array.<shaka.media.PresentationTimeline.TimeRange>} timeline
1199
+ * @property {Array<shaka.media.PresentationTimeline.TimeRange>} timeline
1200
1200
  * The timeline of the representation, if given. Times in seconds.
1201
1201
  * @property {?string} mediaTemplate
1202
1202
  * The media URI template, if given.
package/lib/debug/log.js CHANGED
@@ -129,13 +129,13 @@ shaka.log.MAX_LOG_LEVEL = 3;
129
129
  /**
130
130
  * A Set to indicate which one-time warnings have been issued.
131
131
  *
132
- * @private {!Set.<string>}
132
+ * @private {!Set<string>}
133
133
  */
134
134
  shaka.log.oneTimeWarningIssued_ = new Set();
135
135
 
136
136
 
137
137
  if (window.console) {
138
- /** @private {!Object.<shaka.log.Level, function(...*)>} */
138
+ /** @private {!Object<shaka.log.Level, function(...*)>} */
139
139
  shaka.log.logMap_ = {
140
140
  [shaka.log.Level.ERROR]: (...args) => console.error(...args),
141
141
  [shaka.log.Level.WARNING]: (...args) => console.warn(...args),
@@ -60,11 +60,12 @@ shaka.dependencies.Allowed = {
60
60
  ISOBoxer: 'ISOBoxer',
61
61
  };
62
62
 
63
+ // eslint-disable-next-line jsdoc/require-returns
63
64
  /**
64
65
  * Contains accessor functions to shared dependencies that could be used by
65
66
  * other components. The default accessors can be overridden.
66
67
  *
67
- * @private {!Map.<shaka.dependencies.Allowed, function():?>}
68
+ * @private {!Map<shaka.dependencies.Allowed, function(): ?>}
68
69
  */
69
70
  shaka.dependencies.dependencies_ = new Map([
70
71
  [shaka.dependencies.Allowed.ISOBoxer, () => window.ISOBoxer],