shaka-player 3.3.2 → 3.3.3

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 (328) hide show
  1. package/.csslintrc +11 -1
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
  3. package/.github/pull_request_template.md +6 -34
  4. package/.github/workflows/build-and-test.yaml +130 -0
  5. package/.github/workflows/custom-actions/prep-for-appspot/action.yaml +56 -0
  6. package/.github/workflows/custom-actions/set-commit-status/action.yaml +41 -0
  7. package/.github/workflows/demo-version-index.yaml +29 -0
  8. package/.github/workflows/nightly-demo.yaml +42 -0
  9. package/.github/workflows/release-please.yaml +145 -0
  10. package/.github/workflows/safari-homedir-launcher.sh +18 -0
  11. package/.github/workflows/selenium-lab-tests.yaml +93 -0
  12. package/AUTHORS +2 -0
  13. package/CHANGELOG.md +1691 -1675
  14. package/CONTRIBUTING.md +2 -2
  15. package/CONTRIBUTORS +2 -0
  16. package/README.md +7 -7
  17. package/app-engine/README.md +9 -0
  18. package/app-engine/demo-version-index/README.md +14 -0
  19. package/app-engine/demo-version-index/app.yaml +2 -0
  20. package/app-engine/demo-version-index/main.py +162 -0
  21. package/app-engine/demo-version-index/requirements.txt +6 -0
  22. package/app-engine/demo-version-index/templates/index.html +114 -0
  23. package/app-engine/shaka-player-demo/README.md +18 -0
  24. package/app-engine/shaka-player-demo/app.yaml +61 -0
  25. package/app-engine/shaka-player-demo/main.py +95 -0
  26. package/app-engine/shaka-player-demo/posters/10yo.png +0 -0
  27. package/app-engine/shaka-player-demo/posters/10yo.xcf +0 -0
  28. package/app-engine/shaka-player-demo/posters/1yo.jpg +0 -0
  29. package/app-engine/shaka-player-demo/posters/2yo.png +0 -0
  30. package/app-engine/shaka-player-demo/posters/2yo.xcf +0 -0
  31. package/app-engine/shaka-player-demo/posters/3yo.png +0 -0
  32. package/app-engine/shaka-player-demo/posters/3yo.xcf +0 -0
  33. package/app-engine/shaka-player-demo/posters/4yo.png +0 -0
  34. package/app-engine/shaka-player-demo/posters/4yo.xcf +0 -0
  35. package/app-engine/shaka-player-demo/posters/5yo.png +0 -0
  36. package/app-engine/shaka-player-demo/posters/5yo.xcf +0 -0
  37. package/app-engine/shaka-player-demo/posters/6yo.png +0 -0
  38. package/app-engine/shaka-player-demo/posters/6yo.xcf +0 -0
  39. package/app-engine/shaka-player-demo/posters/7yo.png +0 -0
  40. package/app-engine/shaka-player-demo/posters/7yo.xcf +0 -0
  41. package/app-engine/shaka-player-demo/posters/8yo.png +0 -0
  42. package/app-engine/shaka-player-demo/posters/8yo.xcf +0 -0
  43. package/app-engine/shaka-player-demo/posters/9yo.png +0 -0
  44. package/app-engine/shaka-player-demo/posters/9yo.xcf +0 -0
  45. package/app-engine/shaka-player-demo/posters/audioOnly.gif +0 -0
  46. package/app-engine/shaka-player-demo/posters/audioRickRoll.gif +0 -0
  47. package/app-engine/shaka-player-demo/posters/colorbars.gif +0 -0
  48. package/app-engine/shaka-player-demo/posters/fireworks.jpg +0 -0
  49. package/app-engine/shaka-player-demo/posters/party-hat.png +0 -0
  50. package/app-engine/shaka-player-demo/posters/sources.txt +46 -0
  51. package/app-engine/shaka-player-demo/posters/standard.png +0 -0
  52. package/app-engine/shaka-player-demo/posters/trek.jpg +0 -0
  53. package/app-engine/shaka-player-demo/posters/valentines.png +0 -0
  54. package/app-engine/shaka-player-demo/posters/zombie.jpg +0 -0
  55. package/app-engine/shaka-player-demo/posters.py +110 -0
  56. package/app-engine/shaka-player-demo/requirements.txt +5 -0
  57. package/app-engine/shaka-player-demo/time.txt +1 -0
  58. package/build/README.md +1 -1
  59. package/build/checkversion.py +1 -1
  60. package/build/conformance.textproto +13 -0
  61. package/build/docker/Dockerfile +20 -0
  62. package/build/docker/docker-compose.yml +10 -0
  63. package/build/gendeps.py +18 -15
  64. package/build/shaka-lab.yaml +163 -0
  65. package/build/shakaBuildHelpers.py +4 -29
  66. package/build/test.py +87 -28
  67. package/build/types/polyfill +1 -0
  68. package/build/wrapper.template.js +2 -2
  69. package/demo/TengwarTelcontar.woff2 +0 -0
  70. package/demo/asset_card.js +1 -2
  71. package/demo/cast_receiver/index.html +1 -1
  72. package/demo/cast_receiver/receiver_app.css +14 -14
  73. package/demo/common/assets.js +2 -0
  74. package/demo/config.js +0 -1
  75. package/demo/custom.js +0 -1
  76. package/demo/customWarning.txt +2 -2
  77. package/demo/demo.less +29 -18
  78. package/demo/demo_uncompiled.js +1 -13
  79. package/demo/index.html +1 -1
  80. package/demo/main.js +3 -3
  81. package/dist/controls.css +3 -3
  82. package/dist/controls.css.map +1 -1
  83. package/dist/demo.compiled.debug.js +191 -194
  84. package/dist/demo.compiled.debug.map +4 -4
  85. package/dist/demo.compiled.js +191 -194
  86. package/dist/demo.compiled.map +4 -4
  87. package/dist/demo.css +1 -1
  88. package/dist/demo.css.map +1 -1
  89. package/dist/deps.js +233 -226
  90. package/dist/locales.js +31 -31
  91. package/dist/receiver.compiled.debug.js +43 -45
  92. package/dist/receiver.compiled.debug.map +4 -4
  93. package/dist/receiver.compiled.js +43 -45
  94. package/dist/receiver.compiled.map +4 -4
  95. package/dist/shaka-player.compiled.d.ts +246 -236
  96. package/dist/shaka-player.compiled.debug.d.ts +246 -236
  97. package/dist/shaka-player.compiled.debug.externs.js +14 -3
  98. package/dist/shaka-player.compiled.debug.js +214 -222
  99. package/dist/shaka-player.compiled.debug.map +4 -4
  100. package/dist/shaka-player.compiled.externs.js +14 -3
  101. package/dist/shaka-player.compiled.js +845 -851
  102. package/dist/shaka-player.compiled.map +4 -4
  103. package/dist/shaka-player.ui.d.ts +290 -280
  104. package/dist/shaka-player.ui.debug.d.ts +290 -280
  105. package/dist/shaka-player.ui.debug.externs.js +14 -3
  106. package/dist/shaka-player.ui.debug.js +295 -303
  107. package/dist/shaka-player.ui.debug.map +4 -4
  108. package/dist/shaka-player.ui.externs.js +14 -3
  109. package/dist/shaka-player.ui.js +1000 -1006
  110. package/dist/shaka-player.ui.map +4 -4
  111. package/docs/design/REDESIGN.md +33 -33
  112. package/docs/design/bg-fetch.md +2 -2
  113. package/docs/design/codec_preferences.md +1 -1
  114. package/docs/design/dash-audio-channels.md +3 -3
  115. package/docs/design/dash-manifests.md +1 -1
  116. package/docs/design/gap-jumping.md +3 -3
  117. package/docs/design/preload.md +2 -2
  118. package/docs/tutorials/faq.md +8 -8
  119. package/docs/tutorials/index.json +1 -0
  120. package/docs/tutorials/plugins.md +3 -3
  121. package/docs/tutorials/selenium-grid-config.md +122 -0
  122. package/docs/tutorials/welcome.md +10 -2
  123. package/externs/cmcd.js +1 -1
  124. package/karma.conf.js +137 -30
  125. package/lib/abr/simple_abr_manager.js +12 -6
  126. package/lib/cast/cast_proxy.js +3 -4
  127. package/lib/cea/cea608_data_channel.js +2 -2
  128. package/lib/cea/cea708_service.js +5 -4
  129. package/lib/cea/mp4_cea_parser.js +11 -5
  130. package/lib/cea/sei_processor.js +6 -3
  131. package/lib/dash/dash_parser.js +9 -11
  132. package/lib/dash/mpd_utils.js +4 -5
  133. package/lib/dash/segment_list.js +1 -2
  134. package/lib/dash/segment_template.js +3 -3
  135. package/lib/hls/hls_parser.js +11 -9
  136. package/lib/hls/manifest_text_parser.js +3 -3
  137. package/lib/media/adaptation_set.js +1 -2
  138. package/lib/media/content_workarounds.js +2 -2
  139. package/lib/media/drm_engine.js +3 -2
  140. package/lib/media/media_source_engine.js +3 -2
  141. package/lib/media/mp4_segment_index_parser.js +1 -4
  142. package/lib/media/playhead.js +2 -2
  143. package/lib/media/presentation_timeline.js +18 -8
  144. package/lib/media/streaming_engine.js +6 -6
  145. package/lib/media/time_ranges_utils.js +1 -3
  146. package/lib/media/video_wrapper.js +1 -1
  147. package/lib/net/networking_engine.js +1 -1
  148. package/lib/offline/storage.js +4 -4
  149. package/lib/player.js +34 -16
  150. package/lib/polyfill/all.js +2 -3
  151. package/lib/polyfill/encryption_scheme.js +1 -1
  152. package/lib/polyfill/media_capabilities.js +3 -3
  153. package/lib/polyfill/mediasource.js +1 -1
  154. package/lib/polyfill/symbol.js +46 -0
  155. package/lib/text/cue.js +1 -1
  156. package/lib/text/simple_text_displayer.js +2 -1
  157. package/lib/text/ttml_text_parser.js +8 -5
  158. package/lib/text/ui_text_displayer.js +1 -1
  159. package/lib/util/buffer_utils.js +1 -3
  160. package/lib/util/ebml_parser.js +3 -3
  161. package/lib/util/error.js +1 -1
  162. package/lib/util/iterables.js +0 -46
  163. package/lib/util/mp4_box_parsers.js +1 -4
  164. package/lib/util/mp4_parser.js +5 -7
  165. package/lib/util/periods.js +10 -11
  166. package/lib/util/platform.js +3 -3
  167. package/lib/util/pssh.js +1 -4
  168. package/lib/util/stream_utils.js +4 -3
  169. package/lib/util/string_utils.js +3 -5
  170. package/lib/util/uint8array_utils.js +3 -5
  171. package/lib/util/xml_utils.js +15 -7
  172. package/package.json +61 -36
  173. package/roadmap.md +17 -17
  174. package/shaka-player.uncompiled.js +1 -0
  175. package/test/abr/simple_abr_manager_unit.js +3 -8
  176. package/test/ads/ad_manager_unit.js +0 -6
  177. package/test/cast/cast_proxy_unit.js +0 -8
  178. package/test/cast/cast_receiver_integration.js +1 -18
  179. package/test/cast/cast_receiver_unit.js +1 -9
  180. package/test/cast/cast_sender_unit.js +0 -6
  181. package/test/cast/cast_utils_unit.js +0 -13
  182. package/test/cea/cea608_memory_unit.js +0 -5
  183. package/test/cea/cea708_service_unit.js +0 -7
  184. package/test/cea/cea708_window_unit.js +0 -5
  185. package/test/cea/cea_decoder_unit.js +0 -6
  186. package/test/cea/dtvcc_packet_builder_unit.js +0 -3
  187. package/test/cea/dtvcc_packet_unit.js +0 -5
  188. package/test/cea/mp4_cea_parser_unit.js +0 -4
  189. package/test/dash/dash_parser_content_protection_unit.js +1 -10
  190. package/test/dash/dash_parser_live_unit.js +2 -15
  191. package/test/dash/dash_parser_manifest_unit.js +2 -16
  192. package/test/dash/dash_parser_segment_base_unit.js +1 -8
  193. package/test/dash/dash_parser_segment_list_unit.js +1 -7
  194. package/test/dash/dash_parser_segment_template_unit.js +0 -9
  195. package/test/dash/mpd_utils_unit.js +3 -11
  196. package/test/demo/demo_unit.js +0 -5
  197. package/test/deprecate/enforcer_unit.js +0 -4
  198. package/test/deprecate/version_unit.js +0 -2
  199. package/test/hls/hls_live_unit.js +2 -14
  200. package/test/hls/hls_parser_unit.js +2 -15
  201. package/test/hls/manifest_text_parser_unit.js +0 -10
  202. package/test/media/adaptation_set_criteria_unit.js +3 -7
  203. package/test/media/adaptation_set_unit.js +0 -2
  204. package/test/media/buffering_observer_unit.js +1 -4
  205. package/test/media/closed_caption_parser_unit.js +0 -3
  206. package/test/media/drm_engine_integration.js +2 -15
  207. package/test/media/drm_engine_unit.js +4 -24
  208. package/test/media/manifest_parser_unit.js +0 -4
  209. package/test/media/media_source_engine_integration.js +0 -7
  210. package/test/media/media_source_engine_unit.js +1 -14
  211. package/test/media/mp4_segment_index_parser_unit.js +0 -4
  212. package/test/media/play_rate_controller_unit.js +0 -4
  213. package/test/media/playhead_unit.js +8 -16
  214. package/test/media/presentation_timeline_unit.js +4 -7
  215. package/test/media/quality_observer_unit.js +0 -4
  216. package/test/media/region_observer_unit.js +1 -6
  217. package/test/media/region_timeline_unit.js +0 -3
  218. package/test/media/segment_index_unit.js +0 -6
  219. package/test/media/segment_reference_unit.js +0 -3
  220. package/test/media/stall_detector_unit.js +0 -5
  221. package/test/media/streaming_engine_integration.js +9 -36
  222. package/test/media/streaming_engine_unit.js +11 -35
  223. package/test/media/time_ranges_utils_unit.js +0 -2
  224. package/test/media/transmuxer_integration.js +0 -6
  225. package/test/media/webm_segment_index_parser_unit.js +0 -4
  226. package/test/net/data_uri_plugin_unit.js +0 -7
  227. package/test/net/http_plugin_unit.js +0 -9
  228. package/test/net/networking_engine_unit.js +0 -11
  229. package/test/offline/download_progress_estimator_unit.js +0 -2
  230. package/test/offline/indexeddb_storage_unit.js +0 -6
  231. package/test/offline/manifest_convert_unit.js +0 -8
  232. package/test/offline/offline_integration.js +1 -10
  233. package/test/offline/offline_manifest_parser_unit.js +0 -6
  234. package/test/offline/offline_scheme_unit.js +0 -8
  235. package/test/offline/offline_uri_unit.js +0 -2
  236. package/test/offline/storage_compatibility_unit.js +1 -14
  237. package/test/offline/storage_integration.js +1 -27
  238. package/test/player_external.js +2 -10
  239. package/test/player_integration.js +22 -28
  240. package/test/player_load_graph_integration.js +1 -6
  241. package/test/player_src_equals_external.js +3 -9
  242. package/test/player_src_equals_integration.js +0 -7
  243. package/test/player_unit.js +52 -37
  244. package/test/routing/walker_unit.js +0 -8
  245. package/test/test/assets/large_file.mpd +1 -1
  246. package/test/test/boot.js +75 -22
  247. package/test/test/externs/jasmine.js +2 -2
  248. package/test/test/externs/karma.js +4 -0
  249. package/test/test/namespace.js +10 -0
  250. package/test/test/util/canned_idb.js +0 -8
  251. package/test/test/util/cea_utils.js +0 -6
  252. package/test/test/util/dash_parser_util.js +0 -13
  253. package/test/test/util/fake_ad.js +0 -3
  254. package/test/test/util/fake_ad_manager.js +0 -9
  255. package/test/test/util/fake_demo_main.js +0 -5
  256. package/test/test/util/fake_drm_engine.js +0 -6
  257. package/test/test/util/fake_media_source_engine.js +0 -7
  258. package/test/test/util/fake_networking_engine.js +0 -5
  259. package/test/test/util/fake_text_displayer.js +0 -5
  260. package/test/test/util/indexeddb_utils.js +1 -10
  261. package/test/test/util/jasmine_fetch.js +0 -1
  262. package/test/test/util/loader.js +0 -18
  263. package/test/test/util/manifest_generator.js +9 -14
  264. package/test/test/util/manifest_parser_util.js +0 -6
  265. package/test/test/util/offline_utils.js +0 -5
  266. package/test/test/util/simple_fakes.js +9 -26
  267. package/test/test/util/stream_generator.js +0 -14
  268. package/test/test/util/streaming_engine_util.js +0 -15
  269. package/test/test/util/test_scheme.js +1 -19
  270. package/test/test/util/ttml_utils.js +0 -2
  271. package/test/test/util/ui_utils.js +0 -9
  272. package/test/test/util/util.js +5 -19
  273. package/test/test/util/waiter.js +84 -43
  274. package/test/text/cue_integration.js +0 -4
  275. package/test/text/lrc_text_parser_unit.js +0 -4
  276. package/test/text/mp4_ttml_parser_unit.js +0 -6
  277. package/test/text/mp4_vtt_parser_unit.js +1 -7
  278. package/test/text/sbv_text_parser_unit.js +0 -4
  279. package/test/text/simple_text_displayer_unit.js +1 -8
  280. package/test/text/srt_text_parser_unit.js +0 -4
  281. package/test/text/ssa_text_parser_unit.js +0 -5
  282. package/test/text/text_engine_unit.js +2 -7
  283. package/test/text/text_track_integration.js +0 -2
  284. package/test/text/ttml_text_parser_unit.js +2 -11
  285. package/test/text/ui_text_displayer_unit.js +44 -41
  286. package/test/text/vtt_text_parser_unit.js +0 -9
  287. package/test/text/web_vtt_generator_unit.js +0 -3
  288. package/test/ui/ad_ui_unit.js +0 -11
  289. package/test/ui/localization_unit.js +0 -3
  290. package/test/ui/text_displayer_layout_unit.js +1 -12
  291. package/test/ui/ui_customization_unit.js +0 -6
  292. package/test/ui/ui_integration.js +0 -16
  293. package/test/ui/ui_unit.js +1 -17
  294. package/test/util/abortable_operation_unit.js +4 -9
  295. package/test/util/array_utils_unit.js +0 -2
  296. package/test/util/buffer_utils_unit.js +0 -2
  297. package/test/util/cmcd_manager_unit.js +0 -3
  298. package/test/util/data_view_reader_unit.js +0 -4
  299. package/test/util/ebml_parser_unit.js +0 -4
  300. package/test/util/event_manager_unit.js +0 -3
  301. package/test/util/fake_event_target_unit.js +0 -5
  302. package/test/util/functional_unit.js +1 -1
  303. package/test/util/iterables_unit.js +0 -64
  304. package/test/util/language_utils_unit.js +0 -3
  305. package/test/util/manifest_parser_utils_unit.js +0 -2
  306. package/test/util/mp4_box_parsers_unit.js +0 -5
  307. package/test/util/mp4_parser_unit.js +0 -4
  308. package/test/util/multi_map_unit.js +0 -3
  309. package/test/util/object_utils_unit.js +0 -2
  310. package/test/util/periods_unit.js +14 -7
  311. package/test/util/pssh_unit.js +0 -5
  312. package/test/util/state_history_unit.js +0 -2
  313. package/test/util/stream_utils_unit.js +3 -8
  314. package/test/util/string_utils_unit.js +0 -6
  315. package/test/util/text_parser_unit.js +0 -2
  316. package/test/util/xml_utils_unit.js +0 -4
  317. package/ui/less/ad_controls.less +4 -4
  318. package/ui/less/buttons.less +5 -5
  319. package/ui/less/containers.less +9 -11
  320. package/ui/less/overflow_menu.less +4 -4
  321. package/ui/less/range_elements.less +5 -0
  322. package/ui/less/tooltip.less +1 -1
  323. package/ui/locales/sjn-translations.yaml +257 -0
  324. package/ui/locales/sjn.json +42 -0
  325. package/.github/workflows/build_and_test.yaml +0 -73
  326. package/.github/workflows/release.yaml +0 -53
  327. package/externs/svgelement.js +0 -18
  328. package/externs/webcrypto.js +0 -18
package/CONTRIBUTING.md CHANGED
@@ -3,8 +3,8 @@
3
3
  We'd love to accept your patches and contributions to this project. There are
4
4
  just a few small guidelines you need to follow.
5
5
 
6
- 1. File a bug at https://github.com/google/shaka-player/issues (if there isn't
7
- one already). If your patch is going to be large, you should start a
6
+ 1. File a bug at https://github.com/shaka-project/shaka-player/issues (if there
7
+ isn't one already). If your patch is going to be large, you should start a
8
8
  discussion on GitHub first.
9
9
 
10
10
  Leave a comment to let us know that you are working on a PR for the issue.
package/CONTRIBUTORS CHANGED
@@ -50,6 +50,7 @@ Esteban Dosztal <edosztal@gmail.com>
50
50
  Fadomire <fadomire@gmail.com>
51
51
  François Beaufort <fbeaufort@google.com>
52
52
  Gil Gonen <gil.gonen@gmail.com>
53
+ Giorgio Gamberoni <giorgio.gamberoni@gmail.com>
53
54
  Giuseppe Samela <giuseppe.samela@gmail.com>
54
55
  Hichem Taoufik <hichem@code-it.fr>
55
56
  Itay Kinnrot <itay.kinnrot@kaltura.com>
@@ -65,6 +66,7 @@ John Bowers <john.bowers@verizondigitalmedia.com>
65
66
  Jonas Birmé <jonas.birme@eyevinn.se>
66
67
  Jono Ward <jonoward@gmail.com>
67
68
  Jozef Chúťka <jozefchutka@gmail.com>
69
+ Jun Hong Chong <chongjunhong@gmail.com>
68
70
  Leandro Ribeiro Moreira <leandro.ribeiro.moreira@gmail.com>
69
71
  Lucas Gabriel Sánchez <unkiwii@gmail.com>
70
72
  Matias Russitto <russitto@gmail.com>
package/README.md CHANGED
@@ -52,7 +52,7 @@ NOTES:
52
52
  - ⁶: These are expected to work, but are community-supported and untested by
53
53
  us.
54
54
  - Official support for LG WebOS TV:
55
- https://github.com/google/shaka-player/issues/1330
55
+ https://github.com/shaka-project/shaka-player/issues/1330
56
56
 
57
57
  We support iOS 12+ through Apple's native HLS player. We provide the same
58
58
  top-level API, but we just set the video's `src` element to the manifest/media.
@@ -65,7 +65,7 @@ features and similar APIs for native apps on iOS. This project uses its own
65
65
  media stack, which allows it to play content that would otherwise not be
66
66
  supported. This supports both DASH and HLS manifests.
67
67
 
68
- [Shaka Player Embedded]: https://github.com/google/shaka-player-embedded
68
+ [Shaka Player Embedded]: https://github.com/shaka-project/shaka-player-embedded
69
69
 
70
70
 
71
71
  ## Manifest format support matrix
@@ -102,12 +102,12 @@ DASH features supported:
102
102
  DASH features **not** supported:
103
103
  - Xlink with actuate=onRequest
104
104
  - Manifests without any segment info:
105
- https://github.com/google/shaka-player/issues/1088
105
+ https://github.com/shaka-project/shaka-player/issues/1088
106
106
  - Changing codecs during a presentation (unsupported by MSE)
107
107
  - Multiple trick mode tracks for the same resolution at varying framerates or
108
108
  bitrates
109
109
  - Timescales so large that timestamps cannot be represented as integers in
110
- JavaScript (2^53): https://github.com/google/shaka-player/issues/1667
110
+ JavaScript (2^53): https://github.com/shaka-project/shaka-player/issues/1667
111
111
 
112
112
 
113
113
  ## HLS features
@@ -125,10 +125,10 @@ HLS features supported:
125
125
  - Encrypted content with FairPlay (Safari on macOS and iOS 12+ only)
126
126
 
127
127
  HLS features **not** supported:
128
- - Key rotation: https://github.com/google/shaka-player/issues/917
129
- - I-frame-only playlists: https://github.com/google/shaka-player/issues/742
128
+ - Key rotation: https://github.com/shaka-project/shaka-player/issues/917
129
+ - I-frame-only playlists: https://github.com/shaka-project/shaka-player/issues/742
130
130
  - Raw AAC, MP3, etc (without an MP4 container):
131
- https://github.com/google/shaka-player/issues/2337
131
+ https://github.com/shaka-project/shaka-player/issues/2337
132
132
  - Low-latency streaming with blocking playlist reload
133
133
 
134
134
  [mux.js]: https://github.com/videojs/mux.js/releases
@@ -0,0 +1,9 @@
1
+ # Google App Engine Code
2
+
3
+ This folder contains source code for the services we run on Google App Engine
4
+ (appspot.com).
5
+
6
+ - shaka-player-demo: Our hosted demo on https://shaka-player-demo.appspot.com/
7
+
8
+ - demo-version-index: An index of Shaka Player releases and demos, hosted at
9
+ https://index-dot-shaka-player-demo.appspot.com/
@@ -0,0 +1,14 @@
1
+ # Google App Engine Version Index
2
+
3
+ This folder contains everything necessary to host an index of Shaka Player
4
+ releases and demos at https://index-dot-shaka-player-demo.appspot.com/
5
+
6
+ - app.yaml: App Engine config file. Defines the runtime (Python 3).
7
+
8
+ - main.py: A python service that queries available versions and generates the
9
+ index from a template.
10
+
11
+ - requirements.txt: Used by App Engine to install the necessary Python server
12
+ requirements (Flask, App Engine API).
13
+
14
+ - templates/index.html: A Jinja2 template used to generate the index HTML.
@@ -0,0 +1,2 @@
1
+ runtime: python39
2
+ default_expiration: 1s
@@ -0,0 +1,162 @@
1
+ # Shaka Player Version Index - Appspot Entrypoint
2
+ # Copyright 2022 Google LLC
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ # Generate an index of Shaka Player versions on appspot.
6
+
7
+ import collections
8
+ import google.appengine.api.modules
9
+ import jinja2
10
+ import os
11
+ import random
12
+ import re
13
+
14
+ from flask import Flask, render_template
15
+
16
+ DEMO_URL_TEMPLATE = 'https://{0}-dot-shaka-player-demo.appspot.com/'
17
+
18
+ # In Google Hosted Libraries
19
+ HOSTED_URL_TEMPLATE = 'https://ajax.googleapis.com/ajax/libs/shaka-player/{0}/shaka-player.{1}'
20
+
21
+ # Before Google Hosted Libraries, v1 appspot URLs
22
+ V1_URL_TEMPLATE = 'https://{0}-dot-shaka-player-demo.appspot.com/shaka-player.{1}'
23
+ # Before Google Hosted Libraries, v2 appspot URLs
24
+ V2_URL_TEMPLATE = 'https://{0}-dot-shaka-player-demo.appspot.com/dist/shaka-player.{1}'
25
+
26
+ def version_to_demo_url(v):
27
+ return DEMO_URL_TEMPLATE.format(v.replace('.', '-'))
28
+
29
+ def version_to_lib_url(v):
30
+ if v == 'nightly':
31
+ return V2_URL_TEMPLATE.format(v, 'compiled.js')
32
+ elif (version_key(v) == version_key('v1.6.5') or
33
+ version_key(v) >= version_key('v2.0.6')):
34
+ return HOSTED_URL_TEMPLATE.format(v.replace('v', ''), 'compiled.js')
35
+ elif version_key(v) >= version_key('v2.0.0-beta'):
36
+ return V2_URL_TEMPLATE.format(v.replace('.', '-'), 'compiled.js')
37
+ else:
38
+ return V1_URL_TEMPLATE.format(v.replace('.', '-'), 'compiled.js')
39
+
40
+ def version_to_ui_lib_url(v):
41
+ if v == 'nightly':
42
+ return V2_URL_TEMPLATE.format(v, 'ui.js')
43
+ elif version_key(v) >= version_key('v2.5.0'):
44
+ return HOSTED_URL_TEMPLATE.format(v.replace('v', ''), 'ui.js')
45
+ else:
46
+ return None
47
+
48
+ def version_to_lib_externs_url(v):
49
+ if v == 'nightly':
50
+ return V2_URL_TEMPLATE.format(v, 'compiled.externs.js')
51
+ elif version_key(v) >= version_key('v2.0.6'):
52
+ return HOSTED_URL_TEMPLATE.format(v.replace('v', ''), 'compiled.externs.js')
53
+ else:
54
+ return None
55
+
56
+ def version_to_ui_lib_externs_url(v):
57
+ if v == 'nightly':
58
+ return V2_URL_TEMPLATE.format(v, 'ui.externs.js')
59
+ elif version_key(v) >= version_key('v2.5.0'):
60
+ return HOSTED_URL_TEMPLATE.format(v.replace('v', ''), 'ui.externs.js')
61
+ else:
62
+ return None
63
+
64
+ def version_to_lib_defs_url(v):
65
+ if v == 'nightly':
66
+ return V2_URL_TEMPLATE.format(v, 'compiled.d.ts')
67
+ elif version_key(v) >= version_key('v3.0.6'):
68
+ return HOSTED_URL_TEMPLATE.format(v.replace('v', ''), 'compiled.d.ts')
69
+ else:
70
+ return None
71
+
72
+ def version_to_ui_lib_defs_url(v):
73
+ if v == 'nightly':
74
+ return V2_URL_TEMPLATE.format(v, 'ui.d.ts')
75
+ elif version_key(v) >= version_key('v3.0.6'):
76
+ return HOSTED_URL_TEMPLATE.format(v.replace('v', ''), 'ui.d.ts')
77
+ else:
78
+ return None
79
+
80
+ def version_to_metadata(v):
81
+ return {
82
+ 'version': v,
83
+ 'best': False, # Corrected later in another loop
84
+ 'demo': version_to_demo_url(v),
85
+ 'lib': version_to_lib_url(v),
86
+ 'ui_lib': version_to_ui_lib_url(v),
87
+ 'lib_externs': version_to_lib_externs_url(v),
88
+ 'ui_lib_externs': version_to_ui_lib_externs_url(v),
89
+ 'lib_defs': version_to_lib_defs_url(v),
90
+ 'ui_lib_defs': version_to_ui_lib_defs_url(v),
91
+ }
92
+
93
+ def is_release_version(name):
94
+ return re.match(r'v\d+-\d+-\d+(?:-.+)?', name)
95
+
96
+ def appengine_version_to_package_version(version):
97
+ # Replace the first two dashes with dots. More dashes indicate a prerelease
98
+ # version, as seen in "v2.0.0-beta3".
99
+ return version.replace('-', '.', 2)
100
+
101
+ def version_key(version):
102
+ if version == 'nightly':
103
+ # A false version number for nightly, greater than any actual release
104
+ # version.
105
+ return [float('inf')]
106
+
107
+ assert version[0] == 'v'
108
+ main_version, _, suffix = version[1:].partition('-')
109
+ if not suffix:
110
+ suffix = '}}}' # this puts main releases after prerelease versions
111
+ version_tuple = [int(x) for x in main_version.split('.')]
112
+ return version_tuple + [suffix]
113
+
114
+ def get_appengine_versions():
115
+ if os.getenv('GAE_ENV', '').startswith('standard'):
116
+ # NOTE: this doesn't return anything useful in a local dev server.
117
+ return google.appengine.api.modules.modules.get_versions()
118
+
119
+ # For a local dev server, fake it so we can test sorting.
120
+ fake_versions = [
121
+ 'v1-6-0', 'v1-6-1', 'v1-6-2', 'v1-6-3', 'v1-6-4', 'v1-6-5',
122
+ 'v2-0-0-beta', 'v2-0-0-beta2', 'v2-0-0-beta3', 'v2-0-0',
123
+ 'v2-1-0', 'v2-1-1', 'v2-1-2',
124
+ 'v2-2-1', 'v2-2-2-beta', 'v2-2-2-beta2', 'v2-2-2', 'v2-2-9', 'v2-2-10',
125
+ ]
126
+ random.shuffle(fake_versions) # in-place shuffle
127
+ return fake_versions
128
+
129
+
130
+ app = Flask(__name__)
131
+
132
+ @app.route('/')
133
+ def root():
134
+ appengine_versions = get_appengine_versions()
135
+ # Filter for release versions only.
136
+ appengine_versions = filter(is_release_version, appengine_versions)
137
+
138
+ # Now convert from appengine versions (v2-0-0) to package versions (v2.0.0).
139
+ versions = list(map(appengine_version_to_package_version, appengine_versions))
140
+ # Now sort, putting prerelease versions ahead of the corresponding release.
141
+ versions.sort(key=version_key)
142
+
143
+ version_metadata = collections.OrderedDict()
144
+ latest_by_branch = {}
145
+ for v in versions:
146
+ version_metadata[v] = version_to_metadata(v)
147
+
148
+ # Because |versions| is already sorted, we can just overwrite the entry
149
+ # in the latest_by_branch dictionary.
150
+ branch_key = tuple(version_key(v)[0:2])
151
+ latest_by_branch[branch_key] = v
152
+
153
+ for v in latest_by_branch.values():
154
+ version_metadata[v]['best'] = True
155
+
156
+ # Append nightly rather than filter for it, so that it always appears at the
157
+ # end of the list.
158
+ version_metadata['nightly'] = version_to_metadata('nightly')
159
+ version_metadata['nightly']['best'] = True
160
+
161
+ for i in version_metadata.values(): print(i)
162
+ return render_template('index.html', versions=version_metadata.values())
@@ -0,0 +1,6 @@
1
+ # Shaka Player Version Index - Appspot Python Runtime Requirements
2
+ # Copyright 2022 Google LLC
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ Flask==2.0.3
6
+ appengine-python-standard==0.3.1
@@ -0,0 +1,114 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Shaka Player Demo - Version Index</title>
5
+ <style>
6
+
7
+ #background {
8
+ top: 0;
9
+ left: 0;
10
+ bottom: 0;
11
+ right: 0;
12
+ position: fixed;
13
+ z-index: -1;
14
+
15
+ background:
16
+ url(https://shaka-player-demo.appspot.com/assets/poster.jpg)
17
+ no-repeat center center fixed;
18
+ background-size: contain;
19
+
20
+ opacity: 0.4;
21
+ filter: sepia(50%);
22
+ }
23
+
24
+ #links {
25
+ margin: 20px;
26
+ }
27
+
28
+ #links a {
29
+ margin: 0.5em;
30
+ padding: 0.5em;
31
+
32
+ border: 2px solid black;
33
+ background-color: #006;
34
+
35
+ font-size: 110%;
36
+ color: white;
37
+ font-weight: bold;
38
+ text-decoration: none;
39
+ }
40
+
41
+ table.best tr.old {
42
+ display: none;
43
+ }
44
+
45
+ th, td {
46
+ border: 1px solid black;
47
+ padding: 0.2em 2em;
48
+ }
49
+
50
+ table.best tr.best-even,
51
+ table.all tr:nth-child(2n) {
52
+ background-color: rgba(0,0,0,0.1);
53
+ }
54
+
55
+ </style>
56
+ <script>
57
+ function display(which) {
58
+ table.class = 'which';
59
+ }
60
+ </script>
61
+ </head>
62
+ <body>
63
+ <div id="background"></div>
64
+
65
+ <h1>Shaka Player release demos on appspot</h1>
66
+
67
+ <div id="links">
68
+ <a href="#" onclick="table.className = 'best'">Best versions</a>
69
+ <a href="#" onclick="table.className = 'all'">All versions</a>
70
+ </div>
71
+
72
+ <table id="table" class="best">
73
+ <tr><th>Version</th></tr>
74
+ {% set best_counter = 0 %}
75
+ {% for v in versions %}
76
+ {% if v.best %}
77
+ <tr class="best {{'best-even' if best_counter % 2 == 0 else ''}}">
78
+ {% set best_counter = best_counter + 1 %}
79
+ {% else %}
80
+ <tr class="old">
81
+ {% endif %}
82
+ <th>{{ v.version }}</th>
83
+ <td><a href="{{ v.demo }}">demo</a></td>
84
+ <td><a href="{{ v.lib }}">non-UI library</a></td>
85
+ <td>
86
+ {% if v.ui_lib %}
87
+ <a href="{{ v.ui_lib }}">UI-enabled library</a>
88
+ {% endif %}
89
+ </td>
90
+ <td>
91
+ {% if v.lib_externs %}
92
+ <a href="{{ v.lib_externs }}">non-UI externs</a>
93
+ {% endif %}
94
+ </td>
95
+ <td>
96
+ {% if v.ui_lib_externs %}
97
+ <a href="{{ v.ui_lib_externs }}">UI-enabled externs</a>
98
+ {% endif %}
99
+ </td>
100
+ <td>
101
+ {% if v.lib_defs %}
102
+ <a href="{{ v.lib_defs }}">non-UI typescript defs</a>
103
+ {% endif %}
104
+ </td>
105
+ <td>
106
+ {% if v.ui_lib_defs %}
107
+ <a href="{{ v.ui_lib_defs }}">UI-enabled typescript defs</a>
108
+ {% endif %}
109
+ </td>
110
+ </tr>
111
+ {% endfor %}
112
+ </table>
113
+ </body>
114
+ </html>
@@ -0,0 +1,18 @@
1
+ # Google App Engine Demo
2
+
3
+ This folder contains everything necessary to host our demo on
4
+ https://shaka-player-demo.appspot.com/
5
+
6
+ - app.yaml: App Engine config file. Defines cache expiration and how specific
7
+ URLs are mapped to specific files.
8
+
9
+ - main.py: A catch-all python service to serve any non-static files. This
10
+ handles HTTP redirects for the root path (this is the only way to
11
+ do HTTP redirects in App Engine) and the poster service (which
12
+ returns special poster images on certain days).
13
+
14
+ - requirements.txt: Used by App Engine to install the necessary Python server
15
+ requirements (Flask).
16
+
17
+ - time.txt: A static file used for time sync in the client. Configured with
18
+ special response headers for cross-origin access.
@@ -0,0 +1,61 @@
1
+ # Copyright 2016 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ runtime: python39
16
+ default_expiration: 5m
17
+
18
+ handlers:
19
+ # A static file used for clock sync in the demo app
20
+ - url: /time.txt
21
+ static_files: time.txt
22
+ upload: time.txt
23
+ expiration: 0
24
+ http_headers:
25
+ Access-Control-Allow-Origin: "*"
26
+ Access-Control-Allow-Headers: "If-Modified-Since,Range,Origin"
27
+ Access-Control-Expose-Headers: "Date"
28
+ Access-Control-Max-Age: "2592000"
29
+
30
+ # These used to exist in the repo, but have been generated server-side for many
31
+ # years now.
32
+ - url: /assets/poster.jpg
33
+ script: auto
34
+ - url: /assets/audioOnly.gif
35
+ script: auto
36
+
37
+ # Serve favicon.ico from the demo folder.
38
+ - url: /favicon.ico
39
+ secure: always
40
+ static_files: demo/favicon.ico
41
+ upload: demo/favicon.ico
42
+
43
+ # For these folders, serve their indexes.
44
+ - url: /docs/api/
45
+ secure: always
46
+ static_files: docs/api/index.html
47
+ upload: docs/api/index.html
48
+ - url: /demo/
49
+ secure: always
50
+ static_files: demo/index.html
51
+ upload: demo/index.html
52
+ - url: /demo/
53
+ secure: always
54
+ static_files: demo/index.html
55
+ upload: demo/index.html
56
+
57
+ # Serve everything else directly.
58
+ - url: /(.+)
59
+ secure: always
60
+ static_files: \1
61
+ upload: .+
@@ -0,0 +1,95 @@
1
+ # Shaka Player Demo - Appspot Entrypoint
2
+ # Copyright 2022 Google LLC
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ # Most of the app is served as static content. Any exceptions go here.
6
+
7
+ import datetime
8
+ import os
9
+
10
+ from flask import Flask, make_response, redirect, request, send_file
11
+
12
+
13
+ app = Flask(__name__)
14
+
15
+
16
+ # Redirect root requests to /demo.
17
+ @app.route('/')
18
+ def root():
19
+ return redirect('/demo/', code=302)
20
+
21
+
22
+ # A Doodle-like service to change the poster on certain days.
23
+ # All posters are chosen based on the current date in PST.
24
+
25
+ from posters import VIDEO_POSTERS, VIDEO_DEFAULT, AUDIO_POSTERS, AUDIO_DEFAULT
26
+
27
+
28
+ # Timezone info for PST.
29
+ # I'm ignoring DST to avoid complicating the code.
30
+ class PST(datetime.tzinfo):
31
+ def utcoffset(self, dt):
32
+ return datetime.timedelta(hours=-8)
33
+
34
+ def dst(self, dt):
35
+ return datetime.timedelta(0)
36
+
37
+ def tzname(self, dt):
38
+ return 'PST'
39
+
40
+
41
+ def get_poster(poster_map, default_poster):
42
+ now = datetime.datetime.now(PST())
43
+ today = (now.month, now.day)
44
+ today_with_year = (now.month, now.day, now.year)
45
+ midnight = datetime.datetime(now.year, now.month, now.day, tzinfo=PST())
46
+ local_expiration = midnight + datetime.timedelta(days=1)
47
+ max_age = (local_expiration - now).total_seconds()
48
+
49
+ # For internal debugging and testing of the poster service, we can override
50
+ # the date. To set an override, open /assets/poster.jpg and run this in the
51
+ # JS console:
52
+ # document.cookie="posterdate=10-31"
53
+ # To clear an override, run:
54
+ # document.cookie="posterdate="
55
+ override = request.cookies.get('posterdate')
56
+ if override:
57
+ override_tuple = [int(x) for x in override.split('-')]
58
+ print('Date override:', repr(override_tuple))
59
+
60
+ if len(override_tuple) == 3:
61
+ # Override includes year.
62
+ today_with_year = tuple(override_tuple)
63
+ today = tuple(override_tuple[0:2])
64
+ elif len(override_tuple) == 2:
65
+ # Override does not include year, so add the current year.
66
+ today_with_year = tuple(override_tuple + [now.year])
67
+ today = tuple(override_tuple)
68
+ else:
69
+ # Bad override format. Ignore the year, but add a response header to
70
+ # indicate that the override failed. For internal debugging of the
71
+ # poster service.
72
+ print('Bad date override:', override, file=sys.stderr)
73
+
74
+ # Prefer a poster for this specific year.
75
+ name = poster_map.get(today_with_year, poster_map.get(today, default_poster))
76
+ path = 'posters/%s' % name
77
+
78
+ response = make_response(
79
+ send_file(path, last_modified=midnight, max_age=max_age))
80
+
81
+ response.headers['Access-Control-Allow-Origin'] = '*'
82
+ response.headers['Access-Control-Allow-Headers'] = 'If-Modified-Since,Range'
83
+ response.headers['Access-Control-Expose-Headers'] = 'Date'
84
+ response.headers['Access-Control-Max-Age'] = '2592000'
85
+
86
+ return response
87
+
88
+
89
+ @app.route('/assets/poster.jpg')
90
+ def get_video_poster():
91
+ return get_poster(VIDEO_POSTERS, VIDEO_DEFAULT)
92
+
93
+ @app.route('/assets/audioOnly.gif')
94
+ def get_audio_poster():
95
+ return get_poster(AUDIO_POSTERS, AUDIO_DEFAULT)
@@ -0,0 +1,46 @@
1
+ Trek poster image derived from:
2
+ https://commons.wikimedia.org/wiki/File:Leonard_Nimoy_by_Gage_Skidmore_2.jpg
3
+ Author:
4
+ https://commons.wikimedia.org/wiki/User:Gage
5
+ License:
6
+ Creative Commons Share-Alike 3.0
7
+ http://creativecommons.org/licenses/by-sa/3.0/
8
+
9
+ Zombie poster image derived from:
10
+ https://www.flickr.com/photos/ofsmallthings/8055153041
11
+ Author:
12
+ https://www.flickr.com/photos/ofsmallthings/
13
+ License:
14
+ Creative Commons Share-Alike 2.0
15
+ https://creativecommons.org/licenses/by-sa/2.0/
16
+
17
+ Color bars April Fool's image from:
18
+ http://kittypizzadope.tumblr.com/post/66751567701
19
+ Author:
20
+ unknown
21
+ License:
22
+ unknown
23
+
24
+ Party hat image from:
25
+ https://pixabay.com/en/party-hat-celebration-birthday-42329/
26
+ Author:
27
+ unknown
28
+ License:
29
+ Creative Commons 0 - Public Domain 1.0
30
+ https://creativecommons.org/publicdomain/zero/1.0/deed.en
31
+
32
+ Party streamers image from:
33
+ https://pixabay.com/en/confetti-streamer-party-carnival-1925258/
34
+ Author:
35
+ Unknown
36
+ License:
37
+ Creative Commons 0 - Public Domain 1.0
38
+ https://creativecommons.org/publicdomain/zero/1.0/deed.en
39
+
40
+ Fireworks image from:
41
+ https://pixabay.com/illustrations/fireworks-sylvester-pyrotechnics-2248223/
42
+ Author:
43
+ https://pixabay.com/users/geralt-9301/
44
+ License:
45
+ Simplified Pixabay License
46
+ https://pixabay.com/service/license/