shaka-player 4.3.10 → 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 (316) hide show
  1. package/.github/workflows/release-please.yaml +7 -0
  2. package/AUTHORS +9 -0
  3. package/CHANGELOG.md +295 -200
  4. package/CONTRIBUTORS +8 -0
  5. package/LICENSE +32 -0
  6. package/README.md +63 -10
  7. package/demo/autoTemplate.txt +40 -5
  8. package/demo/close_button.js +11 -0
  9. package/demo/common/asset.js +13 -1
  10. package/demo/common/assets.js +53 -3
  11. package/demo/common/message_ids.js +25 -1
  12. package/demo/config.js +69 -10
  13. package/demo/customWarning.txt +2 -2
  14. package/demo/index.html +3 -1
  15. package/demo/locales/en.json +26 -2
  16. package/demo/locales/source.json +105 -9
  17. package/demo/main.js +52 -9
  18. package/demo/search.js +3 -1
  19. package/demo/service_worker.js +3 -0
  20. package/dist/controls.css +1 -1
  21. package/dist/controls.css.map +1 -1
  22. package/dist/demo.compiled.debug.js +124 -112
  23. package/dist/demo.compiled.debug.map +3 -3
  24. package/dist/demo.compiled.js +124 -112
  25. package/dist/demo.compiled.map +3 -3
  26. package/dist/deps.js +46 -28
  27. package/dist/locales.js +28 -28
  28. package/dist/receiver.compiled.debug.js +52 -46
  29. package/dist/receiver.compiled.debug.map +3 -3
  30. package/dist/receiver.compiled.js +52 -46
  31. package/dist/receiver.compiled.map +3 -3
  32. package/dist/shaka-player.compiled.d.ts +676 -391
  33. package/dist/shaka-player.compiled.debug.d.ts +676 -391
  34. package/dist/shaka-player.compiled.debug.externs.js +1188 -616
  35. package/dist/shaka-player.compiled.debug.js +1045 -700
  36. package/dist/shaka-player.compiled.debug.map +4 -4
  37. package/dist/shaka-player.compiled.externs.js +1188 -616
  38. package/dist/shaka-player.compiled.js +1094 -933
  39. package/dist/shaka-player.compiled.map +4 -4
  40. package/dist/shaka-player.ui.d.ts +677 -392
  41. package/dist/shaka-player.ui.debug.d.ts +677 -392
  42. package/dist/shaka-player.ui.debug.externs.js +1023 -451
  43. package/dist/shaka-player.ui.debug.js +1100 -739
  44. package/dist/shaka-player.ui.debug.map +4 -4
  45. package/dist/shaka-player.ui.externs.js +1023 -451
  46. package/dist/shaka-player.ui.js +1244 -1071
  47. package/dist/shaka-player.ui.map +4 -4
  48. package/docs/tutorials/ad_monetization.md +15 -1
  49. package/docs/tutorials/application-level-redirects.md +1 -1
  50. package/docs/tutorials/config.md +9 -5
  51. package/docs/tutorials/drm-config.md +61 -0
  52. package/docs/tutorials/fairplay.md +19 -4
  53. package/docs/tutorials/license-server-auth.md +4 -4
  54. package/docs/tutorials/license-wrapping.md +2 -2
  55. package/docs/tutorials/ui-customization.md +7 -3
  56. package/docs/tutorials/ui.md +7 -7
  57. package/docs/tutorials/upgrade.md +3 -0
  58. package/externs/ima.js +123 -2
  59. package/externs/isoboxer.js +217 -0
  60. package/externs/mediakeys.js +18 -0
  61. package/externs/mux.js +1 -105
  62. package/externs/pictureinpicture.js +48 -0
  63. package/externs/shaka/ads.js +61 -1
  64. package/externs/shaka/cea.js +110 -0
  65. package/externs/shaka/codecs.js +32 -0
  66. package/externs/shaka/manifest.js +101 -1
  67. package/externs/shaka/manifest_parser.js +0 -10
  68. package/externs/shaka/net.js +36 -7
  69. package/externs/shaka/offline.js +8 -1
  70. package/externs/shaka/player.js +220 -21
  71. package/externs/shaka/text.js +1 -382
  72. package/externs/shaka/transmuxer.js +59 -0
  73. package/karma.conf.js +13 -0
  74. package/lib/abr/simple_abr_manager.js +6 -3
  75. package/lib/ads/ad_manager.js +60 -2
  76. package/lib/ads/client_side_ad.js +86 -0
  77. package/lib/ads/client_side_ad_manager.js +79 -3
  78. package/lib/ads/server_side_ad.js +86 -0
  79. package/lib/ads/server_side_ad_manager.js +13 -0
  80. package/lib/cast/cast_utils.js +1 -0
  81. package/lib/cea/cea608_data_channel.js +24 -14
  82. package/lib/cea/cea608_memory.js +5 -2
  83. package/lib/cea/cea708_service.js +8 -9
  84. package/lib/cea/cea708_window.js +1 -2
  85. package/lib/cea/cea_decoder.js +23 -6
  86. package/lib/cea/cea_utils.js +25 -2
  87. package/lib/cea/dummy_caption_decoder.js +21 -0
  88. package/lib/cea/dummy_cea_parser.js +1 -3
  89. package/lib/cea/mp4_cea_parser.js +15 -10
  90. package/lib/cea/ts_cea_parser.js +69 -0
  91. package/lib/dash/content_protection.js +32 -2
  92. package/lib/dash/dash_parser.js +93 -31
  93. package/lib/dash/mpd_utils.js +6 -25
  94. package/lib/dash/segment_base.js +12 -14
  95. package/lib/dash/segment_list.js +10 -6
  96. package/lib/dash/segment_template.js +349 -32
  97. package/lib/dependencies/all.js +8 -0
  98. package/lib/hls/hls_classes.js +33 -8
  99. package/lib/hls/hls_parser.js +805 -191
  100. package/lib/hls/manifest_text_parser.js +4 -14
  101. package/lib/media/adaptation_set_criteria.js +43 -3
  102. package/lib/media/closed_caption_parser.js +74 -12
  103. package/lib/media/drm_engine.js +189 -49
  104. package/lib/media/gap_jumping_controller.js +1 -1
  105. package/lib/media/manifest_parser.js +34 -0
  106. package/lib/media/media_source_capabilities.js +10 -0
  107. package/lib/media/media_source_engine.js +475 -231
  108. package/lib/media/playhead.js +1 -1
  109. package/lib/media/presentation_timeline.js +62 -0
  110. package/lib/media/segment_index.js +50 -14
  111. package/lib/media/segment_prefetch.js +277 -0
  112. package/lib/media/segment_reference.js +70 -4
  113. package/lib/media/streaming_engine.js +258 -81
  114. package/lib/media/video_wrapper.js +15 -7
  115. package/lib/mss/content_protection.js +353 -0
  116. package/lib/mss/mss_parser.js +1081 -0
  117. package/lib/net/networking_engine.js +60 -10
  118. package/lib/offline/indexeddb/v1_storage_cell.js +1 -0
  119. package/lib/offline/indexeddb/v2_storage_cell.js +1 -0
  120. package/lib/offline/manifest_converter.js +6 -0
  121. package/lib/offline/storage.js +2 -4
  122. package/lib/player.js +309 -105
  123. package/lib/polyfill/media_capabilities.js +43 -3
  124. package/lib/polyfill/patchedmediakeys_apple.js +5 -0
  125. package/lib/polyfill/patchedmediakeys_nop.js +5 -0
  126. package/lib/polyfill/patchedmediakeys_webkit.js +5 -0
  127. package/lib/text/cue.js +208 -130
  128. package/lib/text/lrc_text_parser.js +2 -2
  129. package/lib/text/mp4_vtt_parser.js +2 -2
  130. package/lib/text/sbv_text_parser.js +1 -1
  131. package/lib/text/simple_text_displayer.js +2 -1
  132. package/lib/text/srt_text_parser.js +9 -1
  133. package/lib/text/ssa_text_parser.js +2 -2
  134. package/lib/text/text_engine.js +3 -21
  135. package/lib/text/text_utils.js +71 -20
  136. package/lib/text/ui_text_displayer.js +14 -14
  137. package/lib/text/vtt_text_parser.js +22 -14
  138. package/lib/transmuxer/aac_transmuxer.js +224 -0
  139. package/lib/transmuxer/ac3.js +142 -0
  140. package/lib/transmuxer/ac3_transmuxer.js +212 -0
  141. package/lib/transmuxer/adts.js +232 -0
  142. package/lib/transmuxer/ec3.js +103 -0
  143. package/lib/transmuxer/ec3_transmuxer.js +212 -0
  144. package/lib/transmuxer/h264.js +324 -0
  145. package/lib/transmuxer/mp3_transmuxer.js +204 -0
  146. package/lib/transmuxer/mpeg_audio.js +196 -0
  147. package/lib/transmuxer/mpeg_ts_transmuxer.js +182 -0
  148. package/lib/transmuxer/mss_transmuxer.js +389 -0
  149. package/lib/{media/transmuxer.js → transmuxer/muxjs_transmuxer.js} +34 -80
  150. package/lib/transmuxer/transmuxer_engine.js +161 -0
  151. package/lib/transmuxer/ts_transmuxer.js +738 -0
  152. package/lib/util/cmcd_manager.js +131 -71
  153. package/lib/util/error.js +62 -26
  154. package/lib/util/exp_golomb.js +220 -0
  155. package/lib/util/fairplay_utils.js +64 -13
  156. package/lib/util/id3_utils.js +56 -3
  157. package/lib/util/language_utils.js +11 -8
  158. package/lib/util/manifest_parser_utils.js +3 -0
  159. package/lib/util/mime_utils.js +44 -7
  160. package/lib/util/mp4_box_parsers.js +233 -5
  161. package/lib/util/mp4_generator.js +1381 -0
  162. package/lib/util/periods.js +40 -34
  163. package/lib/util/platform.js +17 -3
  164. package/lib/util/player_configuration.js +38 -1
  165. package/lib/util/stream_utils.js +138 -27
  166. package/lib/util/text_parser.js +1 -1
  167. package/lib/util/ts_parser.js +470 -47
  168. package/lib/util/xml_utils.js +16 -3
  169. package/maintained-branches.md +2 -2
  170. package/package.json +3 -1
  171. package/roadmap.md +21 -6
  172. package/shaka-player.uncompiled.js +18 -0
  173. package/test/abr/simple_abr_manager_unit.js +32 -4
  174. package/test/ads/ad_manager_unit.js +18 -2
  175. package/test/cast/cast_utils_unit.js +7 -2
  176. package/test/cea/cea608_memory_unit.js +24 -0
  177. package/test/cea/cea_decoder_unit.js +33 -0
  178. package/test/dash/dash_parser_content_protection_unit.js +93 -3
  179. package/test/dash/dash_parser_live_unit.js +56 -13
  180. package/test/dash/dash_parser_manifest_unit.js +70 -2
  181. package/test/dash/dash_parser_segment_base_unit.js +14 -9
  182. package/test/dash/dash_parser_segment_template_unit.js +286 -6
  183. package/test/demo/demo_unit.js +5 -1
  184. package/test/hls/hls_live_unit.js +188 -28
  185. package/test/hls/hls_parser_unit.js +250 -109
  186. package/test/hls/manifest_text_parser_unit.js +18 -13
  187. package/test/media/adaptation_set_criteria_unit.js +46 -14
  188. package/test/media/adaptation_set_unit.js +2 -0
  189. package/test/media/drm_engine_integration.js +11 -8
  190. package/test/media/drm_engine_unit.js +220 -7
  191. package/test/media/media_source_engine_integration.js +122 -38
  192. package/test/media/media_source_engine_unit.js +133 -153
  193. package/test/media/playhead_unit.js +3 -0
  194. package/test/media/presentation_timeline_unit.js +51 -0
  195. package/test/media/segment_index_unit.js +52 -0
  196. package/test/media/segment_prefetch_unit.js +243 -0
  197. package/test/media/streaming_engine_integration.js +9 -3
  198. package/test/media/streaming_engine_unit.js +440 -59
  199. package/test/mss/mss_parser_content_protection_unit.js +49 -0
  200. package/test/mss/mss_parser_unit.js +472 -0
  201. package/test/mss/mss_player_integration.js +123 -0
  202. package/test/offline/manifest_convert_unit.js +9 -0
  203. package/test/offline/storage_integration.js +6 -1
  204. package/test/player_unit.js +386 -133
  205. package/test/polyfill/media_capabilities_unit.js +18 -0
  206. package/test/test/assets/hls-raw-aac/fileSequence0.aac +0 -0
  207. package/test/test/assets/hls-raw-aac/fileSequence1.aac +0 -0
  208. package/test/test/assets/hls-raw-aac/fileSequence2.aac +0 -0
  209. package/test/test/assets/hls-raw-aac/fileSequence3.aac +0 -0
  210. package/test/test/assets/hls-raw-aac/manifest.m3u8 +4 -0
  211. package/test/test/assets/hls-raw-aac/stream.m4a.m3u8 +14 -0
  212. package/test/test/assets/hls-raw-ac3/fileSequence0.ac3 +0 -0
  213. package/test/test/assets/hls-raw-ac3/fileSequence1.ac3 +0 -0
  214. package/test/test/assets/hls-raw-ac3/fileSequence2.ac3 +0 -0
  215. package/test/test/assets/hls-raw-ac3/fileSequence3.ac3 +0 -0
  216. package/test/test/assets/hls-raw-ac3/fileSequence4.ac3 +0 -0
  217. package/test/test/assets/hls-raw-ac3/fileSequence5.ac3 +0 -0
  218. package/test/test/assets/hls-raw-ac3/fileSequence6.ac3 +0 -0
  219. package/test/test/assets/hls-raw-ac3/fileSequence7.ac3 +0 -0
  220. package/test/test/assets/hls-raw-ac3/prog_index.m3u8 +31 -0
  221. package/test/test/assets/hls-raw-ec3/fileSequence0.ec3 +0 -0
  222. package/test/test/assets/hls-raw-ec3/fileSequence1.ec3 +0 -0
  223. package/test/test/assets/hls-raw-ec3/fileSequence2.ec3 +0 -0
  224. package/test/test/assets/hls-raw-ec3/fileSequence3.ec3 +0 -0
  225. package/test/test/assets/hls-raw-ec3/fileSequence4.ec3 +0 -0
  226. package/test/test/assets/hls-raw-ec3/fileSequence5.ec3 +0 -0
  227. package/test/test/assets/hls-raw-ec3/fileSequence6.ec3 +0 -0
  228. package/test/test/assets/hls-raw-ec3/fileSequence7.ec3 +0 -0
  229. package/test/test/assets/hls-raw-ec3/prog_index.m3u8 +31 -0
  230. package/test/test/assets/hls-raw-mp3/chunklist_w905519204.m3u8 +13 -0
  231. package/test/test/assets/hls-raw-mp3/media_w905519204_0.mp3 +0 -0
  232. package/test/test/assets/hls-raw-mp3/media_w905519204_1.mp3 +0 -0
  233. package/test/test/assets/hls-raw-mp3/media_w905519204_2.mp3 +0 -0
  234. package/test/test/assets/hls-raw-mp3/media_w905519204_3.mp3 +0 -0
  235. package/test/test/assets/hls-raw-mp3/playlist.m3u8 +4 -0
  236. package/test/test/assets/hls-ts-aac/playlist.m3u8 +23 -0
  237. package/test/test/assets/hls-ts-aac/segment_0.ts +0 -0
  238. package/test/test/assets/hls-ts-aac/segment_1.ts +0 -0
  239. package/test/test/assets/hls-ts-aac/segment_2.ts +0 -0
  240. package/test/test/assets/hls-ts-aac/segment_3.ts +0 -0
  241. package/test/test/assets/hls-ts-aac/segment_4.ts +0 -0
  242. package/test/test/assets/hls-ts-aac/segment_5.ts +0 -0
  243. package/test/test/assets/hls-ts-aac/segment_6.ts +0 -0
  244. package/test/test/assets/hls-ts-aac/segment_7.ts +0 -0
  245. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0000.ts +0 -0
  246. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0001.ts +0 -0
  247. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0002.ts +0 -0
  248. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0003.ts +0 -0
  249. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0004.ts +0 -0
  250. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0005.ts +0 -0
  251. package/test/test/assets/hls-ts-ac3/prog_index.m3u8 +19 -0
  252. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0000.ts +0 -0
  253. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0001.ts +0 -0
  254. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0002.ts +0 -0
  255. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0003.ts +0 -0
  256. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0004.ts +0 -0
  257. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0005.ts +0 -0
  258. package/test/test/assets/hls-ts-ec3/prog_index.m3u8 +19 -0
  259. package/test/test/assets/hls-ts-h264/fileSequence0.ts +0 -0
  260. package/test/test/assets/hls-ts-h264/fileSequence1.ts +0 -0
  261. package/test/test/assets/hls-ts-h264/fileSequence2.ts +0 -0
  262. package/test/test/assets/hls-ts-h264/fileSequence3.ts +0 -0
  263. package/test/test/assets/hls-ts-h264/fileSequence4.ts +0 -0
  264. package/test/test/assets/hls-ts-h264/fileSequence5.ts +0 -0
  265. package/test/test/assets/hls-ts-h264/prog_index.m3u8 +25 -0
  266. package/test/test/assets/hls-ts-mp3/manifest.m3u8 +13 -0
  267. package/test/test/assets/hls-ts-mp3/media_w239891843_0.ts +0 -0
  268. package/test/test/assets/hls-ts-mp3/media_w239891843_1.ts +0 -0
  269. package/test/test/assets/hls-ts-mp3/media_w239891843_2.ts +0 -0
  270. package/test/test/assets/hls-ts-mp3/media_w239891843_3.ts +0 -0
  271. package/test/test/assets/hls-ts-muxed-aac-h264/chunk.m3u8 +17 -0
  272. package/test/test/assets/hls-ts-muxed-aac-h264/n_0_0_0.ts +0 -0
  273. package/test/test/assets/hls-ts-muxed-aac-h264/n_1_0_0.ts +0 -0
  274. package/test/test/assets/hls-ts-muxed-aac-h264/n_2_0_0.ts +0 -0
  275. package/test/test/assets/hls-ts-muxed-aac-h264/n_3_0_0.ts +0 -0
  276. package/test/test/assets/hls-ts-muxed-aac-h264/n_4_0_0.ts +0 -0
  277. package/test/test/assets/hls-ts-muxed-aac-h264/n_5_0_0.ts +0 -0
  278. package/test/test/assets/hls-ts-muxed-aac-h264/playlist.m3u8 +4 -0
  279. package/test/test/boot.js +7 -2
  280. package/test/test/util/fake_ad.js +99 -0
  281. package/test/test/util/fake_ad_manager.js +7 -1
  282. package/test/test/util/fake_networking_engine.js +41 -14
  283. package/test/test/util/fake_segment_prefetch.js +81 -0
  284. package/test/test/util/manifest_generator.js +19 -5
  285. package/test/test/util/mss_parser_util.js +115 -0
  286. package/test/test/util/offline_utils.js +1 -0
  287. package/test/test/util/simple_fakes.js +12 -3
  288. package/test/test/util/streaming_engine_util.js +14 -4
  289. package/test/test/util/ttml_utils.js +2 -2
  290. package/test/text/cue_integration.js +1 -1
  291. package/test/text/srt_text_parser_unit.js +78 -0
  292. package/test/text/text_engine_unit.js +17 -8
  293. package/test/text/ui_text_displayer_unit.js +4 -4
  294. package/test/text/vtt_text_parser_unit.js +59 -40
  295. package/test/text/web_vtt_generator_unit.js +9 -3
  296. package/test/{media/transmuxer_integration.js → transmuxer/muxjs_transmuxer_integration.js} +30 -33
  297. package/test/transmuxer/transmuxer_engine_integration.js +60 -0
  298. package/test/transmuxer/transmuxer_integration.js +296 -0
  299. package/test/util/cmcd_manager_unit.js +162 -13
  300. package/test/util/language_utils_unit.js +9 -2
  301. package/test/util/mp4_box_parsers_unit.js +39 -4
  302. package/test/util/periods_unit.js +34 -26
  303. package/test/util/stream_utils_unit.js +60 -107
  304. package/ui/controls.js +19 -1
  305. package/ui/controls.less +1 -0
  306. package/ui/externs/ui.js +11 -1
  307. package/ui/language_utils.js +15 -0
  308. package/ui/less/thumbnails.less +26 -0
  309. package/ui/locales/oc.json +42 -0
  310. package/ui/pip_button.js +83 -2
  311. package/ui/range_element.js +15 -0
  312. package/ui/resolution_selection.js +9 -2
  313. package/ui/seek_bar.js +223 -0
  314. package/ui/ui.js +5 -0
  315. package/lib/cea/i_caption_decoder.js +0 -51
  316. package/lib/cea/i_cea_parser.js +0 -68
@@ -225,6 +225,7 @@ shaka.extern.BufferedInfo;
225
225
  * primary: boolean,
226
226
  * roles: !Array.<string>,
227
227
  * audioRoles: Array.<string>,
228
+ * accessibilityPurpose: ?shaka.media.ManifestParser.AccessibilityPurpose,
228
229
  * forced: boolean,
229
230
  * videoId: ?number,
230
231
  * audioId: ?number,
@@ -237,7 +238,8 @@ shaka.extern.BufferedInfo;
237
238
  * originalVideoId: ?string,
238
239
  * originalAudioId: ?string,
239
240
  * originalTextId: ?string,
240
- * originalImageId: ?string
241
+ * originalImageId: ?string,
242
+ * originalLanguage: ?string
241
243
  * }}
242
244
  *
243
245
  * @description
@@ -259,8 +261,10 @@ shaka.extern.BufferedInfo;
259
261
  * The bandwidth required to play the track, in bits/sec.
260
262
  *
261
263
  * @property {string} language
262
- * The language of the track, or <code>'und'</code> if not given. This is the
263
- * exact value provided in the manifest; it may need to be normalized.
264
+ * The language of the track, or <code>'und'</code> if not given. This value
265
+ * is normalized as follows - language part is always lowercase and translated
266
+ * to ISO-639-1 when possible, locale part is always uppercase,
267
+ * i.e. <code>'en-US'</code>.
264
268
  * @property {?string} label
265
269
  * The track label, which is unique text that should describe the track.
266
270
  * @property {?string} kind
@@ -301,6 +305,10 @@ shaka.extern.BufferedInfo;
301
305
  * The roles of the audio in the track, e.g. <code>'main'</code> or
302
306
  * <code>'commentary'</code>. Will be null for text tracks or variant tracks
303
307
  * without audio.
308
+ * @property {?shaka.media.ManifestParser.AccessibilityPurpose}
309
+ * accessibilityPurpose
310
+ * The DASH accessibility descriptor, if one was provided for this track.
311
+ * For text tracks, this describes the text; otherwise, this is for the audio.
304
312
  * @property {boolean} forced
305
313
  * True indicates that this in the forced text language for the content.
306
314
  * This flag is based on signals from the manifest.
@@ -335,6 +343,10 @@ shaka.extern.BufferedInfo;
335
343
  * @property {?string} originalImageId
336
344
  * (image tracks only) The original ID of the image track, if any, as it
337
345
  * appeared in the original manifest.
346
+ * @property {?string} originalLanguage
347
+ * The original language of the track, if any, as it appeared in the original
348
+ * manifest. This is the exact value provided in the manifest; for normalized
349
+ * value use <code>language</code> property.
338
350
  * @exportDoc
339
351
  */
340
352
  shaka.extern.Track;
@@ -482,13 +494,13 @@ shaka.extern.MetadataRawFrame;
482
494
  /**
483
495
  * @typedef {{
484
496
  * key: string,
485
- * data: (ArrayBuffer|string),
497
+ * data: (ArrayBuffer|string|number),
486
498
  * description: string
487
499
  * }}
488
500
  *
489
501
  * @description metadata frame parsed.
490
502
  * @property {string} key
491
- * @property {ArrayBuffer|string} data
503
+ * @property {ArrayBuffer|string|number} data
492
504
  * @property {string} description
493
505
  * @exportDoc
494
506
  */
@@ -681,19 +693,68 @@ shaka.extern.ProducerReferenceTime;
681
693
  shaka.extern.AdvancedDrmConfiguration;
682
694
 
683
695
 
696
+ /**
697
+ * @typedef {{
698
+ * sessionId: string,
699
+ * sessionType: string,
700
+ * initData: ?Uint8Array,
701
+ * initDataType: ?string
702
+ * }}
703
+ *
704
+ * @description
705
+ * DRM Session Metadata for an active session
706
+ *
707
+ * @property {string} sessionId
708
+ * Session id
709
+ * @property {string} sessionType
710
+ * Session type
711
+ * @property {?Uint8Array} initData
712
+ * Initialization data in the format indicated by initDataType.
713
+ * @property {string} initDataType
714
+ * A string to indicate what format initData is in.
715
+ * @exportDoc
716
+ */
717
+ shaka.extern.DrmSessionMetadata;
718
+
719
+
720
+ /**
721
+ * @typedef {{
722
+ * sessionId: string,
723
+ * initData: ?Uint8Array,
724
+ * initDataType: ?string
725
+ * }}
726
+ *
727
+ * @description
728
+ * DRM Session Metadata for saved persistent session
729
+ *
730
+ * @property {string} sessionId
731
+ * Session id
732
+ * @property {?Uint8Array} initData
733
+ * Initialization data in the format indicated by initDataType.
734
+ * @property {?string} initDataType
735
+ * A string to indicate what format initData is in.
736
+ * @exportDoc
737
+ */
738
+ shaka.extern.PersistentSessionMetadata;
739
+
740
+
684
741
  /**
685
742
  * @typedef {{
686
743
  * retryParameters: shaka.extern.RetryParameters,
687
744
  * servers: !Object.<string, string>,
688
745
  * clearKeys: !Object.<string, string>,
689
746
  * delayLicenseRequestUntilPlayed: boolean,
747
+ * persistentSessionOnlinePlayback: boolean,
748
+ * persistentSessionsMetadata:
749
+ * !Array.<shaka.extern.PersistentSessionMetadata>,
690
750
  * advanced: Object.<string, shaka.extern.AdvancedDrmConfiguration>,
691
751
  * initDataTransform:(shaka.extern.InitDataTransform|undefined),
692
752
  * logLicenseExchange: boolean,
693
753
  * updateExpirationTime: number,
694
754
  * preferredKeySystems: !Array.<string>,
695
755
  * keySystemsMapping: !Object.<string, string>,
696
- * parseInbandPsshEnabled: boolean
756
+ * parseInbandPsshEnabled: boolean,
757
+ * minHdcpVersion: string
697
758
  * }}
698
759
  *
699
760
  * @property {shaka.extern.RetryParameters} retryParameters
@@ -710,6 +771,13 @@ shaka.extern.AdvancedDrmConfiguration;
710
771
  * <i>Defaults to false.</i> <br>
711
772
  * True to configure drm to delay sending a license request until a user
712
773
  * actually starts playing content.
774
+ * @property {boolean} persistentSessionOnlinePlayback
775
+ * <i>Defaults to false.</i> <br>
776
+ * True to configure drm to try playback with given persistent session ids
777
+ * before requesting a license. Also prevents the session removal at playback
778
+ * stop, as-to be able to re-use it later.
779
+ * @property {!Array.<PersistentSessionMetadata>} persistentSessionsMetadata
780
+ * Persistent sessions metadata to load before starting playback
713
781
  * @property {Object.<string, shaka.extern.AdvancedDrmConfiguration>} advanced
714
782
  * <i>Optional.</i> <br>
715
783
  * A dictionary which maps key system IDs to advanced DRM configuration for
@@ -738,6 +806,10 @@ shaka.extern.AdvancedDrmConfiguration;
738
806
  * When true parse DRM init data from pssh boxes in media and init segments
739
807
  * and ignore 'encrypted' events.
740
808
  * This is required when using in-band key rotation on Xbox One.
809
+ * @property {string} minHdcpVersion
810
+ * <i>By default (''), do not check the HDCP version.</i><br>
811
+ * Indicates the minimum version of HDCP to start the playback of encrypted
812
+ * streams. <b>May be ignored if not supported by the device.</b>
741
813
  *
742
814
  * @exportDoc
743
815
  */
@@ -841,7 +913,9 @@ shaka.extern.DashManifestConfiguration;
841
913
  * ignoreManifestProgramDateTime: boolean,
842
914
  * mediaPlaylistFullMimeType: string,
843
915
  * useSafariBehaviorForLive: boolean,
844
- * liveSegmentsDelay: number
916
+ * liveSegmentsDelay: number,
917
+ * sequenceMode: boolean,
918
+ * ignoreManifestTimestampsInSegmentsMode: boolean
845
919
  * }}
846
920
  *
847
921
  * @property {boolean} ignoreTextStreamFailures
@@ -882,11 +956,46 @@ shaka.extern.DashManifestConfiguration;
882
956
  * The default presentation delay will be calculated as a number of segments.
883
957
  * This is the number of segments for this calculation..
884
958
  * <i>Defaults to <code>3</code>.</i>
959
+ * @property {boolean} sequenceMode
960
+ * If true, the media segments are appended to the SourceBuffer in
961
+ * "sequence mode" (ignoring their internal timestamps).
962
+ * Defaults to <code>true</code> except on WebOS 3, Tizen 2,
963
+ * Tizen 3 and PlayStation 4 whose default value is <code>false</code>.
964
+ * @property {boolean} ignoreManifestTimestampsInSegmentsMode
965
+ * If true, don't adjust the timestamp offset to account for manifest
966
+ * segment durations being out of sync with segment durations. In other
967
+ * words, assume that there are no gaps in the segments when appending
968
+ * to the SourceBuffer, even if the manifest and segment times disagree.
969
+ * Only applies when sequenceMode is <code>false</code>.
970
+ * <i>Defaults to <code>false</code>.</i>
885
971
  * @exportDoc
886
972
  */
887
973
  shaka.extern.HlsManifestConfiguration;
888
974
 
889
975
 
976
+ /**
977
+ * @typedef {{
978
+ * manifestPreprocessor: function(!Element),
979
+ * sequenceMode: boolean,
980
+ * keySystemsBySystemId: !Object.<string, string>
981
+ * }}
982
+ *
983
+ * @property {function(!Element)} manifestPreprocessor
984
+ * Called immediately after the MSS manifest has been parsed into an
985
+ * XMLDocument. Provides a way for applications to perform efficient
986
+ * preprocessing of the manifest.
987
+ * @property {boolean} sequenceMode
988
+ * If true, the media segments are appended to the SourceBuffer in
989
+ * "sequence mode" (ignoring their internal timestamps).
990
+ * <i>Defaults to <code>false</code>.</i>
991
+ * @property {Object.<string, string>} keySystemsBySystemId
992
+ * A map of system id to key system name. Defaults to default key systems
993
+ * mapping handled by Shaka.
994
+ * @exportDoc
995
+ */
996
+ shaka.extern.MssManifestConfiguration;
997
+
998
+
890
999
  /**
891
1000
  * @typedef {{
892
1001
  * retryParameters: shaka.extern.RetryParameters,
@@ -898,7 +1007,9 @@ shaka.extern.HlsManifestConfiguration;
898
1007
  * defaultPresentationDelay: number,
899
1008
  * segmentRelativeVttTiming: boolean,
900
1009
  * dash: shaka.extern.DashManifestConfiguration,
901
- * hls: shaka.extern.HlsManifestConfiguration
1010
+ * hls: shaka.extern.HlsManifestConfiguration,
1011
+ * mss: shaka.extern.MssManifestConfiguration,
1012
+ * raiseFatalErrorOnManifestUpdateRequestFailure: boolean
902
1013
  * }}
903
1014
  *
904
1015
  * @property {shaka.extern.RetryParameters} retryParameters
@@ -936,6 +1047,11 @@ shaka.extern.HlsManifestConfiguration;
936
1047
  * Advanced parameters used by the DASH manifest parser.
937
1048
  * @property {shaka.extern.HlsManifestConfiguration} hls
938
1049
  * Advanced parameters used by the HLS manifest parser.
1050
+ * @property {shaka.extern.MssManifestConfiguration} mss
1051
+ * Advanced parameters used by the MSS manifest parser.
1052
+ * @property {boolean} raiseFatalErrorOnManifestUpdateRequestFailure
1053
+ * If true, manifest update request failures will cause a fatal errror.
1054
+ * Defaults to <code>false</code> if not provided.
939
1055
  *
940
1056
  * @exportDoc
941
1057
  */
@@ -953,8 +1069,8 @@ shaka.extern.ManifestConfiguration;
953
1069
  * alwaysStreamText: boolean,
954
1070
  * startAtSegmentBoundary: boolean,
955
1071
  * gapDetectionThreshold: number,
1072
+ * gapJumpTimerTime: number,
956
1073
  * durationBackoff: number,
957
- * forceTransmux: boolean,
958
1074
  * safeSeekOffset: number,
959
1075
  * stallEnabled: boolean,
960
1076
  * stallThreshold: number,
@@ -969,7 +1085,11 @@ shaka.extern.ManifestConfiguration;
969
1085
  * dispatchAllEmsgBoxes: boolean,
970
1086
  * observeQualityChanges: boolean,
971
1087
  * maxDisabledTime: number,
972
- * parsePrftBox: boolean
1088
+ * parsePrftBox: boolean,
1089
+ * segmentPrefetchLimit: number,
1090
+ * liveSync: boolean,
1091
+ * liveSyncMaxLatency: number,
1092
+ * liveSyncPlaybackRate: number
973
1093
  * }}
974
1094
  *
975
1095
  * @description
@@ -1008,21 +1128,17 @@ shaka.extern.ManifestConfiguration;
1008
1128
  * time for live streams. This can put us further from the live edge. Defaults
1009
1129
  * to <code>false</code>.
1010
1130
  * @property {number} gapDetectionThreshold
1011
- * TThe maximum distance (in seconds) before a gap when we'll automatically
1012
- * jump. This value defaults to <code>0.1</code>, except in Edge Legacy,
1013
- * Tizen, Chromecast that value defaults value is <code>0.5</code>
1131
+ * The maximum distance (in seconds) before a gap when we'll automatically
1132
+ * jump. This value defaults to <code>0.5</code>.
1133
+ * @property {number} gapJumpTimerTime
1134
+ * The polling time in seconds to check for gaps in the media. This value
1135
+ * defaults to <code>0.25</code>.
1014
1136
  * @property {number} durationBackoff
1015
1137
  * By default, we will not allow seeking to exactly the duration of a
1016
1138
  * presentation. This field is the number of seconds before duration we will
1017
1139
  * seek to when the user tries to seek to or start playback at the duration.
1018
1140
  * To disable this behavior, the config can be set to 0. We recommend using
1019
1141
  * the default value unless you have a good reason not to.
1020
- * @property {boolean} forceTransmux
1021
- * If this is <code>true</code>, we will transmux AAC and TS content even if
1022
- * not strictly necessary for the assets to be played. Shaka Player
1023
- * currently only supports CEA 708 captions by transmuxing, so this value is
1024
- * necessary for enabling them on platforms with native TS support like Edge
1025
- * or Chromecast. This value defaults to <code>false</code>.
1026
1142
  * @property {number} safeSeekOffset
1027
1143
  * The amount of seconds that should be added when repositioning the playhead
1028
1144
  * after falling out of the availability window or seek. This gives the player
@@ -1085,6 +1201,23 @@ shaka.extern.ManifestConfiguration;
1085
1201
  * start date will not change, and would save parsing the segment multiple
1086
1202
  * times needlessly.
1087
1203
  * Defaults to <code>false</code>.
1204
+ * @property {boolean} segmentPrefetchLimit
1205
+ * The maximum number of segments for each active stream to be prefetched
1206
+ * ahead of playhead in parallel.
1207
+ * If <code>0</code>, the segments will be fetched sequentially.
1208
+ * Defaults to <code>0</code>.
1209
+ * @property {boolean} liveSync
1210
+ * Enable the live stream sync against the live edge by changing the playback
1211
+ * rate. Defaults to <code>false</code>.
1212
+ * Note: on some SmartTVs, if this is activated, it may not work or the sound
1213
+ * may be lost when activated.
1214
+ * @property {number} liveSyncMaxLatency
1215
+ * Maximum acceptable latency, in seconds. Effective only if liveSync is
1216
+ * true. Defaults to <code>1</code>.
1217
+ * @property {number} liveSyncPlaybackRate
1218
+ * Playback rate used for latency chasing. It is recommended to use a value
1219
+ * between 1 and 2. Effective only if liveSync is true. Defaults to
1220
+ * <code>1.1</code>.
1088
1221
  * @exportDoc
1089
1222
  */
1090
1223
  shaka.extern.StreamingConfiguration;
@@ -1092,7 +1225,9 @@ shaka.extern.StreamingConfiguration;
1092
1225
 
1093
1226
  /**
1094
1227
  * @typedef {{
1095
- * sourceBufferExtraFeatures: string
1228
+ * sourceBufferExtraFeatures: string,
1229
+ * forceTransmux: boolean,
1230
+ * insertFakeEncryptionInInit: boolean
1096
1231
  * }}
1097
1232
  *
1098
1233
  * @description
@@ -1102,11 +1237,45 @@ shaka.extern.StreamingConfiguration;
1102
1237
  * Some platforms may need to pass features when initializing the
1103
1238
  * sourceBuffer.
1104
1239
  * This string is ultimately appended to MIME types in addSourceBuffer().
1240
+ * @property {boolean} forceTransmux
1241
+ * If this is <code>true</code>, we will transmux AAC and TS content even if
1242
+ * not strictly necessary for the assets to be played.
1243
+ * This value defaults to <code>false</code>.
1244
+ * @property {boolean} insertFakeEncryptionInInit
1245
+ * If true, will apply a work-around for non-encrypted init segments on
1246
+ * encrypted content for some platforms.
1247
+ * <br><br>
1248
+ * See https://github.com/shaka-project/shaka-player/issues/2759.
1249
+ * <br><br>
1250
+ * If you know you don't need this, you canset this value to
1251
+ * <code>false</code> to gain a few milliseconds on loading time and seek
1252
+ * time.
1253
+ * <br><br>
1254
+ * This value defaults to <code>true</code>.
1105
1255
  * @exportDoc
1106
1256
  */
1107
1257
  shaka.extern.MediaSourceConfiguration;
1108
1258
 
1109
1259
 
1260
+ /**
1261
+ * @typedef {{
1262
+ * customPlayheadTracker: boolean
1263
+ * }}
1264
+ *
1265
+ * @description
1266
+ * Ads configuration.
1267
+ *
1268
+ * @property {boolean} customPlayheadTracker
1269
+ * If this is <code>true</code>, we create a custom playhead tracker for
1270
+ * Client Side. This is useful because it allows you to implement the use of
1271
+ * IMA on platforms that do not support multiple video elements.
1272
+ * This value defaults to <code>false</code>.
1273
+ *
1274
+ * @exportDoc
1275
+ */
1276
+ shaka.extern.AdsConfiguration;
1277
+
1278
+
1110
1279
  /**
1111
1280
  * @typedef {{
1112
1281
  * enabled: boolean,
@@ -1119,7 +1288,9 @@ shaka.extern.MediaSourceConfiguration;
1119
1288
  * advanced: shaka.extern.AdvancedAbrConfiguration,
1120
1289
  * restrictToElementSize: boolean,
1121
1290
  * restrictToScreenSize: boolean,
1122
- * ignoreDevicePixelRatio: boolean
1291
+ * ignoreDevicePixelRatio: boolean,
1292
+ * clearBufferSwitch: boolean,
1293
+ * safeMarginSwitch: number
1123
1294
  * }}
1124
1295
  *
1125
1296
  * @property {boolean} enabled
@@ -1161,6 +1332,19 @@ shaka.extern.MediaSourceConfiguration;
1161
1332
  * If true,device pixel ratio is ignored when restricting the quality to
1162
1333
  * media element size or screen size.
1163
1334
  * Defaults false.
1335
+ * @property {boolean} clearBufferSwitch
1336
+ * If true, the buffer will be cleared during the switch.
1337
+ * The default automatic behavior is false to have a smoother transition.
1338
+ * On some device it's better to clear buffer.
1339
+ * Defaults false.
1340
+ * @property {number} safeMarginSwitch
1341
+ * Optional amount of buffer (in seconds) to
1342
+ * retain when clearing the buffer during the automatic switch.
1343
+ * Useful for switching variant quickly without causing a buffering event.
1344
+ * Defaults to 0 if not provided. Ignored if clearBuffer is false.
1345
+ * Can cause hiccups on some browsers if chosen too small, e.g.
1346
+ * The amount of two segments is a fair minimum to consider as safeMargin
1347
+ * value.
1164
1348
  * @exportDoc
1165
1349
  */
1166
1350
  shaka.extern.AbrConfiguration;
@@ -1314,6 +1498,7 @@ shaka.extern.OfflineConfiguration;
1314
1498
 
1315
1499
  /**
1316
1500
  * @typedef {{
1501
+ * ads: shaka.extern.AdsConfiguration,
1317
1502
  * autoShowText: shaka.config.AutoShowText,
1318
1503
  * drm: shaka.extern.DrmConfiguration,
1319
1504
  * manifest: shaka.extern.ManifestConfiguration,
@@ -1325,12 +1510,14 @@ shaka.extern.OfflineConfiguration;
1325
1510
  * lcevc: shaka.extern.LcevcConfiguration,
1326
1511
  * offline: shaka.extern.OfflineConfiguration,
1327
1512
  * preferredAudioLanguage: string,
1513
+ * preferredAudioLabel: string,
1328
1514
  * preferredTextLanguage: string,
1329
1515
  * preferredVariantRole: string,
1330
1516
  * preferredTextRole: string,
1331
1517
  * preferredVideoCodecs: !Array.<string>,
1332
1518
  * preferredAudioCodecs: !Array.<string>,
1333
1519
  * preferredAudioChannelCount: number,
1520
+ * preferredVideoHdrLevel: string,
1334
1521
  * preferredDecodingAttributes: !Array.<string>,
1335
1522
  * preferForcedSubs: boolean,
1336
1523
  * restrictions: shaka.extern.Restrictions,
@@ -1339,6 +1526,8 @@ shaka.extern.OfflineConfiguration;
1339
1526
  * textDisplayFactory: shaka.extern.TextDisplayer.Factory
1340
1527
  * }}
1341
1528
  *
1529
+ * @property {shaka.extern.AdsConfiguration} ads
1530
+ * Ads configuration and settings.
1342
1531
  * @property {shaka.config.AutoShowText} autoShowText
1343
1532
  * Controls behavior of auto-showing text tracks on load().
1344
1533
  * @property {shaka.extern.DrmConfiguration} drm
@@ -1364,6 +1553,8 @@ shaka.extern.OfflineConfiguration;
1364
1553
  * The preferred language to use for audio tracks. If not given it will use
1365
1554
  * the <code>'main'</code> track.
1366
1555
  * Changing this during playback will not affect the current playback.
1556
+ * @property {string} preferredAudioLabel
1557
+ * The preferred label to use for audio tracks
1367
1558
  * @property {string} preferredTextLanguage
1368
1559
  * The preferred language to use for text tracks. If a matching text track
1369
1560
  * is found, and the selected audio and text tracks have different languages,
@@ -1379,6 +1570,14 @@ shaka.extern.OfflineConfiguration;
1379
1570
  * The list of preferred audio codecs, in order of highest to lowest priority.
1380
1571
  * @property {number} preferredAudioChannelCount
1381
1572
  * The preferred number of audio channels.
1573
+ * @property {string} preferredVideoHdrLevel
1574
+ * The preferred HDR level of the video. If possible, this will cause the
1575
+ * player to filter to assets that either have that HDR level, or no HDR level
1576
+ * at all.
1577
+ * Can be 'SDR', 'PQ', 'HLG', 'AUTO' for auto-detect, or '' for no preference.
1578
+ * Defaults to 'AUTO'.
1579
+ * Note that one some platforms, such as Chrome, attempting to play PQ content
1580
+ * may cause problems.
1382
1581
  * @property {!Array.<string>} preferredDecodingAttributes
1383
1582
  * The list of preferred attributes of decodingInfo, in the order of their
1384
1583
  * priorities.