shaka-player 4.3.9 → 4.4.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 (321) hide show
  1. package/.github/workflows/build-and-test.yaml +11 -18
  2. package/.github/workflows/compute-incremental-coverage.py +3 -0
  3. package/.github/workflows/release-please.yaml +7 -0
  4. package/.github/workflows/selenium-lab-tests.yaml +45 -10
  5. package/AUTHORS +9 -0
  6. package/CHANGELOG.md +295 -190
  7. package/CONTRIBUTORS +8 -0
  8. package/LICENSE +32 -0
  9. package/README.md +63 -10
  10. package/demo/autoTemplate.txt +40 -5
  11. package/demo/close_button.js +11 -0
  12. package/demo/common/asset.js +13 -1
  13. package/demo/common/assets.js +112 -28
  14. package/demo/common/message_ids.js +25 -1
  15. package/demo/config.js +69 -10
  16. package/demo/customWarning.txt +2 -2
  17. package/demo/index.html +3 -1
  18. package/demo/locales/en.json +26 -2
  19. package/demo/locales/source.json +105 -9
  20. package/demo/main.js +57 -9
  21. package/demo/search.js +3 -1
  22. package/demo/service_worker.js +3 -0
  23. package/dist/controls.css +1 -1
  24. package/dist/controls.css.map +1 -1
  25. package/dist/demo.compiled.debug.js +132 -118
  26. package/dist/demo.compiled.debug.map +3 -3
  27. package/dist/demo.compiled.js +132 -118
  28. package/dist/demo.compiled.map +3 -3
  29. package/dist/deps.js +46 -28
  30. package/dist/locales.js +31 -31
  31. package/dist/receiver.compiled.debug.js +60 -52
  32. package/dist/receiver.compiled.debug.map +3 -3
  33. package/dist/receiver.compiled.js +60 -52
  34. package/dist/receiver.compiled.map +3 -3
  35. package/dist/shaka-player.compiled.d.ts +676 -391
  36. package/dist/shaka-player.compiled.debug.d.ts +676 -391
  37. package/dist/shaka-player.compiled.debug.externs.js +1188 -616
  38. package/dist/shaka-player.compiled.debug.js +1046 -700
  39. package/dist/shaka-player.compiled.debug.map +4 -4
  40. package/dist/shaka-player.compiled.externs.js +1188 -616
  41. package/dist/shaka-player.compiled.js +1094 -933
  42. package/dist/shaka-player.compiled.map +4 -4
  43. package/dist/shaka-player.ui.d.ts +677 -392
  44. package/dist/shaka-player.ui.debug.d.ts +677 -392
  45. package/dist/shaka-player.ui.debug.externs.js +1023 -451
  46. package/dist/shaka-player.ui.debug.js +1101 -738
  47. package/dist/shaka-player.ui.debug.map +4 -4
  48. package/dist/shaka-player.ui.externs.js +1023 -451
  49. package/dist/shaka-player.ui.js +1244 -1071
  50. package/dist/shaka-player.ui.map +4 -4
  51. package/docs/tutorials/ad_monetization.md +15 -1
  52. package/docs/tutorials/application-level-redirects.md +1 -1
  53. package/docs/tutorials/config.md +9 -5
  54. package/docs/tutorials/drm-config.md +61 -0
  55. package/docs/tutorials/fairplay.md +19 -4
  56. package/docs/tutorials/license-server-auth.md +4 -4
  57. package/docs/tutorials/license-wrapping.md +2 -2
  58. package/docs/tutorials/ui-customization.md +7 -3
  59. package/docs/tutorials/ui.md +7 -7
  60. package/docs/tutorials/upgrade.md +3 -0
  61. package/externs/ima.js +123 -2
  62. package/externs/isoboxer.js +217 -0
  63. package/externs/mediakeys.js +18 -0
  64. package/externs/mux.js +1 -105
  65. package/externs/pictureinpicture.js +48 -0
  66. package/externs/shaka/ads.js +61 -1
  67. package/externs/shaka/cea.js +110 -0
  68. package/externs/shaka/codecs.js +32 -0
  69. package/externs/shaka/manifest.js +101 -1
  70. package/externs/shaka/manifest_parser.js +0 -10
  71. package/externs/shaka/net.js +36 -7
  72. package/externs/shaka/offline.js +8 -1
  73. package/externs/shaka/player.js +220 -21
  74. package/externs/shaka/text.js +1 -382
  75. package/externs/shaka/transmuxer.js +59 -0
  76. package/karma.conf.js +15 -0
  77. package/lib/abr/simple_abr_manager.js +6 -3
  78. package/lib/ads/ad_manager.js +60 -2
  79. package/lib/ads/client_side_ad.js +86 -0
  80. package/lib/ads/client_side_ad_manager.js +93 -5
  81. package/lib/ads/server_side_ad.js +86 -0
  82. package/lib/ads/server_side_ad_manager.js +13 -0
  83. package/lib/cast/cast_utils.js +1 -0
  84. package/lib/cea/cea608_data_channel.js +24 -14
  85. package/lib/cea/cea608_memory.js +5 -2
  86. package/lib/cea/cea708_service.js +8 -9
  87. package/lib/cea/cea708_window.js +1 -2
  88. package/lib/cea/cea_decoder.js +23 -6
  89. package/lib/cea/cea_utils.js +25 -2
  90. package/lib/cea/dummy_caption_decoder.js +21 -0
  91. package/lib/cea/dummy_cea_parser.js +1 -3
  92. package/lib/cea/mp4_cea_parser.js +15 -10
  93. package/lib/cea/ts_cea_parser.js +69 -0
  94. package/lib/dash/content_protection.js +32 -2
  95. package/lib/dash/dash_parser.js +93 -31
  96. package/lib/dash/mpd_utils.js +6 -25
  97. package/lib/dash/segment_base.js +12 -14
  98. package/lib/dash/segment_list.js +10 -6
  99. package/lib/dash/segment_template.js +349 -32
  100. package/lib/dependencies/all.js +8 -0
  101. package/lib/hls/hls_classes.js +33 -8
  102. package/lib/hls/hls_parser.js +805 -191
  103. package/lib/hls/manifest_text_parser.js +4 -14
  104. package/lib/media/adaptation_set_criteria.js +43 -3
  105. package/lib/media/closed_caption_parser.js +74 -12
  106. package/lib/media/drm_engine.js +189 -49
  107. package/lib/media/gap_jumping_controller.js +1 -1
  108. package/lib/media/manifest_parser.js +34 -0
  109. package/lib/media/media_source_capabilities.js +10 -0
  110. package/lib/media/media_source_engine.js +475 -231
  111. package/lib/media/playhead.js +1 -1
  112. package/lib/media/presentation_timeline.js +62 -0
  113. package/lib/media/segment_index.js +50 -14
  114. package/lib/media/segment_prefetch.js +277 -0
  115. package/lib/media/segment_reference.js +70 -4
  116. package/lib/media/streaming_engine.js +258 -81
  117. package/lib/media/video_wrapper.js +15 -7
  118. package/lib/mss/content_protection.js +353 -0
  119. package/lib/mss/mss_parser.js +1081 -0
  120. package/lib/net/networking_engine.js +60 -10
  121. package/lib/offline/indexeddb/v1_storage_cell.js +1 -0
  122. package/lib/offline/indexeddb/v2_storage_cell.js +1 -0
  123. package/lib/offline/manifest_converter.js +6 -0
  124. package/lib/offline/storage.js +2 -4
  125. package/lib/player.js +309 -105
  126. package/lib/polyfill/media_capabilities.js +43 -3
  127. package/lib/polyfill/patchedmediakeys_apple.js +5 -0
  128. package/lib/polyfill/patchedmediakeys_nop.js +5 -0
  129. package/lib/polyfill/patchedmediakeys_webkit.js +5 -0
  130. package/lib/text/cue.js +208 -130
  131. package/lib/text/lrc_text_parser.js +2 -2
  132. package/lib/text/mp4_vtt_parser.js +2 -2
  133. package/lib/text/sbv_text_parser.js +1 -1
  134. package/lib/text/simple_text_displayer.js +2 -1
  135. package/lib/text/srt_text_parser.js +9 -1
  136. package/lib/text/ssa_text_parser.js +2 -2
  137. package/lib/text/text_engine.js +3 -21
  138. package/lib/text/text_utils.js +71 -20
  139. package/lib/text/ui_text_displayer.js +14 -14
  140. package/lib/text/vtt_text_parser.js +22 -14
  141. package/lib/transmuxer/aac_transmuxer.js +224 -0
  142. package/lib/transmuxer/ac3.js +142 -0
  143. package/lib/transmuxer/ac3_transmuxer.js +212 -0
  144. package/lib/transmuxer/adts.js +232 -0
  145. package/lib/transmuxer/ec3.js +103 -0
  146. package/lib/transmuxer/ec3_transmuxer.js +212 -0
  147. package/lib/transmuxer/h264.js +324 -0
  148. package/lib/transmuxer/mp3_transmuxer.js +204 -0
  149. package/lib/transmuxer/mpeg_audio.js +196 -0
  150. package/lib/transmuxer/mpeg_ts_transmuxer.js +182 -0
  151. package/lib/transmuxer/mss_transmuxer.js +389 -0
  152. package/lib/{media/transmuxer.js → transmuxer/muxjs_transmuxer.js} +34 -80
  153. package/lib/transmuxer/transmuxer_engine.js +161 -0
  154. package/lib/transmuxer/ts_transmuxer.js +738 -0
  155. package/lib/util/cmcd_manager.js +131 -71
  156. package/lib/util/error.js +62 -26
  157. package/lib/util/exp_golomb.js +220 -0
  158. package/lib/util/fairplay_utils.js +64 -13
  159. package/lib/util/id3_utils.js +56 -3
  160. package/lib/util/language_utils.js +11 -8
  161. package/lib/util/manifest_parser_utils.js +3 -0
  162. package/lib/util/mime_utils.js +44 -7
  163. package/lib/util/mp4_box_parsers.js +233 -5
  164. package/lib/util/mp4_generator.js +1381 -0
  165. package/lib/util/periods.js +40 -34
  166. package/lib/util/platform.js +25 -3
  167. package/lib/util/player_configuration.js +38 -1
  168. package/lib/util/stream_utils.js +138 -27
  169. package/lib/util/text_parser.js +1 -1
  170. package/lib/util/ts_parser.js +470 -47
  171. package/lib/util/xml_utils.js +16 -3
  172. package/maintained-branches.md +2 -2
  173. package/package.json +4 -2
  174. package/roadmap.md +21 -6
  175. package/shaka-player.uncompiled.js +18 -0
  176. package/test/abr/simple_abr_manager_unit.js +32 -4
  177. package/test/ads/ad_manager_unit.js +18 -2
  178. package/test/cast/cast_utils_unit.js +7 -2
  179. package/test/cea/cea608_memory_unit.js +24 -0
  180. package/test/cea/cea_decoder_unit.js +33 -0
  181. package/test/dash/dash_parser_content_protection_unit.js +93 -3
  182. package/test/dash/dash_parser_live_unit.js +56 -13
  183. package/test/dash/dash_parser_manifest_unit.js +70 -2
  184. package/test/dash/dash_parser_segment_base_unit.js +14 -9
  185. package/test/dash/dash_parser_segment_template_unit.js +286 -6
  186. package/test/demo/demo_unit.js +5 -1
  187. package/test/hls/hls_live_unit.js +188 -28
  188. package/test/hls/hls_parser_unit.js +250 -109
  189. package/test/hls/manifest_text_parser_unit.js +18 -13
  190. package/test/media/adaptation_set_criteria_unit.js +46 -14
  191. package/test/media/adaptation_set_unit.js +2 -0
  192. package/test/media/drm_engine_integration.js +11 -8
  193. package/test/media/drm_engine_unit.js +220 -7
  194. package/test/media/media_source_engine_integration.js +122 -38
  195. package/test/media/media_source_engine_unit.js +133 -153
  196. package/test/media/playhead_unit.js +3 -0
  197. package/test/media/presentation_timeline_unit.js +51 -0
  198. package/test/media/segment_index_unit.js +52 -0
  199. package/test/media/segment_prefetch_unit.js +243 -0
  200. package/test/media/streaming_engine_integration.js +9 -3
  201. package/test/media/streaming_engine_unit.js +440 -59
  202. package/test/mss/mss_parser_content_protection_unit.js +49 -0
  203. package/test/mss/mss_parser_unit.js +472 -0
  204. package/test/mss/mss_player_integration.js +123 -0
  205. package/test/offline/manifest_convert_unit.js +9 -0
  206. package/test/offline/storage_integration.js +6 -1
  207. package/test/player_integration.js +4 -1
  208. package/test/player_unit.js +386 -133
  209. package/test/polyfill/media_capabilities_unit.js +18 -0
  210. package/test/test/assets/hls-raw-aac/fileSequence0.aac +0 -0
  211. package/test/test/assets/hls-raw-aac/fileSequence1.aac +0 -0
  212. package/test/test/assets/hls-raw-aac/fileSequence2.aac +0 -0
  213. package/test/test/assets/hls-raw-aac/fileSequence3.aac +0 -0
  214. package/test/test/assets/hls-raw-aac/manifest.m3u8 +4 -0
  215. package/test/test/assets/hls-raw-aac/stream.m4a.m3u8 +14 -0
  216. package/test/test/assets/hls-raw-ac3/fileSequence0.ac3 +0 -0
  217. package/test/test/assets/hls-raw-ac3/fileSequence1.ac3 +0 -0
  218. package/test/test/assets/hls-raw-ac3/fileSequence2.ac3 +0 -0
  219. package/test/test/assets/hls-raw-ac3/fileSequence3.ac3 +0 -0
  220. package/test/test/assets/hls-raw-ac3/fileSequence4.ac3 +0 -0
  221. package/test/test/assets/hls-raw-ac3/fileSequence5.ac3 +0 -0
  222. package/test/test/assets/hls-raw-ac3/fileSequence6.ac3 +0 -0
  223. package/test/test/assets/hls-raw-ac3/fileSequence7.ac3 +0 -0
  224. package/test/test/assets/hls-raw-ac3/prog_index.m3u8 +31 -0
  225. package/test/test/assets/hls-raw-ec3/fileSequence0.ec3 +0 -0
  226. package/test/test/assets/hls-raw-ec3/fileSequence1.ec3 +0 -0
  227. package/test/test/assets/hls-raw-ec3/fileSequence2.ec3 +0 -0
  228. package/test/test/assets/hls-raw-ec3/fileSequence3.ec3 +0 -0
  229. package/test/test/assets/hls-raw-ec3/fileSequence4.ec3 +0 -0
  230. package/test/test/assets/hls-raw-ec3/fileSequence5.ec3 +0 -0
  231. package/test/test/assets/hls-raw-ec3/fileSequence6.ec3 +0 -0
  232. package/test/test/assets/hls-raw-ec3/fileSequence7.ec3 +0 -0
  233. package/test/test/assets/hls-raw-ec3/prog_index.m3u8 +31 -0
  234. package/test/test/assets/hls-raw-mp3/chunklist_w905519204.m3u8 +13 -0
  235. package/test/test/assets/hls-raw-mp3/media_w905519204_0.mp3 +0 -0
  236. package/test/test/assets/hls-raw-mp3/media_w905519204_1.mp3 +0 -0
  237. package/test/test/assets/hls-raw-mp3/media_w905519204_2.mp3 +0 -0
  238. package/test/test/assets/hls-raw-mp3/media_w905519204_3.mp3 +0 -0
  239. package/test/test/assets/hls-raw-mp3/playlist.m3u8 +4 -0
  240. package/test/test/assets/hls-ts-aac/playlist.m3u8 +23 -0
  241. package/test/test/assets/hls-ts-aac/segment_0.ts +0 -0
  242. package/test/test/assets/hls-ts-aac/segment_1.ts +0 -0
  243. package/test/test/assets/hls-ts-aac/segment_2.ts +0 -0
  244. package/test/test/assets/hls-ts-aac/segment_3.ts +0 -0
  245. package/test/test/assets/hls-ts-aac/segment_4.ts +0 -0
  246. package/test/test/assets/hls-ts-aac/segment_5.ts +0 -0
  247. package/test/test/assets/hls-ts-aac/segment_6.ts +0 -0
  248. package/test/test/assets/hls-ts-aac/segment_7.ts +0 -0
  249. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0000.ts +0 -0
  250. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0001.ts +0 -0
  251. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0002.ts +0 -0
  252. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0003.ts +0 -0
  253. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0004.ts +0 -0
  254. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0005.ts +0 -0
  255. package/test/test/assets/hls-ts-ac3/prog_index.m3u8 +19 -0
  256. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0000.ts +0 -0
  257. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0001.ts +0 -0
  258. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0002.ts +0 -0
  259. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0003.ts +0 -0
  260. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0004.ts +0 -0
  261. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0005.ts +0 -0
  262. package/test/test/assets/hls-ts-ec3/prog_index.m3u8 +19 -0
  263. package/test/test/assets/hls-ts-h264/fileSequence0.ts +0 -0
  264. package/test/test/assets/hls-ts-h264/fileSequence1.ts +0 -0
  265. package/test/test/assets/hls-ts-h264/fileSequence2.ts +0 -0
  266. package/test/test/assets/hls-ts-h264/fileSequence3.ts +0 -0
  267. package/test/test/assets/hls-ts-h264/fileSequence4.ts +0 -0
  268. package/test/test/assets/hls-ts-h264/fileSequence5.ts +0 -0
  269. package/test/test/assets/hls-ts-h264/prog_index.m3u8 +25 -0
  270. package/test/test/assets/hls-ts-mp3/manifest.m3u8 +13 -0
  271. package/test/test/assets/hls-ts-mp3/media_w239891843_0.ts +0 -0
  272. package/test/test/assets/hls-ts-mp3/media_w239891843_1.ts +0 -0
  273. package/test/test/assets/hls-ts-mp3/media_w239891843_2.ts +0 -0
  274. package/test/test/assets/hls-ts-mp3/media_w239891843_3.ts +0 -0
  275. package/test/test/assets/hls-ts-muxed-aac-h264/chunk.m3u8 +17 -0
  276. package/test/test/assets/hls-ts-muxed-aac-h264/n_0_0_0.ts +0 -0
  277. package/test/test/assets/hls-ts-muxed-aac-h264/n_1_0_0.ts +0 -0
  278. package/test/test/assets/hls-ts-muxed-aac-h264/n_2_0_0.ts +0 -0
  279. package/test/test/assets/hls-ts-muxed-aac-h264/n_3_0_0.ts +0 -0
  280. package/test/test/assets/hls-ts-muxed-aac-h264/n_4_0_0.ts +0 -0
  281. package/test/test/assets/hls-ts-muxed-aac-h264/n_5_0_0.ts +0 -0
  282. package/test/test/assets/hls-ts-muxed-aac-h264/playlist.m3u8 +4 -0
  283. package/test/test/boot.js +7 -2
  284. package/test/test/util/fake_ad.js +99 -0
  285. package/test/test/util/fake_ad_manager.js +7 -1
  286. package/test/test/util/fake_networking_engine.js +41 -14
  287. package/test/test/util/fake_segment_prefetch.js +81 -0
  288. package/test/test/util/manifest_generator.js +19 -5
  289. package/test/test/util/mss_parser_util.js +115 -0
  290. package/test/test/util/offline_utils.js +1 -0
  291. package/test/test/util/simple_fakes.js +12 -3
  292. package/test/test/util/streaming_engine_util.js +14 -4
  293. package/test/test/util/ttml_utils.js +2 -2
  294. package/test/test/util/ui_utils.js +5 -1
  295. package/test/text/cue_integration.js +1 -1
  296. package/test/text/srt_text_parser_unit.js +78 -0
  297. package/test/text/text_engine_unit.js +17 -8
  298. package/test/text/ui_text_displayer_unit.js +4 -4
  299. package/test/text/vtt_text_parser_unit.js +59 -40
  300. package/test/text/web_vtt_generator_unit.js +9 -3
  301. package/test/{media/transmuxer_integration.js → transmuxer/muxjs_transmuxer_integration.js} +30 -33
  302. package/test/transmuxer/transmuxer_engine_integration.js +60 -0
  303. package/test/transmuxer/transmuxer_integration.js +296 -0
  304. package/test/util/cmcd_manager_unit.js +162 -13
  305. package/test/util/language_utils_unit.js +9 -2
  306. package/test/util/mp4_box_parsers_unit.js +39 -4
  307. package/test/util/periods_unit.js +34 -26
  308. package/test/util/stream_utils_unit.js +60 -107
  309. package/ui/controls.js +19 -1
  310. package/ui/controls.less +1 -0
  311. package/ui/externs/ui.js +13 -3
  312. package/ui/language_utils.js +15 -0
  313. package/ui/less/thumbnails.less +26 -0
  314. package/ui/locales/oc.json +42 -0
  315. package/ui/pip_button.js +83 -2
  316. package/ui/range_element.js +15 -0
  317. package/ui/resolution_selection.js +9 -2
  318. package/ui/seek_bar.js +230 -1
  319. package/ui/ui.js +5 -0
  320. package/lib/cea/i_caption_decoder.js +0 -51
  321. package/lib/cea/i_cea_parser.js +0 -68
@@ -20,6 +20,8 @@ shaka.ads = {};
20
20
  /** @const */
21
21
  shaka.cast = {};
22
22
  /** @const */
23
+ shaka.cea = {};
24
+ /** @const */
23
25
  shaka.config = {};
24
26
  /** @const */
25
27
  shaka.dash = {};
@@ -30,12 +32,18 @@ shaka.lcevc = {};
30
32
  /** @const */
31
33
  shaka.media = {};
32
34
  /** @const */
35
+ shaka.media.SegmentPrefetch = {};
36
+ /** @const */
37
+ shaka.mss = {};
38
+ /** @const */
33
39
  shaka.net = {};
34
40
  /** @const */
35
41
  shaka.offline = {};
36
42
  /** @const */
37
43
  shaka.text = {};
38
44
  /** @const */
45
+ shaka.transmuxer = {};
46
+ /** @const */
39
47
  shaka.util = {};
40
48
  /** @const */
41
49
  shaka.util.CmcdManager = {};
@@ -53,7 +61,95 @@ shaka.util.IReleasable = class {
53
61
  release() {}
54
62
  };
55
63
  /**
56
- * @implements {shaka.extern.Cue}
64
+ * @summary A set of BufferSource utility functions.
65
+ */
66
+ shaka.util.BufferUtils = class {
67
+ /**
68
+ * Compare two buffers for equality. For buffers of different types, this
69
+ * compares the underlying buffers as binary data.
70
+ * @param {?BufferSource} arr1
71
+ * @param {?BufferSource} arr2
72
+ * @return {boolean}
73
+ * @suppress {strictMissingProperties}
74
+ */
75
+ static equal(arr1, arr2) {}
76
+ /**
77
+ * Gets an ArrayBuffer that contains the data from the given TypedArray. Note
78
+ * this will allocate a new ArrayBuffer if the object is a partial view of
79
+ * the data.
80
+ * @param {!BufferSource} view
81
+ * @return {!ArrayBuffer}
82
+ */
83
+ static toArrayBuffer(view) {}
84
+ /**
85
+ * Creates a new Uint8Array view on the same buffer. This clamps the values
86
+ * to be within the same view (i.e. you can't use this to move past the end
87
+ * of the view, even if the underlying buffer is larger). However, you can
88
+ * pass a negative offset to access the data before the view.
89
+ * @param {BufferSource} data
90
+ * @param {number=} offset The offset from the beginning of this data's view
91
+ * to start the new view at.
92
+ * @param {number=} length The byte length of the new view.
93
+ * @return {!Uint8Array}
94
+ */
95
+ static toUint8(data, offset, length) {}
96
+ /**
97
+ * Creates a DataView over the given buffer.
98
+ * @see toUint8
99
+ * @param {BufferSource} buffer
100
+ * @param {number=} offset
101
+ * @param {number=} length
102
+ * @return {!DataView}
103
+ */
104
+ static toDataView(buffer, offset, length) {}
105
+ };
106
+ /**
107
+ * The IClosedCaptionParser defines the interface to provide all operations for
108
+ * parsing the closed captions embedded in Dash videos streams.
109
+ * TODO: Remove this interface and move method definitions
110
+ * directly to ClosedCaptonParser.
111
+ * @interface
112
+ */
113
+ shaka.media.IClosedCaptionParser = class {
114
+ };
115
+ /**
116
+ * Closed Caption Parser provides all operations for parsing the closed captions
117
+ * embedded in Dash videos streams.
118
+ * @implements {shaka.media.IClosedCaptionParser}
119
+ * @final
120
+ */
121
+ shaka.media.ClosedCaptionParser = class {
122
+ /**
123
+ * @param {string} mimeType
124
+ */
125
+ constructor(mimeType) {}
126
+ /**
127
+ * @param {string} mimeType
128
+ * @param {!shaka.extern.CeaParserPlugin} plugin
129
+ */
130
+ static registerParser(mimeType, plugin) {}
131
+ /**
132
+ * @param {string} mimeType
133
+ */
134
+ static unregisterParser(mimeType) {}
135
+ /**
136
+ * @param {string} mimeType
137
+ * @return {?shaka.extern.CeaParserPlugin}
138
+ */
139
+ static findParser(mimeType) {}
140
+ /**
141
+ * @param {!shaka.extern.CaptionDecoderPlugin} plugin
142
+ */
143
+ static registerDecoder(plugin) {}
144
+ /**
145
+ */
146
+ static unregisterDecoder() {}
147
+ /**
148
+ * @return {?shaka.extern.CaptionDecoderPlugin}
149
+ */
150
+ static findDecoder() {}
151
+ };
152
+ /**
57
153
  */
58
154
  shaka.text.Cue = class {
59
155
  /**
@@ -62,153 +158,21 @@ shaka.text.Cue = class {
62
158
  * @param {string} payload
63
159
  */
64
160
  constructor(startTime, endTime, payload) {}
161
+ /**
162
+ * Create a copy of the cue with the same properties.
163
+ * @return {!shaka.text.Cue}
164
+ * @suppress {checkTypes} since we must use [] and "in" with a struct type.
165
+ */
166
+ clone() {}
167
+ /**
168
+ * Check if two Cues have all the same values in all properties.
169
+ * @param {!shaka.text.Cue} cue1
170
+ * @param {!shaka.text.Cue} cue2
171
+ * @return {boolean}
172
+ * @suppress {checkTypes} since we must use [] and "in" with a struct type.
173
+ */
174
+ static equal(cue1, cue2) {}
65
175
  };
66
- /**
67
- * @override
68
- */
69
- shaka.text.Cue.prototype.startTime;
70
- /**
71
- * @override
72
- */
73
- shaka.text.Cue.prototype.direction;
74
- /**
75
- * @override
76
- */
77
- shaka.text.Cue.prototype.endTime;
78
- /**
79
- * @override
80
- */
81
- shaka.text.Cue.prototype.payload;
82
- /**
83
- * @override
84
- */
85
- shaka.text.Cue.prototype.region;
86
- /**
87
- * @override
88
- */
89
- shaka.text.Cue.prototype.position;
90
- /**
91
- * @override
92
- */
93
- shaka.text.Cue.prototype.positionAlign;
94
- /**
95
- * @override
96
- */
97
- shaka.text.Cue.prototype.size;
98
- /**
99
- * @override
100
- */
101
- shaka.text.Cue.prototype.textAlign;
102
- /**
103
- * @override
104
- */
105
- shaka.text.Cue.prototype.writingMode;
106
- /**
107
- * @override
108
- */
109
- shaka.text.Cue.prototype.lineInterpretation;
110
- /**
111
- * @override
112
- */
113
- shaka.text.Cue.prototype.line;
114
- /**
115
- * @override
116
- */
117
- shaka.text.Cue.prototype.lineHeight;
118
- /**
119
- * Line Alignment is set to start by default.
120
- * @override
121
- */
122
- shaka.text.Cue.prototype.lineAlign;
123
- /**
124
- * Set the captions at the bottom of the text container by default.
125
- * @override
126
- */
127
- shaka.text.Cue.prototype.displayAlign;
128
- /**
129
- * @override
130
- */
131
- shaka.text.Cue.prototype.color;
132
- /**
133
- * @override
134
- */
135
- shaka.text.Cue.prototype.backgroundColor;
136
- /**
137
- * @override
138
- */
139
- shaka.text.Cue.prototype.backgroundImage;
140
- /**
141
- * @override
142
- */
143
- shaka.text.Cue.prototype.border;
144
- /**
145
- * @override
146
- */
147
- shaka.text.Cue.prototype.textShadow;
148
- /**
149
- * @override
150
- */
151
- shaka.text.Cue.prototype.textStrokeColor;
152
- /**
153
- * @override
154
- */
155
- shaka.text.Cue.prototype.textStrokeWidth;
156
- /**
157
- * @override
158
- */
159
- shaka.text.Cue.prototype.fontSize;
160
- /**
161
- * @override
162
- */
163
- shaka.text.Cue.prototype.fontWeight;
164
- /**
165
- * @override
166
- */
167
- shaka.text.Cue.prototype.fontStyle;
168
- /**
169
- * @override
170
- */
171
- shaka.text.Cue.prototype.fontFamily;
172
- /**
173
- * @override
174
- */
175
- shaka.text.Cue.prototype.letterSpacing;
176
- /**
177
- * @override
178
- */
179
- shaka.text.Cue.prototype.linePadding;
180
- /**
181
- * @override
182
- */
183
- shaka.text.Cue.prototype.opacity;
184
- /**
185
- * @override
186
- */
187
- shaka.text.Cue.prototype.textDecoration;
188
- /**
189
- * @override
190
- */
191
- shaka.text.Cue.prototype.wrapLine;
192
- /**
193
- * @override
194
- */
195
- shaka.text.Cue.prototype.id;
196
- /**
197
- * @override
198
- */
199
- shaka.text.Cue.prototype.nestedCues;
200
- /**
201
- * @override
202
- */
203
- shaka.text.Cue.prototype.isContainer;
204
- /**
205
- * @override
206
- */
207
- shaka.text.Cue.prototype.lineBreak;
208
- /**
209
- * @override
210
- */
211
- shaka.text.Cue.prototype.cellResolution;
212
176
  /**
213
177
  * @enum {string}
214
178
  */
@@ -275,14 +239,14 @@ shaka.text.Cue.lineAlign = {
275
239
  * @enum {string}
276
240
  */
277
241
  shaka.text.Cue.defaultTextColor = {
278
- 'white': '#FFF',
279
- 'lime': '#0F0',
280
- 'cyan': '#0FF',
281
- 'red': '#F00',
282
- 'yellow': '#FF0',
283
- 'magenta': '#F0F',
284
- 'blue': '#00F',
285
- 'black': '#000'
242
+ 'white': 'white',
243
+ 'lime': 'lime',
244
+ 'cyan': 'cyan',
245
+ 'red': 'red',
246
+ 'yellow': 'yellow',
247
+ 'magenta': 'magenta',
248
+ 'blue': 'blue',
249
+ 'black': 'black'
286
250
  };
287
251
  /**
288
252
  * Default text background color according to
@@ -290,14 +254,14 @@ shaka.text.Cue.defaultTextColor = {
290
254
  * @enum {string}
291
255
  */
292
256
  shaka.text.Cue.defaultTextBackgroundColor = {
293
- 'bg_white': '#FFF',
294
- 'bg_lime': '#0F0',
295
- 'bg_cyan': '#0FF',
296
- 'bg_red': '#F00',
297
- 'bg_yellow': '#FF0',
298
- 'bg_magenta': '#F0F',
299
- 'bg_blue': '#00F',
300
- 'bg_black': '#000'
257
+ 'bg_white': 'white',
258
+ 'bg_lime': 'lime',
259
+ 'bg_cyan': 'cyan',
260
+ 'bg_red': 'red',
261
+ 'bg_yellow': 'yellow',
262
+ 'bg_magenta': 'magenta',
263
+ 'bg_blue': 'blue',
264
+ 'bg_black': 'black'
301
265
  };
302
266
  /**
303
267
  * In CSS font weight can be a number, where 400 is normal and 700 is bold.
@@ -325,57 +289,11 @@ shaka.text.Cue.textDecoration = {
325
289
  'OVERLINE': 'overline'
326
290
  };
327
291
  /**
328
- * @implements {shaka.extern.CueRegion}
329
- * @struct
330
292
  */
331
293
  shaka.text.CueRegion = class {
332
294
  /** */
333
295
  constructor() {}
334
296
  };
335
- /**
336
- * @override
337
- */
338
- shaka.text.CueRegion.prototype.id;
339
- /**
340
- * @override
341
- */
342
- shaka.text.CueRegion.prototype.viewportAnchorX;
343
- /**
344
- * @override
345
- */
346
- shaka.text.CueRegion.prototype.viewportAnchorY;
347
- /**
348
- * @override
349
- */
350
- shaka.text.CueRegion.prototype.regionAnchorX;
351
- /**
352
- * @override
353
- */
354
- shaka.text.CueRegion.prototype.regionAnchorY;
355
- /**
356
- * @override
357
- */
358
- shaka.text.CueRegion.prototype.width;
359
- /**
360
- * @override
361
- */
362
- shaka.text.CueRegion.prototype.height;
363
- /**
364
- * @override
365
- */
366
- shaka.text.CueRegion.prototype.heightUnits;
367
- /**
368
- * @override
369
- */
370
- shaka.text.CueRegion.prototype.widthUnits;
371
- /**
372
- * @override
373
- */
374
- shaka.text.CueRegion.prototype.viewportAnchorUnits;
375
- /**
376
- * @override
377
- */
378
- shaka.text.CueRegion.prototype.scroll;
379
297
  /**
380
298
  * @enum {number}
381
299
  */
@@ -392,60 +310,56 @@ shaka.text.CueRegion.scrollMode = {
392
310
  'UP': 'up'
393
311
  };
394
312
  /**
395
- * @summary A set of BufferSource utility functions.
313
+ * An interface to standardize how objects are destroyed.
314
+ * @interface
396
315
  */
397
- shaka.util.BufferUtils = class {
316
+ shaka.util.IDestroyable = class {
398
317
  /**
399
- * Compare two buffers for equality. For buffers of different types, this
400
- * compares the underlying buffers as binary data.
401
- * @param {?BufferSource} arr1
402
- * @param {?BufferSource} arr2
403
- * @return {boolean}
404
- * @suppress {strictMissingProperties}
318
+ * Request that this object be destroyed, releasing all resources and shutting
319
+ * down all operations. Returns a Promise which is resolved when destruction
320
+ * is complete. This Promise should never be rejected.
321
+ * @return {!Promise}
405
322
  */
406
- static equal(arr1, arr2) {}
323
+ destroy() {}
324
+ };
325
+ /**
326
+ * @summary Manages transmuxer plugins.
327
+ * @implements {shaka.util.IDestroyable}
328
+ */
329
+ shaka.transmuxer.TransmuxerEngine = class {
407
330
  /**
408
- * Gets an ArrayBuffer that contains the data from the given TypedArray. Note
409
- * this will allocate a new ArrayBuffer if the object is a partial view of
410
- * the data.
411
- * @param {!BufferSource} view
412
- * @return {!ArrayBuffer}
331
+ * @override
413
332
  */
414
- static toArrayBuffer(view) {}
333
+ destroy() {}
415
334
  /**
416
- * Creates a new Uint8Array view on the same buffer. This clamps the values
417
- * to be within the same view (i.e. you can't use this to move past the end
418
- * of the view, even if the underlying buffer is larger). However, you can
419
- * pass a negative offset to access the data before the view.
420
- * @param {BufferSource} data
421
- * @param {number=} offset The offset from the beginning of this data's view
422
- * to start the new view at.
423
- * @param {number=} length The byte length of the new view.
424
- * @return {!Uint8Array}
335
+ * @param {string} mimeType
336
+ * @param {!shaka.extern.TransmuxerPlugin} plugin
337
+ * @param {number} priority
425
338
  */
426
- static toUint8(data, offset, length) {}
339
+ static registerTransmuxer(mimeType, plugin, priority) {}
427
340
  /**
428
- * Creates a DataView over the given buffer.
429
- * @see toUint8
430
- * @param {BufferSource} buffer
431
- * @param {number=} offset
432
- * @param {number=} length
433
- * @return {!DataView}
341
+ * @param {string} mimeType
342
+ * @param {number} priority
434
343
  */
435
- static toDataView(buffer, offset, length) {}
344
+ static unregisterTransmuxer(mimeType, priority) {}
345
+ /**
346
+ * @param {string} mimeType
347
+ * @param {string=} contentType
348
+ * @return {?shaka.extern.TransmuxerPlugin}
349
+ */
350
+ static findTransmuxer(mimeType, contentType) {}
436
351
  };
437
352
  /**
438
- * An interface to standardize how objects are destroyed.
439
- * @interface
353
+ * Priority level for transmuxer plugins.
354
+ * If multiple plugins are provided for the same mime type, only the
355
+ * highest-priority one is used.
356
+ * @enum {number}
440
357
  */
441
- shaka.util.IDestroyable = class {
442
- /**
443
- * Request that this object be destroyed, releasing all resources and shutting
444
- * down all operations. Returns a Promise which is resolved when destruction
445
- * is complete. This Promise should never be rejected.
446
- * @return {!Promise}
447
- */
448
- destroy() {}
358
+ shaka.transmuxer.TransmuxerEngine.PluginPriority = {
359
+ 'FALLBACK': 1,
360
+ 'PREFERRED_SECONDARY': 2,
361
+ 'PREFERRED': 3,
362
+ 'APPLICATION': 4
449
363
  };
450
364
  /**
451
365
  * @summary
@@ -504,307 +418,160 @@ shaka.util.Error.Severity = {
504
418
  /**
505
419
  * @enum {number}
506
420
  */
507
- shaka.util.Error.Category = {
508
- 'NETWORK': 1,
509
- 'TEXT': 2,
510
- 'MEDIA': 3,
511
- 'MANIFEST': 4,
512
- 'STREAMING': 5,
513
- 'DRM': 6,
514
- 'PLAYER': 7,
515
- 'CAST': 8,
516
- 'STORAGE': 9,
517
- 'ADS': 10
518
- };
519
- /**
520
- * @enum {number}
521
- */
522
- shaka.util.Error.Code = {
523
- 'UNSUPPORTED_SCHEME': 1000,
524
- 'BAD_HTTP_STATUS': 1001,
525
- 'HTTP_ERROR': 1002,
526
- 'TIMEOUT': 1003,
527
- 'MALFORMED_DATA_URI': 1004,
528
- 'REQUEST_FILTER_ERROR': 1006,
529
- 'RESPONSE_FILTER_ERROR': 1007,
530
- 'MALFORMED_TEST_URI': 1008,
531
- 'UNEXPECTED_TEST_REQUEST': 1009,
532
- 'ATTEMPTS_EXHAUSTED': 1010,
533
- 'SEGMENT_MISSING': 1011,
534
- 'INVALID_TEXT_HEADER': 2000,
535
- 'INVALID_TEXT_CUE': 2001,
536
- 'UNABLE_TO_DETECT_ENCODING': 2003,
537
- 'BAD_ENCODING': 2004,
538
- 'INVALID_XML': 2005,
539
- 'INVALID_MP4_TTML': 2007,
540
- 'INVALID_MP4_VTT': 2008,
541
- 'UNABLE_TO_EXTRACT_CUE_START_TIME': 2009,
542
- 'INVALID_MP4_CEA': 2010,
543
- 'TEXT_COULD_NOT_GUESS_MIME_TYPE': 2011,
544
- 'CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS': 2012,
545
- 'TEXT_ONLY_WEBVTT_SRC_EQUALS': 2013,
546
- 'MISSING_TEXT_PLUGIN': 2014,
547
- 'CHAPTERS_TRACK_FAILED': 2015,
548
- 'CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_SRC_EQUALS': 2016,
549
- 'UNSUPPORTED_EXTERNAL_THUMBNAILS_URI': 2017,
550
- 'BUFFER_READ_OUT_OF_BOUNDS': 3000,
551
- 'JS_INTEGER_OVERFLOW': 3001,
552
- 'EBML_OVERFLOW': 3002,
553
- 'EBML_BAD_FLOATING_POINT_SIZE': 3003,
554
- 'MP4_SIDX_WRONG_BOX_TYPE': 3004,
555
- 'MP4_SIDX_INVALID_TIMESCALE': 3005,
556
- 'MP4_SIDX_TYPE_NOT_SUPPORTED': 3006,
557
- 'WEBM_CUES_ELEMENT_MISSING': 3007,
558
- 'WEBM_EBML_HEADER_ELEMENT_MISSING': 3008,
559
- 'WEBM_SEGMENT_ELEMENT_MISSING': 3009,
560
- 'WEBM_INFO_ELEMENT_MISSING': 3010,
561
- 'WEBM_DURATION_ELEMENT_MISSING': 3011,
562
- 'WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING': 3012,
563
- 'WEBM_CUE_TIME_ELEMENT_MISSING': 3013,
564
- 'MEDIA_SOURCE_OPERATION_FAILED': 3014,
565
- 'MEDIA_SOURCE_OPERATION_THREW': 3015,
566
- 'VIDEO_ERROR': 3016,
567
- 'QUOTA_EXCEEDED_ERROR': 3017,
568
- 'TRANSMUXING_FAILED': 3018,
569
- 'CONTENT_TRANSFORMATION_FAILED': 3019,
570
- 'UNABLE_TO_GUESS_MANIFEST_TYPE': 4000,
571
- 'DASH_INVALID_XML': 4001,
572
- 'DASH_NO_SEGMENT_INFO': 4002,
573
- 'DASH_EMPTY_ADAPTATION_SET': 4003,
574
- 'DASH_EMPTY_PERIOD': 4004,
575
- 'DASH_WEBM_MISSING_INIT': 4005,
576
- 'DASH_UNSUPPORTED_CONTAINER': 4006,
577
- 'DASH_PSSH_BAD_ENCODING': 4007,
578
- 'DASH_NO_COMMON_KEY_SYSTEM': 4008,
579
- 'DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED': 4009,
580
- 'DASH_CONFLICTING_KEY_IDS': 4010,
581
- 'RESTRICTIONS_CANNOT_BE_MET': 4012,
582
- 'HLS_PLAYLIST_HEADER_MISSING': 4015,
583
- 'INVALID_HLS_TAG': 4016,
584
- 'HLS_INVALID_PLAYLIST_HIERARCHY': 4017,
585
- 'DASH_DUPLICATE_REPRESENTATION_ID': 4018,
586
- 'HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND': 4020,
587
- 'HLS_REQUIRED_ATTRIBUTE_MISSING': 4023,
588
- 'HLS_REQUIRED_TAG_MISSING': 4024,
589
- 'HLS_COULD_NOT_GUESS_CODECS': 4025,
590
- 'HLS_KEYFORMATS_NOT_SUPPORTED': 4026,
591
- 'DASH_UNSUPPORTED_XLINK_ACTUATE': 4027,
592
- 'DASH_XLINK_DEPTH_LIMIT': 4028,
593
- 'CONTENT_UNSUPPORTED_BY_BROWSER': 4032,
594
- 'CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM': 4033,
595
- 'NO_VARIANTS': 4036,
596
- 'PERIOD_FLATTENING_FAILED': 4037,
597
- 'INCONSISTENT_DRM_ACROSS_PERIODS': 4038,
598
- 'HLS_VARIABLE_NOT_FOUND': 4039,
599
- 'HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED': 4040,
600
- 'HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED': 4041,
601
- 'NO_WEB_CRYPTO_API': 4042,
602
- 'HLS_AES_128_INVALID_IV_LENGTH': 4043,
603
- 'HLS_AES_128_INVALID_KEY_LENGTH': 4044,
604
- 'CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM': 4045,
605
- 'STREAMING_ENGINE_STARTUP_INVALID_STATE': 5006,
606
- 'NO_RECOGNIZED_KEY_SYSTEMS': 6000,
607
- 'REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE': 6001,
608
- 'FAILED_TO_CREATE_CDM': 6002,
609
- 'FAILED_TO_ATTACH_TO_VIDEO': 6003,
610
- 'INVALID_SERVER_CERTIFICATE': 6004,
611
- 'FAILED_TO_CREATE_SESSION': 6005,
612
- 'FAILED_TO_GENERATE_LICENSE_REQUEST': 6006,
613
- 'LICENSE_REQUEST_FAILED': 6007,
614
- 'LICENSE_RESPONSE_REJECTED': 6008,
615
- 'ENCRYPTED_CONTENT_WITHOUT_DRM_INFO': 6010,
616
- 'NO_LICENSE_SERVER_GIVEN': 6012,
617
- 'OFFLINE_SESSION_REMOVED': 6013,
618
- 'EXPIRED': 6014,
619
- 'SERVER_CERTIFICATE_REQUIRED': 6015,
620
- 'INIT_DATA_TRANSFORM_ERROR': 6016,
621
- 'SERVER_CERTIFICATE_REQUEST_FAILED': 6017,
622
- 'LOAD_INTERRUPTED': 7000,
623
- 'OPERATION_ABORTED': 7001,
624
- 'NO_VIDEO_ELEMENT': 7002,
625
- 'OBJECT_DESTROYED': 7003,
626
- 'CONTENT_NOT_LOADED': 7004,
627
- 'CAST_API_UNAVAILABLE': 8000,
628
- 'NO_CAST_RECEIVERS': 8001,
629
- 'ALREADY_CASTING': 8002,
630
- 'UNEXPECTED_CAST_ERROR': 8003,
631
- 'CAST_CANCELED_BY_USER': 8004,
632
- 'CAST_CONNECTION_TIMED_OUT': 8005,
633
- 'CAST_RECEIVER_APP_UNAVAILABLE': 8006,
634
- 'STORAGE_NOT_SUPPORTED': 9000,
635
- 'INDEXED_DB_ERROR': 9001,
636
- 'DEPRECATED_OPERATION_ABORTED': 9002,
637
- 'REQUESTED_ITEM_NOT_FOUND': 9003,
638
- 'MALFORMED_OFFLINE_URI': 9004,
639
- 'CANNOT_STORE_LIVE_OFFLINE': 9005,
640
- 'NO_INIT_DATA_FOR_OFFLINE': 9007,
641
- 'LOCAL_PLAYER_INSTANCE_REQUIRED': 9008,
642
- 'NEW_KEY_OPERATION_NOT_SUPPORTED': 9011,
643
- 'KEY_NOT_FOUND': 9012,
644
- 'MISSING_STORAGE_CELL': 9013,
645
- 'STORAGE_LIMIT_REACHED': 9014,
646
- 'DOWNLOAD_SIZE_CALLBACK_ERROR': 9015,
647
- 'MODIFY_OPERATION_NOT_SUPPORTED': 9016,
648
- 'INDEXED_DB_INIT_TIMED_OUT': 9017,
649
- 'CS_IMA_SDK_MISSING': 10000,
650
- 'CS_AD_MANAGER_NOT_INITIALIZED': 10001,
651
- 'SS_IMA_SDK_MISSING': 10002,
652
- 'SS_AD_MANAGER_NOT_INITIALIZED': 10003,
653
- 'CURRENT_DAI_REQUEST_NOT_FINISHED': 10004
654
- };
655
- /**
656
- * A timer allows a single function to be executed at a later time or at
657
- * regular intervals.
658
- * @final
659
- */
660
- shaka.util.Timer = class {
661
- /**
662
- * Create a new timer. A timer is committed to a single callback function.
663
- * While there is no technical reason to do this, it is far easier to
664
- * understand and use timers when they are connected to one functional idea.
665
- * @param {function()} onTick
666
- */
667
- constructor(onTick) {}
668
- /**
669
- * Have the timer call |onTick| now.
670
- * @return {!shaka.util.Timer}
671
- */
672
- tickNow() {}
673
- /**
674
- * Have the timer call |onTick| after |seconds| has elapsed unless |stop| is
675
- * called first.
676
- * @param {number} seconds
677
- * @return {!shaka.util.Timer}
678
- */
679
- tickAfter(seconds) {}
680
- /**
681
- * Have the timer call |onTick| every |seconds| until |stop| is called.
682
- * @param {number} seconds
683
- * @return {!shaka.util.Timer}
684
- */
685
- tickEvery(seconds) {}
686
- /**
687
- * Stop the timer and clear the previous behaviour. The timer is still usable
688
- * after calling |stop|.
689
- */
690
- stop() {}
691
- };
692
- /**
693
- * @namespace shaka.util.StringUtils
694
- * @summary A set of string utility functions.
695
- */
696
- shaka.util.StringUtils = class {
697
- /**
698
- * Creates a string from the given buffer as UTF-8 encoding.
699
- * @param {?BufferSource} data
700
- * @return {string}
701
- */
702
- static fromUTF8(data) {}
703
- /**
704
- * Creates a string from the given buffer as UTF-16 encoding.
705
- * @param {?BufferSource} data
706
- * @param {boolean} littleEndian
707
- true to read little endian, false to read big.
708
- * @param {boolean=} noThrow true to avoid throwing in cases where we may
709
- * expect invalid input. If noThrow is true and the data has an odd
710
- * length,it will be truncated.
711
- * @return {string}
712
- */
713
- static fromUTF16(data, littleEndian, noThrow) {}
714
- /**
715
- * Creates a string from the given buffer, auto-detecting the encoding that is
716
- * being used. If it cannot detect the encoding, it will throw an exception.
717
- * @param {?BufferSource} data
718
- * @return {string}
719
- */
720
- static fromBytesAutoDetect(data) {}
721
- /**
722
- * Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.
723
- * @param {string} str
724
- * @return {!ArrayBuffer}
725
- */
726
- static toUTF8(str) {}
727
- /**
728
- * Creates a ArrayBuffer from the given string, converting to UTF-16 encoding.
729
- * @param {string} str
730
- * @param {boolean} littleEndian
731
- * @return {!ArrayBuffer}
732
- */
733
- static toUTF16(str, littleEndian) {}
734
- /**
735
- * Resets the fromCharCode method's implementation.
736
- * For debug use.
737
- */
738
- static resetFromCharCode() {}
739
- };
740
- /**
741
- * @summary A set of Uint8Array utility functions.
742
- */
743
- shaka.util.Uint8ArrayUtils = class {
744
- /**
745
- * Convert a buffer to a base64 string. The output will be standard
746
- * alphabet as opposed to base64url safe alphabet.
747
- * @param {BufferSource} data
748
- * @return {string}
749
- */
750
- static toStandardBase64(data) {}
751
- /**
752
- * Convert a buffer to a base64 string. The output will always use the
753
- * alternate encoding/alphabet also known as "base64url".
754
- * @param {BufferSource} data
755
- * @param {boolean=} padding If true, pad the output with equals signs.
756
- * Defaults to true.
757
- * @return {string}
758
- */
759
- static toBase64(data, padding) {}
760
- /**
761
- * Convert a base64 string to a Uint8Array. Accepts either the standard
762
- * alphabet or the alternate "base64url" alphabet.
763
- * @param {string} str
764
- * @return {!Uint8Array}
765
- */
766
- static fromBase64(str) {}
767
- /**
768
- * Convert a hex string to a Uint8Array.
769
- * @param {string} str
770
- * @return {!Uint8Array}
771
- */
772
- static fromHex(str) {}
773
- /**
774
- * Convert a buffer to a hex string.
775
- * @param {BufferSource} data
776
- * @return {string}
777
- */
778
- static toHex(data) {}
779
- /**
780
- * Concatenate buffers.
781
- * @param {...BufferSource} varArgs
782
- * @return {!Uint8Array}
783
- */
784
- static concat(...varArgs) {}
785
- };
786
- /**
787
- */
788
- shaka.dependencies = class {
789
- /**
790
- * Registers a new dependency.
791
- * @param {shaka.dependencies.Allowed} key which is used for retrieving a
792
- * dependency
793
- * @param {?} dep a dependency
794
- */
795
- static add(key, dep) {}
796
- /**
797
- * Check if we have a dependency for the key.
798
- * @param {shaka.dependencies.Allowed} key key
799
- * @return {boolean}
800
- */
801
- static has(key) {}
421
+ shaka.util.Error.Category = {
422
+ 'NETWORK': 1,
423
+ 'TEXT': 2,
424
+ 'MEDIA': 3,
425
+ 'MANIFEST': 4,
426
+ 'STREAMING': 5,
427
+ 'DRM': 6,
428
+ 'PLAYER': 7,
429
+ 'CAST': 8,
430
+ 'STORAGE': 9,
431
+ 'ADS': 10
802
432
  };
803
433
  /**
804
- * @enum {string}
434
+ * @enum {number}
805
435
  */
806
- shaka.dependencies.Allowed = {
807
- muxjs: 'muxjs'
436
+ shaka.util.Error.Code = {
437
+ 'UNSUPPORTED_SCHEME': 1000,
438
+ 'BAD_HTTP_STATUS': 1001,
439
+ 'HTTP_ERROR': 1002,
440
+ 'TIMEOUT': 1003,
441
+ 'MALFORMED_DATA_URI': 1004,
442
+ 'REQUEST_FILTER_ERROR': 1006,
443
+ 'RESPONSE_FILTER_ERROR': 1007,
444
+ 'MALFORMED_TEST_URI': 1008,
445
+ 'UNEXPECTED_TEST_REQUEST': 1009,
446
+ 'ATTEMPTS_EXHAUSTED': 1010,
447
+ 'SEGMENT_MISSING': 1011,
448
+ 'INVALID_TEXT_HEADER': 2000,
449
+ 'INVALID_TEXT_CUE': 2001,
450
+ 'UNABLE_TO_DETECT_ENCODING': 2003,
451
+ 'BAD_ENCODING': 2004,
452
+ 'INVALID_XML': 2005,
453
+ 'INVALID_MP4_TTML': 2007,
454
+ 'INVALID_MP4_VTT': 2008,
455
+ 'UNABLE_TO_EXTRACT_CUE_START_TIME': 2009,
456
+ 'INVALID_MP4_CEA': 2010,
457
+ 'TEXT_COULD_NOT_GUESS_MIME_TYPE': 2011,
458
+ 'CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS': 2012,
459
+ 'TEXT_ONLY_WEBVTT_SRC_EQUALS': 2013,
460
+ 'MISSING_TEXT_PLUGIN': 2014,
461
+ 'CHAPTERS_TRACK_FAILED': 2015,
462
+ 'CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_SRC_EQUALS': 2016,
463
+ 'UNSUPPORTED_EXTERNAL_THUMBNAILS_URI': 2017,
464
+ 'BUFFER_READ_OUT_OF_BOUNDS': 3000,
465
+ 'JS_INTEGER_OVERFLOW': 3001,
466
+ 'EBML_OVERFLOW': 3002,
467
+ 'EBML_BAD_FLOATING_POINT_SIZE': 3003,
468
+ 'MP4_SIDX_WRONG_BOX_TYPE': 3004,
469
+ 'MP4_SIDX_INVALID_TIMESCALE': 3005,
470
+ 'MP4_SIDX_TYPE_NOT_SUPPORTED': 3006,
471
+ 'WEBM_CUES_ELEMENT_MISSING': 3007,
472
+ 'WEBM_EBML_HEADER_ELEMENT_MISSING': 3008,
473
+ 'WEBM_SEGMENT_ELEMENT_MISSING': 3009,
474
+ 'WEBM_INFO_ELEMENT_MISSING': 3010,
475
+ 'WEBM_DURATION_ELEMENT_MISSING': 3011,
476
+ 'WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING': 3012,
477
+ 'WEBM_CUE_TIME_ELEMENT_MISSING': 3013,
478
+ 'MEDIA_SOURCE_OPERATION_FAILED': 3014,
479
+ 'MEDIA_SOURCE_OPERATION_THREW': 3015,
480
+ 'VIDEO_ERROR': 3016,
481
+ 'QUOTA_EXCEEDED_ERROR': 3017,
482
+ 'TRANSMUXING_FAILED': 3018,
483
+ 'CONTENT_TRANSFORMATION_FAILED': 3019,
484
+ 'MSS_MISSING_DATA_FOR_TRANSMUXING': 3020,
485
+ 'MSS_TRANSMUXING_CODEC_UNKNOWN': 3021,
486
+ 'MSS_TRANSMUXING_FAILED': 3022,
487
+ 'UNABLE_TO_GUESS_MANIFEST_TYPE': 4000,
488
+ 'DASH_INVALID_XML': 4001,
489
+ 'DASH_NO_SEGMENT_INFO': 4002,
490
+ 'DASH_EMPTY_ADAPTATION_SET': 4003,
491
+ 'DASH_EMPTY_PERIOD': 4004,
492
+ 'DASH_WEBM_MISSING_INIT': 4005,
493
+ 'DASH_UNSUPPORTED_CONTAINER': 4006,
494
+ 'DASH_PSSH_BAD_ENCODING': 4007,
495
+ 'DASH_NO_COMMON_KEY_SYSTEM': 4008,
496
+ 'DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED': 4009,
497
+ 'DASH_CONFLICTING_KEY_IDS': 4010,
498
+ 'RESTRICTIONS_CANNOT_BE_MET': 4012,
499
+ 'HLS_PLAYLIST_HEADER_MISSING': 4015,
500
+ 'INVALID_HLS_TAG': 4016,
501
+ 'HLS_INVALID_PLAYLIST_HIERARCHY': 4017,
502
+ 'DASH_DUPLICATE_REPRESENTATION_ID': 4018,
503
+ 'HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND': 4020,
504
+ 'HLS_REQUIRED_ATTRIBUTE_MISSING': 4023,
505
+ 'HLS_REQUIRED_TAG_MISSING': 4024,
506
+ 'HLS_COULD_NOT_GUESS_CODECS': 4025,
507
+ 'HLS_KEYFORMATS_NOT_SUPPORTED': 4026,
508
+ 'DASH_UNSUPPORTED_XLINK_ACTUATE': 4027,
509
+ 'DASH_XLINK_DEPTH_LIMIT': 4028,
510
+ 'CONTENT_UNSUPPORTED_BY_BROWSER': 4032,
511
+ 'CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM': 4033,
512
+ 'NO_VARIANTS': 4036,
513
+ 'PERIOD_FLATTENING_FAILED': 4037,
514
+ 'INCONSISTENT_DRM_ACROSS_PERIODS': 4038,
515
+ 'HLS_VARIABLE_NOT_FOUND': 4039,
516
+ 'HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED': 4040,
517
+ 'HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED': 4041,
518
+ 'NO_WEB_CRYPTO_API': 4042,
519
+ 'HLS_AES_128_INVALID_IV_LENGTH': 4043,
520
+ 'HLS_AES_128_INVALID_KEY_LENGTH': 4044,
521
+ 'CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM': 4045,
522
+ 'MSS_INVALID_XML': 4046,
523
+ 'MSS_LIVE_CONTENT_NOT_SUPPORTED': 4047,
524
+ 'STREAMING_ENGINE_STARTUP_INVALID_STATE': 5006,
525
+ 'NO_RECOGNIZED_KEY_SYSTEMS': 6000,
526
+ 'REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE': 6001,
527
+ 'FAILED_TO_CREATE_CDM': 6002,
528
+ 'FAILED_TO_ATTACH_TO_VIDEO': 6003,
529
+ 'INVALID_SERVER_CERTIFICATE': 6004,
530
+ 'FAILED_TO_CREATE_SESSION': 6005,
531
+ 'FAILED_TO_GENERATE_LICENSE_REQUEST': 6006,
532
+ 'LICENSE_REQUEST_FAILED': 6007,
533
+ 'LICENSE_RESPONSE_REJECTED': 6008,
534
+ 'ENCRYPTED_CONTENT_WITHOUT_DRM_INFO': 6010,
535
+ 'NO_LICENSE_SERVER_GIVEN': 6012,
536
+ 'OFFLINE_SESSION_REMOVED': 6013,
537
+ 'EXPIRED': 6014,
538
+ 'SERVER_CERTIFICATE_REQUIRED': 6015,
539
+ 'INIT_DATA_TRANSFORM_ERROR': 6016,
540
+ 'SERVER_CERTIFICATE_REQUEST_FAILED': 6017,
541
+ 'MIN_HDCP_VERSION_NOT_MATCH': 6018,
542
+ 'ERROR_CHECKING_HDCP_VERSION': 6019,
543
+ 'LOAD_INTERRUPTED': 7000,
544
+ 'OPERATION_ABORTED': 7001,
545
+ 'NO_VIDEO_ELEMENT': 7002,
546
+ 'OBJECT_DESTROYED': 7003,
547
+ 'CONTENT_NOT_LOADED': 7004,
548
+ 'CAST_API_UNAVAILABLE': 8000,
549
+ 'NO_CAST_RECEIVERS': 8001,
550
+ 'ALREADY_CASTING': 8002,
551
+ 'UNEXPECTED_CAST_ERROR': 8003,
552
+ 'CAST_CANCELED_BY_USER': 8004,
553
+ 'CAST_CONNECTION_TIMED_OUT': 8005,
554
+ 'CAST_RECEIVER_APP_UNAVAILABLE': 8006,
555
+ 'STORAGE_NOT_SUPPORTED': 9000,
556
+ 'INDEXED_DB_ERROR': 9001,
557
+ 'DEPRECATED_OPERATION_ABORTED': 9002,
558
+ 'REQUESTED_ITEM_NOT_FOUND': 9003,
559
+ 'MALFORMED_OFFLINE_URI': 9004,
560
+ 'CANNOT_STORE_LIVE_OFFLINE': 9005,
561
+ 'NO_INIT_DATA_FOR_OFFLINE': 9007,
562
+ 'LOCAL_PLAYER_INSTANCE_REQUIRED': 9008,
563
+ 'NEW_KEY_OPERATION_NOT_SUPPORTED': 9011,
564
+ 'KEY_NOT_FOUND': 9012,
565
+ 'MISSING_STORAGE_CELL': 9013,
566
+ 'STORAGE_LIMIT_REACHED': 9014,
567
+ 'DOWNLOAD_SIZE_CALLBACK_ERROR': 9015,
568
+ 'MODIFY_OPERATION_NOT_SUPPORTED': 9016,
569
+ 'INDEXED_DB_INIT_TIMED_OUT': 9017,
570
+ 'CS_IMA_SDK_MISSING': 10000,
571
+ 'CS_AD_MANAGER_NOT_INITIALIZED': 10001,
572
+ 'SS_IMA_SDK_MISSING': 10002,
573
+ 'SS_AD_MANAGER_NOT_INITIALIZED': 10003,
574
+ 'CURRENT_DAI_REQUEST_NOT_FINISHED': 10004
808
575
  };
809
576
  /**
810
577
  * @summary A set of utility functions for dealing with MIME types.
@@ -812,12 +579,20 @@ shaka.dependencies.Allowed = {
812
579
  shaka.util.MimeUtils = class {
813
580
  /**
814
581
  * Takes a MIME type and optional codecs string and produces the full MIME
815
- * type.
582
+ * type. Also remove the codecs for raw formats.
816
583
  * @param {string} mimeType
817
584
  * @param {string=} codecs
818
585
  * @return {string}
819
586
  */
820
587
  static getFullType(mimeType, codecs) {}
588
+ /**
589
+ * Takes a MIME type and optional codecs string and produces the full MIME
590
+ * type.
591
+ * @param {string} mimeType
592
+ * @param {string=} codecs
593
+ * @return {string}
594
+ */
595
+ static getFullTypeWithAllCodecs(mimeType, codecs) {}
821
596
  };
822
597
  /**
823
598
  * @summary Manages text parsers and cues.
@@ -987,6 +762,59 @@ shaka.util.LanguageUtils = class {
987
762
  */
988
763
  static findClosestLocale(target, searchSpace) {}
989
764
  };
765
+ /**
766
+ * A timer allows a single function to be executed at a later time or at
767
+ * regular intervals.
768
+ * @final
769
+ */
770
+ shaka.util.Timer = class {
771
+ /**
772
+ * Create a new timer. A timer is committed to a single callback function.
773
+ * While there is no technical reason to do this, it is far easier to
774
+ * understand and use timers when they are connected to one functional idea.
775
+ * @param {function()} onTick
776
+ */
777
+ constructor(onTick) {}
778
+ /**
779
+ * Have the timer call |onTick| now.
780
+ * @return {!shaka.util.Timer}
781
+ */
782
+ tickNow() {}
783
+ /**
784
+ * Have the timer call |onTick| after |seconds| has elapsed unless |stop| is
785
+ * called first.
786
+ * @param {number} seconds
787
+ * @return {!shaka.util.Timer}
788
+ */
789
+ tickAfter(seconds) {}
790
+ /**
791
+ * Have the timer call |onTick| every |seconds| until |stop| is called.
792
+ * @param {number} seconds
793
+ * @return {!shaka.util.Timer}
794
+ */
795
+ tickEvery(seconds) {}
796
+ /**
797
+ * Stop the timer and clear the previous behaviour. The timer is still usable
798
+ * after calling |stop|.
799
+ */
800
+ stop() {}
801
+ };
802
+ /**
803
+ * @summary A set of utility functions for dealing with Streams and Manifests.
804
+ */
805
+ shaka.util.StreamUtils = class {
806
+ /**
807
+ * @param {shaka.extern.Variant} variant
808
+ * @param {shaka.extern.Restrictions} restrictions
809
+ * Configured restrictions from the user.
810
+ * @param {{width: number, height: number}} maxHwRes
811
+ * The maximum resolution the hardware can handle.
812
+ * This is applied separately from user restrictions because the setting
813
+ * should not be easily replaced by the user's configuration.
814
+ * @return {boolean}
815
+ */
816
+ static meetsRestrictions(variant, restrictions, maxHwRes) {}
817
+ };
990
818
  /**
991
819
  * @summary
992
820
  * <p>
@@ -1234,8 +1062,10 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
1234
1062
  * Called when the headers are received for a download.
1235
1063
  * @param {shaka.net.NetworkingEngine.OnDownloadFailed=} onDownloadFailed
1236
1064
  * Called when a download fails, for any reason.
1065
+ * @param {shaka.net.NetworkingEngine.OnRequest=} onRequest
1066
+ * Called when a request is made
1237
1067
  */
1238
- constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed) {}
1068
+ constructor(onProgressUpdated, onHeadersReceived, onDownloadFailed, onRequest) {}
1239
1069
  /**
1240
1070
  * @param {boolean} forceHTTPS
1241
1071
  */
@@ -1310,9 +1140,10 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
1310
1140
  * Makes a network request and returns the resulting data.
1311
1141
  * @param {shaka.net.NetworkingEngine.RequestType} type
1312
1142
  * @param {shaka.extern.Request} request
1143
+ * @param {shaka.extern.RequestContext=} context
1313
1144
  * @return {!shaka.net.NetworkingEngine.PendingRequest}
1314
1145
  */
1315
- request(type, request) {}
1146
+ request(type, request, context) {}
1316
1147
  };
1317
1148
  /**
1318
1149
  * A wrapper class for the number of bytes remaining to be downloaded for the
@@ -1364,6 +1195,22 @@ shaka.net.NetworkingEngine.RequestType = {
1364
1195
  'SERVER_CERTIFICATE': 5,
1365
1196
  'KEY': 6
1366
1197
  };
1198
+ /**
1199
+ * A more advanced form of the RequestType structure, meant to describe
1200
+ * sub-types of basic request types.
1201
+ * For example, an INIT_SEGMENT is a sub-type of SEGMENT.
1202
+ * This is meant to allow for more specificity to be added to the request type
1203
+ * data, without breaking backwards compatibility.
1204
+ * @enum {number}
1205
+ */
1206
+ shaka.net.NetworkingEngine.AdvancedRequestType = {
1207
+ 'INIT_SEGMENT': 0,
1208
+ 'MEDIA_SEGMENT': 1,
1209
+ 'MEDIA_PLAYLIST': 2,
1210
+ 'MASTER_PLAYLIST': 3,
1211
+ 'MPD': 4,
1212
+ 'MSS': 5
1213
+ };
1367
1214
  /**
1368
1215
  * Priority level for network scheme plugins.
1369
1216
  * If multiple plugins are provided for the same scheme, only the
@@ -1396,6 +1243,15 @@ shaka.net.NetworkingEngine.OnHeadersReceived;
1396
1243
  * reason (e.g. even if the download was aborted).
1397
1244
  */
1398
1245
  shaka.net.NetworkingEngine.OnDownloadFailed;
1246
+ /**
1247
+ * @typedef {function(
1248
+ * !shaka.net.NetworkingEngine.RequestType,
1249
+ * !shaka.extern.Request,
1250
+ * (shaka.extern.RequestContext|undefined))}
1251
+ * @description
1252
+ * A callback function called on every request
1253
+ */
1254
+ shaka.net.NetworkingEngine.OnRequest;
1399
1255
  /**
1400
1256
  * @summary
1401
1257
  * An EventManager maintains a collection of "event
@@ -1432,23 +1288,71 @@ shaka.util.EventManager = class {
1432
1288
  * The passive option, if true, indicates that this function will never
1433
1289
  * call preventDefault(), which improves scrolling performance.
1434
1290
  */
1435
- listenOnce(target, type, listener, options) {}
1291
+ listenOnce(target, type, listener, options) {}
1292
+ /**
1293
+ * Detaches an event listener from an event target.
1294
+ * @param {EventTarget} target The event target.
1295
+ * @param {string} type The event type.
1296
+ * @param {shaka.util.EventManager.ListenerType=} listener The event listener.
1297
+ */
1298
+ unlisten(target, type, listener) {}
1299
+ /**
1300
+ * Detaches all event listeners from all targets.
1301
+ */
1302
+ removeAll() {}
1303
+ };
1304
+ /**
1305
+ * @typedef {function(!Event)}
1306
+ */
1307
+ shaka.util.EventManager.ListenerType;
1308
+ /**
1309
+ * @namespace shaka.util.StringUtils
1310
+ * @summary A set of string utility functions.
1311
+ */
1312
+ shaka.util.StringUtils = class {
1313
+ /**
1314
+ * Creates a string from the given buffer as UTF-8 encoding.
1315
+ * @param {?BufferSource} data
1316
+ * @return {string}
1317
+ */
1318
+ static fromUTF8(data) {}
1319
+ /**
1320
+ * Creates a string from the given buffer as UTF-16 encoding.
1321
+ * @param {?BufferSource} data
1322
+ * @param {boolean} littleEndian
1323
+ true to read little endian, false to read big.
1324
+ * @param {boolean=} noThrow true to avoid throwing in cases where we may
1325
+ * expect invalid input. If noThrow is true and the data has an odd
1326
+ * length,it will be truncated.
1327
+ * @return {string}
1328
+ */
1329
+ static fromUTF16(data, littleEndian, noThrow) {}
1330
+ /**
1331
+ * Creates a string from the given buffer, auto-detecting the encoding that is
1332
+ * being used. If it cannot detect the encoding, it will throw an exception.
1333
+ * @param {?BufferSource} data
1334
+ * @return {string}
1335
+ */
1336
+ static fromBytesAutoDetect(data) {}
1337
+ /**
1338
+ * Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.
1339
+ * @param {string} str
1340
+ * @return {!ArrayBuffer}
1341
+ */
1342
+ static toUTF8(str) {}
1436
1343
  /**
1437
- * Detaches an event listener from an event target.
1438
- * @param {EventTarget} target The event target.
1439
- * @param {string} type The event type.
1440
- * @param {shaka.util.EventManager.ListenerType=} listener The event listener.
1344
+ * Creates a ArrayBuffer from the given string, converting to UTF-16 encoding.
1345
+ * @param {string} str
1346
+ * @param {boolean} littleEndian
1347
+ * @return {!ArrayBuffer}
1441
1348
  */
1442
- unlisten(target, type, listener) {}
1349
+ static toUTF16(str, littleEndian) {}
1443
1350
  /**
1444
- * Detaches all event listeners from all targets.
1351
+ * Resets the fromCharCode method's implementation.
1352
+ * For debug use.
1445
1353
  */
1446
- removeAll() {}
1354
+ static resetFromCharCode() {}
1447
1355
  };
1448
- /**
1449
- * @typedef {function(!Event)}
1450
- */
1451
- shaka.util.EventManager.ListenerType;
1452
1356
  /**
1453
1357
  * @summary DataViewReader abstracts a DataView object.
1454
1358
  */
@@ -1627,6 +1531,52 @@ shaka.util.Mp4Parser = class {
1627
1531
  * @typedef {function(!shaka.extern.ParsedBox)}
1628
1532
  */
1629
1533
  shaka.util.Mp4Parser.CallbackType;
1534
+ /**
1535
+ * @summary A set of Uint8Array utility functions.
1536
+ */
1537
+ shaka.util.Uint8ArrayUtils = class {
1538
+ /**
1539
+ * Convert a buffer to a base64 string. The output will be standard
1540
+ * alphabet as opposed to base64url safe alphabet.
1541
+ * @param {BufferSource} data
1542
+ * @return {string}
1543
+ */
1544
+ static toStandardBase64(data) {}
1545
+ /**
1546
+ * Convert a buffer to a base64 string. The output will always use the
1547
+ * alternate encoding/alphabet also known as "base64url".
1548
+ * @param {BufferSource} data
1549
+ * @param {boolean=} padding If true, pad the output with equals signs.
1550
+ * Defaults to true.
1551
+ * @return {string}
1552
+ */
1553
+ static toBase64(data, padding) {}
1554
+ /**
1555
+ * Convert a base64 string to a Uint8Array. Accepts either the standard
1556
+ * alphabet or the alternate "base64url" alphabet.
1557
+ * @param {string} str
1558
+ * @return {!Uint8Array}
1559
+ */
1560
+ static fromBase64(str) {}
1561
+ /**
1562
+ * Convert a hex string to a Uint8Array.
1563
+ * @param {string} str
1564
+ * @return {!Uint8Array}
1565
+ */
1566
+ static fromHex(str) {}
1567
+ /**
1568
+ * Convert a buffer to a hex string.
1569
+ * @param {BufferSource} data
1570
+ * @return {string}
1571
+ */
1572
+ static toHex(data) {}
1573
+ /**
1574
+ * Concatenate buffers.
1575
+ * @param {...BufferSource} varArgs
1576
+ * @return {!Uint8Array}
1577
+ */
1578
+ static concat(...varArgs) {}
1579
+ };
1630
1580
  /**
1631
1581
  * @summary An interface to register manifest parsers.
1632
1582
  */
@@ -1651,6 +1601,13 @@ shaka.media.ManifestParser = class {
1651
1601
  */
1652
1602
  static unregisterParserByMime(mimeType) {}
1653
1603
  };
1604
+ /**
1605
+ * @enum {string}
1606
+ */
1607
+ shaka.media.ManifestParser.AccessibilityPurpose = {
1608
+ VISUALLY_IMPAIRED: 'visually impaired',
1609
+ HARD_OF_HEARING: 'hard of hearing'
1610
+ };
1654
1611
  /**
1655
1612
  * Creates an InitSegmentReference, which provides the location to an
1656
1613
  * initialization segment.
@@ -1666,9 +1623,10 @@ shaka.media.InitSegmentReference = class {
1666
1623
  * segment extends to the end of the resource.
1667
1624
  * @param {null|shaka.extern.MediaQualityInfo=} mediaQuality Information about
1668
1625
  * the quality of the media associated with this init segment.
1669
- * @param {number=} timescale
1626
+ * @param {(null|number)=} timescale
1627
+ * @param {(null|BufferSource)=} segmentData
1670
1628
  */
1671
- constructor(uris, startByte, endByte, mediaQuality, timescale) {}
1629
+ constructor(uris, startByte, endByte, mediaQuality, timescale, segmentData) {}
1672
1630
  /**
1673
1631
  * Returns the offset from the start of the resource to the
1674
1632
  * start of the segment.
@@ -1802,6 +1760,26 @@ shaka.media.SegmentReference = class {
1802
1760
  * @return {boolean}
1803
1761
  */
1804
1762
  isPreload() {}
1763
+ /**
1764
+ * Mark the reference as non-independent.
1765
+ */
1766
+ markAsNonIndependent() {}
1767
+ /**
1768
+ * Returns true if the segment is independent.
1769
+ * @return {boolean}
1770
+ */
1771
+ isIndependent() {}
1772
+ /**
1773
+ * Mark the reference as byterange optimization.
1774
+ * The "byterange optimization" means that it is playable using MP4 low
1775
+ * latency streaming with chunked data.
1776
+ */
1777
+ markAsByterangeOptimization() {}
1778
+ /**
1779
+ * Returns true if the segment has a byterange optimization.
1780
+ * @return {boolean}
1781
+ */
1782
+ hasByterangeOptimization() {}
1805
1783
  /**
1806
1784
  * Set the segment's thumbnail sprite.
1807
1785
  * @param {shaka.media.SegmentReference.ThumbnailSprite} thumbnailSprite
@@ -1862,6 +1840,26 @@ shaka.util.Id3Utils = class {
1862
1840
  * @return {!Array.<shaka.extern.MetadataFrame>}
1863
1841
  */
1864
1842
  static getID3Frames(id3Data) {}
1843
+ /**
1844
+ * Returns any adjacent ID3 tags found in data starting at offset, as one
1845
+ * block of data
1846
+ * @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags
1847
+ * @param {number=} offset - The offset at which to start searching
1848
+ * @return {!Uint8Array}
1849
+ */
1850
+ static getID3Data(id3Data, offset) {}
1851
+ };
1852
+ /**
1853
+ * @summary
1854
+ * Parser for exponential Golomb codes, a variable-bitwidth number encoding
1855
+ * scheme used by h264.
1856
+ * Based on https://github.com/videojs/mux.js/blob/main/lib/utils/exp-golomb.js
1857
+ */
1858
+ shaka.util.ExpGolomb = class {
1859
+ /**
1860
+ * @param {!Uint8Array} data
1861
+ */
1862
+ constructor(data) {}
1865
1863
  };
1866
1864
  /**
1867
1865
  * @see https://en.wikipedia.org/wiki/MPEG_transport_stream
@@ -1869,7 +1867,77 @@ shaka.util.Id3Utils = class {
1869
1867
  shaka.util.TsParser = class {
1870
1868
  /** */
1871
1869
  constructor() {}
1870
+ /**
1871
+ * Clear previous data
1872
+ */
1873
+ clearData() {}
1874
+ /**
1875
+ * Parse the given data
1876
+ * @param {Uint8Array} data
1877
+ * @return {!shaka.util.TsParser}
1878
+ */
1879
+ parse(data) {}
1880
+ /**
1881
+ * Parse AVC Nalus
1882
+ * The code is based on hls.js
1883
+ * Credit to https://github.com/video-dev/hls.js/blob/master/src/demux/tsdemuxer.ts
1884
+ * @param {shaka.extern.MPEG_PES} pes
1885
+ * @param {?shaka.extern.MPEG_PES=} nextPes
1886
+ * @return {!Array.<shaka.extern.VideoNalu>}
1887
+ */
1888
+ parseAvcNalus(pes, nextPes) {}
1889
+ /**
1890
+ * Return the ID3 metadata
1891
+ * @return {!Array.<shaka.extern.ID3Metadata>}
1892
+ */
1893
+ getMetadata() {}
1894
+ /**
1895
+ * Return the audio data
1896
+ * @return {!Array.<shaka.extern.MPEG_PES>}
1897
+ */
1898
+ getAudioData() {}
1899
+ /**
1900
+ * Return the audio data
1901
+ * @return {!Array.<shaka.extern.MPEG_PES>}
1902
+ */
1903
+ getVideoData() {}
1904
+ /**
1905
+ * Return the start time for the audio and video
1906
+ * @return {{audio: ?number, video: ?number}}
1907
+ */
1908
+ getStartTime() {}
1909
+ /**
1910
+ * Return the audio and video codecs
1911
+ * @return {{audio: ?string, video: ?string}}
1912
+ */
1913
+ getCodecs() {}
1914
+ /**
1915
+ * Return the video data
1916
+ * @return {!Array.<shaka.extern.VideoNalu>}
1917
+ */
1918
+ getVideoNalus() {}
1919
+ /**
1920
+ * Return the video resolution
1921
+ * @return {{height: ?string, width: ?string}}
1922
+ */
1923
+ getVideoResolution() {}
1924
+ /**
1925
+ * Check if the passed data corresponds to an MPEG2-TS
1926
+ * @param {Uint8Array} data
1927
+ * @return {boolean}
1928
+ */
1929
+ static probe(data) {}
1930
+ /**
1931
+ * Returns the synchronization offset
1932
+ * @param {Uint8Array} data
1933
+ * @return {number}
1934
+ */
1935
+ static syncOffset(data) {}
1872
1936
  };
1937
+ /**
1938
+ * @const {number}
1939
+ */
1940
+ shaka.util.TsParser.Timescale;
1873
1941
  /**
1874
1942
  * @summary
1875
1943
  * lcevcDil - (MPEG-5 Part 2 LCEVC - Decoder Integration Layer) provides
@@ -1963,6 +2031,14 @@ shaka.media.PresentationTimeline = class {
1963
2031
  * @return {number}
1964
2032
  */
1965
2033
  getDelay() {}
2034
+ /**
2035
+ * Gives PresentationTimeline a Stream's timeline so it can size and position
2036
+ * the segment availability window, and account for missing segment
2037
+ * information.
2038
+ * @param {!Array.<shaka.media.PresentationTimeline.TimeRange>} timeline
2039
+ * @param {number} startOffset
2040
+ */
2041
+ notifyTimeRange(timeline, startOffset) {}
1966
2042
  /**
1967
2043
  * Gives PresentationTimeline an array of segments so it can size and position
1968
2044
  * the segment availability window, and account for missing segment
@@ -2072,6 +2148,22 @@ shaka.media.PresentationTimeline = class {
2072
2148
  */
2073
2149
  setAvailabilityTimeOffset(offset) {}
2074
2150
  };
2151
+ /**
2152
+ * @typedef {{
2153
+ * start: number,
2154
+ * unscaledStart: number,
2155
+ * end: number
2156
+ * }}
2157
+ * @description
2158
+ * Defines a time range of a media segment. Times are in seconds.
2159
+ * @property {number} start
2160
+ * The start time of the range.
2161
+ * @property {number} unscaledStart
2162
+ * The start time of the range in representation timescale units.
2163
+ * @property {number} end
2164
+ * The end time (exclusive) of the range.
2165
+ */
2166
+ shaka.media.PresentationTimeline.TimeRange;
2075
2167
  /**
2076
2168
  * SegmentIndex.
2077
2169
  * @implements {shaka.util.IReleasable}
@@ -2158,9 +2250,14 @@ shaka.media.SegmentIndex = class {
2158
2250
  updateEvery(interval, updateCallback) {}
2159
2251
  /**
2160
2252
  * Returns a new iterator that initially points to the segment that contains
2161
- * the given time. Like the normal iterator, next() must be called first to
2162
- * get to the first element. Returns null if we do not find a segment at the
2253
+ * the given time, or the nearest independent segment before it.
2254
+ * Like the normal iterator, next() must be called first to get to the first
2255
+ * element. Returns null if we do not find a segment at the
2163
2256
  * requested time.
2257
+ * The first segment returned by the iterator _MUST_ be an independent
2258
+ * segment. Assumes that only partial references can be dependent, based on
2259
+ * RFC 8216 rev 13, section 8.1: "Each (non-Partial) Media Segment in a Media
2260
+ * Playlist will contain at least one independent frame."
2164
2261
  * @param {number} time
2165
2262
  * @return {?shaka.media.SegmentIterator}
2166
2263
  */
@@ -2246,6 +2343,16 @@ shaka.media.MetaSegmentIndex = class extends shaka.media.SegmentIndex {
2246
2343
  */
2247
2344
  updateEvery(interval, updateCallback) {}
2248
2345
  };
2346
+ /**
2347
+ * @typedef {function(
2348
+ * !(shaka.media.InitSegmentReference|shaka.media.SegmentReference),
2349
+ * shaka.extern.Stream,
2350
+ * ?function(BufferSource):!Promise=
2351
+ * ):!shaka.net.NetworkingEngine.PendingRequest}
2352
+ * @description
2353
+ * A callback function that fetches a segment.
2354
+ */
2355
+ shaka.media.SegmentPrefetch.FetchDispatcher;
2249
2356
  /**
2250
2357
  * A text displayer plugin using the browser's native VTTCue interface.
2251
2358
  * @implements {shaka.extern.TextDisplayer}
@@ -2321,37 +2428,6 @@ shaka.text.UITextDisplayer = class {
2321
2428
  */
2322
2429
  shaka.text.WebVttGenerator = class {
2323
2430
  };
2324
- /**
2325
- * @typedef {{
2326
- * type: string,
2327
- * init: boolean,
2328
- * duration: number,
2329
- * mimeType: string,
2330
- * codecs: string,
2331
- * bandwidth: (number|undefined)
2332
- * }}
2333
- * @property {string} type
2334
- * The media type
2335
- * @property {boolean} init
2336
- * Flag indicating whether the segment is an init segment
2337
- * @property {number} duration
2338
- * The duration of the segment in seconds
2339
- * @property {string} mimeType
2340
- * The segment's mime type
2341
- * @property {string} codecs
2342
- * The segment's codecs
2343
- * @property {(number|undefined)} bandwidth
2344
- * The segment's variation bandwidth
2345
- */
2346
- shaka.util.CmcdManager.SegmentInfo;
2347
- /**
2348
- * @typedef {{
2349
- * format: shaka.util.CmcdManager.StreamingFormat
2350
- * }}
2351
- * @property {shaka.util.CmcdManager.StreamingFormat} format
2352
- * The manifest's stream format
2353
- */
2354
- shaka.util.CmcdManager.ManifestInfo;
2355
2431
  /**
2356
2432
  * @enum {string}
2357
2433
  */
@@ -2439,30 +2515,48 @@ shaka.util.FairPlayUtils = class {
2439
2515
  * @param {?shaka.extern.DrmInfo} drmInfo
2440
2516
  */
2441
2517
  static conaxInitDataTransform(initData, initDataType, drmInfo) {}
2518
+ /**
2519
+ * ExpressPlay initDataTransform configuration.
2520
+ * @param {!Uint8Array} initData
2521
+ * @param {string} initDataType
2522
+ * @param {?shaka.extern.DrmInfo} drmInfo
2523
+ */
2524
+ static expressplayInitDataTransform(initData, initDataType, drmInfo) {}
2442
2525
  /**
2443
2526
  * Verimatrix FairPlay request.
2444
2527
  * @param {shaka.net.NetworkingEngine.RequestType} type
2445
2528
  * @param {shaka.extern.Request} request
2529
+ * @param {shaka.extern.RequestContext=} context
2446
2530
  */
2447
- static verimatrixFairPlayRequest(type, request) {}
2531
+ static verimatrixFairPlayRequest(type, request, context) {}
2448
2532
  /**
2449
2533
  * EZDRM FairPlay request.
2450
2534
  * @param {shaka.net.NetworkingEngine.RequestType} type
2451
2535
  * @param {shaka.extern.Request} request
2536
+ * @param {shaka.extern.RequestContext=} context
2452
2537
  */
2453
- static ezdrmFairPlayRequest(type, request) {}
2538
+ static ezdrmFairPlayRequest(type, request, context) {}
2454
2539
  /**
2455
2540
  * Conax FairPlay request.
2456
2541
  * @param {shaka.net.NetworkingEngine.RequestType} type
2457
2542
  * @param {shaka.extern.Request} request
2543
+ * @param {shaka.extern.RequestContext=} context
2544
+ */
2545
+ static conaxFairPlayRequest(type, request, context) {}
2546
+ /**
2547
+ * ExpressPlay FairPlay request.
2548
+ * @param {shaka.net.NetworkingEngine.RequestType} type
2549
+ * @param {shaka.extern.Request} request
2550
+ * @param {shaka.extern.RequestContext=} context
2458
2551
  */
2459
- static conaxFairPlayRequest(type, request) {}
2552
+ static expressplayFairPlayRequest(type, request, context) {}
2460
2553
  /**
2461
2554
  * Common FairPlay response transform for some DRMs providers.
2462
2555
  * @param {shaka.net.NetworkingEngine.RequestType} type
2463
2556
  * @param {shaka.extern.Response} response
2557
+ * @param {shaka.extern.RequestContext=} context
2464
2558
  */
2465
- static commonFairPlayResponse(type, response) {}
2559
+ static commonFairPlayResponse(type, response, context) {}
2466
2560
  };
2467
2561
  /**
2468
2562
  * @final
@@ -2658,6 +2752,11 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2658
2752
  * @return {shaka.Player.LoadMode}
2659
2753
  */
2660
2754
  getLoadMode() {}
2755
+ /**
2756
+ * Get the current manifest type.
2757
+ * @return {?string}
2758
+ */
2759
+ getManifestType() {}
2661
2760
  /**
2662
2761
  * Get the media element that the player is currently using to play loaded
2663
2762
  * content. If the player has not loaded content, this will return
@@ -2737,6 +2836,11 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2737
2836
  * @return {number}
2738
2837
  */
2739
2838
  getExpiration() {}
2839
+ /**
2840
+ * Returns the active sessions metadata
2841
+ * @return {!Array.<shaka.extern.DrmSessionMetadata>}
2842
+ */
2843
+ getActiveSessionsMetadata() {}
2740
2844
  /**
2741
2845
  * Gets a map of EME key ID to the current key status.
2742
2846
  * @return {!Object<string, string>}
@@ -2874,8 +2978,9 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2874
2978
  * @param {string} language
2875
2979
  * @param {string=} role
2876
2980
  * @param {number=} channelsCount
2981
+ * @param {number=} safeMargin
2877
2982
  */
2878
- selectAudioLanguage(language, role, channelsCount) {}
2983
+ selectAudioLanguage(language, role, channelsCount, safeMargin) {}
2879
2984
  /**
2880
2985
  * Sets the current text language and current text role to the selected
2881
2986
  * language and role, and chooses a new variant if need be. If the player has
@@ -2890,8 +2995,14 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2890
2995
  * label uniquely identifies an audio stream, so all the variants
2891
2996
  * are expected to have the same variant.audio.
2892
2997
  * @param {string} label
2998
+ * @param {boolean=} clearBuffer Optional clear buffer or not when
2999
+ * switch to new variant
3000
+ * Defaults to true if not provided
3001
+ * @param {number=} safeMargin Optional amount of buffer (in seconds) to
3002
+ * retain when clearing the buffer.
3003
+ * Defaults to 0 if not provided. Ignored if clearBuffer is false.
2893
3004
  */
2894
- selectVariantsByLabel(label) {}
3005
+ selectVariantsByLabel(label, clearBuffer, safeMargin) {}
2895
3006
  /**
2896
3007
  * Check if the text displayer is enabled.
2897
3008
  * @return {boolean}
@@ -3133,6 +3244,42 @@ shaka.ads.ClientSideAd = class {
3133
3244
  * @override
3134
3245
  */
3135
3246
  getDescription() {}
3247
+ /**
3248
+ * @override
3249
+ */
3250
+ getVastMediaBitrate() {}
3251
+ /**
3252
+ * @override
3253
+ */
3254
+ getVastMediaHeight() {}
3255
+ /**
3256
+ * @override
3257
+ */
3258
+ getVastMediaWidth() {}
3259
+ /**
3260
+ * @override
3261
+ */
3262
+ getAdId() {}
3263
+ /**
3264
+ * @override
3265
+ */
3266
+ getCreativeAdId() {}
3267
+ /**
3268
+ * @override
3269
+ */
3270
+ getAdvertiserName() {}
3271
+ /**
3272
+ * @override
3273
+ */
3274
+ getMediaUrl() {}
3275
+ /**
3276
+ * @override
3277
+ */
3278
+ getTimeOffset() {}
3279
+ /**
3280
+ * @override
3281
+ */
3282
+ getPodIndex() {}
3136
3283
  /**
3137
3284
  * @override
3138
3285
  */
@@ -3227,6 +3374,42 @@ shaka.ads.ServerSideAd = class {
3227
3374
  * @override
3228
3375
  */
3229
3376
  getDescription() {}
3377
+ /**
3378
+ * @override
3379
+ */
3380
+ getVastMediaBitrate() {}
3381
+ /**
3382
+ * @override
3383
+ */
3384
+ getVastMediaHeight() {}
3385
+ /**
3386
+ * @override
3387
+ */
3388
+ getVastMediaWidth() {}
3389
+ /**
3390
+ * @override
3391
+ */
3392
+ getAdId() {}
3393
+ /**
3394
+ * @override
3395
+ */
3396
+ getCreativeAdId() {}
3397
+ /**
3398
+ * @override
3399
+ */
3400
+ getAdvertiserName() {}
3401
+ /**
3402
+ * @override
3403
+ */
3404
+ getMediaUrl() {}
3405
+ /**
3406
+ * @override
3407
+ */
3408
+ getTimeOffset() {}
3409
+ /**
3410
+ * @override
3411
+ */
3412
+ getPodIndex() {}
3230
3413
  /**
3231
3414
  * @override
3232
3415
  */
@@ -3247,7 +3430,11 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
3247
3430
  /**
3248
3431
  * @override
3249
3432
  */
3250
- initClientSide(adContainer, video) {}
3433
+ configure(config) {}
3434
+ /**
3435
+ * @override
3436
+ */
3437
+ initClientSide(adContainer, video, adsRenderingSettings) {}
3251
3438
  /**
3252
3439
  * @override
3253
3440
  */
@@ -3260,6 +3447,10 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
3260
3447
  * @override
3261
3448
  */
3262
3449
  requestClientSideAds(imaRequest) {}
3450
+ /**
3451
+ * @override
3452
+ */
3453
+ updateClientSideAdsRenderingSettings(adsRenderingSettings) {}
3263
3454
  /**
3264
3455
  * @override
3265
3456
  */
@@ -3440,6 +3631,11 @@ shaka.ads.AdManager.AD_METADATA;
3440
3631
  * @const {string}
3441
3632
  */
3442
3633
  shaka.ads.AdManager.AD_RECOVERABLE_ERROR;
3634
+ /**
3635
+ * The event name for when the ad manager dispatch errors.
3636
+ * @const {string}
3637
+ */
3638
+ shaka.ads.AdManager.AD_ERROR;
3443
3639
  /**
3444
3640
  * The event name for when the client side SDK signalled its readiness
3445
3641
  * to play a VPAID ad or an ad rule.
@@ -3587,19 +3783,70 @@ shaka.cast.CastReceiver = class extends shaka.util.FakeEventTarget {
3587
3783
  * Should be called from an appDataCallback.
3588
3784
  * @param {string} imageUrl
3589
3785
  */
3590
- setContentImage(imageUrl) {}
3786
+ setContentImage(imageUrl) {}
3787
+ /**
3788
+ * Set the Cast content's artist.
3789
+ * Also sets the metadata type to music.
3790
+ * Should be called from an appDataCallback.
3791
+ * @param {string} artist
3792
+ */
3793
+ setContentArtist(artist) {}
3794
+ /**
3795
+ * Destroys the underlying Player, then terminates the cast receiver app.
3796
+ * @override
3797
+ */
3798
+ destroy() {}
3799
+ };
3800
+ /**
3801
+ * CEA-X08 captions decoder.
3802
+ * @implements {shaka.extern.ICaptionDecoder}
3803
+ */
3804
+ shaka.cea.CeaDecoder = class {
3805
+ /** */
3806
+ constructor() {}
3807
+ };
3808
+ /**
3809
+ * MPEG4 stream parser used for extracting 708 closed captions data.
3810
+ * @implements {shaka.extern.ICeaParser}
3811
+ */
3812
+ shaka.cea.Mp4CeaParser = class {
3813
+ /** */
3814
+ constructor() {}
3815
+ };
3816
+ /**
3817
+ * MPEG TS CEA parser.
3818
+ * @implements {shaka.extern.ICeaParser}
3819
+ */
3820
+ shaka.cea.TsCeaParser = class {
3821
+ /** */
3822
+ constructor() {}
3823
+ };
3824
+ /**
3825
+ * A utility to combine streams across periods.
3826
+ * @implements {shaka.util.IReleasable}
3827
+ * @final
3828
+ */
3829
+ shaka.util.PeriodCombiner = class {
3830
+ /** */
3831
+ constructor() {}
3832
+ /**
3833
+ * @return {!Array.<shaka.extern.Variant>}
3834
+ */
3835
+ getVariants() {}
3591
3836
  /**
3592
- * Set the Cast content's artist.
3593
- * Also sets the metadata type to music.
3594
- * Should be called from an appDataCallback.
3595
- * @param {string} artist
3837
+ * @return {!Array.<shaka.extern.Stream>}
3838
+ */
3839
+ getTextStreams() {}
3840
+ /**
3841
+ * @return {!Array.<shaka.extern.Stream>}
3596
3842
  */
3597
- setContentArtist(artist) {}
3843
+ getImageStreams() {}
3598
3844
  /**
3599
- * Destroys the underlying Player, then terminates the cast receiver app.
3600
- * @override
3845
+ * @param {!Array.<shaka.extern.Period>} periods
3846
+ * @param {boolean} isDynamic
3847
+ * @return {!Promise}
3601
3848
  */
3602
- destroy() {}
3849
+ combinePeriods(periods, isDynamic) {}
3603
3850
  };
3604
3851
  /**
3605
3852
  * Creates a new DASH parser.
@@ -3629,6 +3876,30 @@ shaka.dash.DashParser = class {
3629
3876
  */
3630
3877
  onExpirationUpdated(sessionId, expiration) {}
3631
3878
  };
3879
+ /**
3880
+ */
3881
+ shaka.dependencies = class {
3882
+ /**
3883
+ * Registers a new dependency.
3884
+ * @param {shaka.dependencies.Allowed} key which is used for retrieving a
3885
+ * dependency
3886
+ * @param {?} dep a dependency
3887
+ */
3888
+ static add(key, dep) {}
3889
+ /**
3890
+ * Check if we have a dependency for the key.
3891
+ * @param {shaka.dependencies.Allowed} key key
3892
+ * @return {boolean}
3893
+ */
3894
+ static has(key) {}
3895
+ };
3896
+ /**
3897
+ * @enum {string}
3898
+ */
3899
+ shaka.dependencies.Allowed = {
3900
+ muxjs: 'muxjs',
3901
+ ISOBoxer: 'ISOBoxer'
3902
+ };
3632
3903
  /**
3633
3904
  * @summary A networking plugin to handle data URIs.
3634
3905
  * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs
@@ -3674,6 +3945,34 @@ shaka.hls.HlsParser = class {
3674
3945
  */
3675
3946
  onExpirationUpdated(sessionId, expiration) {}
3676
3947
  };
3948
+ /**
3949
+ * Creates a new MSS parser.
3950
+ * @implements {shaka.extern.ManifestParser}
3951
+ */
3952
+ shaka.mss.MssParser = class {
3953
+ /** Creates a new MSS parser. */
3954
+ constructor() {}
3955
+ /**
3956
+ * @override
3957
+ */
3958
+ configure(config) {}
3959
+ /**
3960
+ * @override
3961
+ */
3962
+ start(uri, playerInterface) {}
3963
+ /**
3964
+ * @override
3965
+ */
3966
+ stop() {}
3967
+ /**
3968
+ * @override
3969
+ */
3970
+ update() {}
3971
+ /**
3972
+ * @override
3973
+ */
3974
+ onExpirationUpdated(sessionId, expiration) {}
3975
+ };
3677
3976
  /**
3678
3977
  * @summary A networking plugin to handle http and https URIs via the Fetch API.
3679
3978
  */
@@ -3963,11 +4262,20 @@ shaka.polyfill.MediaCapabilities = class {
3963
4262
  };
3964
4263
  /**
3965
4264
  * A copy of the MediaCapabilities instance, to prevent Safari from
3966
- * garbage-collecting the polyfilled method on it. We make it public and export
4265
+ * garbage-collecting the polyfilled method on it. We make it public and export
3967
4266
  * it to ensure that it is not stripped out by the compiler.
3968
4267
  * @type {MediaCapabilities}
3969
4268
  */
3970
4269
  shaka.polyfill.MediaCapabilities.originalMcap;
4270
+ /**
4271
+ * A cache that stores the MediaKeySystemAccess result of calling
4272
+ * `navigator.requestMediaKeySystemAccess` by a key combination of
4273
+ * video/audio codec and key system string.
4274
+ * @type {(Object<(!string), (!MediaKeySystemAccess)>)}
4275
+ */
4276
+ shaka.polyfill.MediaCapabilities.memoizedMediaKeySystemAccessRequests_ = {
4277
+
4278
+ };
3971
4279
  /**
3972
4280
  * @summary A polyfill to patch MSE bugs.
3973
4281
  */
@@ -4248,3 +4556,267 @@ shaka.text.SsaTextParser = class {
4248
4556
  */
4249
4557
  parseMedia(data, time) {}
4250
4558
  };
4559
+ /**
4560
+ * @implements {shaka.extern.Transmuxer}
4561
+ */
4562
+ shaka.transmuxer.AacTransmuxer = class {
4563
+ /**
4564
+ * @param {string} mimeType
4565
+ */
4566
+ constructor(mimeType) {}
4567
+ /**
4568
+ * @override
4569
+ */
4570
+ destroy() {}
4571
+ /**
4572
+ * Check if the mime type and the content type is supported.
4573
+ * @param {string} mimeType
4574
+ * @param {string=} contentType
4575
+ * @return {boolean}
4576
+ * @override
4577
+ */
4578
+ isSupported(mimeType, contentType) {}
4579
+ /**
4580
+ * @override
4581
+ */
4582
+ convertCodecs(contentType, mimeType) {}
4583
+ /**
4584
+ * @override
4585
+ */
4586
+ getOrginalMimeType() {}
4587
+ /**
4588
+ * @override
4589
+ */
4590
+ transmux(data, stream, reference, duration) {}
4591
+ };
4592
+ /**
4593
+ * @implements {shaka.extern.Transmuxer}
4594
+ */
4595
+ shaka.transmuxer.Ac3Transmuxer = class {
4596
+ /**
4597
+ * @param {string} mimeType
4598
+ */
4599
+ constructor(mimeType) {}
4600
+ /**
4601
+ * @override
4602
+ */
4603
+ destroy() {}
4604
+ /**
4605
+ * Check if the mime type and the content type is supported.
4606
+ * @param {string} mimeType
4607
+ * @param {string=} contentType
4608
+ * @return {boolean}
4609
+ * @override
4610
+ */
4611
+ isSupported(mimeType, contentType) {}
4612
+ /**
4613
+ * @override
4614
+ */
4615
+ convertCodecs(contentType, mimeType) {}
4616
+ /**
4617
+ * @override
4618
+ */
4619
+ getOrginalMimeType() {}
4620
+ /**
4621
+ * @override
4622
+ */
4623
+ transmux(data, stream, reference, duration) {}
4624
+ };
4625
+ /**
4626
+ * @implements {shaka.extern.Transmuxer}
4627
+ */
4628
+ shaka.transmuxer.Ec3Transmuxer = class {
4629
+ /**
4630
+ * @param {string} mimeType
4631
+ */
4632
+ constructor(mimeType) {}
4633
+ /**
4634
+ * @override
4635
+ */
4636
+ destroy() {}
4637
+ /**
4638
+ * Check if the mime type and the content type is supported.
4639
+ * @param {string} mimeType
4640
+ * @param {string=} contentType
4641
+ * @return {boolean}
4642
+ * @override
4643
+ */
4644
+ isSupported(mimeType, contentType) {}
4645
+ /**
4646
+ * @override
4647
+ */
4648
+ convertCodecs(contentType, mimeType) {}
4649
+ /**
4650
+ * @override
4651
+ */
4652
+ getOrginalMimeType() {}
4653
+ /**
4654
+ * @override
4655
+ */
4656
+ transmux(data, stream, reference, duration) {}
4657
+ };
4658
+ /**
4659
+ * @implements {shaka.extern.Transmuxer}
4660
+ */
4661
+ shaka.transmuxer.Mp3Transmuxer = class {
4662
+ /**
4663
+ * @param {string} mimeType
4664
+ */
4665
+ constructor(mimeType) {}
4666
+ /**
4667
+ * @override
4668
+ */
4669
+ destroy() {}
4670
+ /**
4671
+ * Check if the mime type and the content type is supported.
4672
+ * @param {string} mimeType
4673
+ * @param {string=} contentType
4674
+ * @return {boolean}
4675
+ * @override
4676
+ */
4677
+ isSupported(mimeType, contentType) {}
4678
+ /**
4679
+ * @override
4680
+ */
4681
+ convertCodecs(contentType, mimeType) {}
4682
+ /**
4683
+ * @override
4684
+ */
4685
+ getOrginalMimeType() {}
4686
+ /**
4687
+ * @override
4688
+ */
4689
+ transmux(data, stream, reference, duration) {}
4690
+ };
4691
+ /**
4692
+ * @implements {shaka.extern.Transmuxer}
4693
+ */
4694
+ shaka.transmuxer.MpegTsTransmuxer = class {
4695
+ /**
4696
+ * @param {string} mimeType
4697
+ */
4698
+ constructor(mimeType) {}
4699
+ /**
4700
+ * @override
4701
+ */
4702
+ destroy() {}
4703
+ /**
4704
+ * Check if the mime type and the content type is supported.
4705
+ * @param {string} mimeType
4706
+ * @param {string=} contentType
4707
+ * @return {boolean}
4708
+ * @override
4709
+ */
4710
+ isSupported(mimeType, contentType) {}
4711
+ /**
4712
+ * @override
4713
+ */
4714
+ convertCodecs(contentType, mimeType) {}
4715
+ /**
4716
+ * @override
4717
+ */
4718
+ getOrginalMimeType() {}
4719
+ /**
4720
+ * @override
4721
+ */
4722
+ transmux(data) {}
4723
+ };
4724
+ /**
4725
+ * @implements {shaka.extern.Transmuxer}
4726
+ */
4727
+ shaka.transmuxer.MssTransmuxer = class {
4728
+ /**
4729
+ * @param {string} mimeType
4730
+ */
4731
+ constructor(mimeType) {}
4732
+ /**
4733
+ * @override
4734
+ */
4735
+ destroy() {}
4736
+ /**
4737
+ * Check if the mime type and the content type is supported.
4738
+ * @param {string} mimeType
4739
+ * @param {string=} contentType
4740
+ * @return {boolean}
4741
+ * @override
4742
+ */
4743
+ isSupported(mimeType, contentType) {}
4744
+ /**
4745
+ * @override
4746
+ */
4747
+ convertCodecs(contentType, mimeType) {}
4748
+ /**
4749
+ * @override
4750
+ */
4751
+ getOrginalMimeType() {}
4752
+ /**
4753
+ * @override
4754
+ */
4755
+ transmux(data, stream, reference) {}
4756
+ };
4757
+ /**
4758
+ * @implements {shaka.extern.Transmuxer}
4759
+ */
4760
+ shaka.transmuxer.MuxjsTransmuxer = class {
4761
+ /**
4762
+ * @param {string} mimeType
4763
+ */
4764
+ constructor(mimeType) {}
4765
+ /**
4766
+ * @override
4767
+ */
4768
+ destroy() {}
4769
+ /**
4770
+ * Check if the mime type and the content type is supported.
4771
+ * @param {string} mimeType
4772
+ * @param {string=} contentType
4773
+ * @return {boolean}
4774
+ * @override
4775
+ */
4776
+ isSupported(mimeType, contentType) {}
4777
+ /**
4778
+ * @override
4779
+ */
4780
+ convertCodecs(contentType, mimeType) {}
4781
+ /**
4782
+ * @override
4783
+ */
4784
+ getOrginalMimeType() {}
4785
+ /**
4786
+ * @override
4787
+ */
4788
+ transmux(data) {}
4789
+ };
4790
+ /**
4791
+ * @implements {shaka.extern.Transmuxer}
4792
+ */
4793
+ shaka.transmuxer.TsTransmuxer = class {
4794
+ /**
4795
+ * @param {string} mimeType
4796
+ */
4797
+ constructor(mimeType) {}
4798
+ /**
4799
+ * @override
4800
+ */
4801
+ destroy() {}
4802
+ /**
4803
+ * Check if the mime type and the content type is supported.
4804
+ * @param {string} mimeType
4805
+ * @param {string=} contentType
4806
+ * @return {boolean}
4807
+ * @override
4808
+ */
4809
+ isSupported(mimeType, contentType) {}
4810
+ /**
4811
+ * @override
4812
+ */
4813
+ convertCodecs(contentType, mimeType) {}
4814
+ /**
4815
+ * @override
4816
+ */
4817
+ getOrginalMimeType() {}
4818
+ /**
4819
+ * @override
4820
+ */
4821
+ transmux(data, stream, reference, duration) {}
4822
+ };