shaka-player 4.6.3 → 4.7.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 (608) hide show
  1. package/README.md +1 -0
  2. package/dist/controls.css +1 -1
  3. package/dist/controls.css.map +1 -1
  4. package/dist/deps.js +13 -9
  5. package/dist/locales.js +33 -33
  6. package/dist/shaka-player.compiled.d.ts +47 -4
  7. package/dist/shaka-player.compiled.debug.d.ts +47 -4
  8. package/dist/shaka-player.compiled.debug.externs.js +50 -2
  9. package/dist/shaka-player.compiled.debug.js +408 -376
  10. package/dist/shaka-player.compiled.debug.map +4 -4
  11. package/dist/shaka-player.compiled.externs.js +50 -2
  12. package/dist/shaka-player.compiled.js +1134 -1118
  13. package/dist/shaka-player.compiled.map +4 -4
  14. package/dist/shaka-player.ui.d.ts +69 -5
  15. package/dist/shaka-player.ui.debug.d.ts +69 -5
  16. package/dist/shaka-player.ui.debug.externs.js +82 -2
  17. package/dist/shaka-player.ui.debug.js +457 -420
  18. package/dist/shaka-player.ui.debug.map +4 -4
  19. package/dist/shaka-player.ui.externs.js +82 -2
  20. package/dist/shaka-player.ui.js +1305 -1289
  21. package/dist/shaka-player.ui.map +4 -4
  22. package/externs/mediasession.js +7 -0
  23. package/externs/shaka/abr_manager.js +8 -0
  24. package/externs/shaka/manifest.js +3 -3
  25. package/externs/shaka/player.js +59 -4
  26. package/lib/abr/simple_abr_manager.js +41 -15
  27. package/lib/ads/client_side_ad_manager.js +4 -0
  28. package/lib/ads/media_tailor_ad_manager.js +5 -0
  29. package/lib/ads/server_side_ad_manager.js +4 -0
  30. package/lib/cea/cea708_service.js +1 -1
  31. package/lib/cea/cea708_window.js +95 -7
  32. package/lib/dash/dash_parser.js +55 -11
  33. package/lib/hls/hls_parser.js +17 -5
  34. package/lib/media/adaptation_set_criteria.js +76 -10
  35. package/lib/media/drm_engine.js +0 -3
  36. package/lib/media/media_source_engine.js +42 -18
  37. package/lib/media/segment_reference.js +12 -0
  38. package/lib/media/streaming_engine.js +58 -5
  39. package/lib/media/video_wrapper.js +4 -3
  40. package/lib/player.js +95 -11
  41. package/lib/text/simple_text_displayer.js +8 -7
  42. package/lib/text/text_utils.js +39 -13
  43. package/lib/text/ui_text_displayer.js +20 -11
  44. package/lib/text/web_vtt_generator.js +1 -1
  45. package/lib/util/cmsd_manager.js +269 -0
  46. package/lib/util/content_steering_manager.js +5 -1
  47. package/lib/util/mime_utils.js +6 -2
  48. package/lib/util/periods.js +108 -39
  49. package/lib/util/player_configuration.js +19 -5
  50. package/lib/util/stream_utils.js +82 -13
  51. package/package.json +1 -1
  52. package/ui/audio_language_selection.js +3 -0
  53. package/ui/controls.js +60 -0
  54. package/ui/externs/ui.js +12 -1
  55. package/ui/hidden_fast_forward_button.js +32 -0
  56. package/ui/hidden_rewind_button.js +32 -0
  57. package/ui/hidden_seek_button.js +121 -0
  58. package/ui/less/buttons.less +50 -0
  59. package/ui/less/containers.less +18 -0
  60. package/ui/resolution_selection.js +2 -0
  61. package/ui/ui.js +2 -0
  62. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -75
  63. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -26
  64. package/.github/ISSUE_TEMPLATE/question.md +0 -26
  65. package/.github/config.yml +0 -1
  66. package/.github/workflows/appspot.yaml +0 -39
  67. package/.github/workflows/build-and-test.yaml +0 -222
  68. package/.github/workflows/compute-incremental-coverage.py +0 -265
  69. package/.github/workflows/custom-actions/prep-for-appspot/action.yaml +0 -56
  70. package/.github/workflows/custom-actions/set-commit-status/action.yaml +0 -37
  71. package/.github/workflows/deflake.yaml +0 -31
  72. package/.github/workflows/demo-version-index.yaml +0 -43
  73. package/.github/workflows/nightly-demo.yaml +0 -42
  74. package/.github/workflows/release-please.yaml +0 -193
  75. package/.github/workflows/report-incremental-coverage.yaml +0 -39
  76. package/.github/workflows/safari-homedir-launcher.sh +0 -18
  77. package/.github/workflows/selenium-lab-tests.yaml +0 -370
  78. package/.github/workflows/shaka-bot-commands/command-help.sh +0 -27
  79. package/.github/workflows/shaka-bot-commands/command-test.sh +0 -56
  80. package/.github/workflows/shaka-bot-commands/lib.sh +0 -83
  81. package/.github/workflows/shaka-bot-commands/main.sh +0 -51
  82. package/.github/workflows/sync-labels.yaml +0 -33
  83. package/.github/workflows/talk-to-shaka-bot.yaml +0 -29
  84. package/.github/workflows/update-issues.yaml +0 -31
  85. package/.github/workflows/update-screenshots.yaml +0 -142
  86. package/.github/workflows/validate-pr-title.yaml +0 -27
  87. package/CHANGELOG.md +0 -5764
  88. package/CODE_OF_CONDUCT.md +0 -93
  89. package/CONTRIBUTING.md +0 -76
  90. package/demo/TengwarTelcontar.woff2 +0 -0
  91. package/demo/app_logo_144.png +0 -0
  92. package/demo/app_logo_192.png +0 -0
  93. package/demo/app_logo_256.png +0 -0
  94. package/demo/app_logo_384.png +0 -0
  95. package/demo/app_logo_512.png +0 -0
  96. package/demo/app_manifest.json +0 -29
  97. package/demo/asset_card.js +0 -410
  98. package/demo/autoTemplate.txt +0 -61
  99. package/demo/cast_receiver/idle1.jpg +0 -0
  100. package/demo/cast_receiver/idle2.jpg +0 -0
  101. package/demo/cast_receiver/idle3.jpg +0 -0
  102. package/demo/cast_receiver/index.html +0 -75
  103. package/demo/cast_receiver/receiver_app.css +0 -111
  104. package/demo/cast_receiver/receiver_app.js +0 -158
  105. package/demo/close_button.js +0 -60
  106. package/demo/common/asset.js +0 -511
  107. package/demo/common/assets.js +0 -1635
  108. package/demo/config.js +0 -859
  109. package/demo/custom.js +0 -907
  110. package/demo/customWarning.txt +0 -8
  111. package/demo/demo.less +0 -591
  112. package/demo/demo_uncompiled.js +0 -11
  113. package/demo/demo_utils.js +0 -113
  114. package/demo/favicon.ico +0 -0
  115. package/demo/front.js +0 -156
  116. package/demo/icons/README.md +0 -4
  117. package/demo/icons/baseline-audiotrack-24px.svg +0 -1
  118. package/demo/icons/baseline-closed_caption-24px.svg +0 -1
  119. package/demo/icons/baseline-fast_forward-24px.svg +0 -1
  120. package/demo/icons/baseline-language-24px.svg +0 -1
  121. package/demo/icons/baseline-live_tv-24px.svg +0 -1
  122. package/demo/icons/baseline-subtitles-24px.svg +0 -1
  123. package/demo/icons/baseline-surround_sound-24px.svg +0 -1
  124. package/demo/icons/custom_ad.svg +0 -1
  125. package/demo/icons/custom_box_with_text.svg +0 -1
  126. package/demo/icons/custom_clear_key.svg +0 -1
  127. package/demo/icons/custom_high_definition.svg +0 -1
  128. package/demo/icons/custom_playready.svg +0 -1
  129. package/demo/icons/custom_ultra_high_definition.svg +0 -1
  130. package/demo/icons/custom_widevine.svg +0 -1
  131. package/demo/index.html +0 -173
  132. package/demo/input.js +0 -270
  133. package/demo/input_container.js +0 -218
  134. package/demo/load.js +0 -156
  135. package/demo/main.js +0 -1854
  136. package/demo/search.js +0 -452
  137. package/demo/service_worker.js +0 -355
  138. package/demo/shaka_logo_trans.png +0 -0
  139. package/demo/tooltip.js +0 -29
  140. package/demo/visualizer.js +0 -335
  141. package/demo/visualizer_button.js +0 -84
  142. package/dist/demo.compiled.debug.js +0 -340
  143. package/dist/demo.compiled.debug.map +0 -8
  144. package/dist/demo.compiled.js +0 -340
  145. package/dist/demo.compiled.map +0 -8
  146. package/dist/demo.css +0 -6
  147. package/dist/demo.css.map +0 -1
  148. package/dist/receiver.compiled.debug.js +0 -187
  149. package/dist/receiver.compiled.debug.map +0 -8
  150. package/dist/receiver.compiled.js +0 -187
  151. package/dist/receiver.compiled.map +0 -8
  152. package/docs/announcement-list-join-group.png +0 -0
  153. package/docs/api-mainpage.md +0 -28
  154. package/docs/design/REDESIGN.md +0 -283
  155. package/docs/design/architecture.md +0 -13
  156. package/docs/design/bg-fetch-after.gv +0 -29
  157. package/docs/design/bg-fetch-after.gv.png +0 -0
  158. package/docs/design/bg-fetch-before.gv +0 -18
  159. package/docs/design/bg-fetch-before.gv.png +0 -0
  160. package/docs/design/bg-fetch.md +0 -134
  161. package/docs/design/cast.gv +0 -35
  162. package/docs/design/cast.gv.png +0 -0
  163. package/docs/design/chromecast.md +0 -151
  164. package/docs/design/codec_preferences.md +0 -158
  165. package/docs/design/dash-audio-channels.md +0 -123
  166. package/docs/design/dash-manifests.md +0 -248
  167. package/docs/design/dash-timeline.svg +0 -4
  168. package/docs/design/dataflow.gv +0 -66
  169. package/docs/design/dataflow.gv.png +0 -0
  170. package/docs/design/export.md +0 -70
  171. package/docs/design/fuzzy-locale-matching.md +0 -40
  172. package/docs/design/gap-jumping.md +0 -151
  173. package/docs/design/lcevc-architecture.png +0 -0
  174. package/docs/design/lcevc-demo.png +0 -0
  175. package/docs/design/lcevc-integration.md +0 -72
  176. package/docs/design/locale_compatibility.svg +0 -1
  177. package/docs/design/locales_tree.svg +0 -1
  178. package/docs/design/localization-design-principles.md +0 -158
  179. package/docs/design/newdemo.gv +0 -83
  180. package/docs/design/newdemo.gv.png +0 -0
  181. package/docs/design/offline.gv +0 -43
  182. package/docs/design/offline.gv.png +0 -0
  183. package/docs/design/offline.md +0 -153
  184. package/docs/design/ownership.gv +0 -76
  185. package/docs/design/ownership.gv.png +0 -0
  186. package/docs/design/preload.md +0 -299
  187. package/docs/design/preload.png +0 -0
  188. package/docs/design/talking-about-languages.md +0 -46
  189. package/docs/design/timeline.svg +0 -152
  190. package/docs/design/ui.md +0 -31
  191. package/docs/design/ui_player_relationships.svg +0 -1
  192. package/docs/jsdoc-plugin.js +0 -74
  193. package/docs/jsdoc-template/README.md +0 -1
  194. package/docs/jsdoc-template/publish.js +0 -879
  195. package/docs/jsdoc-template/static/fonts/OpenSans-Bold-webfont.eot +0 -0
  196. package/docs/jsdoc-template/static/fonts/OpenSans-Bold-webfont.svg +0 -1830
  197. package/docs/jsdoc-template/static/fonts/OpenSans-Bold-webfont.woff +0 -0
  198. package/docs/jsdoc-template/static/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  199. package/docs/jsdoc-template/static/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  200. package/docs/jsdoc-template/static/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  201. package/docs/jsdoc-template/static/fonts/OpenSans-Italic-webfont.eot +0 -0
  202. package/docs/jsdoc-template/static/fonts/OpenSans-Italic-webfont.svg +0 -1830
  203. package/docs/jsdoc-template/static/fonts/OpenSans-Italic-webfont.woff +0 -0
  204. package/docs/jsdoc-template/static/fonts/OpenSans-Light-webfont.eot +0 -0
  205. package/docs/jsdoc-template/static/fonts/OpenSans-Light-webfont.svg +0 -1831
  206. package/docs/jsdoc-template/static/fonts/OpenSans-Light-webfont.woff +0 -0
  207. package/docs/jsdoc-template/static/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  208. package/docs/jsdoc-template/static/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  209. package/docs/jsdoc-template/static/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  210. package/docs/jsdoc-template/static/fonts/OpenSans-Regular-webfont.eot +0 -0
  211. package/docs/jsdoc-template/static/fonts/OpenSans-Regular-webfont.svg +0 -1831
  212. package/docs/jsdoc-template/static/fonts/OpenSans-Regular-webfont.woff +0 -0
  213. package/docs/jsdoc-template/static/scripts/linenumber.js +0 -44
  214. package/docs/jsdoc-template/static/scripts/show-widget.js +0 -55
  215. package/docs/jsdoc-template/static/styles/jsdoc-default.css +0 -438
  216. package/docs/jsdoc-template/tmpl/augments.tmpl +0 -10
  217. package/docs/jsdoc-template/tmpl/container.tmpl +0 -205
  218. package/docs/jsdoc-template/tmpl/details.tmpl +0 -152
  219. package/docs/jsdoc-template/tmpl/example.tmpl +0 -2
  220. package/docs/jsdoc-template/tmpl/examples.tmpl +0 -13
  221. package/docs/jsdoc-template/tmpl/exceptions.tmpl +0 -32
  222. package/docs/jsdoc-template/tmpl/layout.tmpl +0 -50
  223. package/docs/jsdoc-template/tmpl/mainpage.tmpl +0 -14
  224. package/docs/jsdoc-template/tmpl/members.tmpl +0 -47
  225. package/docs/jsdoc-template/tmpl/method.tmpl +0 -140
  226. package/docs/jsdoc-template/tmpl/modifies.tmpl +0 -14
  227. package/docs/jsdoc-template/tmpl/params.tmpl +0 -131
  228. package/docs/jsdoc-template/tmpl/properties.tmpl +0 -125
  229. package/docs/jsdoc-template/tmpl/returns.tmpl +0 -19
  230. package/docs/jsdoc-template/tmpl/source.tmpl +0 -8
  231. package/docs/jsdoc-template/tmpl/tutorial.tmpl +0 -21
  232. package/docs/jsdoc-template/tmpl/type.tmpl +0 -7
  233. package/docs/jsdoc.conf.json +0 -38
  234. package/docs/shaka-player-logo.png +0 -0
  235. package/docs/style.md +0 -174
  236. package/docs/tutorials/a11y.md +0 -64
  237. package/docs/tutorials/ad_monetization.md +0 -292
  238. package/docs/tutorials/application-level-redirects.md +0 -94
  239. package/docs/tutorials/architecture.md +0 -32
  240. package/docs/tutorials/basic-usage.md +0 -89
  241. package/docs/tutorials/blob-url.md +0 -15
  242. package/docs/tutorials/config.md +0 -148
  243. package/docs/tutorials/debugging.md +0 -189
  244. package/docs/tutorials/drm-config.md +0 -274
  245. package/docs/tutorials/errors.md +0 -95
  246. package/docs/tutorials/fairplay.md +0 -242
  247. package/docs/tutorials/faq.md +0 -252
  248. package/docs/tutorials/index.json +0 -29
  249. package/docs/tutorials/lcevc.md +0 -118
  250. package/docs/tutorials/license-server-auth.md +0 -248
  251. package/docs/tutorials/license-wrapping.md +0 -168
  252. package/docs/tutorials/manifest-parser.md +0 -365
  253. package/docs/tutorials/network-and-buffering-config.md +0 -119
  254. package/docs/tutorials/offline.md +0 -683
  255. package/docs/tutorials/plugins.md +0 -184
  256. package/docs/tutorials/selenium-grid-config.md +0 -174
  257. package/docs/tutorials/service-worker.md +0 -106
  258. package/docs/tutorials/ui-customization.md +0 -288
  259. package/docs/tutorials/ui.md +0 -230
  260. package/docs/tutorials/upgrade-manifest.md +0 -281
  261. package/docs/tutorials/upgrade.md +0 -104
  262. package/docs/tutorials/welcome.md +0 -108
  263. package/docs/tutorials/widevine-service-certs.md +0 -45
  264. package/karma.conf.js +0 -879
  265. package/maintained-branches.md +0 -15
  266. package/roadmap.md +0 -186
  267. package/test/abr/simple_abr_manager_unit.js +0 -398
  268. package/test/ads/ad_manager_unit.js +0 -260
  269. package/test/assumptions/uint8_array_unit.js +0 -22
  270. package/test/cast/cast_proxy_unit.js +0 -736
  271. package/test/cast/cast_receiver_integration.js +0 -488
  272. package/test/cast/cast_receiver_unit.js +0 -1183
  273. package/test/cast/cast_sender_unit.js +0 -973
  274. package/test/cast/cast_utils_unit.js +0 -311
  275. package/test/cea/cea608_memory_unit.js +0 -411
  276. package/test/cea/cea708_service_unit.js +0 -674
  277. package/test/cea/cea708_window_unit.js +0 -373
  278. package/test/cea/cea_decoder_unit.js +0 -615
  279. package/test/cea/dtvcc_packet_builder_unit.js +0 -158
  280. package/test/cea/dtvcc_packet_unit.js +0 -60
  281. package/test/cea/mp4_cea_parser_unit.js +0 -127
  282. package/test/codec_switching/codec_switching_integration.js +0 -182
  283. package/test/dash/dash_parser_content_protection_unit.js +0 -998
  284. package/test/dash/dash_parser_integration.js +0 -74
  285. package/test/dash/dash_parser_live_unit.js +0 -1542
  286. package/test/dash/dash_parser_manifest_unit.js +0 -3121
  287. package/test/dash/dash_parser_segment_base_unit.js +0 -421
  288. package/test/dash/dash_parser_segment_list_unit.js +0 -380
  289. package/test/dash/dash_parser_segment_template_unit.js +0 -910
  290. package/test/dash/mpd_utils_unit.js +0 -794
  291. package/test/demo/demo_unit.js +0 -108
  292. package/test/deprecate/enforcer_unit.js +0 -74
  293. package/test/deprecate/version_unit.js +0 -57
  294. package/test/hls/hls_live_unit.js +0 -1330
  295. package/test/hls/hls_parser_unit.js +0 -5276
  296. package/test/hls/manifest_text_parser_unit.js +0 -545
  297. package/test/media/adaptation_set_criteria_unit.js +0 -806
  298. package/test/media/adaptation_set_unit.js +0 -229
  299. package/test/media/buffering_observer_unit.js +0 -143
  300. package/test/media/closed_caption_parser_unit.js +0 -18
  301. package/test/media/content_workarounds_unit.js +0 -43
  302. package/test/media/drm_engine_integration.js +0 -356
  303. package/test/media/drm_engine_unit.js +0 -2778
  304. package/test/media/media_source_engine_integration.js +0 -691
  305. package/test/media/media_source_engine_unit.js +0 -1512
  306. package/test/media/mp4_segment_index_parser_unit.js +0 -80
  307. package/test/media/play_rate_controller_unit.js +0 -69
  308. package/test/media/playhead_unit.js +0 -1394
  309. package/test/media/presentation_timeline_unit.js +0 -477
  310. package/test/media/quality_observer_unit.js +0 -138
  311. package/test/media/region_observer_unit.js +0 -374
  312. package/test/media/region_timeline_unit.js +0 -139
  313. package/test/media/segment_index_unit.js +0 -1080
  314. package/test/media/segment_prefetch_unit.js +0 -243
  315. package/test/media/segment_reference_unit.js +0 -63
  316. package/test/media/stall_detector_unit.js +0 -184
  317. package/test/media/streaming_engine_integration.js +0 -632
  318. package/test/media/streaming_engine_unit.js +0 -4211
  319. package/test/media/time_ranges_utils_unit.js +0 -123
  320. package/test/media/webm_segment_index_parser_unit.js +0 -90
  321. package/test/mss/mss_parser_content_protection_unit.js +0 -49
  322. package/test/mss/mss_parser_unit.js +0 -474
  323. package/test/mss/mss_player_integration.js +0 -124
  324. package/test/net/data_uri_plugin_unit.js +0 -105
  325. package/test/net/http_plugin_unit.js +0 -439
  326. package/test/net/networking_engine_unit.js +0 -1236
  327. package/test/net/networking_utils_unit.js +0 -37
  328. package/test/offline/download_progress_estimator_unit.js +0 -90
  329. package/test/offline/indexeddb_storage_unit.js +0 -192
  330. package/test/offline/manifest_convert_unit.js +0 -622
  331. package/test/offline/offline_integration.js +0 -168
  332. package/test/offline/offline_manifest_parser_unit.js +0 -231
  333. package/test/offline/offline_scheme_unit.js +0 -154
  334. package/test/offline/offline_uri_unit.js +0 -59
  335. package/test/offline/storage_compatibility_unit.js +0 -344
  336. package/test/offline/storage_integration.js +0 -1858
  337. package/test/player_external.js +0 -237
  338. package/test/player_integration.js +0 -1371
  339. package/test/player_load_graph_integration.js +0 -865
  340. package/test/player_src_equals_external.js +0 -154
  341. package/test/player_src_equals_integration.js +0 -527
  342. package/test/player_unit.js +0 -4434
  343. package/test/polyfill/media_capabilities_unit.js +0 -277
  344. package/test/polyfill/patchedmediakeys_apple_unit.js +0 -130
  345. package/test/test/assets/3675/chunk-stream0-00001.m4s +0 -0
  346. package/test/test/assets/3675/chunk-stream0-00002.m4s +0 -0
  347. package/test/test/assets/3675/chunk-stream0-00003.m4s +0 -0
  348. package/test/test/assets/3675/chunk-stream0-00004.m4s +0 -0
  349. package/test/test/assets/3675/chunk-stream0-00005.m4s +0 -0
  350. package/test/test/assets/3675/chunk-stream0-00006.m4s +0 -0
  351. package/test/test/assets/3675/chunk-stream0-00007.m4s +0 -0
  352. package/test/test/assets/3675/dash_0.mpd +0 -30
  353. package/test/test/assets/3675/dash_1.mpd +0 -30
  354. package/test/test/assets/3675/dash_2.mpd +0 -30
  355. package/test/test/assets/3675/dash_3.mpd +0 -30
  356. package/test/test/assets/3675/dash_4.mpd +0 -30
  357. package/test/test/assets/3675/dash_5.mpd +0 -26
  358. package/test/test/assets/3675/init-stream0.m4s +0 -0
  359. package/test/test/assets/audio-xhe-aac.mp4 +0 -0
  360. package/test/test/assets/audio.ts +0 -0
  361. package/test/test/assets/captions-test.ts +0 -0
  362. package/test/test/assets/cea-init.mp4 +0 -0
  363. package/test/test/assets/cea-segment.mp4 +0 -0
  364. package/test/test/assets/chapters.srt +0 -11
  365. package/test/test/assets/chapters.vtt +0 -10
  366. package/test/test/assets/chapters2.vtt +0 -10
  367. package/test/test/assets/dash-aes-128/Fragments(video=0,format=mpd-time-csf) +0 -0
  368. package/test/test/assets/dash-aes-128/Fragments(video=20000000,format=mpd-time-csf) +0 -0
  369. package/test/test/assets/dash-aes-128/Fragments(video=40000000,format=mpd-time-csf) +0 -0
  370. package/test/test/assets/dash-aes-128/Fragments(video=60000000,format=mpd-time-csf) +0 -0
  371. package/test/test/assets/dash-aes-128/Fragments(video=i,format=mpd-time-csf) +0 -0
  372. package/test/test/assets/dash-aes-128/dash.mpd +0 -18
  373. package/test/test/assets/dash-aes-128/license +0 -1
  374. package/test/test/assets/dash-multi-codec/audio_en_2c_128k_aac.mp4 +0 -0
  375. package/test/test/assets/dash-multi-codec/audio_es_2c_64k_opus.webm +0 -0
  376. package/test/test/assets/dash-multi-codec/dash.mpd +0 -32
  377. package/test/test/assets/dash-multi-codec/video_144p_108k_h264.mp4 +0 -0
  378. package/test/test/assets/db-dump-v1.json +0 -1
  379. package/test/test/assets/db-dump-v2-broken.json +0 -1
  380. package/test/test/assets/db-dump-v2-clean.json +0 -1
  381. package/test/test/assets/db-dump-v3.json +0 -1
  382. package/test/test/assets/db-dump-v4-broken.json +0 -1
  383. package/test/test/assets/db-dump-v5.json +0 -1
  384. package/test/test/assets/empty_caption_video_init.mp4 +0 -0
  385. package/test/test/assets/empty_caption_video_segment.mp4 +0 -0
  386. package/test/test/assets/encrypted-sintel-audio-init.mp4 +0 -0
  387. package/test/test/assets/encrypted-sintel-audio-segment.mp4 +0 -0
  388. package/test/test/assets/encrypted-sintel-video-init.mp4 +0 -0
  389. package/test/test/assets/encrypted-sintel-video-segment.mp4 +0 -0
  390. package/test/test/assets/green-pixel.mp4 +0 -0
  391. package/test/test/assets/green-pixel.txt +0 -15
  392. package/test/test/assets/h265-cea-init.mp4 +0 -0
  393. package/test/test/assets/h265-cea-segment.mp4 +0 -0
  394. package/test/test/assets/hls-raw-aac/fileSequence0.aac +0 -0
  395. package/test/test/assets/hls-raw-aac/fileSequence1.aac +0 -0
  396. package/test/test/assets/hls-raw-aac/fileSequence2.aac +0 -0
  397. package/test/test/assets/hls-raw-aac/fileSequence3.aac +0 -0
  398. package/test/test/assets/hls-raw-aac/manifest.m3u8 +0 -4
  399. package/test/test/assets/hls-raw-aac/stream.m4a.m3u8 +0 -14
  400. package/test/test/assets/hls-raw-ac3/fileSequence0.ac3 +0 -0
  401. package/test/test/assets/hls-raw-ac3/fileSequence1.ac3 +0 -0
  402. package/test/test/assets/hls-raw-ac3/fileSequence2.ac3 +0 -0
  403. package/test/test/assets/hls-raw-ac3/fileSequence3.ac3 +0 -0
  404. package/test/test/assets/hls-raw-ac3/fileSequence4.ac3 +0 -0
  405. package/test/test/assets/hls-raw-ac3/fileSequence5.ac3 +0 -0
  406. package/test/test/assets/hls-raw-ac3/fileSequence6.ac3 +0 -0
  407. package/test/test/assets/hls-raw-ac3/fileSequence7.ac3 +0 -0
  408. package/test/test/assets/hls-raw-ac3/prog_index.m3u8 +0 -31
  409. package/test/test/assets/hls-raw-ec3/fileSequence0.ec3 +0 -0
  410. package/test/test/assets/hls-raw-ec3/fileSequence1.ec3 +0 -0
  411. package/test/test/assets/hls-raw-ec3/fileSequence2.ec3 +0 -0
  412. package/test/test/assets/hls-raw-ec3/fileSequence3.ec3 +0 -0
  413. package/test/test/assets/hls-raw-ec3/fileSequence4.ec3 +0 -0
  414. package/test/test/assets/hls-raw-ec3/fileSequence5.ec3 +0 -0
  415. package/test/test/assets/hls-raw-ec3/fileSequence6.ec3 +0 -0
  416. package/test/test/assets/hls-raw-ec3/fileSequence7.ec3 +0 -0
  417. package/test/test/assets/hls-raw-ec3/prog_index.m3u8 +0 -31
  418. package/test/test/assets/hls-raw-mp3/chunklist_w905519204.m3u8 +0 -13
  419. package/test/test/assets/hls-raw-mp3/media_w905519204_0.mp3 +0 -0
  420. package/test/test/assets/hls-raw-mp3/media_w905519204_1.mp3 +0 -0
  421. package/test/test/assets/hls-raw-mp3/media_w905519204_2.mp3 +0 -0
  422. package/test/test/assets/hls-raw-mp3/media_w905519204_3.mp3 +0 -0
  423. package/test/test/assets/hls-raw-mp3/playlist.m3u8 +0 -4
  424. package/test/test/assets/hls-ts-aac/playlist.m3u8 +0 -23
  425. package/test/test/assets/hls-ts-aac/segment_0.ts +0 -0
  426. package/test/test/assets/hls-ts-aac/segment_1.ts +0 -0
  427. package/test/test/assets/hls-ts-aac/segment_2.ts +0 -0
  428. package/test/test/assets/hls-ts-aac/segment_3.ts +0 -0
  429. package/test/test/assets/hls-ts-aac/segment_4.ts +0 -0
  430. package/test/test/assets/hls-ts-aac/segment_5.ts +0 -0
  431. package/test/test/assets/hls-ts-aac/segment_6.ts +0 -0
  432. package/test/test/assets/hls-ts-aac/segment_7.ts +0 -0
  433. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0000.ts +0 -0
  434. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0001.ts +0 -0
  435. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0002.ts +0 -0
  436. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0003.ts +0 -0
  437. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0004.ts +0 -0
  438. package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0005.ts +0 -0
  439. package/test/test/assets/hls-ts-ac3/prog_index.m3u8 +0 -19
  440. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0000.ts +0 -0
  441. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0001.ts +0 -0
  442. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0002.ts +0 -0
  443. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0003.ts +0 -0
  444. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0004.ts +0 -0
  445. package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0005.ts +0 -0
  446. package/test/test/assets/hls-ts-ec3/prog_index.m3u8 +0 -19
  447. package/test/test/assets/hls-ts-h264/fileSequence0.ts +0 -0
  448. package/test/test/assets/hls-ts-h264/fileSequence1.ts +0 -0
  449. package/test/test/assets/hls-ts-h264/fileSequence2.ts +0 -0
  450. package/test/test/assets/hls-ts-h264/fileSequence3.ts +0 -0
  451. package/test/test/assets/hls-ts-h264/fileSequence4.ts +0 -0
  452. package/test/test/assets/hls-ts-h264/fileSequence5.ts +0 -0
  453. package/test/test/assets/hls-ts-h264/prog_index.m3u8 +0 -25
  454. package/test/test/assets/hls-ts-h265/0.ts +0 -0
  455. package/test/test/assets/hls-ts-h265/hevc.m3u8 +0 -6
  456. package/test/test/assets/hls-ts-h265/index.m3u8 +0 -7
  457. package/test/test/assets/hls-ts-mp3/manifest.m3u8 +0 -13
  458. package/test/test/assets/hls-ts-mp3/media_w239891843_0.ts +0 -0
  459. package/test/test/assets/hls-ts-mp3/media_w239891843_1.ts +0 -0
  460. package/test/test/assets/hls-ts-mp3/media_w239891843_2.ts +0 -0
  461. package/test/test/assets/hls-ts-mp3/media_w239891843_3.ts +0 -0
  462. package/test/test/assets/hls-ts-muxed-aac-h264/chunk.m3u8 +0 -17
  463. package/test/test/assets/hls-ts-muxed-aac-h264/n_0_0_0.ts +0 -0
  464. package/test/test/assets/hls-ts-muxed-aac-h264/n_1_0_0.ts +0 -0
  465. package/test/test/assets/hls-ts-muxed-aac-h264/n_2_0_0.ts +0 -0
  466. package/test/test/assets/hls-ts-muxed-aac-h264/n_3_0_0.ts +0 -0
  467. package/test/test/assets/hls-ts-muxed-aac-h264/n_4_0_0.ts +0 -0
  468. package/test/test/assets/hls-ts-muxed-aac-h264/n_5_0_0.ts +0 -0
  469. package/test/test/assets/hls-ts-muxed-aac-h264/playlist.m3u8 +0 -4
  470. package/test/test/assets/hls-ts-muxed-aac-h265/0.ts +0 -0
  471. package/test/test/assets/hls-ts-muxed-aac-h265/1.ts +0 -0
  472. package/test/test/assets/hls-ts-muxed-aac-h265/media.m3u8 +0 -9
  473. package/test/test/assets/hls-ts-muxed-ac3-h264/media.m3u8 +0 -24
  474. package/test/test/assets/hls-ts-muxed-ac3-h264/s_00000.ts +0 -0
  475. package/test/test/assets/hls-ts-muxed-ac3-h264/s_00001.ts +0 -0
  476. package/test/test/assets/hls-ts-muxed-ac3-h264/s_00002.ts +0 -0
  477. package/test/test/assets/hls-ts-muxed-ac3-h264/s_00003.ts +0 -0
  478. package/test/test/assets/hls-ts-muxed-ac3-h264/s_00004.ts +0 -0
  479. package/test/test/assets/hls-ts-muxed-ac3-h264/s_00005.ts +0 -0
  480. package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0000.ts +0 -0
  481. package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0001.ts +0 -0
  482. package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0002.ts +0 -0
  483. package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0003.ts +0 -0
  484. package/test/test/assets/hls-ts-muxed-ec3-h264/prog_index.m3u8 +0 -14
  485. package/test/test/assets/hls-ts-muxed-mp3-h264/index.m3u8 +0 -23
  486. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-1-v1-a1.ts +0 -0
  487. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-2-v1-a1.ts +0 -0
  488. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-3-v1-a1.ts +0 -0
  489. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-4-v1-a1.ts +0 -0
  490. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-5-v1-a1.ts +0 -0
  491. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-6-v1-a1.ts +0 -0
  492. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-7-v1-a1.ts +0 -0
  493. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-8-v1-a1.ts +0 -0
  494. package/test/test/assets/id3-metadata.aac +0 -0
  495. package/test/test/assets/id3-metadata.ts +0 -0
  496. package/test/test/assets/index-segment.mp4 +0 -0
  497. package/test/test/assets/index-segment.webm +0 -0
  498. package/test/test/assets/init-segment.webm +0 -0
  499. package/test/test/assets/large_file.mpd +0 -4930
  500. package/test/test/assets/multidrm-audio-init.mp4 +0 -0
  501. package/test/test/assets/multidrm-audio-segment.mp4 +0 -0
  502. package/test/test/assets/multidrm-video-init.mp4 +0 -0
  503. package/test/test/assets/multidrm-video-segment.mp4 +0 -0
  504. package/test/test/assets/multiple-trun-init.mp4 +0 -0
  505. package/test/test/assets/multiple-trun-segment.mp4 +0 -0
  506. package/test/test/assets/sintel-audio-init.mp4 +0 -0
  507. package/test/test/assets/sintel-audio-segment.mp4 +0 -0
  508. package/test/test/assets/sintel-video-init.mp4 +0 -0
  509. package/test/test/assets/sintel-video-segment.mp4 +0 -0
  510. package/test/test/assets/small.mp4 +0 -0
  511. package/test/test/assets/text-clip-alt.vtt +0 -63
  512. package/test/test/assets/text-clip.vtt +0 -63
  513. package/test/test/assets/thumbnails-sprites.vtt +0 -10
  514. package/test/test/assets/thumbnails.vtt +0 -10
  515. package/test/test/assets/ttml-init.mp4 +0 -0
  516. package/test/test/assets/ttml-segment-multiplemdat.mp4 +0 -0
  517. package/test/test/assets/ttml-segment.mp4 +0 -0
  518. package/test/test/assets/video.ts +0 -0
  519. package/test/test/assets/vtt-init.mp4 +0 -0
  520. package/test/test/assets/vtt-segment-multi-payload.mp4 +0 -0
  521. package/test/test/assets/vtt-segment-no-duration.mp4 +0 -0
  522. package/test/test/assets/vtt-segment-settings.mp4 +0 -0
  523. package/test/test/assets/vtt-segment.mp4 +0 -0
  524. package/test/test/boot.js +0 -495
  525. package/test/test/externs/filters.js +0 -44
  526. package/test/test/externs/fontfaceonload.js +0 -29
  527. package/test/test/externs/jasmine.js +0 -670
  528. package/test/test/externs/karma.js +0 -26
  529. package/test/test/externs/require.js +0 -21
  530. package/test/test/externs/sprintf.js +0 -18
  531. package/test/test/namespace.js +0 -10
  532. package/test/test/util/canned_idb.js +0 -379
  533. package/test/test/util/cea_utils.js +0 -60
  534. package/test/test/util/dash_parser_util.js +0 -329
  535. package/test/test/util/fake_ad.js +0 -321
  536. package/test/test/util/fake_ad_manager.js +0 -122
  537. package/test/test/util/fake_demo_main.js +0 -144
  538. package/test/test/util/fake_drm_engine.js +0 -103
  539. package/test/test/util/fake_media_source_engine.js +0 -464
  540. package/test/test/util/fake_networking_engine.js +0 -381
  541. package/test/test/util/fake_segment_prefetch.js +0 -84
  542. package/test/test/util/fake_text_displayer.js +0 -60
  543. package/test/test/util/id3_generator.js +0 -100
  544. package/test/test/util/indexeddb_utils.js +0 -124
  545. package/test/test/util/jasmine_fetch.js +0 -382
  546. package/test/test/util/layout_tests.js +0 -434
  547. package/test/test/util/loader.js +0 -88
  548. package/test/test/util/manifest_generator.js +0 -705
  549. package/test/test/util/manifest_parser_util.js +0 -101
  550. package/test/test/util/mss_parser_util.js +0 -119
  551. package/test/test/util/offline_utils.js +0 -105
  552. package/test/test/util/simple_fakes.js +0 -535
  553. package/test/test/util/stream_generator.js +0 -676
  554. package/test/test/util/streaming_engine_util.js +0 -506
  555. package/test/test/util/test_scheme.js +0 -778
  556. package/test/test/util/ttml_utils.js +0 -77
  557. package/test/test/util/ui_utils.js +0 -183
  558. package/test/test/util/util.js +0 -374
  559. package/test/test/util/waiter.js +0 -406
  560. package/test/text/cue_integration.js +0 -51
  561. package/test/text/lrc_text_parser_unit.js +0 -98
  562. package/test/text/mp4_ttml_parser_unit.js +0 -171
  563. package/test/text/mp4_vtt_parser_unit.js +0 -195
  564. package/test/text/sbv_text_parser_unit.js +0 -81
  565. package/test/text/simple_text_displayer_unit.js +0 -468
  566. package/test/text/srt_text_parser_unit.js +0 -163
  567. package/test/text/ssa_text_parser_unit.js +0 -382
  568. package/test/text/text_displayer_layout_unit.js +0 -323
  569. package/test/text/text_engine_unit.js +0 -500
  570. package/test/text/text_track_integration.js +0 -186
  571. package/test/text/ttml_text_parser_unit.js +0 -2176
  572. package/test/text/ui_text_displayer_unit.js +0 -608
  573. package/test/text/vtt_text_parser_unit.js +0 -1363
  574. package/test/text/web_vtt_generator_unit.js +0 -144
  575. package/test/text/web_vtt_layout_integration.js +0 -524
  576. package/test/transmuxer/transmuxer_engine_integration.js +0 -69
  577. package/test/transmuxer/transmuxer_integration.js +0 -443
  578. package/test/ui/ad_ui_unit.js +0 -369
  579. package/test/ui/localization_unit.js +0 -508
  580. package/test/ui/ui_customization_unit.js +0 -208
  581. package/test/ui/ui_integration.js +0 -669
  582. package/test/ui/ui_unit.js +0 -902
  583. package/test/util/abortable_operation_unit.js +0 -624
  584. package/test/util/array_utils_unit.js +0 -58
  585. package/test/util/buffer_utils_unit.js +0 -185
  586. package/test/util/cmcd_manager_unit.js +0 -440
  587. package/test/util/content_steering_manager_unit.js +0 -427
  588. package/test/util/data_view_reader_unit.js +0 -254
  589. package/test/util/ebml_parser_unit.js +0 -297
  590. package/test/util/event_manager_unit.js +0 -185
  591. package/test/util/fake_event_target_unit.js +0 -123
  592. package/test/util/id3_utils_unit.js +0 -168
  593. package/test/util/iterables_unit.js +0 -68
  594. package/test/util/language_utils_unit.js +0 -240
  595. package/test/util/manifest_parser_utils_unit.js +0 -55
  596. package/test/util/mime_utils_unit.js +0 -64
  597. package/test/util/mp4_box_parsers_unit.js +0 -246
  598. package/test/util/mp4_parser_unit.js +0 -373
  599. package/test/util/multi_map_unit.js +0 -94
  600. package/test/util/object_utils_unit.js +0 -79
  601. package/test/util/periods_unit.js +0 -1623
  602. package/test/util/pssh_unit.js +0 -226
  603. package/test/util/state_history_unit.js +0 -101
  604. package/test/util/stream_utils_unit.js +0 -1068
  605. package/test/util/string_utils_unit.js +0 -166
  606. package/test/util/text_parser_unit.js +0 -165
  607. package/test/util/ts_parser_unit.js +0 -77
  608. package/test/util/xml_utils_unit.js +0 -444
@@ -1,879 +0,0 @@
1
- /**
2
- * @license
3
- * JSDoc is free software, licensed under the Apache License, Version 2.0 (the
4
- * "License"). Commercial and non-commercial use are permitted in compliance
5
- * with the License.
6
- *
7
- * Copyright (c) 2011-present Michael Mathews <micmath@gmail.com> and the
8
- * [contributors to JSDoc](https://github.com/jsdoc/jsdoc/graphs/contributors).
9
- * All rights reserved.
10
- *
11
- * You may obtain a copy of the License at:
12
- * http://www.apache.org/licenses/LICENSE-2.0
13
- */
14
-
15
- /**
16
- * @fileoverview The publication code for the JSDoc template.
17
- *
18
- * Forked by Shaka Player team from the default template in JSDoc.
19
- */
20
-
21
- const catharsis = require('catharsis');
22
- const doop = require('jsdoc/util/doop');
23
- const env = require('jsdoc/env');
24
- const fs = require('jsdoc/fs');
25
- const helper = require('jsdoc/util/templateHelper');
26
- const inline = require('jsdoc/tag/inline');
27
- const logger = require('jsdoc/util/logger');
28
- const path = require('jsdoc/path');
29
- const taffy = require('taffydb').taffy;
30
- const template = require('jsdoc/template');
31
-
32
- const htmlsafe = helper.htmlsafe;
33
- const linkto = helper.linkto;
34
- const resolveAuthorLinks = helper.resolveAuthorLinks;
35
- const hasOwnProp = Object.prototype.hasOwnProperty;
36
-
37
- const FONT_NAMES = [
38
- 'OpenSans-Bold',
39
- 'OpenSans-BoldItalic',
40
- 'OpenSans-Italic',
41
- 'OpenSans-Light',
42
- 'OpenSans-LightItalic',
43
- 'OpenSans-Regular'
44
- ];
45
- const PRETTIFIER_CSS_FILES = [
46
- 'tomorrow.min.css'
47
- ];
48
- const PRETTIFIER_SCRIPT_FILES = [
49
- 'lang-css.js',
50
- 'prettify.js'
51
- ];
52
-
53
- let data;
54
- let view;
55
-
56
- let outdir = path.normalize(env.opts.destination);
57
-
58
- let docletMap;
59
-
60
- function customResolveLinks(html) {
61
- console.assert(!!docletMap, 'No doclet map!');
62
-
63
- // Do the standard link resolution first.
64
- html = helper.resolveLinks(html);
65
-
66
- // Now do our custom link resolution.
67
- const customReplacers = {
68
- linksource: (string, tagInfo) => {
69
- const longname = tagInfo.text;
70
- const doclet = docletMap[longname];
71
- if (!doclet) {
72
- logger.fatal('Unknown linksource target: %s', longname);
73
- return '';
74
- }
75
-
76
- const link = linkto(
77
- /* destination */ doclet.meta.shortpath,
78
- /* link text */ longname,
79
- /* css class */ null,
80
- /* fragment */ 'line' + doclet.meta.lineno);
81
- return string.replace(tagInfo.completeTag, link);
82
- },
83
- };
84
-
85
- return inline.replaceInlineTags(html, customReplacers).newString;
86
- }
87
-
88
- function find(spec) {
89
- return helper.find(data, spec);
90
- }
91
-
92
- function tutoriallink(tutorial) {
93
- return helper.toTutorial(tutorial, null, {
94
- tag: 'em',
95
- classname: 'disabled',
96
- prefix: 'Tutorial: '
97
- });
98
- }
99
-
100
- function getAncestorLinks(doclet) {
101
- return helper.getAncestorLinks(data, doclet);
102
- }
103
-
104
- function hashToLink(doclet, hash) {
105
- let url;
106
-
107
- if ( !/^(#.+)/.test(hash) ) {
108
- return hash;
109
- }
110
-
111
- url = helper.createLink(doclet);
112
- url = url.replace(/(#.+|$)/, hash);
113
-
114
- return `<a href="${url}">${hash}</a>`;
115
- }
116
-
117
- function needsSignature({kind, type, meta}) {
118
- let needsSig = false;
119
-
120
- // function and class definitions always get a signature
121
- if (kind === 'function' || kind === 'class') {
122
- needsSig = true;
123
- }
124
- // typedefs that contain functions get a signature, too
125
- else if (kind === 'typedef' && type && type.names &&
126
- type.names.length) {
127
- for (let i = 0, l = type.names.length; i < l; i++) {
128
- if (type.names[i].toLowerCase() === 'function') {
129
- needsSig = true;
130
- break;
131
- }
132
- }
133
- }
134
- // and namespaces that are functions get a signature (but finding them is a
135
- // bit messy)
136
- else if (kind === 'namespace' && meta && meta.code &&
137
- meta.code.type && meta.code.type.match(/[Ff]unction/)) {
138
- needsSig = true;
139
- }
140
-
141
- return needsSig;
142
- }
143
-
144
- function getSignatureAttributes({optional, nullable}) {
145
- const attributes = [];
146
-
147
- if (optional) {
148
- attributes.push('opt');
149
- }
150
-
151
- if (nullable === true) {
152
- attributes.push('nullable');
153
- }
154
- else if (nullable === false) {
155
- attributes.push('non-null');
156
- }
157
-
158
- return attributes;
159
- }
160
-
161
- function updateItemName(item) {
162
- const attributes = getSignatureAttributes(item);
163
- let itemName = item.name || '';
164
-
165
- if (item.variable) {
166
- itemName = `&hellip;${itemName}`;
167
- }
168
-
169
- if (attributes && attributes.length) {
170
- itemName = `${itemName}<span class="signature-attributes">${attributes.join(', ')}</span>`;
171
- }
172
-
173
- return itemName;
174
- }
175
-
176
- function addParamAttributes(params) {
177
- return params.filter(({name}) => name && !name.includes('.')).map(updateItemName);
178
- }
179
-
180
- function buildItemTypeStrings(item) {
181
- const types = [];
182
-
183
- if (item && item.type && item.type.names) {
184
- item.type.names.forEach(name => {
185
- types.push( linkto(name, htmlsafe(name)) );
186
- });
187
- }
188
-
189
- return types;
190
- }
191
-
192
- function buildAttribsString(attribs) {
193
- let attribsString = '';
194
-
195
- if (attribs && attribs.length) {
196
- htmlsafe(`(${attribs.join(', ')}) `);
197
- }
198
-
199
- return attribsString;
200
- }
201
-
202
- function addNonParamAttributes(items) {
203
- let types = [];
204
-
205
- items.forEach(item => {
206
- types = types.concat( buildItemTypeStrings(item) );
207
- });
208
-
209
- return types;
210
- }
211
-
212
- function addSignatureParams(f) {
213
- const params = f.params ? addParamAttributes(f.params) : [];
214
-
215
- f.signature = `${f.signature || ''}(${params.join(', ')})`;
216
- }
217
-
218
- function addSignatureReturns(f) {
219
- const attribs = [];
220
- let attribsString = '';
221
- let returnTypes = [];
222
- let returnTypesString = '';
223
- const source = f.yields || f.returns;
224
-
225
- // jam all the return-type attributes into an array. this could create odd results (for example,
226
- // if there are both nullable and non-nullable return types), but let's assume that most people
227
- // who use multiple @return tags aren't using Closure Compiler type annotations, and vice-versa.
228
- if (source) {
229
- source.forEach(item => {
230
- helper.getAttribs(item).forEach(attrib => {
231
- if (!attribs.includes(attrib)) {
232
- attribs.push(attrib);
233
- }
234
- });
235
- });
236
-
237
- attribsString = buildAttribsString(attribs);
238
- }
239
-
240
- if (source) {
241
- returnTypes = addNonParamAttributes(source);
242
- }
243
- if (returnTypes.length) {
244
- returnTypesString = ` &rarr; ${attribsString}{${returnTypes.join('|')}}`;
245
- }
246
-
247
- f.signature = `<span class="signature">${f.signature || ''}</span>` +
248
- `<span class="type-signature">${returnTypesString}</span>`;
249
- }
250
-
251
- function addSignatureTypes(f) {
252
- const types = f.type ? buildItemTypeStrings(f) : [];
253
-
254
- f.signature = `${f.signature || ''}<span class="type-signature">` +
255
- `${types.length ? ` :${types.join('|')}` : ''}</span>`;
256
- }
257
-
258
- function addAttribs(f) {
259
- const attribs = helper.getAttribs(f);
260
- const attribsString = buildAttribsString(attribs);
261
-
262
- f.attribs = `<span class="type-signature">${attribsString}</span>`;
263
- }
264
-
265
- function shortenPaths(files, commonPrefix) {
266
- Object.keys(files).forEach(file => {
267
- files[file].shortened = files[file].resolved.replace(commonPrefix, '')
268
- // always use forward slashes
269
- .replace(/\\/g, '/');
270
- });
271
-
272
- return files;
273
- }
274
-
275
- function getPathFromDoclet({meta}) {
276
- if (!meta) {
277
- return null;
278
- }
279
-
280
- return meta.path && meta.path !== 'null' ?
281
- path.join(meta.path, meta.filename) :
282
- meta.filename;
283
- }
284
-
285
- function generate(title, docs, filename, resolveLinks) {
286
- let docData;
287
- let html;
288
- let outpath;
289
-
290
- resolveLinks = resolveLinks !== false;
291
-
292
- docData = {
293
- env: env,
294
- title: title,
295
- docs: docs
296
- };
297
-
298
- outpath = path.join(outdir, filename);
299
- html = view.render('container.tmpl', docData);
300
-
301
- if (resolveLinks) {
302
- html = customResolveLinks(html); // turn {@link foo} into <a href="foodoc.html">foo</a>
303
- }
304
-
305
- fs.writeFileSync(outpath, html, 'utf8');
306
- }
307
-
308
- function generateSourceFiles(sourceFiles, encoding = 'utf8') {
309
- Object.keys(sourceFiles).forEach(file => {
310
- let source;
311
- // links are keyed to the shortened path in each doclet's `meta.shortpath` property
312
- const sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened);
313
-
314
- helper.registerLink(sourceFiles[file].shortened, sourceOutfile);
315
-
316
- try {
317
- source = {
318
- kind: 'source',
319
- code: helper.htmlsafe( fs.readFileSync(sourceFiles[file].resolved, encoding) )
320
- };
321
- }
322
- catch (e) {
323
- logger.error('Error while generating source file %s: %s', file, e.message);
324
- }
325
-
326
- generate(`Source: ${sourceFiles[file].shortened}`, [source], sourceOutfile,
327
- false);
328
- });
329
- }
330
-
331
- /**
332
- * Look for classes or functions with the same name as modules (which indicates that the module
333
- * exports only that class or function), then attach the classes or functions to the `module`
334
- * property of the appropriate module doclets. The name of each class or function is also updated
335
- * for display purposes. This function mutates the original arrays.
336
- *
337
- * @private
338
- * @param {Array.<module:jsdoc/doclet.Doclet>} doclets - The array of classes and functions to
339
- * check.
340
- * @param {Array.<module:jsdoc/doclet.Doclet>} modules - The array of module doclets to search.
341
- */
342
- function attachModuleSymbols(doclets, modules) {
343
- const symbols = {};
344
-
345
- // build a lookup table
346
- doclets.forEach(symbol => {
347
- symbols[symbol.longname] = symbols[symbol.longname] || [];
348
- symbols[symbol.longname].push(symbol);
349
- });
350
-
351
- modules.forEach(module => {
352
- if (symbols[module.longname]) {
353
- module.modules = symbols[module.longname]
354
- // Only show symbols that have a description. Make an exception for classes, because
355
- // we want to show the constructor-signature heading no matter what.
356
- .filter(({description, kind}) => description || kind === 'class')
357
- .map(symbol => {
358
- symbol = doop(symbol);
359
-
360
- if (symbol.kind === 'class' || symbol.kind === 'function') {
361
- symbol.name = `${symbol.name.replace('module:', '(require("')}"))`;
362
- }
363
-
364
- return symbol;
365
- });
366
- }
367
- });
368
- }
369
-
370
- function buildMemberNav(items, itemHeading, itemsSeen, linktoFn) {
371
- let nav = '';
372
-
373
- if (items.length) {
374
- let itemsNav = '';
375
-
376
- items.forEach(item => {
377
- let displayName;
378
-
379
- let className = 'access-public'; // default
380
- if (item.access) {
381
- className = 'access-' + item.access;
382
- }
383
-
384
- // Tutorials should always be visible.
385
- if (item.kind == undefined && !!item.title) {
386
- className = '';
387
- }
388
-
389
- if ( !hasOwnProp.call(item, 'longname') ) {
390
- itemsNav += `<li class="${className}">${linktoFn('', item.name)}</li>`;
391
- }
392
- else if ( !hasOwnProp.call(itemsSeen, item.longname) ) {
393
- if (env.conf.templates.default.useLongnameInNav) {
394
- displayName = item.longname;
395
- } else {
396
- displayName = item.name;
397
- }
398
- itemsNav += `<li class="${className}">${linktoFn(item.longname, displayName.replace(/\b(module|event):/g, ''))}</li>`;
399
-
400
- itemsSeen[item.longname] = true;
401
- }
402
- });
403
-
404
- if (itemsNav !== '') {
405
- nav += `<h3>${itemHeading}</h3><ul>${itemsNav}</ul>`;
406
- }
407
- }
408
-
409
- return nav;
410
- }
411
-
412
- function linktoTutorial(longName, name) {
413
- return tutoriallink(name);
414
- }
415
-
416
- function linktoExternal(longName, name) {
417
- return linkto(longName, name.replace(/(^"|"$)/g, ''));
418
- }
419
-
420
- /**
421
- * Create the navigation sidebar.
422
- * @param {object} members The members that will be used to create the sidebar.
423
- * @param {array<object>} members.classes
424
- * @param {array<object>} members.externals
425
- * @param {array<object>} members.mixins
426
- * @param {array<object>} members.modules
427
- * @param {array<object>} members.namespaces
428
- * @param {array<object>} members.tutorials
429
- * @param {array<object>} members.events
430
- * @param {array<object>} members.interfaces
431
- * @return {string} The HTML for the navigation sidebar.
432
- */
433
- function buildNav(members) {
434
- let nav = '<h2><a href="index.html">Home</a></h2>';
435
- const seen = {};
436
- const seenTutorials = {};
437
-
438
- const navSections = [
439
- [members.modules, 'Modules', {}, linkto],
440
- [members.externals, 'Externals', seen, linktoExternal],
441
- [members.namespaces, 'Namespaces', seen, linkto],
442
- [members.classes, 'Classes', seen, linkto],
443
- [members.enums, 'Enums', seen, linkto],
444
- [members.interfaces, 'Interfaces', seen, linkto],
445
- [members.events, 'Events', seen, linkto],
446
- [members.mixins, 'Mixins', seen, linkto],
447
- [members.tutorials, 'Tutorials', seenTutorials, linktoTutorial],
448
- ];
449
-
450
- let navOrder = env.conf.templates.default.navOrder;
451
- if (!navOrder) {
452
- // Default order: everything listed in navSections, in that order.
453
- navOrder = navSections.map(section => section[1]);
454
- }
455
-
456
- for (const name of navOrder) {
457
- const section = navSections.find(section => section[1] == name);
458
- if (section) {
459
- nav += buildMemberNav.apply(null, section);
460
- } else {
461
- logger.error('Section %s in navOrder is unrecognized!', name);
462
- }
463
- }
464
-
465
- return nav;
466
- }
467
-
468
- function fixUpType(type) {
469
- // Replace generic "function" and "record" types with their original types.
470
- // With this, we see, for example:
471
- // "function(string):number" instead of just "function"
472
- // "{{ foo: string, bar: number }}" instead of just "Object"
473
- const parsedType = type.parsedType || {};
474
- if (parsedType.type == 'FunctionType' || parsedType.type == 'RecordType') {
475
- const originalType = catharsis.stringify(parsedType);
476
- type.names = [originalType];
477
- }
478
- }
479
-
480
- /**
481
- @param {TAFFY} taffyData See <http://taffydb.com/>.
482
- @param {object} opts
483
- @param {Tutorial} tutorials
484
- */
485
- exports.publish = (taffyData, opts, tutorials) => {
486
- let classes;
487
- let conf;
488
- let enums;
489
- let externals;
490
- let files;
491
- let fromDir;
492
- let indexUrl;
493
- let interfaces;
494
- let members;
495
- let mixins;
496
- let modules;
497
- let namespaces;
498
- let outputSourceFiles;
499
- let packageInfo;
500
- let packages;
501
- const sourceFilePaths = [];
502
- let sourceFiles = {};
503
- let staticFileFilter;
504
- let staticFilePaths;
505
- let staticFiles;
506
- let staticFileScanner;
507
- let templatePath;
508
-
509
- data = taffyData;
510
-
511
- conf = env.conf.templates || {};
512
- conf.default = conf.default || {};
513
-
514
- templatePath = path.normalize(opts.template);
515
- view = new template.Template( path.join(templatePath, 'tmpl') );
516
-
517
- // claim some special filenames in advance, so the All-Powerful Overseer of Filename Uniqueness
518
- // doesn't try to hand them out later
519
- indexUrl = helper.getUniqueFilename('index');
520
- // don't call registerLink() on this one! 'index' is also a valid longname
521
-
522
- // set up templating
523
- view.layout = conf.default.layoutFile ?
524
- path.getResourcePath(path.dirname(conf.default.layoutFile),
525
- path.basename(conf.default.layoutFile) ) :
526
- 'layout.tmpl';
527
-
528
- // set up tutorials for helper
529
- helper.setTutorials(tutorials);
530
-
531
- data = helper.prune(data);
532
- data.sort('longname, version, since');
533
- helper.addEventListeners(data);
534
-
535
- data().each(doclet => {
536
- let sourcePath;
537
-
538
- doclet.attribs = '';
539
-
540
- if (doclet.examples) {
541
- doclet.examples = doclet.examples.map(example => {
542
- let caption;
543
- let code;
544
-
545
- if (example.match(/^\s*<caption>([\s\S]+?)<\/caption>(\s*[\n\r])([\s\S]+)$/i)) {
546
- caption = RegExp.$1;
547
- code = RegExp.$3;
548
- }
549
-
550
- return {
551
- caption: caption || '',
552
- code: code || example
553
- };
554
- });
555
- }
556
- if (doclet.see) {
557
- doclet.see.forEach((seeItem, i) => {
558
- doclet.see[i] = hashToLink(doclet, seeItem);
559
- });
560
- }
561
-
562
- // build a list of source files
563
- if (doclet.meta) {
564
- sourcePath = getPathFromDoclet(doclet);
565
- sourceFiles[sourcePath] = {
566
- resolved: sourcePath,
567
- shortened: null
568
- };
569
- if (!sourceFilePaths.includes(sourcePath)) {
570
- sourceFilePaths.push(sourcePath);
571
- }
572
- }
573
- });
574
-
575
- // update outdir if necessary, then create outdir
576
- packageInfo = ( find({kind: 'package'}) || [] )[0];
577
- if (packageInfo && packageInfo.name) {
578
- outdir = path.join( outdir, packageInfo.name, (packageInfo.version || '') );
579
- }
580
- fs.mkPath(outdir);
581
-
582
- // copy the template's static files to outdir
583
- fromDir = path.join(templatePath, 'static');
584
- staticFiles = fs.ls(fromDir, 3);
585
-
586
- staticFiles.forEach(fileName => {
587
- const toDir = fs.toDir( fileName.replace(fromDir, outdir) );
588
-
589
- fs.mkPath(toDir);
590
- fs.copyFileSync(fileName, toDir);
591
- });
592
-
593
- // copy the fonts used by the template to outdir
594
- staticFiles = fs.ls(path.join(require.resolve('open-sans-fonts'), '..', 'open-sans'), 3);
595
-
596
- staticFiles.forEach(fileName => {
597
- const toDir = path.join(outdir, 'fonts');
598
-
599
- if (FONT_NAMES.includes(path.parse(fileName).name)) {
600
- fs.mkPath(toDir);
601
- fs.copyFileSync(fileName, toDir);
602
- }
603
- });
604
-
605
- // copy the prettify script to outdir
606
- PRETTIFIER_SCRIPT_FILES.forEach(fileName => {
607
- const toDir = path.join(outdir, 'scripts');
608
-
609
- fs.copyFileSync(
610
- path.join(require.resolve('code-prettify'), '..', fileName),
611
- toDir
612
- );
613
- });
614
-
615
- // copy the prettify CSS to outdir
616
- PRETTIFIER_CSS_FILES.forEach(fileName => {
617
- const toDir = path.join(outdir, 'styles');
618
-
619
- fs.copyFileSync(
620
- // `require.resolve()` has trouble with this package, so we use an extra-hacky way to
621
- // get the filepath.
622
- path.join(
623
- templatePath,
624
- '..',
625
- '..',
626
- 'node_modules',
627
- 'color-themes-for-google-code-prettify',
628
- 'dist',
629
- 'themes',
630
- fileName
631
- ),
632
- toDir
633
- );
634
- });
635
-
636
- // copy user-specified static files to outdir
637
- if (conf.default.staticFiles) {
638
- // The canonical property name is `include`. We accept `paths` for backwards compatibility
639
- // with a bug in JSDoc 3.2.x.
640
- staticFilePaths = conf.default.staticFiles.include ||
641
- conf.default.staticFiles.paths ||
642
- [];
643
- staticFileFilter = new (require('jsdoc/src/filter').Filter)(conf.default.staticFiles);
644
- staticFileScanner = new (require('jsdoc/src/scanner').Scanner)();
645
-
646
- staticFilePaths.forEach(filePath => {
647
- let extraStaticFiles;
648
-
649
- filePath = path.resolve(env.pwd, filePath);
650
- extraStaticFiles = staticFileScanner.scan([filePath], 10, staticFileFilter);
651
-
652
- extraStaticFiles.forEach(fileName => {
653
- const sourcePath = fs.toDir(filePath);
654
- const toDir = fs.toDir( fileName.replace(sourcePath, outdir) );
655
-
656
- fs.mkPath(toDir);
657
- fs.copyFileSync(fileName, toDir);
658
- });
659
- });
660
- }
661
-
662
- if (sourceFilePaths.length) {
663
- sourceFiles = shortenPaths( sourceFiles, path.commonPrefix(sourceFilePaths) );
664
- }
665
- data().each(doclet => {
666
- let docletPath;
667
- const url = helper.createLink(doclet);
668
-
669
- helper.registerLink(doclet.longname, url);
670
-
671
- // add a shortened version of the full path
672
- if (doclet.meta) {
673
- docletPath = getPathFromDoclet(doclet);
674
- docletPath = sourceFiles[docletPath].shortened;
675
- if (docletPath) {
676
- doclet.meta.shortpath = docletPath;
677
- }
678
- }
679
- });
680
-
681
- // Fix up types before signatures have been generated!
682
- data().each(doclet => {
683
- if (doclet.params) {
684
- for (const param of doclet.params) {
685
- fixUpType(param.type);
686
- }
687
- }
688
- if (doclet.returns) {
689
- for (const ret of doclet.returns) {
690
- fixUpType(ret.type);
691
- }
692
- }
693
- if (doclet.type) {
694
- fixUpType(doclet.type);
695
- }
696
- });
697
-
698
- data().each(doclet => {
699
- const url = helper.longnameToUrl[doclet.longname];
700
-
701
- if (url.includes('#')) {
702
- doclet.id = helper.longnameToUrl[doclet.longname].split(/#/).pop();
703
- }
704
- else {
705
- doclet.id = doclet.name;
706
- }
707
-
708
- if ( needsSignature(doclet) ) {
709
- addSignatureParams(doclet);
710
- addSignatureReturns(doclet);
711
- addAttribs(doclet);
712
- }
713
- });
714
-
715
- // do this after the urls have all been generated
716
- data().each(doclet => {
717
- doclet.ancestors = getAncestorLinks(doclet);
718
-
719
- if (doclet.kind === 'member') {
720
- addSignatureTypes(doclet);
721
- addAttribs(doclet);
722
- }
723
-
724
- if (doclet.kind === 'constant') {
725
- addSignatureTypes(doclet);
726
- addAttribs(doclet);
727
- doclet.kind = 'member';
728
- }
729
- });
730
-
731
- // Used later by customResolveLinks.
732
- docletMap = {};
733
- data().each(doclet => {
734
- docletMap[doclet.longname] = doclet;
735
- });
736
-
737
- members = helper.getMembers(data);
738
- members.enums = [];
739
-
740
- data().each(doclet => {
741
- if (doclet.isEnum) {
742
- const hasParent = !!docletMap[doclet.memberof];
743
-
744
- // Enums without parents (not attached to a class, but directly to a
745
- // namespace) aren't recognized by jsdoc by default and need to be
746
- // massaged into the docs separately.
747
- if (!hasParent) {
748
- // Temporarily call this a "class", so that we can fix the URL.
749
- doclet.kind = 'class';
750
- // Regenerate the URL, so that this enum gets its own page
751
- // instead of a URL that links to an ID within a non-existent
752
- // parent page.
753
- delete helper.longnameToUrl[doclet.longname];
754
- helper.createLink(doclet);
755
- // Mark this as an enum (custom type), so that it doesn't get
756
- // slotted with the classes.
757
- doclet.kind = 'enum';
758
- members.enums.push(doclet);
759
- }
760
- }
761
- });
762
-
763
- members.tutorials = tutorials.children;
764
- if (conf.default.sortTutorialsByConfigOrder) {
765
- members.tutorials.sort((a, b) => {
766
- if (a.autoindex !== undefined && b.autoindex !== undefined) {
767
- return a.autoindex - b.autoindex;
768
- } else if (a.autoindex !== undefined) {
769
- return -1;
770
- } else if (b.autoindex !== undefined) {
771
- return 1;
772
- }
773
- });
774
- }
775
-
776
- // output pretty-printed source files by default
777
- outputSourceFiles = conf.default && conf.default.outputSourceFiles !== false;
778
-
779
- // add template helpers
780
- view.find = find;
781
- view.linkto = linkto;
782
- view.resolveAuthorLinks = resolveAuthorLinks;
783
- view.tutoriallink = tutoriallink;
784
- view.htmlsafe = htmlsafe;
785
- view.outputSourceFiles = outputSourceFiles;
786
-
787
- // once for all
788
- view.nav = buildNav(members);
789
- attachModuleSymbols( find({ longname: {left: 'module:'} }), members.modules );
790
-
791
- // generate the pretty-printed source files first so other pages can link to them
792
- if (outputSourceFiles) {
793
- generateSourceFiles(sourceFiles, opts.encoding);
794
- }
795
-
796
- // index page displays information from package.json and lists files
797
- files = find({kind: 'file'});
798
- packages = find({kind: 'package'});
799
-
800
- generate('Home', [{
801
- kind: 'mainpage',
802
- readme: opts.readme,
803
- longname: (opts.mainpagetitle) ? opts.mainpagetitle : 'Main Page'
804
- }], indexUrl);
805
-
806
- // set up the lists that we'll use to generate pages
807
- classes = taffy(members.classes);
808
- enums = taffy(members.enums);
809
- modules = taffy(members.modules);
810
- namespaces = taffy(members.namespaces);
811
- mixins = taffy(members.mixins);
812
- externals = taffy(members.externals);
813
- interfaces = taffy(members.interfaces);
814
-
815
- Object.keys(helper.longnameToUrl).forEach(longname => {
816
- const myClasses = helper.find(classes, {longname: longname});
817
- const myEnums = helper.find(enums, {longname: longname});
818
- const myExternals = helper.find(externals, {longname: longname});
819
- const myInterfaces = helper.find(interfaces, {longname: longname});
820
- const myMixins = helper.find(mixins, {longname: longname});
821
- const myModules = helper.find(modules, {longname: longname});
822
- const myNamespaces = helper.find(namespaces, {longname: longname});
823
-
824
- if (myModules.length) {
825
- generate(`Module: ${myModules[0].longname}`, myModules, helper.longnameToUrl[longname]);
826
- }
827
-
828
- if (myClasses.length) {
829
- generate(`Class: ${myClasses[0].longname}`, myClasses, helper.longnameToUrl[longname]);
830
- }
831
-
832
- if (myEnums.length) {
833
- generate(`Enum: ${myEnums[0].longname}`, myEnums, helper.longnameToUrl[longname]);
834
- }
835
-
836
- if (myNamespaces.length) {
837
- generate(`Namespace: ${myNamespaces[0].longname}`, myNamespaces, helper.longnameToUrl[longname]);
838
- }
839
-
840
- if (myMixins.length) {
841
- generate(`Mixin: ${myMixins[0].longname}`, myMixins, helper.longnameToUrl[longname]);
842
- }
843
-
844
- if (myExternals.length) {
845
- generate(`External: ${myExternals[0].longname}`, myExternals, helper.longnameToUrl[longname]);
846
- }
847
-
848
- if (myInterfaces.length) {
849
- generate(`Interface: ${myInterfaces[0].longname}`, myInterfaces, helper.longnameToUrl[longname]);
850
- }
851
- });
852
-
853
- // TODO: move the tutorial functions to templateHelper.js
854
- function generateTutorial(title, tutorial, filename) {
855
- const tutorialData = {
856
- title: title,
857
- header: tutorial.title,
858
- content: tutorial.parse(),
859
- children: tutorial.children
860
- };
861
- const tutorialPath = path.join(outdir, filename);
862
- let html = view.render('tutorial.tmpl', tutorialData);
863
-
864
- // yes, you can use {@link} in tutorials too!
865
- html = customResolveLinks(html); // turn {@link foo} into <a href="foodoc.html">foo</a>
866
-
867
- fs.writeFileSync(tutorialPath, html, 'utf8');
868
- }
869
-
870
- // tutorials can have only one parent so there is no risk for loops
871
- function saveChildren({children}) {
872
- children.forEach(child => {
873
- generateTutorial(`Tutorial: ${child.title}`, child, helper.tutorialToUrl(child.name));
874
- saveChildren(child);
875
- });
876
- }
877
-
878
- saveChildren(tutorials);
879
- };