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,248 +0,0 @@
1
- # DASH Manifests
2
-
3
- This document describes some of the pieces of a DASH manifest and how they
4
- relate to playback. This won't cover everything that DASH allows, but this will
5
- cover the important concepts and hopefully will alleviate some of the confusion
6
- many people have with DASH manifests.
7
-
8
-
9
- ## Time
10
-
11
- When dealing with media and streaming, there are many different kinds of times
12
- we are dealing with. Some don't apply to all cases; for example, VOD doesn't
13
- care about the wall-clock time. It is important to use the correct words for
14
- the kind of time we are dealing with to avoid confusion. It is possible to
15
- convert from one kind of time to another, but these all have distinct values
16
- that need to be considered different.
17
-
18
- ### Presentation time
19
-
20
- The time within the presentation. This represents the amount of time that has
21
- passed since the start of the presentation. For VOD, this is the time since the
22
- beginning of the video; for live, this is the time since the live stream
23
- started.
24
-
25
- ### Media time
26
-
27
- The time that is encoded within a media segment. Each media segment has
28
- information in it for what time it should be played at. The media time is not
29
- used by the player to determine presentation time; however, it is used by the
30
- media player (e.g. the browser) to play the segment. So if the segment has a
31
- media time of 30 seconds, then the browser will put the segment at 30 seconds in
32
- the `<video>`.
33
-
34
- The manifest specifies values which can adjust the media time. Both the
35
- `presentationTimeOffset` and the `Period@start` will change the media times so
36
- the segment appears at the correct time in the `<video>` element.
37
-
38
- ### Wall-Clock time
39
-
40
- This represents the time as seen on a clock. In terms of value, this is
41
- commonly represented as seconds since the epoch. This does **not** mean the
42
- time that a segment will be played at.
43
-
44
-
45
- ## Presentation Timeline
46
-
47
- The biggest concept in DASH is the presentation timeline. This represents a
48
- unified timeline of what content to play. This can be thought of as the time
49
- of a single VOD clip. The timeline starts at 0 and describes at what time to
50
- play each segment. So if a media segment has a presentation time of 30 seconds,
51
- then it will play 30 seconds after the presentation has started.
52
-
53
- Media times from different pieces of content are adjusted so they appear at the
54
- correct time within the timeline. This allows concatenating different clips to
55
- form a continuous video playback. Different streams may exist that describe
56
- different versions of the content to switch between (e.g. SD and HD).
57
-
58
- In Shaka Player, we only deal with presentation time. We map this directly
59
- to the `<video>` element. This means that `video.currentTime` represents the
60
- presentation time of the content. So if you seek to 90 seconds, we will look
61
- up the segment that has a presentation time of 90 seconds.
62
-
63
-
64
- ## Periods
65
-
66
- The presentation timeline is composed of one or more sequential Periods. A
67
- Period represents an independent piece of the timeline. Periods cannot overlap
68
- and should not have gaps between them (although Shaka Player supports gap
69
- jumping). Each Period has a start time, which can be explicit through the
70
- `start` attribute, or can be implicit by using the `duration` attribute of the
71
- previous Period.
72
-
73
- Content is clamped to a Period. Any content that appears before the Period
74
- start or after the Period end will be dropped. If the whole segment is outside
75
- the Period, the player will just ignore it.
76
-
77
- Note that we implement content deleting using the MSE `appendWindowStart`. This
78
- has a subtle problem if we have a partial segment at the start of the Period.
79
- When the browser drops content at the start of the Period, it will continue to
80
- drop frames until the next keyframe. This means that if your first segment
81
- starts at -0.1 relative to the Period (e.g. `PTO > S@t`), then we may loose the
82
- whole segment if there are no more keyframes in it. See the
83
- [coded frame processing][] algorithm for more info.
84
-
85
- [coded frame processing]: https://w3c.github.io/media-source/#sourcebuffer-coded-frame-processing
86
-
87
-
88
- ## Calculating presentation times
89
-
90
- ```xml
91
- <Period start="PT30S" duration="PT10S">
92
- <AdaptationSet>
93
- <Representation>
94
- <SegmentTemplate timescale="10" presentationTimeOffset="100"
95
- media="s$Number$.mp4" initialization="init.mp4">
96
- <SegmentTimeline>
97
- <S t="111" d="40" />
98
- <S d="10" />
99
- <S t="170" d="10" />
100
- </SegmentTimeline>
101
- </SegmentTemplate>
102
- </Representation>
103
- </AdaptationSet>
104
- </Period>
105
- ```
106
-
107
- The above example uses `SegmentTemplate` with `SegmentTimeline`, but you could
108
- easily use the other formats, there is no difference. In any case, there is a
109
- list of the segments where each segment has a start and duration.
110
-
111
- Here is the general equation used to calculate presentation times.
112
-
113
- ```js
114
- start = 111; // S@t
115
- presentationTime = (start - presentationTimeOffset) / timescale + periodStart;
116
- ```
117
-
118
- First the start time in the manifest needs to be offset by the
119
- `presentationTimeOffset` (PTO). The reason this exists is because the time
120
- specified in the time attribute MUST match the media time. The PTO will adjust
121
- the media time too; this means if you just change the `S@t`, when we append the
122
- media, the browser will put the segment at the wrong time since we didn't adjust
123
- the media time correctly.
124
-
125
- Next, both the start time and PTO are specified in timescale units, so we need
126
- to convert that to seconds.
127
-
128
- Lastly, times in the manifest are relative to the Period. This means that you
129
- need to add the Period time to get the real presentation time. This allows you
130
- to specify each Period independent to where the Period is within the timeline.
131
- This is especially useful for ad-insertion.
132
-
133
- So in the above example, the first segment starts playing at
134
- `(111 - 100) / 10 + 30`, or 31.1 seconds. The first segment has a duration of
135
- `S@d / timescale` seconds so the second segment will start at 35.1 seconds.
136
- There is a gap before the third segment, and it will start at
137
- `(170 - 100) / 10 + 30` or 37 seconds.
138
-
139
- ![timeline example](dash-timeline.svg)
140
-
141
- ### Choosing values for presentationTimeOffset (PTO)
142
-
143
- You want to set `S@t` to exactly the same value as the media time. If that
144
- doesn't result in a presentation time you want, you should use PTO or Period
145
- start to change that. If there is a single Period, you can have Period start be
146
- 0 and just use PTO to adjust the segment to be at the right time; in
147
- multi-Period content you'll need to adjust it so that the segments within the
148
- Period start at 0.
149
-
150
- Be sure to use the same value for PTO for all streams. It may be tempting to
151
- just use the first `S@t` value for PTO, but that won't work. If you use
152
- different values, it will result in audio/video de-sync since they have been
153
- adjusted by different amounts. It is better to pick a specific value and set
154
- each stream to the same value (make sure to account for timescale).
155
-
156
- Also when choosing between two values for PTO, it is suggested to use the
157
- smaller value. If you use the bigger one, then the Period-relative time of the
158
- other stream will be negative. See note in the Periods section above.
159
-
160
-
161
- ## Live
162
-
163
- It is important to note that live works almost exactly the same as VOD. Live
164
- still has the same timeline and same presentation times. For live content,
165
- the presentation time of 0 represents when the live stream started. This is
166
- given in the manifest as `availabilityStartTime`. So when we start playing a
167
- live stream, we will calculate the difference between `now` and the start time
168
- and that gives us the current presentation time to play at.
169
-
170
- Important: You shouldn't map presentation times to wall-clock times. If a
171
- media segment has a presentation time of 5 minutes and an AST of 9:00, that
172
- doesn't mean the segment will be played at 9:05; the app can pause the video
173
- which will delay when it is played. All it means is that is when it was
174
- recorded.
175
-
176
- Also note that it is common to use Unix timestamps for the media timestamps in
177
- live content. Then setting the AST to the epoch means the segments appear at
178
- the correct time. This is valid, but not required. Just like VOD content, the
179
- media time doesn't matter so long as the adjusted presentation time puts the
180
- segment at the correct position.
181
-
182
- ### Live edge
183
-
184
- When playing live content, we need to determine what the current time is. The
185
- live edge is the latest edge of the live playback, in presentation time. As we
186
- are playing, the live edge moves forward with the current wall-clock time.
187
-
188
- To calculate the live edge, we look at the `availabilityStartTime` (AST) to
189
- determine the wall-clock time that the stream started. The current wall-clock
190
- time is equivalent to `now - AST` in presentation time; however, the server is
191
- still recording that segment, so we can't play it yet. So we back the live edge
192
- up by the segment size. So the live edge is `now - AST - maxSegmentSize`.
193
-
194
- ```js
195
- const ast = 1518717600; // availabilityStartTime="2018-02-15T18:00:00Z"
196
- const now = 1518718680; // (Date.now() / 1000) -> 2018-02-15T18:18:00Z
197
- const maxSegmentSize = 10; // seconds
198
-
199
- const liveEdge = now - ast - maxSegmentSize; // 1070
200
-
201
- video.currentTime = liveEdge; // Start playing at live edge.
202
- // We'll start playing segments with a *presentation time* around 1070.
203
- ```
204
-
205
- But even then, manifest updates and network delays can cause us to stall if we
206
- try to play at the live edge. So we will actually delay where we will play at
207
- so we don't stall. The time we adjust by can be specified in the manifest using
208
- the `MPD@suggestedPresentationDelay` attribute. This specifies the delay to
209
- give the live stream to allow for smooth playback. If it isn't specified, we
210
- will give a reasonable default value.
211
-
212
- ### Segment availability
213
-
214
- DASH has a concept of availability. This defines which segments can be
215
- downloaded from the server. So long as a segment is available, the segment MUST
216
- exist on the server to be downloaded. The availability of a segment is
217
- determined by the `MPD@timeShiftBufferDepth` attribute. This specifies a
218
- moving window of availability around the live edge. So if the TSBD attribute
219
- is 10 minutes, that means that you can play the most recent 10 minutes of a
220
- live stream; or specifically, the seekable range of presentation times is
221
- between the live edge and 10 minutes before that.
222
-
223
- A manifest may list more or fewer segments than the availability window. If it
224
- lists more, the extra segments may already be unavailable when the manifest is
225
- downloaded; if the manifest lists less segments, then we may not be able to fill
226
- the whole availability window. Note that the player is allowed to remember the
227
- segments even if they are no longer listed. So if an updated manifest no longer
228
- includes some segments, they are still available to be downloaded until they
229
- fall outside the availability window.
230
-
231
- ### Clock sync
232
-
233
- Since both the live edge and the availability window calculations involve the
234
- current wall-clock time, both the server and the client need to have
235
- synchronized clocks. This is done in DASH by using the `UTCTiming` element;
236
- this specifies how to get an accurate clock time on the server so the client can
237
- alter the client clock to match.
238
-
239
- This means that DASH manifests are sensitive to drift and clock-sync issues. It
240
- is very common for live manifests to have clock problems, so if your live
241
- manifest doesn't play, it is likely because of clock sync. This is so common
242
- that Shaka Player will be changing to determine the live edge using the list of
243
- segments. You can follow progress in [#999][]. But note that DASH requires
244
- accurate clock times, so even after that feature is added, your manifest may
245
- not play in other DASH players.
246
-
247
- [#999]: https://github.com/shaka-project/shaka-player/issues/999
248
-
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" standalone="yes"?>
2
-
3
- <svg version="1.1" viewBox="0.0 0.0 948.1102362204724 282.00787401574803" fill="none" stroke="none" stroke-linecap="square" stroke-miterlimit="10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="p.0"><path d="m0 0l948.1102 0l0 282.00787l-948.1102 0l0 -282.00787z" clip-rule="nonzero"></path></clipPath><g clip-path="url(#p.0)"><path fill="#000000" fill-opacity="0.0" d="m0 0l948.1102 0l0 282.00787l-948.1102 0z" fill-rule="evenodd"></path><path fill="#000000" fill-opacity="0.0" d="m223.44356 73.603676l521.6693 0l0 85.826775l-521.6693 0z" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m223.44356 73.603676l521.6693 0l0 85.826775l-521.6693 0z" fill-rule="evenodd"></path><path fill="#000000" fill-opacity="0.0" d="m234.50919 120.72179l42.236206 0l0 38.708664l-42.236206 0z" fill-rule="evenodd"></path><path fill="#000000" d="m247.97794 141.24179l-1.046875 0l0 -6.71875q-0.390625 0.359375 -1.015625 0.734375q-0.609375 0.359375 -1.09375 0.53125l0 -1.015625q0.875 -0.421875 1.53125 -1.0q0.671875 -0.59375 0.953125 -1.15625l0.671875 0l0 8.625zm3.2988281 0l0 -1.203125l1.203125 0l0 1.203125l-1.203125 0zm6.7089844 0l-1.046875 0l0 -6.71875q-0.390625 0.359375 -1.015625 0.734375q-0.609375 0.359375 -1.09375 0.53125l0 -1.015625q0.875 -0.421875 1.53125 -1.0q0.671875 -0.59375 0.953125 -1.15625l0.671875 0l0 8.625z" fill-rule="nonzero"></path><path fill="#000000" fill-opacity="0.0" d="m80.125984 165.88452l799.74805 0" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m80.125984 165.88452l799.74805 0" fill-rule="evenodd"></path><path fill="#cfe2f3" d="m89.05502 73.603676l112.59842 0l0 85.826775l-112.59842 0z" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m89.05502 73.603676l112.59842 0l0 85.826775l-112.59842 0z" fill-rule="evenodd"></path><path fill="#cfe2f3" d="m759.7664 73.603676l112.59839 0l0 85.826775l-112.59839 0z" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m759.7664 73.603676l112.59839 0l0 85.826775l-112.59839 0z" fill-rule="evenodd"></path><path fill="#000000" fill-opacity="0.0" d="m89.055115 73.603676l112.598434 0l0 85.826775l-112.598434 0z" fill-rule="evenodd"></path><path fill="#000000" d="m112.04821 123.43706l0 -13.359375l5.046875 0q1.328125 0 2.03125 0.125q0.96875 0.171875 1.640625 0.640625q0.671875 0.453125 1.078125 1.28125q0.40625 0.828125 0.40625 1.828125q0 1.703125 -1.09375 2.890625q-1.078125 1.171875 -3.921875 1.171875l-3.421875 0l0 5.421875l-1.765625 0zm1.765625 -7.0l3.453125 0q1.71875 0 2.4375 -0.640625q0.71875 -0.640625 0.71875 -1.796875q0 -0.84375 -0.421875 -1.4375q-0.421875 -0.59375 -1.125 -0.78125q-0.4375 -0.125 -1.640625 -0.125l-3.421875 0l0 4.78125zm17.099815 3.890625l1.6875 0.203125q-0.40625 1.484375 -1.484375 2.3125q-1.078125 0.8125 -2.765625 0.8125q-2.1249924 0 -3.3749924 -1.296875q-1.234375 -1.3125 -1.234375 -3.671875q0 -2.453125 1.25 -3.796875q1.265625 -1.34375 3.2656174 -1.34375q1.9375 0 3.15625 1.328125q1.234375 1.3125 1.234375 3.703125q0 0.15625 0 0.4375l-7.2187424 0q0.09375 1.59375 0.90625 2.453125q0.8125 0.84375 2.0156174 0.84375q0.90625 0 1.546875 -0.46875q0.640625 -0.484375 1.015625 -1.515625zm-5.3906174 -2.65625l5.4062424 0q-0.109375 -1.21875 -0.625 -1.828125q-0.78125 -0.953125 -2.03125 -0.953125q-1.1249924 0 -1.9062424 0.765625q-0.765625 0.75 -0.84375 2.015625zm9.12571 5.765625l0 -9.671875l1.46875 0l0 1.46875q0.5625 -1.03125 1.03125 -1.359375q0.484375 -0.328125 1.0625 -0.328125q0.828125 0 1.6875 0.53125l-0.5625 1.515625q-0.609375 -0.359375 -1.203125 -0.359375q-0.546875 0 -0.96875 0.328125q-0.421875 0.328125 -0.609375 0.890625q-0.28125 0.875 -0.28125 1.921875l0 5.0625l-1.625 0zm6.228302 -11.46875l0 -1.890625l1.640625 0l0 1.890625l-1.640625 0zm0 11.46875l0 -9.671875l1.640625 0l0 9.671875l-1.640625 0zm3.5354462 -4.84375q0 -2.6875 1.484375 -3.96875q1.25 -1.078125 3.046875 -1.078125q2.0 0 3.265625 1.3125q1.265625 1.296875 1.265625 3.609375q0 1.859375 -0.5625 2.9375q-0.5625 1.0625 -1.640625 1.65625q-1.0625 0.59375 -2.328125 0.59375q-2.03125 0 -3.28125 -1.296875q-1.25 -1.3125 -1.25 -3.765625zm1.6875 0q0 1.859375 0.796875 2.796875q0.8125 0.921875 2.046875 0.921875q1.21875 0 2.03125 -0.921875q0.8125 -0.9375 0.8125 -2.84375q0 -1.796875 -0.8125 -2.71875q-0.8125 -0.921875 -2.03125 -0.921875q-1.234375 0 -2.046875 0.921875q-0.796875 0.90625 -0.796875 2.765625zm15.563217 4.84375l0 -1.21875q-0.90625 1.4375 -2.703125 1.4375q-1.15625 0 -2.125 -0.640625q-0.96875 -0.640625 -1.5 -1.78125q-0.53125 -1.140625 -0.53125 -2.625q0 -1.453125 0.484375 -2.625q0.484375 -1.1875 1.4375 -1.8125q0.96875 -0.625 2.171875 -0.625q0.875 0 1.546875 0.375q0.6875 0.359375 1.109375 0.953125l0 -4.796875l1.640625 0l0 13.359375l-1.53125 0zm-5.171875 -4.828125q0 1.859375 0.78125 2.78125q0.78125 0.921875 1.84375 0.921875q1.078125 0 1.828125 -0.875q0.75 -0.890625 0.75 -2.6875q0 -1.984375 -0.765625 -2.90625q-0.765625 -0.9375 -1.890625 -0.9375q-1.078125 0 -1.8125 0.890625q-0.734375 0.890625 -0.734375 2.8125zm14.012146 -1.765625q0 -2.359375 0.484375 -3.796875q0.484375 -1.453125 1.4375 -2.234375q0.96875 -0.78125 2.421875 -0.78125q1.078125 0 1.890625 0.4375q0.8125 0.421875 1.328125 1.25q0.53125 0.8125 0.828125 1.984375q0.3125 1.15625 0.3125 3.140625q0 2.359375 -0.484375 3.8125q-0.484375 1.4375 -1.453125 2.234375q-0.953125 0.78125 -2.421875 0.78125q-1.921875 0 -3.03125 -1.390625q-1.3125 -1.671875 -1.3125 -5.4375zm1.671875 0q0 3.296875 0.765625 4.390625q0.78125 1.078125 1.90625 1.078125q1.140625 0 1.90625 -1.09375q0.765625 -1.09375 0.765625 -4.375q0 -3.296875 -0.765625 -4.375q-0.765625 -1.078125 -1.921875 -1.078125q-1.125 0 -1.796875 0.953125q-0.859375 1.21875 -0.859375 4.5z" fill-rule="nonzero"></path><path fill="#000000" fill-opacity="0.0" d="m759.7664 73.603676l112.59839 0l0 85.826775l-112.59839 0z" fill-rule="evenodd"></path><path fill="#000000" d="m782.7595 123.43706l0 -13.359375l5.046875 0q1.328125 0 2.03125 0.125q0.96875 0.171875 1.640625 0.640625q0.671875 0.453125 1.078125 1.28125q0.40625 0.828125 0.40625 1.828125q0 1.703125 -1.09375 2.890625q-1.078125 1.171875 -3.921875 1.171875l-3.421875 0l0 5.421875l-1.765625 0zm1.765625 -7.0l3.453125 0q1.71875 0 2.4375 -0.640625q0.71875 -0.640625 0.71875 -1.796875q0 -0.84375 -0.421875 -1.4375q-0.421875 -0.59375 -1.125 -0.78125q-0.4375 -0.125 -1.640625 -0.125l-3.421875 0l0 4.78125zm17.099792 3.890625l1.6875 0.203125q-0.40625 1.484375 -1.484375 2.3125q-1.078125 0.8125 -2.765625 0.8125q-2.125 0 -3.375 -1.296875q-1.234375 -1.3125 -1.234375 -3.671875q0 -2.453125 1.25 -3.796875q1.265625 -1.34375 3.265625 -1.34375q1.9375 0 3.15625 1.328125q1.234375 1.3125 1.234375 3.703125q0 0.15625 0 0.4375l-7.21875 0q0.09375 1.59375 0.90625 2.453125q0.8125 0.84375 2.015625 0.84375q0.90625 0 1.546875 -0.46875q0.640625 -0.484375 1.015625 -1.515625zm-5.390625 -2.65625l5.40625 0q-0.109375 -1.21875 -0.625 -1.828125q-0.78125 -0.953125 -2.03125 -0.953125q-1.125 0 -1.90625 0.765625q-0.765625 0.75 -0.84375 2.015625zm9.125732 5.765625l0 -9.671875l1.46875 0l0 1.46875q0.5625 -1.03125 1.03125 -1.359375q0.484375 -0.328125 1.0625 -0.328125q0.828125 0 1.6875 0.53125l-0.5625 1.515625q-0.609375 -0.359375 -1.203125 -0.359375q-0.546875 0 -0.96875 0.328125q-0.421875 0.328125 -0.609375 0.890625q-0.28125 0.875 -0.28125 1.921875l0 5.0625l-1.625 0zm6.2282715 -11.46875l0 -1.890625l1.640625 0l0 1.890625l-1.640625 0zm0 11.46875l0 -9.671875l1.640625 0l0 9.671875l-1.640625 0zm3.5354614 -4.84375q0 -2.6875 1.484375 -3.96875q1.25 -1.078125 3.046875 -1.078125q2.0 0 3.265625 1.3125q1.265625 1.296875 1.265625 3.609375q0 1.859375 -0.5625 2.9375q-0.5625 1.0625 -1.640625 1.65625q-1.0625 0.59375 -2.328125 0.59375q-2.03125 0 -3.28125 -1.296875q-1.25 -1.3125 -1.25 -3.765625zm1.6875 0q0 1.859375 0.796875 2.796875q0.8125 0.921875 2.046875 0.921875q1.21875 0 2.03125 -0.921875q0.8125 -0.9375 0.8125 -2.84375q0 -1.796875 -0.8125 -2.71875q-0.8125 -0.921875 -2.03125 -0.921875q-1.234375 0 -2.046875 0.921875q-0.796875 0.90625 -0.796875 2.765625zm15.563232 4.84375l0 -1.21875q-0.90625 1.4375 -2.703125 1.4375q-1.15625 0 -2.125 -0.640625q-0.96875 -0.640625 -1.5 -1.78125q-0.53125 -1.140625 -0.53125 -2.625q0 -1.453125 0.484375 -2.625q0.484375 -1.1875 1.4375 -1.8125q0.96875 -0.625 2.171875 -0.625q0.875 0 1.546875 0.375q0.6875 0.359375 1.109375 0.953125l0 -4.796875l1.640625 0l0 13.359375l-1.53125 0zm-5.171875 -4.828125q0 1.859375 0.78125 2.78125q0.78125 0.921875 1.84375 0.921875q1.078125 0 1.828125 -0.875q0.75 -0.890625 0.75 -2.6875q0 -1.984375 -0.765625 -2.90625q-0.765625 -0.9375 -1.890625 -0.9375q-1.078125 0 -1.8125 0.890625q-0.734375 0.890625 -0.734375 2.8125zm22.621521 3.25l0 1.578125l-8.828125 0q-0.015625 -0.59375 0.1875 -1.140625q0.34375 -0.90625 1.078125 -1.78125q0.75 -0.875 2.15625 -2.015625q2.171875 -1.78125 2.9375 -2.828125q0.765625 -1.046875 0.765625 -1.96875q0 -0.984375 -0.703125 -1.640625q-0.6875 -0.671875 -1.8125 -0.671875q-1.1875 0 -1.90625 0.71875q-0.703125 0.703125 -0.703125 1.953125l-1.6875 -0.171875q0.171875 -1.890625 1.296875 -2.875q1.140625 -0.984375 3.03125 -0.984375q1.921875 0 3.046875 1.0625q1.125 1.0625 1.125 2.640625q0 0.796875 -0.328125 1.578125q-0.328125 0.78125 -1.09375 1.640625q-0.75 0.84375 -2.53125 2.34375q-1.46875 1.234375 -1.890625 1.6875q-0.421875 0.4375 -0.6875 0.875l6.546875 0z" fill-rule="nonzero"></path><path fill="#000000" fill-opacity="0.0" d="m201.65355 165.88452l57.448807 0l0 42.519684l-57.448807 0z" fill-rule="evenodd"></path><path fill="#000000" d="m211.4348 189.27327l1.640625 -0.21875q0.28125 1.40625 0.953125 2.015625q0.6875 0.609375 1.65625 0.609375q1.15625 0 1.953125 -0.796875q0.796875 -0.796875 0.796875 -1.984375q0 -1.125 -0.734375 -1.859375q-0.734375 -0.734375 -1.875 -0.734375q-0.46875 0 -1.15625 0.171875l0.1875 -1.4375q0.15625 0.015625 0.265625 0.015625q1.046875 0 1.875 -0.546875q0.84375 -0.546875 0.84375 -1.671875q0 -0.90625 -0.609375 -1.5q-0.609375 -0.59375 -1.578125 -0.59375q-0.953125 0 -1.59375 0.609375q-0.640625 0.59375 -0.8125 1.796875l-1.640625 -0.296875q0.296875 -1.640625 1.359375 -2.546875q1.0625 -0.90625 2.65625 -0.90625q1.09375 0 2.0 0.46875q0.921875 0.46875 1.40625 1.28125q0.5 0.8125 0.5 1.71875q0 0.859375 -0.46875 1.578125q-0.46875 0.703125 -1.375 1.125q1.1875 0.28125 1.84375 1.140625q0.65625 0.859375 0.65625 2.15625q0 1.734375 -1.28125 2.953125q-1.265625 1.21875 -3.21875 1.21875q-1.765625 0 -2.921875 -1.046875q-1.15625 -1.046875 -1.328125 -2.71875zm10.375717 -3.0625q0 -2.359375 0.484375 -3.796875q0.484375 -1.453125 1.4375 -2.234375q0.96875 -0.78125 2.421875 -0.78125q1.078125 0 1.890625 0.4375q0.8125 0.421875 1.328125 1.25q0.53125 0.8125 0.828125 1.984375q0.3125 1.15625 0.3125 3.140625q0 2.359375 -0.484375 3.8125q-0.484375 1.4375 -1.453125 2.234375q-0.953125 0.78125 -2.421875 0.78125q-1.921875 0 -3.03125 -1.390625q-1.3125 -1.671875 -1.3125 -5.4375zm1.671875 0q0 3.296875 0.765625 4.390625q0.78125 1.078125 1.90625 1.078125q1.140625 0 1.90625 -1.09375q0.765625 -1.09375 0.765625 -4.375q0 -3.296875 -0.765625 -4.375q-0.765625 -1.078125 -1.921875 -1.078125q-1.125 0 -1.796875 0.953125q-0.859375 1.21875 -0.859375 4.5z" fill-rule="nonzero"></path><path fill="#cfe2f3" d="m288.55643 100.850395l191.43307 0l0 31.590553l-191.43307 0z" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m288.55643 100.850395l191.43307 0l0 31.590553l-191.43307 0z" fill-rule="evenodd"></path><path fill="#cfe2f3" d="m480.0 100.850395l63.84253 0l0 31.590553l-63.84253 0z" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m480.0 100.850395l63.84253 0l0 31.590553l-63.84253 0z" fill-rule="evenodd"></path><path fill="#000000" fill-opacity="0.0" d="m724.9449 165.88452l57.44879 0l0 42.519684l-57.44879 0z" fill-rule="evenodd"></path><path fill="#000000" d="m739.97614 192.80452l0 -3.203125l-5.796875 0l0 -1.5l6.09375 -8.65625l1.34375 0l0 8.65625l1.796875 0l0 1.5l-1.796875 0l0 3.203125l-1.640625 0zm0 -4.703125l0 -6.015625l-4.1875 6.015625l4.1875 0zm5.1257324 -1.890625q0 -2.359375 0.484375 -3.796875q0.484375 -1.453125 1.4375 -2.234375q0.96875 -0.78125 2.421875 -0.78125q1.078125 0 1.890625 0.4375q0.8125 0.421875 1.328125 1.25q0.53125 0.8125 0.828125 1.984375q0.3125 1.15625 0.3125 3.140625q0 2.359375 -0.484375 3.8125q-0.484375 1.4375 -1.453125 2.234375q-0.953125 0.78125 -2.421875 0.78125q-1.921875 0 -3.03125 -1.390625q-1.3125 -1.671875 -1.3125 -5.4375zm1.671875 0q0 3.296875 0.765625 4.390625q0.78125 1.078125 1.90625 1.078125q1.140625 0 1.90625 -1.09375q0.765625 -1.09375 0.765625 -4.375q0 -3.296875 -0.765625 -4.375q-0.765625 -1.078125 -1.921875 -1.078125q-1.125 0 -1.796875 0.953125q-0.859375 1.21875 -0.859375 4.5z" fill-rule="nonzero"></path><path fill="#000000" fill-opacity="0.0" d="m223.70604 147.29396l63.842514 0" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m229.70604 147.29396l51.842514 0" fill-rule="evenodd"></path><path fill="#000000" stroke="#000000" stroke-width="1.0" stroke-linecap="butt" d="m229.70604 145.64223l-4.538101 1.6517334l4.538101 1.6517334z" fill-rule="evenodd"></path><path fill="#000000" stroke="#000000" stroke-width="1.0" stroke-linecap="butt" d="m281.54855 148.9457l4.538086 -1.6517334l-4.538086 -1.6517334z" fill-rule="evenodd"></path><path fill="#000000" fill-opacity="0.0" d="m288.55643 154.83464l190.04724 0" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m294.55643 154.83464l178.04724 0" fill-rule="evenodd"></path><path fill="#000000" stroke="#000000" stroke-width="1.0" stroke-linecap="butt" d="m294.55643 153.1829l-4.538086 1.6517334l4.538086 1.6517334z" fill-rule="evenodd"></path><path fill="#000000" stroke="#000000" stroke-width="1.0" stroke-linecap="butt" d="m472.60367 156.48637l4.5381165 -1.6517334l-4.5381165 -1.6517334z" fill-rule="evenodd"></path><path fill="#000000" fill-opacity="0.0" d="m367.67978 130.26509l32.188995 0l0 29.16536l-32.188995 0z" fill-rule="evenodd"></path><path fill="#000000" d="m380.55478 150.7851l0 -2.0625l-3.71875 0l0 -0.96875l3.921875 -5.5625l0.859375 0l0 5.5625l1.15625 0l0 0.96875l-1.15625 0l0 2.0625l-1.0625 0zm0 -3.03125l0 -3.859375l-2.6875 3.859375l2.6875 0z" fill-rule="nonzero"></path><path fill="#000000" fill-opacity="0.0" d="m457.0866 165.88452l45.826782 0l0 42.519684l-45.826782 0z" fill-rule="evenodd"></path><path fill="#000000" d="m466.86786 189.27327l1.640625 -0.21875q0.28125 1.40625 0.953125 2.015625q0.6875 0.609375 1.65625 0.609375q1.15625 0 1.953125 -0.796875q0.796875 -0.796875 0.796875 -1.984375q0 -1.125 -0.734375 -1.859375q-0.734375 -0.734375 -1.875 -0.734375q-0.46875 0 -1.15625 0.171875l0.1875 -1.4375q0.15625 0.015625 0.265625 0.015625q1.046875 0 1.875 -0.546875q0.84375 -0.546875 0.84375 -1.671875q0 -0.90625 -0.609375 -1.5q-0.609375 -0.59375 -1.578125 -0.59375q-0.953125 0 -1.59375 0.609375q-0.640625 0.59375 -0.8125 1.796875l-1.640625 -0.296875q0.296875 -1.640625 1.359375 -2.546875q1.0625 -0.90625 2.65625 -0.90625q1.09375 0 2.0 0.46875q0.921875 0.46875 1.40625 1.28125q0.5 0.8125 0.5 1.71875q0 0.859375 -0.46875 1.578125q-0.46875 0.703125 -1.375 1.125q1.1875 0.28125 1.84375 1.140625q0.65625 0.859375 0.65625 2.15625q0 1.734375 -1.28125 2.953125q-1.265625 1.21875 -3.21875 1.21875q-1.765625 0 -2.921875 -1.046875q-1.15625 -1.046875 -1.328125 -2.71875zm10.375732 0.03125l1.71875 -0.140625q0.1875 1.25 0.875 1.890625q0.703125 0.625 1.6875 0.625q1.1875 0 2.0 -0.890625q0.828125 -0.890625 0.828125 -2.359375q0 -1.40625 -0.796875 -2.21875q-0.78125 -0.8125 -2.0625 -0.8125q-0.78125 0 -1.421875 0.359375q-0.640625 0.359375 -1.0 0.9375l-1.546875 -0.203125l1.296875 -6.859375l6.640625 0l0 1.5625l-5.328125 0l-0.71875 3.59375q1.203125 -0.84375 2.515625 -0.84375q1.75 0 2.953125 1.21875q1.203125 1.203125 1.203125 3.109375q0 1.8125 -1.046875 3.140625q-1.296875 1.625 -3.515625 1.625q-1.8125 0 -2.96875 -1.015625q-1.15625 -1.03125 -1.3125 -2.71875z" fill-rule="nonzero"></path><path fill="#cfe2f3" d="m575.0131 100.850395l63.84253 0l0 31.590553l-63.84253 0z" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m575.0131 100.850395l63.84253 0l0 31.590553l-63.84253 0z" fill-rule="evenodd"></path><path fill="#000000" fill-opacity="0.0" d="m223.70604 80.43307l351.40155 0" fill-rule="evenodd"></path><path stroke="#000000" stroke-width="1.0" stroke-linejoin="round" stroke-linecap="butt" d="m229.70604 80.43307l339.40155 0" fill-rule="evenodd"></path><path fill="#000000" stroke="#000000" stroke-width="1.0" stroke-linecap="butt" d="m229.70604 78.78134l-4.538101 1.6517258l4.538101 1.6517334z" fill-rule="evenodd"></path><path fill="#000000" stroke="#000000" stroke-width="1.0" stroke-linecap="butt" d="m569.1076 82.0848l4.538086 -1.6517334l-4.538086 -1.6517258z" fill-rule="evenodd"></path><path fill="#000000" fill-opacity="0.0" d="m405.60104 71.580055l25.13385 0l0 33.795273l-25.13385 0z" fill-rule="evenodd"></path><path fill="#000000" d="m415.16354 84.6313l0 -1.015625l5.5625 0l0 0.828125q-0.8125 0.875 -1.625 2.328125q-0.796875 1.4375 -1.234375 2.96875q-0.328125 1.078125 -0.40625 2.359375l-1.09375 0q0.015625 -1.015625 0.390625 -2.453125q0.390625 -1.4375 1.09375 -2.765625q0.71875 -1.328125 1.53125 -2.25l-4.21875 0z" fill-rule="nonzero"></path></g></svg>
4
-
@@ -1,66 +0,0 @@
1
- # Generate png with: dot -Tpng -O dataflow.gv
2
-
3
- digraph shaka2_data {
4
- label=<<u>Shaka 2 Data Flow Diagram (excluding Cast, Offline)</u>>
5
- labelloc=t
6
- node [ shape=rectangle ]
7
- edge [ fontsize=10 ]
8
-
9
- SourceBuffer [ shape=oval ]
10
- TextTrack [ shape=oval ]
11
-
12
- AbrManager [ shape=trapezium ]
13
- ManifestParser [ shape=trapezium ]
14
- TextDisplayer [ shape=trapezium ]
15
- TextParser [ shape=trapezium ]
16
- RequestFilter [ shape=trapezium ]
17
- ResponseFilter [ shape=trapezium ]
18
- HttpFetchPlugin [ shape=trapezium ]
19
-
20
- Player -> AbrManager [ label="Variants => Variant" dir=both arrowtail=onormal style=dashed ]
21
- Player -> ManifestParser [ label="URL => Manifest" dir=both arrowtail=onormal style=dashed ]
22
- Player -> StreamingEngine [ label=Manifest ]
23
- Player -> DrmEngine [ label=Manifest ]
24
-
25
- ManifestParser -> NetworkingEngine [ label="Request(MANIFEST) => Response" dir=both arrowtail=onormal style=dashed ]
26
- StreamingEngine -> NetworkingEngine [ label="Request(SEGMENT) => Response" dir=both arrowtail=onormal style=dashed ]
27
- DrmEngine -> NetworkingEngine [ label="Request(LICENSE) => Response" dir=both arrowtail=onormal style=dashed ]
28
-
29
- StreamingEngine -> MediaSourceEngine [ label="ArrayBuffer" ]
30
- MediaSourceEngine -> SourceBuffer [ label="ArrayBuffer" ]
31
- MediaSourceEngine -> TextEngine [ label="ArrayBuffer" ]
32
- MediaSourceEngine -> Transmuxer [ label="ArrayBuffer => ArrayBuffer" dir=both arrowtail=onormal style=dashed ]
33
-
34
- TextEngine -> TextParser [ label="ArrayBuffer => Cues" dir=both arrowtail=onormal ]
35
- TextEngine -> TextDisplayer [ label="Cues" ]
36
- TextDisplayer -> TextTrack [ label="TextCues" ]
37
-
38
- NetworkingEngine -> RequestFilter [ label="Request => Request" dir=both arrowtail=onormal style=dashed ]
39
- NetworkingEngine -> ResponseFilter [ label="Response => Response" dir=both arrowtail=onormal style=dashed ]
40
- NetworkingEngine -> HttpFetchPlugin [ label="Request => Response" dir=both arrowtail=onormal style=dashed ]
41
-
42
- subgraph cluster_legend {
43
- style=rounded
44
- color="#444444"
45
- label=<<u>Legend</u>>
46
- fontsize=12
47
- fontcolor="#444444"
48
-
49
- node [ shape=plaintext color="#444444" fontsize=10 fontcolor="#444444" ]
50
- edge [ color="#444444" fontcolor="#444444" ]
51
-
52
- blank1 [ label="" fixedsize=true height=0 ]
53
- blank2 [ label="" fixedsize=true height=0 ]
54
- blank3 [ label="" fixedsize=true height=0 ]
55
- "async request" -> blank3 [ dir=both arrowtail=onormal style=dashed ]
56
- "request with return value" -> blank2 [ dir=both arrowtail=onormal label="ArgType => ReturnType" ]
57
- "data pushed one way" -> blank1 [ label="DataType" ]
58
-
59
- plugin [ shape=trapezium ]
60
- "browser built-in" [ shape=oval ]
61
- "internal class" [ shape=rectangle ]
62
- }
63
-
64
- # Hack to move the legend beneath the main graph:
65
- TextParser -> "internal class" [ style=invisible arrowhead=none ]
66
- }
Binary file
@@ -1,70 +0,0 @@
1
- # Shaka Player Exports
2
-
3
- ## True exports
4
-
5
- Shaka Player uses the Closure Compiler to compile the raw sources into a single
6
- bundle. In this compiled bundle, most symbols have been renamed to short,
7
- internal-only names.
8
-
9
- Symbols that the application needs to access must be exported. Exporting is the
10
- process of attaching these internal, renamed symbols to the exported namespace.
11
- (An example of an exported namespace is `window`. If you are using a module
12
- loader like requirejs, the exported namespace is returned to from the loader.)
13
-
14
- The compiler has a special annotation for this: `@export`. Anything annotated
15
- with `@export` will be exported by the compiler automatically.
16
-
17
-
18
- ## Exporting to the docs
19
-
20
- We generate our documentation from the same annotations that we feed to the
21
- compiler. To make it clear in the generated docs what is exported, public, or
22
- private, we added support for the `@export` annotation in jsdoc.
23
-
24
- There are situations where we want something to show up in the exports section
25
- of the docs, even though it can't be truly exported by the compiler. For
26
- example, event definitions are part of the interface to our library, so they
27
- should show up in the exports section of the docs. As far as the compiler is
28
- concerned, though, these are just typedefs that don't actually exist in the
29
- runtime environment.
30
-
31
- For this scenario, we created a new annotation: `@exportDoc`. This is ignored
32
- by the compiler, but is consumed by our customized copy of jsdoc.
33
-
34
-
35
- ## Generating externs
36
-
37
- The compiler has a concept of something called externs. Externs are definitions
38
- of things that come from the external runtime environment. For example, the
39
- compiler has built-in externs for most standard web APIs provided by the
40
- browser.
41
-
42
- If you are building something with the Closure Compiler and you want to import
43
- another library, you must have externs for that library so that the compiler can
44
- know what the APIs and types are for that library.
45
-
46
- We have a build step that generates externs for Shaka Player itself. This is
47
- useful for importing Shaka Player into another Closure-based project.
48
-
49
- There are some abstract interfaces and internal base classes in Shaka Player
50
- that need to be in the generated externs, but should not be exported by the
51
- compiler because they are not part of the library's public API. For example,
52
- `shaka.util.IDestroyable`, which is implemented by `shaka.Player`.
53
-
54
- To make this work, we created another new annotation: `@exportInterface`. This
55
- annotation is used by the extern generator, but is ignored by the compiler.
56
-
57
- In some cases, public member variables need to be preserved when they would
58
- otherwise be renamed by the compiler. `@export` is not sufficient to keep the
59
- names from being renamed and is only useful for static members or prototype
60
- values. `@expose` used to be used for this but is now deprecated. The current
61
- best practice is to write an externs file defining the properties that should
62
- be preserved.
63
-
64
-
65
- ## Summary
66
-
67
- - `@export`: truly exported (attached to namespace) by the compiler
68
- - `@expose`: deprecated
69
- - `@exportDoc`: considered part of the exports in the docs
70
- - `@exportInterface`: considered part of the exports in generated externs
@@ -1,40 +0,0 @@
1
- # Shaka Player - Fuzzy Locale Matching
2
-
3
- ## Summary
4
- Language is a complex issue, and trying to match what language someone speaks with the best content option leaves a lot of room for interpretation. The core lesson we have learned from this is that if you try to be strict, you will be wrong most of the time. Because of this, when comparing the languages that a user wants with the content we have, we have adopted this strategy.
5
-
6
- ## Background
7
- For a full explanation of the terms and definitions used when we talk about language please see our ["Talking about Languages"](talking-about-languages.md) article.
8
-
9
- ## Strategy
10
- The question boils down to, "If the user says they prefer a specific locale, and we don't have it. What locale should we present to them?" To make things easier on us, we do not support dialects in our searches. When we read the locale, we purposely drop the dialect component as it simplifies the searches. We chose to adopt this short-cut because we have yet to see dialects appear in any content.
11
-
12
- Conceptually locales follow a tree-like structure, so give a set of locales, we could create a tree like:
13
-
14
- ![Locales Tree](locales_tree.svg)
15
-
16
- When we look for the best match, we try three searches. The searches are ordered from best to worst match so that once a match is found, we can stop searching. The searches are:
17
- - Locale Compatible
18
- - Parent Locale - A check where we see if one of our locales is the "parent" of the user's locale. For this to work:
19
- - our locale must only have a language component
20
- - the user's locale must have a language and region component
21
- - both locales must be Language Compatible
22
- - Language Compatible
23
-
24
- ## Examples
25
- If we assume that we can only respond to requests with the following locales:
26
- - en
27
- - en-CA
28
- - en-US
29
- - fr-CA
30
-
31
- Then for any given request, we should be able to identify what match we can make and what locale we would respond wit. The table below shows some examples:
32
-
33
- ```
34
- User Wants | Matching Type | Locale
35
- -----------|---------------------|----------
36
- en | Locale Compatible | en
37
- en-UK | Parent Locale | en
38
- fr | Language Compatible | fr-CA
39
- zk | No Match | No Match
40
- ```
@@ -1,151 +0,0 @@
1
- # Shaka Player Gap Jumping
2
-
3
-
4
- ## Overview
5
-
6
- Gap jumping is a feature to automatically jump over gaps (i.e. missing content)
7
- in a stream. There are several cases where content may not be present. This
8
- missing content can cause gaps in the video which will cause the player to stop,
9
- waiting for content that may never exist. Gap jumping is one of the most
10
- requested features by developers.
11
-
12
- There are two kinds of gaps we need to consider: gaps in the manifest and gaps
13
- in the media itself. Gaps in the manifest can be fixed by simply adjusting the
14
- start and end times of the segments. We already adjust the segment index to
15
- make the segments continuous. Gaps in the media cannot be detected early (since
16
- the gaps may not appear in the manifest); they can only be detected once the
17
- media has been appended to the MediaSource and the browser gives us a gap in the
18
- buffered ranges.
19
-
20
- ## Background
21
-
22
- There have been a number of bugs filed asking for this feature.
23
-
24
- #### [#180](https://github.com/shaka-project/shaka-player/issues/180)
25
- One of the first bugs asking for gap jumping. The author talks about how live
26
- streams can commonly lose source content (e.g. from network outages or weather).
27
- This can cause the packagers to introduce gaps in either the media segments or
28
- the manifest.
29
-
30
- #### [#555](https://github.com/shaka-project/shaka-player/issues/555)
31
- This one is also asking about live streams and outages. The author discusses
32
- several options for dealing with interruptions in the live streams. The
33
- suggestions were:
34
-
35
- - Use 404s to indicate a segment does not exist on the server.
36
- - Use “short Periods” (a Period with no content, but @duration) to indicate a gap.
37
- - Fill with dummy content.
38
-
39
- It is brought up that using 404 for missing segments can cause problems since we
40
- can’t tell if a segment will never be available or is just not created yet.
41
- Also that dummy content is usually generated by the server; however, the author
42
- notes that this may not be feasible.
43
-
44
- #### [#661](https://github.com/shaka-project/shaka-player/issues/661)
45
- This content with small gaps in the media that result in playback stalling.
46
- Chrome and Firefox will actually play through the gap, but we don’t allow it
47
- since it wouldn’t work on Safari.
48
-
49
-
50
- ## Design
51
-
52
- If there are gaps in the media (e.g. missing segments), they should not appear
53
- in the manifest. If there are missing Periods, then the @start attribute should
54
- appear in the later Period to indicate a gap. If there are gaps in the
55
- manifest, they will be logged and removed by the manifest parser. Internally,
56
- the segment index will be continuous. Even if there is a whole Period missing
57
- that is minutes long, the segment index will be continuous. This means that the
58
- previous Period will be extended to cover the gap and the last segment of that
59
- Period will also be extended.
60
-
61
- Keeping the segment index continuous allows most gap jumping logic to be in
62
- Playhead. StreamingEngine will not know about gaps and will simply buffer
63
- segments like before. It will buffer segments independently of whether there
64
- are gaps in the media. Then if Playhead detects a gap in the media, it will
65
- jump it there.
66
-
67
- There are two kinds of gaps: small gaps that may not be noticeable (and may be
68
- jumped automatically), and large gaps caused by missing segments in live
69
- streams. Small gaps (less than 0.5 seconds) should be jumped automatically on
70
- all browsers to provide seamless playback. Larger gaps should be identified and
71
- sent to the app to make a decision. If the app wants to (through a
72
- configuration parameter), we will jump those gaps also. Additionally, we should
73
- gracefully handle attempted seeks into gaps (for both buffered and unbuffered
74
- seeks).
75
-
76
- ### Configuration
77
-
78
- - `.streaming.smallGapLimit` (default 0.5) the threshold (in seconds) for a gap
79
- to be considered small and jumped automatically.
80
- - `.streaming.jumpLargeGaps` (default false) if true, automatically jump large
81
- gaps. (see event below)
82
-
83
- ### Small vs Large Gaps
84
-
85
- To support gap jumping across browsers, we will jump small gaps on all browsers
86
- without user interaction. These gaps should be small so they do not interrupt
87
- playback visually. Larger gaps can be optionally jumped, but we will tell the
88
- app about it first.
89
-
90
- There will be a new event `largegap`. When the playhead enters a large gap, the
91
- video will be paused, but we won’t enter a buffering state. We will then fire
92
- the event to the app, giving it the current time and the start and end time of
93
- the gap.
94
-
95
- If `jumpLargeGaps` is set, we will use the default action of the event to get
96
- feedback from the event listeners. The “default” action here is to jump the
97
- gap. If the event handlers call `preventDefault()`, we will not jump this gap.
98
- If `jumpLargeGaps` is not set, we will still fire the event, but never jump the
99
- gap ourselves.
100
-
101
- ### Manifest Parser
102
-
103
- The manifest parser should remove all gaps from the index. The segment index
104
- should be continuous, even for large gaps. We are not going to support “empty
105
- periods”; all Period elements should have content. However, there can be gaps
106
- between segments or between Period elements. If the gap is larger than a
107
- threshold, a warning is printed.
108
-
109
- ### Streaming Engine
110
-
111
- StreamingEngine will not require any changes. Since the segment index is
112
- continuous, it will not see any gaps and just buffer like normal. We will need
113
- to modify the buffering logic a little. We will calculate the amount buffered
114
- based on the content buffered (i.e. we will ignore the time in the gap). This
115
- ensures smooth playback with gap jumping.
116
-
117
- Like now, it will continue buffering a sequence of segments from the index. It
118
- will only buffer segments in media order, waiting for any segments that appear
119
- in the index but are not ready on the server (404). This ensures that any gap
120
- in the buffered ranges is caused by gaps in the content, not by content that
121
- will be available later.
122
-
123
- We already fetch the segment before the target time when seeking. We also only
124
- adjust the end time of a segment, so the start time is “close” to the real time.
125
- This means that when we seek, there will always be content buffered before the
126
- playhead. Once we have buffered past the playhead, we will know if we have
127
- seeked into a gap.
128
-
129
- ### Playhead
130
-
131
- The Playhead will hold the logic for gap jumping. When the video plays into a
132
- gap, the browser will do two things: (1) fire a `waiting` event and (2) change
133
- the readyState to 2 (`HAVE_CURRENT_FRAME`) or 1 (`HAVE_METADATA`) if this was a
134
- seek. To handle this, the Playhead will listen to the `waiting` event and
135
- update the current time to just past the gap.
136
-
137
- When we seek, StreamingEngine will clear the buffer. This will cause a
138
- `waiting` event to fire, which we ignore since nothing will be buffered. Once
139
- StreamingEngine starts buffering new content, we need to determine if we are
140
- still in a gap. If we are inside a gap, the ready state will be 1 or 2 (it will
141
- be 3 or 4 while playing). We will poll the ready state and if it is 1 or 2, we
142
- are inside (or near) a gap and will need to jump it. If the ready state is 3 or
143
- 4, we can play and we don’t need to do anything more now.
144
-
145
- Playhead will only change the current time if we are in a gap, or close to it.
146
- If the first buffered range is slightly ahead of the playhead, we will jump it;
147
- it will also jump if there are multiple buffered ranges and the playhead is
148
- close to a gap.
149
-
150
- Playhead will also handle firing the event for large gaps. Event firing is
151
- synchronous, so Playhead will fire the event and then jump the gap if needed.
Binary file
Binary file