shaka-player 3.3.2 → 4.0.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 (389) 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 +129 -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 +37 -0
  8. package/.github/workflows/nightly-demo.yaml +42 -0
  9. package/.github/workflows/release-please.yaml +168 -0
  10. package/.github/workflows/safari-homedir-launcher.sh +18 -0
  11. package/.github/workflows/selenium-lab-tests.yaml +92 -0
  12. package/.github/workflows/sync-labels.yaml +33 -0
  13. package/.github/workflows/update-issues.yaml +29 -0
  14. package/.github/workflows/validate-pr-title.yaml +35 -0
  15. package/AUTHORS +3 -0
  16. package/CHANGELOG.md +1866 -1675
  17. package/CONTRIBUTING.md +2 -2
  18. package/CONTRIBUTORS +3 -0
  19. package/README.md +16 -13
  20. package/app-engine/README.md +9 -0
  21. package/app-engine/demo-version-index/README.md +14 -0
  22. package/app-engine/demo-version-index/app.yaml +28 -0
  23. package/app-engine/demo-version-index/generate.py +164 -0
  24. package/app-engine/demo-version-index/main.py +11 -0
  25. package/app-engine/demo-version-index/requirements.txt +5 -0
  26. package/app-engine/demo-version-index/templates/index.html +114 -0
  27. package/app-engine/shaka-player-demo/README.md +18 -0
  28. package/app-engine/shaka-player-demo/app.yaml +61 -0
  29. package/app-engine/shaka-player-demo/main.py +95 -0
  30. package/app-engine/shaka-player-demo/posters/10yo.png +0 -0
  31. package/app-engine/shaka-player-demo/posters/10yo.xcf +0 -0
  32. package/app-engine/shaka-player-demo/posters/1yo.jpg +0 -0
  33. package/app-engine/shaka-player-demo/posters/2yo.png +0 -0
  34. package/app-engine/shaka-player-demo/posters/2yo.xcf +0 -0
  35. package/app-engine/shaka-player-demo/posters/3yo.png +0 -0
  36. package/app-engine/shaka-player-demo/posters/3yo.xcf +0 -0
  37. package/app-engine/shaka-player-demo/posters/4yo.png +0 -0
  38. package/app-engine/shaka-player-demo/posters/4yo.xcf +0 -0
  39. package/app-engine/shaka-player-demo/posters/5yo.png +0 -0
  40. package/app-engine/shaka-player-demo/posters/5yo.xcf +0 -0
  41. package/app-engine/shaka-player-demo/posters/6yo.png +0 -0
  42. package/app-engine/shaka-player-demo/posters/6yo.xcf +0 -0
  43. package/app-engine/shaka-player-demo/posters/7yo.png +0 -0
  44. package/app-engine/shaka-player-demo/posters/7yo.xcf +0 -0
  45. package/app-engine/shaka-player-demo/posters/8yo.png +0 -0
  46. package/app-engine/shaka-player-demo/posters/8yo.xcf +0 -0
  47. package/app-engine/shaka-player-demo/posters/9yo.png +0 -0
  48. package/app-engine/shaka-player-demo/posters/9yo.xcf +0 -0
  49. package/app-engine/shaka-player-demo/posters/audioOnly.gif +0 -0
  50. package/app-engine/shaka-player-demo/posters/audioRickRoll.gif +0 -0
  51. package/app-engine/shaka-player-demo/posters/colorbars.gif +0 -0
  52. package/app-engine/shaka-player-demo/posters/fireworks.jpg +0 -0
  53. package/app-engine/shaka-player-demo/posters/party-hat.png +0 -0
  54. package/app-engine/shaka-player-demo/posters/sources.txt +46 -0
  55. package/app-engine/shaka-player-demo/posters/standard.png +0 -0
  56. package/app-engine/shaka-player-demo/posters/trek.jpg +0 -0
  57. package/app-engine/shaka-player-demo/posters/valentines.png +0 -0
  58. package/app-engine/shaka-player-demo/posters/zombie.jpg +0 -0
  59. package/app-engine/shaka-player-demo/posters.py +110 -0
  60. package/app-engine/shaka-player-demo/requirements.txt +5 -0
  61. package/app-engine/shaka-player-demo/time.txt +1 -0
  62. package/build/README.md +3 -3
  63. package/build/checkversion.py +1 -1
  64. package/build/compiler.py +1 -1
  65. package/build/conformance.textproto +13 -0
  66. package/build/docker/Dockerfile +20 -0
  67. package/build/docker/docker-compose.yml +10 -0
  68. package/build/gendeps.py +18 -15
  69. package/build/shaka-lab.yaml +161 -0
  70. package/build/shakaBuildHelpers.py +4 -29
  71. package/build/test.py +94 -29
  72. package/build/types/core +0 -1
  73. package/build/types/polyfill +1 -3
  74. package/build/wrapper.template.js +2 -2
  75. package/demo/TengwarTelcontar.woff2 +0 -0
  76. package/demo/asset_card.js +1 -2
  77. package/demo/cast_receiver/index.html +1 -1
  78. package/demo/cast_receiver/receiver_app.css +14 -14
  79. package/demo/common/asset.js +17 -1
  80. package/demo/common/assets.js +31 -0
  81. package/demo/common/message_ids.js +6 -3
  82. package/demo/config.js +10 -12
  83. package/demo/custom.js +39 -1
  84. package/demo/customWarning.txt +2 -2
  85. package/demo/demo.less +29 -18
  86. package/demo/demo_uncompiled.js +1 -13
  87. package/demo/demo_utils.js +0 -1
  88. package/demo/index.html +1 -1
  89. package/demo/locales/en.json +6 -3
  90. package/demo/locales/source.json +22 -10
  91. package/demo/main.js +12 -9
  92. package/demo/search.js +2 -1
  93. package/dist/controls.css +3 -3
  94. package/dist/controls.css.map +1 -1
  95. package/dist/demo.compiled.debug.js +236 -232
  96. package/dist/demo.compiled.debug.map +4 -4
  97. package/dist/demo.compiled.js +236 -232
  98. package/dist/demo.compiled.map +4 -4
  99. package/dist/demo.css +1 -1
  100. package/dist/demo.css.map +1 -1
  101. package/dist/deps.js +229 -226
  102. package/dist/locales.js +34 -32
  103. package/dist/receiver.compiled.debug.js +75 -73
  104. package/dist/receiver.compiled.debug.map +4 -4
  105. package/dist/receiver.compiled.js +75 -73
  106. package/dist/receiver.compiled.map +4 -4
  107. package/dist/shaka-player.compiled.d.ts +321 -314
  108. package/dist/shaka-player.compiled.debug.d.ts +321 -314
  109. package/dist/shaka-player.compiled.debug.externs.js +140 -129
  110. package/dist/shaka-player.compiled.debug.js +527 -592
  111. package/dist/shaka-player.compiled.debug.map +4 -4
  112. package/dist/shaka-player.compiled.externs.js +140 -129
  113. package/dist/shaka-player.compiled.js +836 -860
  114. package/dist/shaka-player.compiled.map +4 -4
  115. package/dist/shaka-player.ui.d.ts +367 -358
  116. package/dist/shaka-player.ui.debug.d.ts +367 -358
  117. package/dist/shaka-player.ui.debug.externs.js +148 -129
  118. package/dist/shaka-player.ui.debug.js +586 -649
  119. package/dist/shaka-player.ui.debug.map +4 -4
  120. package/dist/shaka-player.ui.externs.js +148 -129
  121. package/dist/shaka-player.ui.js +1008 -1028
  122. package/dist/shaka-player.ui.map +4 -4
  123. package/docs/design/REDESIGN.md +33 -33
  124. package/docs/design/bg-fetch.md +2 -2
  125. package/docs/design/codec_preferences.md +1 -1
  126. package/docs/design/dash-audio-channels.md +3 -3
  127. package/docs/design/dash-manifests.md +1 -1
  128. package/docs/design/gap-jumping.md +3 -3
  129. package/docs/design/preload.md +2 -2
  130. package/docs/tutorials/config.md +0 -2
  131. package/docs/tutorials/drm-config.md +5 -0
  132. package/docs/tutorials/fairplay.md +7 -22
  133. package/docs/tutorials/faq.md +8 -19
  134. package/docs/tutorials/index.json +3 -8
  135. package/docs/tutorials/plugins.md +4 -6
  136. package/docs/tutorials/selenium-grid-config.md +122 -0
  137. package/docs/tutorials/upgrade.md +83 -11
  138. package/docs/tutorials/welcome.md +10 -2
  139. package/externs/cmcd.js +1 -1
  140. package/externs/polyfill.js +15 -0
  141. package/externs/shaka/manifest.js +5 -1
  142. package/externs/shaka/net.js +12 -0
  143. package/externs/shaka/offline.js +5 -1
  144. package/externs/shaka/player.js +39 -32
  145. package/externs/shaka/text.js +12 -12
  146. package/externs/sourcebuffer.js +15 -0
  147. package/karma.conf.js +137 -30
  148. package/lib/abr/simple_abr_manager.js +12 -6
  149. package/lib/ads/client_side_ad.js +13 -2
  150. package/lib/ads/client_side_ad_manager.js +22 -4
  151. package/lib/cast/cast_proxy.js +3 -4
  152. package/lib/cast/cast_utils.js +0 -1
  153. package/lib/cea/cea608_data_channel.js +2 -2
  154. package/lib/cea/cea708_service.js +5 -4
  155. package/lib/cea/mp4_cea_parser.js +11 -5
  156. package/lib/cea/sei_processor.js +6 -3
  157. package/lib/dash/content_protection.js +85 -5
  158. package/lib/dash/dash_parser.js +10 -12
  159. package/lib/dash/mpd_utils.js +4 -5
  160. package/lib/dash/segment_list.js +1 -2
  161. package/lib/dash/segment_template.js +3 -3
  162. package/lib/hls/hls_parser.js +386 -749
  163. package/lib/hls/manifest_text_parser.js +5 -6
  164. package/lib/media/adaptation_set.js +1 -2
  165. package/lib/media/content_workarounds.js +2 -2
  166. package/lib/media/drm_engine.js +105 -55
  167. package/lib/media/gap_jumping_controller.js +10 -45
  168. package/lib/media/media_source_engine.js +90 -17
  169. package/lib/media/mp4_segment_index_parser.js +1 -4
  170. package/lib/media/playhead.js +4 -7
  171. package/lib/media/presentation_timeline.js +19 -10
  172. package/lib/media/segment_index.js +13 -46
  173. package/lib/media/segment_reference.js +47 -1
  174. package/lib/media/streaming_engine.js +35 -17
  175. package/lib/media/time_ranges_utils.js +5 -12
  176. package/lib/media/video_wrapper.js +1 -1
  177. package/lib/net/networking_engine.js +4 -1
  178. package/lib/offline/indexeddb/v1_storage_cell.js +1 -0
  179. package/lib/offline/indexeddb/v2_storage_cell.js +1 -0
  180. package/lib/offline/manifest_converter.js +1 -0
  181. package/lib/offline/storage.js +104 -136
  182. package/lib/player.js +50 -216
  183. package/lib/polyfill/all.js +2 -3
  184. package/lib/polyfill/encryption_scheme.js +1 -1
  185. package/lib/polyfill/media_capabilities.js +15 -9
  186. package/lib/polyfill/mediasource.js +0 -28
  187. package/lib/polyfill/patchedmediakeys_nop.js +2 -0
  188. package/lib/polyfill/patchedmediakeys_webkit.js +2 -0
  189. package/lib/polyfill/symbol.js +46 -0
  190. package/lib/text/cue.js +1 -7
  191. package/lib/text/lrc_text_parser.js +8 -0
  192. package/lib/text/mp4_ttml_parser.js +8 -0
  193. package/lib/text/mp4_vtt_parser.js +8 -0
  194. package/lib/text/sbv_text_parser.js +8 -0
  195. package/lib/text/simple_text_displayer.js +3 -8
  196. package/lib/text/srt_text_parser.js +8 -0
  197. package/lib/text/ssa_text_parser.js +8 -0
  198. package/lib/text/text_engine.js +19 -3
  199. package/lib/text/ttml_text_parser.js +16 -5
  200. package/lib/text/ui_text_displayer.js +2 -8
  201. package/lib/text/vtt_text_parser.js +24 -2
  202. package/lib/text/web_vtt_generator.js +1 -7
  203. package/lib/util/buffer_utils.js +1 -3
  204. package/lib/util/ebml_parser.js +3 -3
  205. package/lib/util/error.js +10 -14
  206. package/lib/util/fairplay_utils.js +109 -0
  207. package/lib/util/functional.js +0 -42
  208. package/lib/util/iterables.js +0 -46
  209. package/lib/util/mime_utils.js +2 -0
  210. package/lib/util/mp4_box_parsers.js +1 -4
  211. package/lib/util/mp4_parser.js +5 -7
  212. package/lib/util/periods.js +10 -11
  213. package/lib/util/platform.js +48 -3
  214. package/lib/util/player_configuration.js +12 -6
  215. package/lib/util/pssh.js +24 -8
  216. package/lib/util/stream_utils.js +96 -25
  217. package/lib/util/string_utils.js +3 -5
  218. package/lib/util/uint8array_utils.js +3 -21
  219. package/lib/util/xml_utils.js +16 -8
  220. package/package.json +61 -36
  221. package/roadmap.md +27 -27
  222. package/shaka-player.uncompiled.js +1 -3
  223. package/test/abr/simple_abr_manager_unit.js +3 -8
  224. package/test/ads/ad_manager_unit.js +0 -6
  225. package/test/cast/cast_proxy_unit.js +0 -8
  226. package/test/cast/cast_receiver_integration.js +1 -18
  227. package/test/cast/cast_receiver_unit.js +1 -9
  228. package/test/cast/cast_sender_unit.js +0 -6
  229. package/test/cast/cast_utils_unit.js +1 -13
  230. package/test/cea/cea608_memory_unit.js +0 -5
  231. package/test/cea/cea708_service_unit.js +0 -7
  232. package/test/cea/cea708_window_unit.js +0 -5
  233. package/test/cea/cea_decoder_unit.js +0 -6
  234. package/test/cea/dtvcc_packet_builder_unit.js +0 -3
  235. package/test/cea/dtvcc_packet_unit.js +0 -5
  236. package/test/cea/mp4_cea_parser_unit.js +0 -4
  237. package/test/dash/dash_parser_content_protection_unit.js +45 -10
  238. package/test/dash/dash_parser_live_unit.js +2 -15
  239. package/test/dash/dash_parser_manifest_unit.js +2 -40
  240. package/test/dash/dash_parser_segment_base_unit.js +1 -8
  241. package/test/dash/dash_parser_segment_list_unit.js +1 -7
  242. package/test/dash/dash_parser_segment_template_unit.js +3 -13
  243. package/test/dash/mpd_utils_unit.js +3 -11
  244. package/test/demo/demo_unit.js +2 -6
  245. package/test/deprecate/enforcer_unit.js +0 -4
  246. package/test/deprecate/version_unit.js +0 -2
  247. package/test/hls/hls_live_unit.js +101 -234
  248. package/test/hls/hls_parser_unit.js +517 -447
  249. package/test/hls/manifest_text_parser_unit.js +0 -10
  250. package/test/media/adaptation_set_criteria_unit.js +3 -7
  251. package/test/media/adaptation_set_unit.js +0 -2
  252. package/test/media/buffering_observer_unit.js +1 -4
  253. package/test/media/closed_caption_parser_unit.js +0 -3
  254. package/test/media/drm_engine_integration.js +2 -15
  255. package/test/media/drm_engine_unit.js +90 -144
  256. package/test/media/manifest_parser_unit.js +0 -4
  257. package/test/media/media_source_engine_integration.js +26 -10
  258. package/test/media/media_source_engine_unit.js +8 -20
  259. package/test/media/mp4_segment_index_parser_unit.js +0 -4
  260. package/test/media/play_rate_controller_unit.js +0 -4
  261. package/test/media/playhead_unit.js +35 -207
  262. package/test/media/presentation_timeline_unit.js +4 -7
  263. package/test/media/quality_observer_unit.js +0 -4
  264. package/test/media/region_observer_unit.js +1 -6
  265. package/test/media/region_timeline_unit.js +0 -3
  266. package/test/media/segment_index_unit.js +15 -31
  267. package/test/media/segment_reference_unit.js +0 -3
  268. package/test/media/stall_detector_unit.js +0 -5
  269. package/test/media/streaming_engine_integration.js +13 -75
  270. package/test/media/streaming_engine_unit.js +14 -37
  271. package/test/media/time_ranges_utils_unit.js +0 -7
  272. package/test/media/transmuxer_integration.js +0 -6
  273. package/test/media/webm_segment_index_parser_unit.js +0 -4
  274. package/test/net/data_uri_plugin_unit.js +0 -7
  275. package/test/net/http_plugin_unit.js +0 -9
  276. package/test/net/networking_engine_unit.js +0 -11
  277. package/test/offline/download_progress_estimator_unit.js +0 -2
  278. package/test/offline/indexeddb_storage_unit.js +0 -6
  279. package/test/offline/manifest_convert_unit.js +34 -12
  280. package/test/offline/offline_integration.js +1 -10
  281. package/test/offline/offline_manifest_parser_unit.js +1 -6
  282. package/test/offline/offline_scheme_unit.js +0 -8
  283. package/test/offline/offline_uri_unit.js +0 -2
  284. package/test/offline/storage_compatibility_unit.js +1 -14
  285. package/test/offline/storage_integration.js +6 -31
  286. package/test/player_external.js +1 -15
  287. package/test/player_integration.js +38 -28
  288. package/test/player_load_graph_integration.js +1 -6
  289. package/test/player_src_equals_external.js +3 -9
  290. package/test/player_src_equals_integration.js +0 -7
  291. package/test/player_unit.js +78 -37
  292. package/test/routing/walker_unit.js +0 -8
  293. package/test/test/assets/large_file.mpd +1 -1
  294. package/test/test/boot.js +75 -22
  295. package/test/test/externs/jasmine.js +2 -2
  296. package/test/test/externs/karma.js +4 -0
  297. package/test/test/namespace.js +10 -0
  298. package/test/test/util/canned_idb.js +0 -8
  299. package/test/test/util/cea_utils.js +0 -6
  300. package/test/test/util/dash_parser_util.js +0 -13
  301. package/test/test/util/fake_ad.js +0 -3
  302. package/test/test/util/fake_ad_manager.js +0 -9
  303. package/test/test/util/fake_demo_main.js +0 -5
  304. package/test/test/util/fake_drm_engine.js +0 -6
  305. package/test/test/util/fake_media_source_engine.js +11 -11
  306. package/test/test/util/fake_networking_engine.js +0 -5
  307. package/test/test/util/fake_text_displayer.js +0 -5
  308. package/test/test/util/indexeddb_utils.js +1 -10
  309. package/test/test/util/jasmine_fetch.js +0 -1
  310. package/test/test/util/loader.js +0 -18
  311. package/test/test/util/manifest_generator.js +12 -15
  312. package/test/test/util/manifest_parser_util.js +4 -7
  313. package/test/test/util/offline_utils.js +1 -5
  314. package/test/test/util/simple_fakes.js +9 -26
  315. package/test/test/util/stream_generator.js +0 -14
  316. package/test/test/util/streaming_engine_util.js +1 -15
  317. package/test/test/util/test_scheme.js +25 -20
  318. package/test/test/util/ttml_utils.js +0 -2
  319. package/test/test/util/ui_utils.js +0 -9
  320. package/test/test/util/util.js +9 -23
  321. package/test/test/util/waiter.js +84 -43
  322. package/test/text/cue_integration.js +2 -6
  323. package/test/text/lrc_text_parser_unit.js +6 -11
  324. package/test/text/mp4_ttml_parser_unit.js +6 -10
  325. package/test/text/mp4_vtt_parser_unit.js +7 -12
  326. package/test/text/sbv_text_parser_unit.js +5 -10
  327. package/test/text/simple_text_displayer_unit.js +1 -8
  328. package/test/text/srt_text_parser_unit.js +5 -10
  329. package/test/text/ssa_text_parser_unit.js +17 -34
  330. package/test/text/text_engine_unit.js +47 -12
  331. package/test/text/text_track_integration.js +0 -2
  332. package/test/text/ttml_text_parser_unit.js +79 -88
  333. package/test/text/ui_text_displayer_unit.js +44 -41
  334. package/test/text/vtt_text_parser_unit.js +55 -66
  335. package/test/text/web_vtt_generator_unit.js +0 -3
  336. package/test/ui/ad_ui_unit.js +0 -11
  337. package/test/ui/localization_unit.js +0 -3
  338. package/test/ui/text_displayer_layout_unit.js +1 -12
  339. package/test/ui/ui_customization_unit.js +0 -6
  340. package/test/ui/ui_integration.js +0 -32
  341. package/test/ui/ui_unit.js +28 -17
  342. package/test/util/abortable_operation_unit.js +4 -9
  343. package/test/util/array_utils_unit.js +0 -2
  344. package/test/util/buffer_utils_unit.js +0 -2
  345. package/test/util/cmcd_manager_unit.js +3 -3
  346. package/test/util/data_view_reader_unit.js +0 -4
  347. package/test/util/ebml_parser_unit.js +0 -4
  348. package/test/util/event_manager_unit.js +0 -3
  349. package/test/util/fake_event_target_unit.js +0 -5
  350. package/test/util/iterables_unit.js +0 -64
  351. package/test/util/language_utils_unit.js +0 -3
  352. package/test/util/manifest_parser_utils_unit.js +0 -2
  353. package/test/util/mp4_box_parsers_unit.js +0 -5
  354. package/test/util/mp4_parser_unit.js +0 -4
  355. package/test/util/multi_map_unit.js +0 -3
  356. package/test/util/object_utils_unit.js +0 -2
  357. package/test/util/periods_unit.js +14 -7
  358. package/test/util/pssh_unit.js +0 -5
  359. package/test/util/state_history_unit.js +0 -2
  360. package/test/util/stream_utils_unit.js +26 -15
  361. package/test/util/string_utils_unit.js +0 -6
  362. package/test/util/text_parser_unit.js +0 -2
  363. package/test/util/xml_utils_unit.js +0 -4
  364. package/ui/controls.js +65 -40
  365. package/ui/fullscreen_button.js +26 -6
  366. package/ui/less/ad_controls.less +6 -6
  367. package/ui/less/buttons.less +6 -6
  368. package/ui/less/containers.less +10 -12
  369. package/ui/less/overflow_menu.less +4 -4
  370. package/ui/less/range_elements.less +7 -2
  371. package/ui/less/tooltip.less +4 -4
  372. package/ui/locales/en.json +1 -0
  373. package/ui/locales/sjn-translations.yaml +257 -0
  374. package/ui/locales/sjn.json +42 -0
  375. package/ui/locales/source.json +5 -0
  376. package/ui/resolution_selection.js +31 -33
  377. package/ui/seek_bar.js +2 -1
  378. package/ui/ui.js +0 -17
  379. package/.github/workflows/build_and_test.yaml +0 -73
  380. package/.github/workflows/release.yaml +0 -53
  381. package/docs/tutorials/upgrade-v2-5.md +0 -441
  382. package/docs/tutorials/upgrade-v3.md +0 -38
  383. package/externs/svgelement.js +0 -18
  384. package/externs/webcrypto.js +0 -18
  385. package/lib/polyfill/mathround.js +0 -49
  386. package/lib/polyfill/patchedmediakeys_apple.js +0 -744
  387. package/lib/polyfill/patchedmediakeys_ms.js +0 -698
  388. package/lib/util/mutex.js +0 -52
  389. package/test/util/functional_unit.js +0 -82
@@ -4,30 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- goog.require('goog.asserts');
8
- goog.require('shaka.Player');
9
- goog.require('shaka.log');
10
- goog.require('shaka.media.BufferingObserver');
11
- goog.require('shaka.media.ManifestParser');
12
- goog.require('shaka.media.PresentationTimeline');
13
- goog.require('shaka.media.SegmentReference');
14
- goog.require('shaka.media.SegmentIndex');
15
- goog.require('shaka.test.FakeAbrManager');
16
- goog.require('shaka.test.FakeDrmEngine');
17
- goog.require('shaka.test.FakeManifestParser');
18
- goog.require('shaka.test.FakeNetworkingEngine');
19
- goog.require('shaka.test.FakePlayhead');
20
- goog.require('shaka.test.FakeStreamingEngine');
21
- goog.require('shaka.test.FakeTextDisplayer');
22
- goog.require('shaka.test.FakeVideo');
23
- goog.require('shaka.test.ManifestGenerator');
24
- goog.require('shaka.test.Util');
25
- goog.require('shaka.util.ConfigUtils');
26
- goog.require('shaka.util.Error');
27
- goog.require('shaka.util.Iterables');
28
- goog.require('shaka.util.ManifestParserUtils');
29
- goog.requireType('shaka.media.Playhead');
30
-
31
7
  describe('Player', () => {
32
8
  const ContentType = shaka.util.ManifestParserUtils.ContentType;
33
9
  const Util = shaka.test.Util;
@@ -140,6 +116,8 @@ describe('Player', () => {
140
116
  jasmine.createSpy('destroy').and.returnValue(Promise.resolve()),
141
117
  setUseEmbeddedText: jasmine.createSpy('setUseEmbeddedText'),
142
118
  getUseEmbeddedText: jasmine.createSpy('getUseEmbeddedText'),
119
+ setSegmentRelativeVttTiming:
120
+ jasmine.createSpy('setSegmentRelativeVttTiming'),
143
121
  getTextDisplayer: () => textDisplayer,
144
122
  ended: jasmine.createSpy('ended').and.returnValue(false),
145
123
  };
@@ -325,7 +303,7 @@ describe('Player', () => {
325
303
  // We used to fire the event /before/ filtering, which meant that for
326
304
  // multi-codec content, the application might select something which will
327
305
  // later be removed during filtering.
328
- // https://github.com/google/shaka-player/issues/1119
306
+ // https://github.com/shaka-project/shaka-player/issues/1119
329
307
  it('fires after tracks have been filtered', async () => {
330
308
  streamingListener.and.callFake(() => {
331
309
  const tracks = player.getVariantTracks();
@@ -621,7 +599,7 @@ describe('Player', () => {
621
599
  expect(logWarnSpy).not.toHaveBeenCalled();
622
600
  });
623
601
 
624
- // Regression test for https://github.com/google/shaka-player/issues/784
602
+ // Regression test for https://github.com/shaka-project/shaka-player/issues/784
625
603
  it('does not throw when overwriting serverCertificate', () => {
626
604
  player.configure({
627
605
  drm: {
@@ -687,9 +665,9 @@ describe('Player', () => {
687
665
  });
688
666
 
689
667
  it('configures play and seek range for VOD', async () => {
690
- player.configure({playRangeStart: 5, playRangeEnd: 10});
691
668
  const timeline = new shaka.media.PresentationTimeline(300, 0);
692
669
  timeline.setStatic(true);
670
+ timeline.setDuration(300);
693
671
  manifest = shaka.test.ManifestGenerator.generate((manifest) => {
694
672
  manifest.presentationTimeline = timeline;
695
673
  manifest.addVariant(0, (variant) => {
@@ -697,7 +675,46 @@ describe('Player', () => {
697
675
  });
698
676
  });
699
677
  goog.asserts.assert(manifest, 'manifest must be non-null');
678
+
679
+ player.configure({playRangeStart: 5, playRangeEnd: 10});
700
680
  await player.load(fakeManifestUri, 0, fakeMimeType);
681
+
682
+ const seekRange = player.seekRange();
683
+ expect(seekRange.start).toBe(5);
684
+ expect(seekRange.end).toBe(10);
685
+ });
686
+
687
+ // Test for https://github.com/shaka-project/shaka-player/issues/4026
688
+ it('configures play and seek range with notifySegments', async () => {
689
+ const timeline = new shaka.media.PresentationTimeline(300, 0);
690
+ timeline.setStatic(true);
691
+ // This duration is used by useSegmentTemplate below to decide how many
692
+ // references to generate.
693
+ timeline.setDuration(300);
694
+ manifest = shaka.test.ManifestGenerator.generate((manifest) => {
695
+ manifest.presentationTimeline = timeline;
696
+ manifest.addVariant(0, (variant) => {
697
+ variant.addVideo(1, (stream) => {
698
+ stream.useSegmentTemplate(
699
+ '$Number$.mp4', /* segmentDuration= */ 10);
700
+ });
701
+ });
702
+ });
703
+ goog.asserts.assert(manifest, 'manifest must be non-null');
704
+
705
+ // Explicitly notify the timeline of the segment references.
706
+ const videoStream = manifest.variants[0].video;
707
+ await videoStream.createSegmentIndex();
708
+ goog.asserts.assert(videoStream.segmentIndex,
709
+ 'SegmentIndex must be non-null');
710
+ const references = Array.from(videoStream.segmentIndex);
711
+ goog.asserts.assert(references.length != 0,
712
+ 'Must have references for this test!');
713
+ timeline.notifySegments(references);
714
+
715
+ player.configure({playRangeStart: 5, playRangeEnd: 10});
716
+ await player.load(fakeManifestUri, 0, fakeMimeType);
717
+
701
718
  const seekRange = player.seekRange();
702
719
  expect(seekRange.start).toBe(5);
703
720
  expect(seekRange.end).toBe(10);
@@ -798,7 +815,7 @@ describe('Player', () => {
798
815
  expect(newConfig.streaming.bufferBehind).toBe(77);
799
816
  });
800
817
 
801
- // https://github.com/google/shaka-player/issues/1524
818
+ // https://github.com/shaka-project/shaka-player/issues/1524
802
819
  it('does not pollute other advanced DRM configs', () => {
803
820
  player.configure('drm.advanced.foo', {});
804
821
  player.configure('drm.advanced.bar', {});
@@ -1115,6 +1132,8 @@ describe('Player', () => {
1115
1132
  pixelAspectRatio: '59:54',
1116
1133
  hdr: null,
1117
1134
  mimeType: 'video/mp4',
1135
+ audioMimeType: 'audio/mp4',
1136
+ videoMimeType: 'video/mp4',
1118
1137
  codecs: 'avc1.4d401f, mp4a.40.2',
1119
1138
  audioCodec: 'mp4a.40.2',
1120
1139
  videoCodec: 'avc1.4d401f',
@@ -1149,6 +1168,8 @@ describe('Player', () => {
1149
1168
  pixelAspectRatio: '59:54',
1150
1169
  hdr: null,
1151
1170
  mimeType: 'video/mp4',
1171
+ audioMimeType: 'audio/mp4',
1172
+ videoMimeType: 'video/mp4',
1152
1173
  codecs: 'avc1.4d401f, mp4a.40.2',
1153
1174
  audioCodec: 'mp4a.40.2',
1154
1175
  videoCodec: 'avc1.4d401f',
@@ -1183,6 +1204,8 @@ describe('Player', () => {
1183
1204
  pixelAspectRatio: '59:54',
1184
1205
  hdr: null,
1185
1206
  mimeType: 'video/mp4',
1207
+ audioMimeType: 'audio/mp4',
1208
+ videoMimeType: 'video/mp4',
1186
1209
  codecs: 'avc1.4d401f, mp4a.40.2',
1187
1210
  audioCodec: 'mp4a.40.2',
1188
1211
  videoCodec: 'avc1.4d401f',
@@ -1217,6 +1240,8 @@ describe('Player', () => {
1217
1240
  pixelAspectRatio: '59:54',
1218
1241
  hdr: null,
1219
1242
  mimeType: 'video/mp4',
1243
+ audioMimeType: 'audio/mp4',
1244
+ videoMimeType: 'video/mp4',
1220
1245
  codecs: 'avc1.4d401f, mp4a.40.2',
1221
1246
  audioCodec: 'mp4a.40.2',
1222
1247
  videoCodec: 'avc1.4d401f',
@@ -1251,6 +1276,8 @@ describe('Player', () => {
1251
1276
  pixelAspectRatio: '59:54',
1252
1277
  hdr: null,
1253
1278
  mimeType: 'video/mp4',
1279
+ audioMimeType: 'audio/mp4',
1280
+ videoMimeType: 'video/mp4',
1254
1281
  codecs: 'avc1.4d401f, mp4a.40.2',
1255
1282
  audioCodec: 'mp4a.40.2',
1256
1283
  videoCodec: 'avc1.4d401f',
@@ -1285,6 +1312,8 @@ describe('Player', () => {
1285
1312
  pixelAspectRatio: '59:54',
1286
1313
  hdr: null,
1287
1314
  mimeType: 'video/mp4',
1315
+ audioMimeType: 'audio/mp4',
1316
+ videoMimeType: 'video/mp4',
1288
1317
  codecs: 'avc1.4d401f, mp4a.40.2',
1289
1318
  audioCodec: 'mp4a.40.2',
1290
1319
  videoCodec: 'avc1.4d401f',
@@ -1319,6 +1348,8 @@ describe('Player', () => {
1319
1348
  pixelAspectRatio: '59:54',
1320
1349
  hdr: null,
1321
1350
  mimeType: 'video/mp4',
1351
+ audioMimeType: 'audio/mp4',
1352
+ videoMimeType: 'video/mp4',
1322
1353
  codecs: 'avc1.4d401f, mp4a.40.2',
1323
1354
  audioCodec: 'mp4a.40.2',
1324
1355
  videoCodec: 'avc1.4d401f',
@@ -1353,6 +1384,8 @@ describe('Player', () => {
1353
1384
  pixelAspectRatio: '59:54',
1354
1385
  hdr: null,
1355
1386
  mimeType: 'video/mp4',
1387
+ audioMimeType: 'audio/mp4',
1388
+ videoMimeType: 'video/mp4',
1356
1389
  codecs: 'avc1.4d401f, mp4a.40.2',
1357
1390
  audioCodec: 'mp4a.40.2',
1358
1391
  videoCodec: 'avc1.4d401f',
@@ -1384,6 +1417,8 @@ describe('Player', () => {
1384
1417
  label: 'Spanish',
1385
1418
  kind: 'caption',
1386
1419
  mimeType: 'text/vtt',
1420
+ audioMimeType: null,
1421
+ videoMimeType: null,
1387
1422
  codecs: null,
1388
1423
  audioCodec: null,
1389
1424
  videoCodec: null,
@@ -1418,6 +1453,8 @@ describe('Player', () => {
1418
1453
  label: 'English',
1419
1454
  kind: 'caption',
1420
1455
  mimeType: 'application/ttml+xml',
1456
+ audioMimeType: null,
1457
+ videoMimeType: null,
1421
1458
  codecs: null,
1422
1459
  audioCodec: null,
1423
1460
  videoCodec: null,
@@ -1452,6 +1489,8 @@ describe('Player', () => {
1452
1489
  label: 'English',
1453
1490
  kind: 'caption',
1454
1491
  mimeType: 'application/ttml+xml',
1492
+ audioMimeType: null,
1493
+ videoMimeType: null,
1455
1494
  codecs: null,
1456
1495
  audioCodec: null,
1457
1496
  videoCodec: null,
@@ -1489,6 +1528,8 @@ describe('Player', () => {
1489
1528
  label: null,
1490
1529
  kind: null,
1491
1530
  mimeType: 'image/jpeg',
1531
+ audioMimeType: null,
1532
+ videoMimeType: null,
1492
1533
  codecs: null,
1493
1534
  audioCodec: null,
1494
1535
  videoCodec: null,
@@ -1668,8 +1709,8 @@ describe('Player', () => {
1668
1709
  expect(getActiveTextTrack().id).toBe(spanishTextTrack.id);
1669
1710
  });
1670
1711
 
1671
- // Regression test for https://github.com/google/shaka-player/issues/2906
1672
- // and https://github.com/google/shaka-player/issues/2909.
1712
+ // Regression test for https://github.com/shaka-project/shaka-player/issues/2906
1713
+ // and https://github.com/shaka-project/shaka-player/issues/2909.
1673
1714
  it('selectAudioLanguage() can choose role-less tracks', async () => {
1674
1715
  // For this test, we use a different (and simpler) manifest.
1675
1716
  // Both audio tracks are English; one has a role, and one has no roles.
@@ -1729,7 +1770,7 @@ describe('Player', () => {
1729
1770
  expect(getActiveVariantTrack().audioRoles).toEqual([]);
1730
1771
  });
1731
1772
 
1732
- // https://github.com/google/shaka-player/issues/3262
1773
+ // https://github.com/shaka-project/shaka-player/issues/3262
1733
1774
  it('selectAudioLanguage() doesn\'t change resolution', () => {
1734
1775
  player.configure('abr.enabled', false);
1735
1776
  abrManager.chooseIndex = 1;
@@ -1807,7 +1848,7 @@ describe('Player', () => {
1807
1848
  expect(getActiveTextTrack().language).toBe('en');
1808
1849
  });
1809
1850
 
1810
- // https://github.com/google/shaka-player/issues/2010
1851
+ // https://github.com/shaka-project/shaka-player/issues/2010
1811
1852
  it('changing text lang changes active stream when not streaming', () => {
1812
1853
  player.setTextTrackVisibility(false);
1813
1854
 
@@ -2112,8 +2153,8 @@ describe('Player', () => {
2112
2153
  async function runTest(languages, preference, expectedIndex) {
2113
2154
  // A manifest we can use to test language selection.
2114
2155
  manifest = shaka.test.ManifestGenerator.generate((manifest) => {
2115
- const enumerate = (it) => shaka.util.Iterables.enumerate(it);
2116
- for (const {i, item: lang} of enumerate(languages)) {
2156
+ for (let i = 0; i < languages.length; i++) {
2157
+ const lang = languages[i];
2117
2158
  if (lang.charAt(0) == '*') {
2118
2159
  manifest.addVariant(i, (variant) => {
2119
2160
  variant.primary = true;
@@ -2548,7 +2589,7 @@ describe('Player', () => {
2548
2589
  expect(variants[0].id).toBe(2);
2549
2590
 
2550
2591
  // Now increase the restriction, AbrManager should still be updated.
2551
- // https://github.com/google/shaka-player/issues/1533
2592
+ // https://github.com/shaka-project/shaka-player/issues/1533
2552
2593
  abrManager.setVariants.calls.reset();
2553
2594
  player.configure({restrictions: {maxBandwidth: Infinity}});
2554
2595
  expect(abrManager.setVariants).toHaveBeenCalledTimes(1);
@@ -3186,7 +3227,7 @@ describe('Player', () => {
3186
3227
  // Most of our Player unit tests never adapt. This allowed some assertions
3187
3228
  // to creep in that went uncaught until they happened during manual testing.
3188
3229
  // Repro only happens with audio+video variants in which we only adapt one
3189
- // type. This test covers https://github.com/google/shaka-player/issues/954
3230
+ // type. This test covers https://github.com/shaka-project/shaka-player/issues/954
3190
3231
 
3191
3232
  manifest = shaka.test.ManifestGenerator.generate((manifest) => {
3192
3233
  manifest.addVariant(0, (variant) => {
@@ -3268,7 +3309,7 @@ describe('Player', () => {
3268
3309
 
3269
3310
  describe('load', () => {
3270
3311
  it('tolerates bandwidth of NaN, undefined, or 0', async () => {
3271
- // Regression test for https://github.com/google/shaka-player/issues/938
3312
+ // Regression test for https://github.com/shaka-project/shaka-player/issues/938
3272
3313
  manifest = shaka.test.ManifestGenerator.generate((manifest) => {
3273
3314
  manifest.addVariant(0, (variant) => {
3274
3315
  variant.bandwidth = /** @type {?} */(undefined);
@@ -4,14 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- goog.require('goog.asserts');
8
- goog.require('shaka.routing.Walker');
9
- goog.require('shaka.test.Util');
10
- goog.require('shaka.util.AbortableOperation');
11
- goog.require('shaka.util.Error');
12
- goog.require('shaka.util.PublicPromise');
13
- goog.requireType('shaka.routing.Node');
14
-
15
7
  describe('Walker', () => {
16
8
  const AbortableOperation = shaka.util.AbortableOperation;
17
9
 
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <!--Generated with https://github.com/google/shaka-packager version v2.4.1-c731217-release-->
2
+ <!--Generated with https://github.com/shaka-project/shaka-packager version v2.4.1-c731217-release-->
3
3
  <MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT60S">
4
4
  <Period id="0">
5
5
  <!-- This comment is very long:
package/test/test/boot.js CHANGED
@@ -4,18 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- goog.require('goog.asserts');
8
- goog.require('shaka.Player');
9
- goog.require('shaka.log');
10
- goog.require('shaka.polyfill');
11
- goog.require('shaka.util.Error');
12
- goog.require('shaka.util.Platform');
13
-
14
- // If ENABLE_DEBUG_LOADER is not set to false, goog.require() will try to load
15
- // extra sources on-the-fly using pre-computed pathes in deps.js, which is not
16
- // applicable for the tests.
17
- goog['ENABLE_DEBUG_LOADER'] = false;
18
-
19
7
  /**
20
8
  * Gets the value of an argument passed from karma.
21
9
  * @param {string} name
@@ -384,9 +372,10 @@ function configureJasmineEnvironment() {
384
372
  };
385
373
  }
386
374
 
387
- // Executed before test utilities and tests are loaded, but after Shaka Player
388
- // is loaded in uncompiled mode.
389
- try {
375
+ /**
376
+ * Set up the Shaka Player test environment.
377
+ */
378
+ function setupTestEnvironment() {
390
379
  failTestsOnFailedAssertions();
391
380
  failTestsOnNamespacedElementOrAttributeNames();
392
381
  failTestsOnUnhandledRejections();
@@ -399,12 +388,76 @@ try {
399
388
  shaka.polyfill.installAll();
400
389
 
401
390
  configureJasmineEnvironment();
391
+ }
402
392
 
403
- // eslint-disable-next-line no-restricted-syntax
404
- } catch (error) {
405
- // Throw this boot-sequence error in place of jasmine's execute method, to
406
- // fail clearly and right away without running any tests.
407
- jasmine.getEnv().execute = () => {
408
- throw error;
409
- };
393
+ /**
394
+ * Load a script dynamically and await completion.
395
+ *
396
+ * @param {string} file
397
+ * @return {!Promise}
398
+ */
399
+ function loadScript(file) {
400
+ return new Promise((resolve, reject) => {
401
+ const script = /** @type {!HTMLScriptElement} */(
402
+ document.createElement('script'));
403
+ script.defer = false;
404
+ script['async'] = false;
405
+ script.onload = resolve;
406
+ script.onerror = reject;
407
+ script.setAttribute('src', '/base/' + file);
408
+ document.head.appendChild(script);
409
+ });
410
410
  }
411
+
412
+ /**
413
+ * Load all test scripts and await completion.
414
+ *
415
+ * @return {!Promise}
416
+ */
417
+ function loadTests() {
418
+ const loadPromises = [];
419
+ for (const file of getClientArg('testFiles')) {
420
+ loadPromises.push(loadScript(file));
421
+ }
422
+ return Promise.all(loadPromises);
423
+ }
424
+
425
+ // Hijack Karma's start() method and start things our way.
426
+ // eslint-disable-next-line no-restricted-syntax
427
+ const originalStart = window.__karma__.start.bind(window.__karma__);
428
+ window.__karma__.start = async () => {
429
+ // Executed when Karma has finished loading everything it loads for us.
430
+ // Those things were all loaded in parallel, and had no interdependencies
431
+ // other than those in the Shaka Player library, tracked by the Closure
432
+ // library's goog.require/goog.provide.
433
+
434
+ // Now we load the tests from here, rather than letting Karma do it. This
435
+ // give us control over the order, so that everything else is loaded and
436
+ // complete before any tests are requested. Then we may reference test
437
+ // utilities and library namespaces in the body of describe() blocks, which
438
+ // are executed synchronously as the test scripts are loaded. Without this
439
+ // ordering, we would have to either:
440
+ // 1. very carefully avoid references in describe() and defer them to
441
+ // beforeAll()
442
+ // or 2. strictly adopt goog.provide/goog.require throughout our tests
443
+ // In those scenarios, failure to do so would only manifest some of the time
444
+ // and on certain platforms. So this seems to be the more robust solution.
445
+
446
+ // See https://github.com/shaka-project/shaka-player/issues/4094
447
+
448
+ try {
449
+ setupTestEnvironment();
450
+ console.log('Set up test environment.');
451
+ await loadTests();
452
+ console.log('Loaded all tests.');
453
+
454
+ // eslint-disable-next-line no-restricted-syntax
455
+ } catch (error) {
456
+ console.error('Error during setup:', error);
457
+ window.__karma__.error(error);
458
+ return;
459
+ }
460
+
461
+ // Finally, start the tests.
462
+ originalStart();
463
+ };
@@ -343,7 +343,7 @@ jasmine.Spy.prototype.and;
343
343
  /**
344
344
  * @param {string} name
345
345
  * @return {!jasmine.Spy}
346
- * @see https://github.com/google/closure-compiler/issues/1422
346
+ * @see https://github.com/shaka-project/closure-compiler/issues/1422
347
347
  */
348
348
  jasmine.createSpy = function(name) {};
349
349
 
@@ -360,7 +360,7 @@ jasmine.createSpyObj = function(name, members) {};
360
360
  * @param {*} obj
361
361
  * @param {string} name
362
362
  * @return {!jasmine.Spy}
363
- * @see https://github.com/google/closure-compiler/issues/1422
363
+ * @see https://github.com/shaka-project/closure-compiler/issues/1422
364
364
  */
365
365
  var spyOn = function(obj, name) {};
366
366
 
@@ -20,3 +20,7 @@ __karma__.config = {};
20
20
 
21
21
  /** @const {!Array.<*>} */
22
22
  __karma__.config.args;
23
+
24
+
25
+ /** @param {?} error */
26
+ __karma__.error = function(error) {};
@@ -0,0 +1,10 @@
1
+ /*! @license
2
+ * Shaka Player
3
+ * Copyright 2016 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ // Define the shaka.test namespace before we load the test utilities.
8
+ // Without goog.provide in the test utils, this has to be explicit and come
9
+ // before we load the utils.
10
+ shaka.test = {};
@@ -4,14 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- goog.provide('shaka.test.CannedIDB');
8
-
9
- goog.require('shaka.log');
10
- goog.require('shaka.offline.indexeddb.DBOperation');
11
- goog.require('shaka.util.BufferUtils');
12
- goog.require('shaka.util.Uint8ArrayUtils');
13
-
14
-
15
7
  /**
16
8
  * A testing utility that can be used to dump and restore entire IndexedDB
17
9
  * databases. This can be inserted into a running app to snapshot databases
@@ -4,12 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- goog.provide('shaka.test.CeaUtils');
8
-
9
- goog.require('shaka.cea.CeaUtils');
10
- goog.require('shaka.text.Cue');
11
-
12
-
13
7
  /**
14
8
  * Testing helpers to assist tests for Closed Caption decoders for CEA captions.
15
9
  */
@@ -4,19 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- goog.provide('shaka.test.Dash');
8
-
9
- goog.require('goog.asserts');
10
- goog.require('shaka.dash.DashParser');
11
- goog.require('shaka.test.FakeNetworkingEngine');
12
- goog.require('shaka.test.ManifestParser');
13
- goog.require('shaka.test.Util');
14
- goog.require('shaka.util.PlayerConfiguration');
15
- goog.require('shaka.util.StringUtils');
16
- goog.requireType('shaka.media.SegmentReference');
17
- goog.requireType('shaka.util.Error');
18
-
19
-
20
7
  /** @summary Utilities for working with the DASH parser. */
21
8
  shaka.test.Dash = class {
22
9
  /**
@@ -4,9 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- goog.provide('shaka.test.FakeAd');
8
-
9
-
10
7
  /**
11
8
  * @implements {shaka.extern.IAd}
12
9
  */
@@ -4,15 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- goog.provide('shaka.test.FakeAdManager');
8
-
9
- goog.require('shaka.ads.AdManager');
10
- goog.require('shaka.ads.AdsStats');
11
- goog.require('shaka.util.FakeEvent');
12
- goog.require('shaka.util.FakeEventTarget');
13
- goog.requireType('shaka.test.FakeAd');
14
-
15
-
16
7
  /**
17
8
  * @implements {shaka.extern.IAdManager}
18
9
  * @final
@@ -4,11 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- goog.provide('shaka.test.FakeDemoMain');
8
-
9
- goog.require('shaka.Player');
10
-
11
-
12
7
  /**
13
8
  * @summary
14
9
  * This simulates the interface between ShakaDemoMain and the various tabs.
@@ -4,12 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- goog.provide('shaka.test.FakeDrmEngine');
8
-
9
- goog.require('shaka.media.DrmEngine');
10
- goog.require('shaka.test.Util');
11
-
12
-
13
7
  /**
14
8
  * A fake DrmEngine.
15
9
  *
@@ -4,13 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- goog.provide('shaka.test.FakeMediaSourceEngine');
8
-
9
- goog.require('shaka.media.MediaSourceEngine');
10
- goog.require('shaka.test.FakeTextDisplayer');
11
- goog.require('shaka.util.ManifestParserUtils');
12
-
13
-
14
7
  /**
15
8
  * @summary
16
9
  * This simulates multiple SourceBuffers. However, it only
@@ -114,8 +107,8 @@ shaka.test.FakeMediaSourceEngine = class {
114
107
 
115
108
  /** @type {!jasmine.Spy} */
116
109
  this.setStreamProperties = jasmine.createSpy('setStreamProperties')
117
- .and.callFake((type, offset, end) =>
118
- this.setStreamPropertiesImpl_(type, offset, end));
110
+ .and.callFake((type, offset, end, sequenceMode) =>
111
+ this.setStreamPropertiesImpl_(type, offset, end, sequenceMode));
119
112
 
120
113
  /** @type {!jasmine.Spy} */
121
114
  this.remove = jasmine.createSpy('remove')
@@ -132,6 +125,10 @@ shaka.test.FakeMediaSourceEngine = class {
132
125
  this.getTextDisplayer =
133
126
  jasmine.createSpy('getTextDisplayer')
134
127
  .and.returnValue(new shaka.test.FakeTextDisplayer());
128
+
129
+ /** @type {!jasmine.Spy} */
130
+ this.setSegmentRelativeVttTiming =
131
+ jasmine.createSpy('setSegmentRelativeVttTiming').and.stub();
135
132
  }
136
133
 
137
134
  /** @override */
@@ -362,14 +359,17 @@ shaka.test.FakeMediaSourceEngine = class {
362
359
  * @param {string} type
363
360
  * @param {number} offset
364
361
  * @param {number} appendWindowEnd
362
+ * @param {boolean} sequenceMode
365
363
  * @return {!Promise}
366
364
  * @private
367
365
  */
368
- setStreamPropertiesImpl_(type, offset, appendWindowEnd) {
366
+ setStreamPropertiesImpl_(type, offset, appendWindowEnd, sequenceMode) {
369
367
  if (!this.segments[type]) {
370
368
  throw new Error('unexpected type');
371
369
  }
372
- this.timestampOffsets_[type] = offset;
370
+ if (!sequenceMode) {
371
+ this.timestampOffsets_[type] = offset;
372
+ }
373
373
  // Don't use |appendWindowEnd|.
374
374
  return Promise.resolve();
375
375
  }
@@ -4,11 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- goog.provide('shaka.test.FakeNetworkingEngine');
8
-
9
- /** @fileoverview @suppress {missingRequire} */
10
-
11
-
12
7
  /**
13
8
  * A fake networking engine that returns constant data. The request member
14
9
  * is a jasmine spy and can be used to check the actual calls that occurred.
@@ -4,11 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- goog.provide('shaka.test.FakeTextDisplayer');
8
-
9
- goog.require('shaka.test.Util');
10
-
11
-
12
7
  /**
13
8
  * @implements {shaka.extern.TextDisplayer}
14
9
  * @final