shaka-player 3.1.4 → 3.1.7

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 (332) hide show
  1. package/.csslintrc +11 -1
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
  3. package/.github/workflows/build-and-test.yaml +130 -0
  4. package/.github/workflows/custom-actions/prep-for-appspot/action.yaml +56 -0
  5. package/.github/workflows/custom-actions/set-commit-status/action.yaml +41 -0
  6. package/.github/workflows/demo-version-index.yaml +29 -0
  7. package/.github/workflows/nightly-demo.yaml +42 -0
  8. package/.github/workflows/release-please.yaml +145 -0
  9. package/.github/workflows/safari-homedir-launcher.sh +18 -0
  10. package/.github/workflows/selenium-lab-tests.yaml +93 -0
  11. package/AUTHORS +2 -0
  12. package/CHANGELOG.md +1540 -1474
  13. package/CONTRIBUTING.md +2 -2
  14. package/CONTRIBUTORS +2 -0
  15. package/README.md +7 -7
  16. package/app-engine/README.md +9 -0
  17. package/app-engine/demo-version-index/README.md +14 -0
  18. package/app-engine/demo-version-index/app.yaml +2 -0
  19. package/app-engine/demo-version-index/main.py +162 -0
  20. package/app-engine/demo-version-index/requirements.txt +6 -0
  21. package/app-engine/demo-version-index/templates/index.html +114 -0
  22. package/app-engine/shaka-player-demo/README.md +18 -0
  23. package/app-engine/shaka-player-demo/app.yaml +61 -0
  24. package/app-engine/shaka-player-demo/main.py +95 -0
  25. package/app-engine/shaka-player-demo/posters/10yo.png +0 -0
  26. package/app-engine/shaka-player-demo/posters/10yo.xcf +0 -0
  27. package/app-engine/shaka-player-demo/posters/1yo.jpg +0 -0
  28. package/app-engine/shaka-player-demo/posters/2yo.png +0 -0
  29. package/app-engine/shaka-player-demo/posters/2yo.xcf +0 -0
  30. package/app-engine/shaka-player-demo/posters/3yo.png +0 -0
  31. package/app-engine/shaka-player-demo/posters/3yo.xcf +0 -0
  32. package/app-engine/shaka-player-demo/posters/4yo.png +0 -0
  33. package/app-engine/shaka-player-demo/posters/4yo.xcf +0 -0
  34. package/app-engine/shaka-player-demo/posters/5yo.png +0 -0
  35. package/app-engine/shaka-player-demo/posters/5yo.xcf +0 -0
  36. package/app-engine/shaka-player-demo/posters/6yo.png +0 -0
  37. package/app-engine/shaka-player-demo/posters/6yo.xcf +0 -0
  38. package/app-engine/shaka-player-demo/posters/7yo.png +0 -0
  39. package/app-engine/shaka-player-demo/posters/7yo.xcf +0 -0
  40. package/app-engine/shaka-player-demo/posters/8yo.png +0 -0
  41. package/app-engine/shaka-player-demo/posters/8yo.xcf +0 -0
  42. package/app-engine/shaka-player-demo/posters/9yo.png +0 -0
  43. package/app-engine/shaka-player-demo/posters/9yo.xcf +0 -0
  44. package/app-engine/shaka-player-demo/posters/audioOnly.gif +0 -0
  45. package/app-engine/shaka-player-demo/posters/audioRickRoll.gif +0 -0
  46. package/app-engine/shaka-player-demo/posters/colorbars.gif +0 -0
  47. package/app-engine/shaka-player-demo/posters/fireworks.jpg +0 -0
  48. package/app-engine/shaka-player-demo/posters/party-hat.png +0 -0
  49. package/app-engine/shaka-player-demo/posters/sources.txt +46 -0
  50. package/app-engine/shaka-player-demo/posters/standard.png +0 -0
  51. package/app-engine/shaka-player-demo/posters/trek.jpg +0 -0
  52. package/app-engine/shaka-player-demo/posters/valentines.png +0 -0
  53. package/app-engine/shaka-player-demo/posters/zombie.jpg +0 -0
  54. package/app-engine/shaka-player-demo/posters.py +110 -0
  55. package/app-engine/shaka-player-demo/requirements.txt +5 -0
  56. package/app-engine/shaka-player-demo/time.txt +1 -0
  57. package/build/README.md +1 -1
  58. package/build/checkversion.py +1 -1
  59. package/build/conformance.textproto +13 -0
  60. package/build/docker/Dockerfile +20 -0
  61. package/build/docker/docker-compose.yml +10 -0
  62. package/build/gendeps.py +18 -15
  63. package/build/shaka-lab.yaml +163 -0
  64. package/build/shakaBuildHelpers.py +4 -29
  65. package/build/test.py +93 -28
  66. package/build/wrapper.template.js +2 -2
  67. package/demo/TengwarTelcontar.woff2 +0 -0
  68. package/demo/asset_card.js +1 -2
  69. package/demo/cast_receiver/index.html +1 -1
  70. package/demo/cast_receiver/receiver_app.css +14 -14
  71. package/demo/common/assets.js +2 -0
  72. package/demo/config.js +0 -1
  73. package/demo/custom.js +0 -1
  74. package/demo/customWarning.txt +2 -2
  75. package/demo/demo.less +29 -18
  76. package/demo/demo_uncompiled.js +1 -13
  77. package/demo/index.html +1 -1
  78. package/demo/main.js +3 -3
  79. package/dist/controls.css +2 -2
  80. package/dist/controls.css.map +1 -1
  81. package/dist/demo.compiled.debug.js +191 -194
  82. package/dist/demo.compiled.debug.map +4 -4
  83. package/dist/demo.compiled.js +191 -194
  84. package/dist/demo.compiled.map +4 -4
  85. package/dist/demo.css +1 -1
  86. package/dist/demo.css.map +1 -1
  87. package/dist/deps.js +224 -218
  88. package/dist/locales.js +30 -30
  89. package/dist/receiver.compiled.debug.js +43 -45
  90. package/dist/receiver.compiled.debug.map +4 -4
  91. package/dist/receiver.compiled.js +43 -45
  92. package/dist/receiver.compiled.map +4 -4
  93. package/dist/shaka-player.compiled.d.ts +237 -222
  94. package/dist/shaka-player.compiled.debug.d.ts +237 -222
  95. package/dist/shaka-player.compiled.debug.externs.js +20 -3
  96. package/dist/shaka-player.compiled.debug.js +361 -365
  97. package/dist/shaka-player.compiled.debug.map +4 -4
  98. package/dist/shaka-player.compiled.externs.js +20 -3
  99. package/dist/shaka-player.compiled.js +811 -815
  100. package/dist/shaka-player.compiled.map +4 -4
  101. package/dist/shaka-player.ui.d.ts +281 -275
  102. package/dist/shaka-player.ui.debug.d.ts +281 -275
  103. package/dist/shaka-player.ui.debug.externs.js +34 -26
  104. package/dist/shaka-player.ui.debug.js +384 -389
  105. package/dist/shaka-player.ui.debug.map +4 -4
  106. package/dist/shaka-player.ui.externs.js +34 -26
  107. package/dist/shaka-player.ui.js +945 -950
  108. package/dist/shaka-player.ui.map +4 -4
  109. package/docs/design/REDESIGN.md +33 -33
  110. package/docs/design/codec_preferences.md +1 -1
  111. package/docs/design/dash-audio-channels.md +3 -3
  112. package/docs/design/dash-manifests.md +1 -1
  113. package/docs/design/gap-jumping.md +3 -3
  114. package/docs/design/preload.md +2 -2
  115. package/docs/tutorials/faq.md +8 -8
  116. package/docs/tutorials/index.json +1 -0
  117. package/docs/tutorials/plugins.md +3 -3
  118. package/docs/tutorials/selenium-grid-config.md +122 -0
  119. package/docs/tutorials/welcome.md +10 -2
  120. package/externs/shaka/text.js +10 -0
  121. package/karma.conf.js +156 -45
  122. package/lib/abr/simple_abr_manager.js +12 -6
  123. package/lib/ads/ad_manager.js +1 -0
  124. package/lib/cast/cast_proxy.js +6 -4
  125. package/lib/cast/cast_receiver.js +3 -0
  126. package/lib/cea/cea608_data_channel.js +3 -3
  127. package/lib/cea/cea608_memory.js +1 -1
  128. package/lib/cea/cea708_service.js +6 -5
  129. package/lib/cea/cea_decoder.js +1 -1
  130. package/lib/cea/i_caption_decoder.js +2 -3
  131. package/lib/cea/mp4_cea_parser.js +11 -5
  132. package/lib/cea/sei_processor.js +6 -3
  133. package/lib/dash/dash_parser.js +43 -31
  134. package/lib/dash/mpd_utils.js +4 -5
  135. package/lib/dash/segment_list.js +1 -2
  136. package/lib/dash/segment_template.js +3 -3
  137. package/lib/hls/hls_parser.js +11 -9
  138. package/lib/hls/manifest_text_parser.js +4 -3
  139. package/lib/media/adaptation_set.js +1 -2
  140. package/lib/media/closed_caption_parser.js +0 -1
  141. package/lib/media/content_workarounds.js +2 -2
  142. package/lib/media/drm_engine.js +3 -2
  143. package/lib/media/media_source_engine.js +3 -2
  144. package/lib/media/mp4_segment_index_parser.js +1 -4
  145. package/lib/media/playhead.js +2 -2
  146. package/lib/media/presentation_timeline.js +18 -8
  147. package/lib/media/region_observer.js +39 -33
  148. package/lib/media/region_timeline.js +17 -19
  149. package/lib/media/streaming_engine.js +12 -9
  150. package/lib/media/time_ranges_utils.js +1 -3
  151. package/lib/media/video_wrapper.js +1 -1
  152. package/lib/net/networking_engine.js +5 -1
  153. package/lib/offline/storage.js +14 -15
  154. package/lib/player.js +52 -22
  155. package/lib/polyfill/all.js +2 -3
  156. package/lib/polyfill/encryption_scheme.js +1 -1
  157. package/lib/polyfill/media_capabilities.js +32 -17
  158. package/lib/polyfill/mediasource.js +1 -1
  159. package/lib/routing/walker.js +2 -3
  160. package/lib/text/cue.js +7 -1
  161. package/lib/text/simple_text_displayer.js +2 -1
  162. package/lib/text/text_engine.js +1 -1
  163. package/lib/text/ttml_text_parser.js +92 -63
  164. package/lib/text/ui_text_displayer.js +18 -12
  165. package/lib/util/buffer_utils.js +1 -3
  166. package/lib/util/ebml_parser.js +3 -3
  167. package/lib/util/error.js +1 -1
  168. package/lib/util/fake_event_target.js +21 -1
  169. package/lib/util/iterables.js +0 -46
  170. package/lib/util/mp4_box_parsers.js +1 -4
  171. package/lib/util/mp4_parser.js +5 -7
  172. package/lib/util/periods.js +8 -9
  173. package/lib/util/platform.js +3 -3
  174. package/lib/util/pssh.js +1 -4
  175. package/lib/util/stream_utils.js +60 -8
  176. package/lib/util/string_utils.js +3 -5
  177. package/lib/util/uint8array_utils.js +3 -5
  178. package/lib/util/xml_utils.js +34 -7
  179. package/package.json +62 -40
  180. package/roadmap.md +17 -17
  181. package/test/abr/simple_abr_manager_unit.js +3 -8
  182. package/test/ads/ad_manager_unit.js +0 -6
  183. package/test/cast/cast_proxy_unit.js +0 -8
  184. package/test/cast/cast_receiver_integration.js +1 -18
  185. package/test/cast/cast_receiver_unit.js +1 -9
  186. package/test/cast/cast_sender_unit.js +0 -6
  187. package/test/cast/cast_utils_unit.js +0 -13
  188. package/test/cea/cea608_memory_unit.js +0 -5
  189. package/test/cea/cea708_service_unit.js +0 -7
  190. package/test/cea/cea708_window_unit.js +0 -5
  191. package/test/cea/cea_decoder_unit.js +0 -6
  192. package/test/cea/dtvcc_packet_builder_unit.js +0 -3
  193. package/test/cea/dtvcc_packet_unit.js +0 -5
  194. package/test/cea/mp4_cea_parser_unit.js +0 -4
  195. package/test/dash/dash_parser_content_protection_unit.js +1 -10
  196. package/test/dash/dash_parser_live_unit.js +45 -15
  197. package/test/dash/dash_parser_manifest_unit.js +37 -18
  198. package/test/dash/dash_parser_segment_base_unit.js +1 -8
  199. package/test/dash/dash_parser_segment_list_unit.js +1 -7
  200. package/test/dash/dash_parser_segment_template_unit.js +0 -9
  201. package/test/dash/mpd_utils_unit.js +3 -11
  202. package/test/demo/demo_unit.js +0 -5
  203. package/test/deprecate/enforcer_unit.js +0 -4
  204. package/test/deprecate/version_unit.js +0 -2
  205. package/test/hls/hls_live_unit.js +2 -14
  206. package/test/hls/hls_parser_unit.js +76 -15
  207. package/test/hls/manifest_text_parser_unit.js +0 -10
  208. package/test/media/adaptation_set_criteria_unit.js +3 -7
  209. package/test/media/adaptation_set_unit.js +0 -2
  210. package/test/media/buffering_observer_unit.js +1 -4
  211. package/test/media/closed_caption_parser_unit.js +0 -3
  212. package/test/media/drm_engine_integration.js +3 -17
  213. package/test/media/drm_engine_unit.js +7 -26
  214. package/test/media/manifest_parser_unit.js +0 -4
  215. package/test/media/media_source_engine_integration.js +0 -7
  216. package/test/media/media_source_engine_unit.js +1 -14
  217. package/test/media/mp4_segment_index_parser_unit.js +0 -4
  218. package/test/media/play_rate_controller_unit.js +0 -4
  219. package/test/media/playhead_unit.js +8 -16
  220. package/test/media/presentation_timeline_unit.js +4 -7
  221. package/test/media/region_observer_unit.js +40 -10
  222. package/test/media/region_timeline_unit.js +40 -25
  223. package/test/media/segment_index_unit.js +0 -6
  224. package/test/media/segment_reference_unit.js +0 -3
  225. package/test/media/stall_detector_unit.js +0 -5
  226. package/test/media/streaming_engine_integration.js +11 -37
  227. package/test/media/streaming_engine_unit.js +155 -34
  228. package/test/media/time_ranges_utils_unit.js +0 -2
  229. package/test/media/transmuxer_integration.js +0 -6
  230. package/test/media/webm_segment_index_parser_unit.js +0 -4
  231. package/test/net/data_uri_plugin_unit.js +0 -7
  232. package/test/net/http_plugin_unit.js +0 -9
  233. package/test/net/networking_engine_unit.js +0 -11
  234. package/test/offline/download_progress_estimator_unit.js +0 -2
  235. package/test/offline/indexeddb_storage_unit.js +0 -6
  236. package/test/offline/manifest_convert_unit.js +0 -8
  237. package/test/offline/offline_integration.js +1 -10
  238. package/test/offline/offline_manifest_parser_unit.js +0 -6
  239. package/test/offline/offline_scheme_unit.js +0 -8
  240. package/test/offline/offline_uri_unit.js +0 -2
  241. package/test/offline/storage_compatibility_unit.js +1 -14
  242. package/test/offline/storage_integration.js +1 -25
  243. package/test/player_external.js +2 -10
  244. package/test/player_integration.js +21 -28
  245. package/test/player_load_graph_integration.js +1 -6
  246. package/test/player_src_equals_external.js +3 -9
  247. package/test/player_src_equals_integration.js +0 -7
  248. package/test/player_unit.js +57 -42
  249. package/test/routing/walker_unit.js +0 -8
  250. package/test/test/assets/large_file.mpd +1 -1
  251. package/test/test/boot.js +75 -22
  252. package/test/test/externs/jasmine.js +2 -2
  253. package/test/test/externs/karma.js +4 -0
  254. package/test/test/namespace.js +10 -0
  255. package/test/test/util/canned_idb.js +0 -8
  256. package/test/test/util/cea_utils.js +0 -6
  257. package/test/test/util/dash_parser_util.js +0 -13
  258. package/test/test/util/fake_ad.js +0 -3
  259. package/test/test/util/fake_ad_manager.js +0 -9
  260. package/test/test/util/fake_demo_main.js +0 -5
  261. package/test/test/util/fake_drm_engine.js +0 -6
  262. package/test/test/util/fake_media_source_engine.js +0 -7
  263. package/test/test/util/fake_networking_engine.js +0 -5
  264. package/test/test/util/fake_text_displayer.js +0 -5
  265. package/test/test/util/indexeddb_utils.js +1 -10
  266. package/test/test/util/jasmine_fetch.js +0 -1
  267. package/test/test/util/loader.js +0 -18
  268. package/test/test/util/manifest_generator.js +9 -14
  269. package/test/test/util/manifest_parser_util.js +0 -6
  270. package/test/test/util/offline_utils.js +0 -5
  271. package/test/test/util/simple_fakes.js +9 -26
  272. package/test/test/util/stream_generator.js +0 -14
  273. package/test/test/util/streaming_engine_util.js +0 -15
  274. package/test/test/util/test_scheme.js +1 -19
  275. package/test/test/util/ttml_utils.js +79 -0
  276. package/test/test/util/ui_utils.js +0 -9
  277. package/test/test/util/util.js +15 -26
  278. package/test/test/util/waiter.js +84 -43
  279. package/test/text/cue_integration.js +0 -4
  280. package/test/text/lrc_text_parser_unit.js +0 -4
  281. package/test/text/mp4_ttml_parser_unit.js +10 -23
  282. package/test/text/mp4_vtt_parser_unit.js +1 -7
  283. package/test/text/sbv_text_parser_unit.js +0 -4
  284. package/test/text/simple_text_displayer_unit.js +1 -8
  285. package/test/text/srt_text_parser_unit.js +0 -4
  286. package/test/text/ssa_text_parser_unit.js +0 -5
  287. package/test/text/text_engine_unit.js +2 -7
  288. package/test/text/text_track_integration.js +0 -2
  289. package/test/text/ttml_text_parser_unit.js +495 -237
  290. package/test/text/ui_text_displayer_unit.js +44 -41
  291. package/test/text/vtt_text_parser_unit.js +0 -9
  292. package/test/text/web_vtt_generator_unit.js +0 -3
  293. package/test/ui/ad_ui_unit.js +0 -11
  294. package/test/ui/localization_unit.js +0 -3
  295. package/test/ui/text_displayer_layout_unit.js +9 -19
  296. package/test/ui/ui_customization_unit.js +0 -6
  297. package/test/ui/ui_integration.js +0 -16
  298. package/test/ui/ui_unit.js +1 -17
  299. package/test/util/abortable_operation_unit.js +4 -9
  300. package/test/util/array_utils_unit.js +0 -2
  301. package/test/util/buffer_utils_unit.js +0 -2
  302. package/test/util/data_view_reader_unit.js +0 -4
  303. package/test/util/ebml_parser_unit.js +0 -4
  304. package/test/util/event_manager_unit.js +0 -3
  305. package/test/util/fake_event_target_unit.js +0 -5
  306. package/test/util/functional_unit.js +1 -1
  307. package/test/util/iterables_unit.js +0 -64
  308. package/test/util/language_utils_unit.js +0 -3
  309. package/test/util/manifest_parser_utils_unit.js +0 -2
  310. package/test/util/mp4_box_parsers_unit.js +0 -5
  311. package/test/util/mp4_parser_unit.js +0 -4
  312. package/test/util/multi_map_unit.js +0 -3
  313. package/test/util/object_utils_unit.js +0 -2
  314. package/test/util/periods_unit.js +14 -7
  315. package/test/util/pssh_unit.js +0 -5
  316. package/test/util/state_history_unit.js +0 -2
  317. package/test/util/stream_utils_unit.js +38 -37
  318. package/test/util/string_utils_unit.js +0 -6
  319. package/test/util/text_parser_unit.js +0 -2
  320. package/test/util/xml_utils_unit.js +0 -4
  321. package/ui/controls.js +3 -0
  322. package/ui/less/ad_controls.less +4 -4
  323. package/ui/less/buttons.less +5 -9
  324. package/ui/less/containers.less +5 -7
  325. package/ui/less/overflow_menu.less +4 -4
  326. package/ui/less/range_elements.less +5 -0
  327. package/ui/locales/sjn-translations.yaml +257 -0
  328. package/ui/locales/sjn.json +42 -0
  329. package/ui/localization.js +12 -36
  330. package/ui/text_selection.js +1 -0
  331. package/externs/media_capabilities.js +0 -16
  332. package/externs/svgelement.js +0 -18
@@ -8,16 +8,19 @@ goog.provide('shaka.media.RegionObserver');
8
8
 
9
9
  goog.require('shaka.media.IPlayheadObserver');
10
10
  goog.require('shaka.media.RegionTimeline');
11
+ goog.require('shaka.util.EventManager');
12
+ goog.require('shaka.util.FakeEvent');
13
+ goog.require('shaka.util.FakeEventTarget');
11
14
 
12
15
 
13
16
  /**
14
17
  * The region observer watches a region timeline and playhead, and fires events
15
- * (onEnter, onExit, and onSkip) as the playhead moves.
18
+ * ('enter', 'exit', 'skip') as the playhead moves.
16
19
  *
17
20
  * @implements {shaka.media.IPlayheadObserver}
18
21
  * @final
19
22
  */
20
- shaka.media.RegionObserver = class {
23
+ shaka.media.RegionObserver = class extends shaka.util.FakeEventTarget {
21
24
  /**
22
25
  * Create a region observer for the given timeline. The observer does not
23
26
  * own the timeline, only uses it. This means that the observer should NOT
@@ -26,6 +29,8 @@ shaka.media.RegionObserver = class {
26
29
  * @param {!shaka.media.RegionTimeline} timeline
27
30
  */
28
31
  constructor(timeline) {
32
+ super();
33
+
29
34
  /** @private {shaka.media.RegionTimeline} */
30
35
  this.timeline_ = timeline;
31
36
 
@@ -39,13 +44,6 @@ shaka.media.RegionObserver = class {
39
44
  */
40
45
  this.oldPosition_ = new Map();
41
46
 
42
- /** @private {shaka.media.RegionObserver.EventListener} */
43
- this.onEnter_ = (region, seeking) => {};
44
- /** @private {shaka.media.RegionObserver.EventListener} */
45
- this.onExit_ = (region, seeking) => {};
46
- /** @private {shaka.media.RegionObserver.EventListener} */
47
- this.onSkip_ = (region, seeking) => {};
48
-
49
47
  // To make the rules easier to read, alias all the relative positions.
50
48
  const RelativePosition = shaka.media.RegionObserver.RelativePosition_;
51
49
  const BEFORE_THE_REGION = RelativePosition.BEFORE_THE_REGION;
@@ -62,39 +60,48 @@ shaka.media.RegionObserver = class {
62
60
  {
63
61
  weWere: null,
64
62
  weAre: IN_THE_REGION,
65
- invoke: (region, seeking) => this.onEnter_(region, seeking),
63
+ invoke: (region, seeking) => this.onEvent_('enter', region, seeking),
66
64
  },
67
65
  {
68
66
  weWere: BEFORE_THE_REGION,
69
67
  weAre: IN_THE_REGION,
70
- invoke: (region, seeking) => this.onEnter_(region, seeking),
68
+ invoke: (region, seeking) => this.onEvent_('enter', region, seeking),
71
69
  },
72
70
  {
73
71
  weWere: AFTER_THE_REGION,
74
72
  weAre: IN_THE_REGION,
75
- invoke: (region, seeking) => this.onEnter_(region, seeking),
73
+ invoke: (region, seeking) => this.onEvent_('enter', region, seeking),
76
74
  },
77
75
  {
78
76
  weWere: IN_THE_REGION,
79
77
  weAre: BEFORE_THE_REGION,
80
- invoke: (region, seeking) => this.onExit_(region, seeking),
78
+ invoke: (region, seeking) => this.onEvent_('exit', region, seeking),
81
79
  },
82
80
  {
83
81
  weWere: IN_THE_REGION,
84
82
  weAre: AFTER_THE_REGION,
85
- invoke: (region, seeking) => this.onExit_(region, seeking),
83
+ invoke: (region, seeking) => this.onEvent_('exit', region, seeking),
86
84
  },
87
85
  {
88
86
  weWere: BEFORE_THE_REGION,
89
87
  weAre: AFTER_THE_REGION,
90
- invoke: (region, seeking) => this.onSkip_(region, seeking),
88
+ invoke: (region, seeking) => this.onEvent_('skip', region, seeking),
91
89
  },
92
90
  {
93
91
  weWere: AFTER_THE_REGION,
94
92
  weAre: BEFORE_THE_REGION,
95
- invoke: (region, seeking) => this.onSkip_(region, seeking),
93
+ invoke: (region, seeking) => this.onEvent_('skip', region, seeking),
96
94
  },
97
95
  ];
96
+
97
+ /** @private {shaka.util.EventManager} */
98
+ this.eventManager_ = new shaka.util.EventManager();
99
+
100
+ this.eventManager_.listen(this.timeline_, 'regionremove', (event) => {
101
+ /** @type {shaka.extern.TimelineRegionInfo} */
102
+ const region = event['region'];
103
+ this.oldPosition_.delete(region);
104
+ });
98
105
  }
99
106
 
100
107
  /** @override */
@@ -105,11 +112,10 @@ shaka.media.RegionObserver = class {
105
112
  // needed.
106
113
  this.oldPosition_.clear();
107
114
 
108
- // Clear the callbacks so that we don't hold onto any references external
109
- // to this class.
110
- this.onEnter_ = (region, seeking) => {};
111
- this.onExit_ = (region, seeking) => {};
112
- this.onSkip_ = (region, seeking) => {};
115
+ this.eventManager_.release();
116
+ this.eventManager_ = null;
117
+
118
+ super.release();
113
119
  }
114
120
 
115
121
  /** @override */
@@ -134,20 +140,20 @@ shaka.media.RegionObserver = class {
134
140
  }
135
141
 
136
142
  /**
137
- * Set all the listeners. This overrides any previous calls to |setListeners|.
143
+ * Dispatch events of the given type. All event types in this class have the
144
+ * same parameters: region and seeking.
138
145
  *
139
- * @param {shaka.media.RegionObserver.EventListener} onEnter
140
- * The callback for when we move from outside a region to inside a region.
141
- * @param {shaka.media.RegionObserver.EventListener} onExit
142
- * The callback for when we move from inside a region to outside a region.
143
- * @param {shaka.media.RegionObserver.EventListener} onSkip
144
- * The callback for when we move from before to after a region or from
145
- * after to before a region.
146
+ * @param {string} eventType
147
+ * @param {shaka.extern.TimelineRegionInfo} region
148
+ * @param {boolean} seeking
149
+ * @private
146
150
  */
147
- setListeners(onEnter, onExit, onSkip) {
148
- this.onEnter_ = onEnter;
149
- this.onExit_ = onExit;
150
- this.onSkip_ = onSkip;
151
+ onEvent_(eventType, region, seeking) {
152
+ const event = new shaka.util.FakeEvent(eventType, new Map([
153
+ ['region', region],
154
+ ['seeking', seeking],
155
+ ]));
156
+ this.dispatchEvent(event);
151
157
  }
152
158
 
153
159
  /**
@@ -6,26 +6,30 @@
6
6
 
7
7
  goog.provide('shaka.media.RegionTimeline');
8
8
 
9
+ goog.require('shaka.util.FakeEvent');
10
+ goog.require('shaka.util.FakeEventTarget');
9
11
  goog.require('shaka.util.IReleasable');
10
12
  goog.require('shaka.util.Timer');
11
13
 
12
14
 
13
15
  /**
14
16
  * The region timeline is a set of unique timeline region info entries. When
15
- * a new entry is added, the |onAddRegion| callback will be called.
17
+ * a new entry is added, the 'regionadd' event will be fired. When an entry is
18
+ * deleted, the 'regionremove' event will be fired.
16
19
  *
17
20
  * @implements {shaka.util.IReleasable}
18
21
  * @final
19
22
  */
20
- shaka.media.RegionTimeline = class {
23
+ shaka.media.RegionTimeline = class extends shaka.util.FakeEventTarget {
21
24
  /**
22
25
  * @param {!function():{start: number, end: number}} getSeekRange
23
26
  */
24
27
  constructor(getSeekRange) {
25
- /** @private {function(shaka.extern.TimelineRegionInfo)} */
26
- this.onAddRegion_ = (region) => {};
28
+ super();
29
+
27
30
  /** @private {!Set.<shaka.extern.TimelineRegionInfo>} */
28
31
  this.regions_ = new Set();
32
+
29
33
  /** @private {!function():{start: number, end: number}} */
30
34
  this.getSeekRange_ = getSeekRange;
31
35
 
@@ -44,22 +48,9 @@ shaka.media.RegionTimeline = class {
44
48
 
45
49
  /** @override */
46
50
  release() {
47
- // Prevent us from holding onto any external references via the callback.
48
- this.onAddRegion_ = (region) => {};
49
51
  this.regions_.clear();
50
52
  this.filterTimer_.stop();
51
- }
52
-
53
- /**
54
- * Set the callbacks for events. This will override any previous calls to
55
- * |setListeners|.
56
- *
57
- * @param {function(shaka.extern.TimelineRegionInfo)} onAddRegion
58
- * Set the callback for when we add a new region. This callback will only
59
- * be called when a region is unique (we reject duplicate regions).
60
- */
61
- setListeners(onAddRegion) {
62
- this.onAddRegion_ = onAddRegion;
53
+ super.release();
63
54
  }
64
55
 
65
56
  /**
@@ -72,7 +63,10 @@ shaka.media.RegionTimeline = class {
72
63
  // instead of making the parser track it.
73
64
  if (similarRegion == null) {
74
65
  this.regions_.add(region);
75
- this.onAddRegion_(region);
66
+ const event = new shaka.util.FakeEvent('regionadd', new Map([
67
+ ['region', region],
68
+ ]));
69
+ this.dispatchEvent(event);
76
70
  }
77
71
  }
78
72
 
@@ -89,6 +83,10 @@ shaka.media.RegionTimeline = class {
89
83
  // reson to store or process them.
90
84
  if (region.endTime < seekRange.start) {
91
85
  this.regions_.delete(region);
86
+ const event = new shaka.util.FakeEvent('regionremove', new Map([
87
+ ['region', region],
88
+ ]));
89
+ this.dispatchEvent(event);
92
90
  }
93
91
  }
94
92
  }
@@ -623,7 +623,7 @@ shaka.media.StreamingEngine = class {
623
623
 
624
624
  // Don't clear the buffer unless something is buffered. This extra
625
625
  // check prevents extra, useless calls to clear the buffer.
626
- if (somethingBuffered) {
626
+ if (somethingBuffered || mediaState.performingUpdate) {
627
627
  this.forceClearBuffer_(mediaState);
628
628
  streamCleared = true;
629
629
  }
@@ -669,7 +669,7 @@ shaka.media.StreamingEngine = class {
669
669
 
670
670
  if (mediaState.waitingToClearBuffer) {
671
671
  // May not be performing an update, but an update will still happen.
672
- // See: https://github.com/google/shaka-player/issues/334
672
+ // See: https://github.com/shaka-project/shaka-player/issues/334
673
673
  shaka.log.debug(logPrefix, 'clear: already waiting');
674
674
  return;
675
675
  }
@@ -909,9 +909,9 @@ shaka.media.StreamingEngine = class {
909
909
  // buffering forever at the end.
910
910
  // We should only do this if the duration needs to shrink.
911
911
  // Growing it by less than 1ms can actually cause buffering on
912
- // replay, as in https://github.com/google/shaka-player/issues/979
912
+ // replay, as in https://github.com/shaka-project/shaka-player/issues/979
913
913
  // On some platforms, this can spuriously be 0, so ignore this case.
914
- // https://github.com/google/shaka-player/issues/1967,
914
+ // https://github.com/shaka-project/shaka-player/issues/1967,
915
915
  const duration = this.playerInterface_.mediaSourceEngine.getDuration();
916
916
  if (duration != 0 &&
917
917
  duration < this.manifest_.presentationTimeline.getDuration()) {
@@ -977,7 +977,10 @@ shaka.media.StreamingEngine = class {
977
977
  unscaledBufferingGoal * this.bufferingGoalScale_;
978
978
 
979
979
  // Check if we've buffered to the end of the presentation.
980
- if (timeNeeded >= this.manifest_.presentationTimeline.getDuration()) {
980
+ const timeUntilEnd =
981
+ this.manifest_.presentationTimeline.getDuration() - timeNeeded;
982
+ const oneMicrosecond = 1e-6;
983
+ if (timeUntilEnd < oneMicrosecond) {
981
984
  // We shouldn't rebuffer if the playhead is close to the end of the
982
985
  // presentation.
983
986
  shaka.log.debug(logPrefix, 'buffered to end of presentation');
@@ -1641,7 +1644,7 @@ shaka.media.StreamingEngine = class {
1641
1644
  // See DASH sec. 5.10.3.3.1
1642
1645
  // If a DASH client detects an event message box with a scheme that is not
1643
1646
  // defined in MPD, the client is expected to ignore it.
1644
- if (emsgSchemeIdUris.includes(schemeId)) {
1647
+ if (emsgSchemeIdUris && emsgSchemeIdUris.includes(schemeId)) {
1645
1648
  // See DASH sec. 5.10.4.1
1646
1649
  // A special scheme in DASH used to signal manifest updates.
1647
1650
  if (schemeId == 'urn:mpeg:dash:event:2012') {
@@ -1699,7 +1702,7 @@ shaka.media.StreamingEngine = class {
1699
1702
  const bufferedBehind = presentationTime - startTime;
1700
1703
 
1701
1704
  const overflow = bufferedBehind - bufferBehind;
1702
- // See: https://github.com/google/shaka-player/issues/2982
1705
+ // See: https://github.com/shaka-project/shaka-player/issues/2982
1703
1706
  if (overflow <= 0.01) {
1704
1707
  shaka.log.v2(logPrefix,
1705
1708
  'buffer behind okay:',
@@ -2038,7 +2041,7 @@ shaka.media.StreamingEngine.MediaState_;
2038
2041
  * of the Period.
2039
2042
  *
2040
2043
  * NOTE: This was increased as part of the solution to
2041
- * https://github.com/google/shaka-player/issues/1281
2044
+ * https://github.com/shaka-project/shaka-player/issues/1281
2042
2045
  *
2043
2046
  * @const {number}
2044
2047
  * @private
@@ -2052,7 +2055,7 @@ shaka.media.StreamingEngine.APPEND_WINDOW_START_FUDGE_ = 0.1;
2052
2055
  * the Period. This rounding error could then create an artificial gap and a
2053
2056
  * stutter when the gap-jumping logic takes over.
2054
2057
  *
2055
- * https://github.com/google/shaka-player/issues/1597
2058
+ * https://github.com/shaka-project/shaka-player/issues/1597
2056
2059
  *
2057
2060
  * @const {number}
2058
2061
  * @private
@@ -6,8 +6,6 @@
6
6
 
7
7
  goog.provide('shaka.media.TimeRangesUtils');
8
8
 
9
- goog.require('shaka.util.Iterables');
10
-
11
9
 
12
10
  /**
13
11
  * @summary A set of utility functions for dealing with TimeRanges objects.
@@ -157,7 +155,7 @@ shaka.media.TimeRangesUtils = class {
157
155
  return [];
158
156
  }
159
157
  const ret = [];
160
- for (const i of shaka.util.Iterables.range(b.length)) {
158
+ for (let i = 0; i < b.length; i++) {
161
159
  ret.push({start: b.start(i), end: b.end(i)});
162
160
  }
163
161
  return ret;
@@ -141,7 +141,7 @@ shaka.media.VideoWrapper = class {
141
141
  // TODO: Need further investigation why it happens. Before and after
142
142
  // setting the current time, video.readyState is 1, video.paused is true,
143
143
  // and video.buffered's TimeRanges length is 0.
144
- // See: https://github.com/google/shaka-player/issues/1298
144
+ // See: https://github.com/shaka-project/shaka-player/issues/1298
145
145
  this.mover_.moveTo(
146
146
  this.video_.currentTime == 0 ?
147
147
  startTime :
@@ -222,6 +222,10 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
222
222
  this.destroyed_ = true;
223
223
  this.requestFilters_.clear();
224
224
  this.responseFilters_.clear();
225
+
226
+ // FakeEventTarget implements IReleasable
227
+ super.release();
228
+
225
229
  return this.operationManager_.destroy();
226
230
  }
227
231
 
@@ -417,7 +421,7 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
417
421
  }
418
422
 
419
423
  // Schemes are meant to be case-insensitive.
420
- // See https://github.com/google/shaka-player/issues/2173
424
+ // See https://github.com/shaka-project/shaka-player/issues/2173
421
425
  // and https://tools.ietf.org/html/rfc3986#section-3.1
422
426
  scheme = scheme.toLowerCase();
423
427
 
@@ -477,23 +477,22 @@ shaka.offline.Storage = class {
477
477
  * @private
478
478
  */
479
479
  async filterManifest_(manifest, drmEngine, config) {
480
- const StreamUtils = shaka.util.StreamUtils;
481
-
482
480
  // Filter the manifest based on the restrictions given in the player
483
481
  // configuration.
484
482
  const maxHwRes = {width: Infinity, height: Infinity};
485
- StreamUtils.filterByRestrictions(manifest, config.restrictions, maxHwRes);
483
+ shaka.util.StreamUtils.filterByRestrictions(
484
+ manifest, config.restrictions, maxHwRes);
486
485
 
487
486
  // Filter the manifest based on what we know media source will be able to
488
487
  // play later (no point storing something we can't play).
489
488
  if (config.useMediaCapabilities) {
490
- StreamUtils.filterManifestByMediaCapabilities(
489
+ await shaka.util.StreamUtils.filterManifestByMediaCapabilities(
491
490
  manifest, config.offline.usePersistentLicense);
492
491
  } else {
493
- StreamUtils.filterManifestByMediaSource(manifest);
492
+ shaka.util.StreamUtils.filterManifestByMediaSource(manifest);
494
493
  // Filter the manifest based on what we know our drm system will support
495
494
  // playing later.
496
- StreamUtils.filterManifestByDrm(manifest, drmEngine);
495
+ shaka.util.StreamUtils.filterManifestByDrm(manifest, drmEngine);
497
496
  }
498
497
 
499
498
  // Gather all tracks.
@@ -501,23 +500,23 @@ shaka.offline.Storage = class {
501
500
 
502
501
  // Choose the codec that has the lowest average bandwidth.
503
502
  const preferredAudioChannelCount = config.preferredAudioChannelCount;
504
- StreamUtils.chooseCodecsAndFilterManifest(
503
+ shaka.util.StreamUtils.chooseCodecsAndFilterManifest(
505
504
  manifest, preferredAudioChannelCount);
506
505
 
507
506
  for (const variant of manifest.variants) {
508
507
  goog.asserts.assert(
509
- StreamUtils.isPlayable(variant),
508
+ shaka.util.StreamUtils.isPlayable(variant),
510
509
  'We should have already filtered by "is playable"');
511
510
 
512
- allTracks.push(StreamUtils.variantToTrack(variant));
511
+ allTracks.push(shaka.util.StreamUtils.variantToTrack(variant));
513
512
  }
514
513
 
515
514
  for (const text of manifest.textStreams) {
516
- allTracks.push(StreamUtils.textStreamToTrack(text));
515
+ allTracks.push(shaka.util.StreamUtils.textStreamToTrack(text));
517
516
  }
518
517
 
519
518
  for (const image of manifest.imageStreams) {
520
- allTracks.push(StreamUtils.imageStreamToTrack(image));
519
+ allTracks.push(shaka.util.StreamUtils.imageStreamToTrack(image));
521
520
  }
522
521
 
523
522
  // Let the application choose which tracks to store.
@@ -601,10 +600,10 @@ shaka.offline.Storage = class {
601
600
  storage, drmEngine, manifest, uri, metadata, config, downloader) {
602
601
  const pendingContent = shaka.offline.StoredContentUtils.fromManifest(
603
602
  uri, manifest, /* size= */ 0, metadata);
604
- // In https://github.com/google/shaka-player/issues/2652, we found that this
605
- // callback would be removed by the compiler if we reference the config in
606
- // the onProgress closure below. Reading it into a local variable first
607
- // seems to work around this apparent compiler bug.
603
+ // In https://github.com/shaka-project/shaka-player/issues/2652, we found
604
+ // that this callback would be removed by the compiler if we reference the
605
+ // config in the onProgress closure below. Reading it into a local
606
+ // variable first seems to work around this apparent compiler bug.
608
607
  const progressCallback = config.offline.progressCallback;
609
608
 
610
609
  const onProgress = (progress, size) => {
package/lib/player.js CHANGED
@@ -726,6 +726,9 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
726
726
  await this.networkingEngine_.destroy();
727
727
  this.networkingEngine_ = null;
728
728
  }
729
+
730
+ // FakeEventTarget implements IReleasable
731
+ super.release();
729
732
  }
730
733
 
731
734
  /**
@@ -1627,8 +1630,11 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
1627
1630
  // initialize it now even through it appears a little out-of-place.
1628
1631
  this.regionTimeline_ =
1629
1632
  new shaka.media.RegionTimeline(() => this.seekRange());
1630
- this.regionTimeline_.setListeners(/* onRegionAdded= */ (region) => {
1633
+ this.regionTimeline_.addEventListener('regionadd', (event) => {
1634
+ /** @type {shaka.extern.TimelineRegionInfo} */
1635
+ const region = event['region'];
1631
1636
  this.onRegionEvent_(shaka.Player.EventName.TimelineRegionAdded, region);
1637
+
1632
1638
  if (this.adManager_) {
1633
1639
  this.adManager_.onDashTimedMetadata(region);
1634
1640
  }
@@ -2114,6 +2120,14 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2114
2120
 
2115
2121
  this.playhead_ = new shaka.media.SrcEqualsPlayhead(has.mediaElement);
2116
2122
 
2123
+ // This flag is used below in the language preference setup and
2124
+ // track-management to check if this load was canceled before the necessary
2125
+ // events fired.
2126
+ let unloaded = false;
2127
+ this.cleanupOnUnload_.push(() => {
2128
+ unloaded = true;
2129
+ });
2130
+
2117
2131
  if (has.startTime != null) {
2118
2132
  this.playhead_.setStartTime(has.startTime);
2119
2133
  }
@@ -2141,7 +2155,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2141
2155
 
2142
2156
  // Wait for the 'loadedmetadata' event to measure load() latency, but only
2143
2157
  // if preload is set in a way that would result in this event firing
2144
- // automatically. See https://github.com/google/shaka-player/issues/2483
2158
+ // automatically.
2159
+ // See https://github.com/shaka-project/shaka-player/issues/2483
2145
2160
  if (this.video_.preload != 'none') {
2146
2161
  this.eventManager_.listenOnce(this.video_, 'loadedmetadata', () => {
2147
2162
  const now = Date.now() / 1000;
@@ -2164,6 +2179,12 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2164
2179
  }
2165
2180
  if (this.video_.textTracks) {
2166
2181
  this.eventManager_.listen(this.video_.textTracks, 'addtrack', (e) => {
2182
+ // If we have moved on to another piece of content while waiting for
2183
+ // the above event, we should not process tracks here.
2184
+ if (unloaded) {
2185
+ return;
2186
+ }
2187
+
2167
2188
  this.onTracksChanged_();
2168
2189
  this.processTimedMetadataSrcEqls_(/** @type {!TrackEvent} */(e));
2169
2190
  });
@@ -2205,13 +2226,6 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2205
2226
  fullyLoaded.resolve();
2206
2227
  });
2207
2228
 
2208
- // This flag is used below in the language preference setup to check if this
2209
- // load was canceled before the necessary events fire.
2210
- let unloaded = false;
2211
- this.cleanupOnUnload_.push(() => {
2212
- unloaded = true;
2213
- });
2214
-
2215
2229
  // We can't switch to preferred languages, though, until the data is loaded.
2216
2230
  shaka.util.MediaReadyState.waitForReadyState(this.video_,
2217
2231
  HTMLMediaElement.HAVE_CURRENT_DATA,
@@ -2369,12 +2383,16 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2369
2383
  // In Safari the initial assignment does not always work, so we schedule
2370
2384
  // this process to be repeated several times to ensure that it has been put
2371
2385
  // in the correct mode.
2372
- new shaka.util.Timer(() => {
2386
+ const timer = new shaka.util.Timer(() => {
2373
2387
  const textTracks = this.getMetadataTracks_();
2374
2388
  for (const textTrack of textTracks) {
2375
2389
  textTrack.mode = 'hidden';
2376
2390
  }
2377
- }).tickNow().tickAfter(/* seconds= */ 0.5);
2391
+ }).tickNow().tickAfter(0.5);
2392
+
2393
+ this.cleanupOnUnload_.push(() => {
2394
+ timer.stop();
2395
+ });
2378
2396
  }
2379
2397
 
2380
2398
 
@@ -2519,21 +2537,31 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2519
2537
  // Create the region observer. This will allow us to notify the app when we
2520
2538
  // move in and out of timeline regions.
2521
2539
  const regionObserver = new shaka.media.RegionObserver(this.regionTimeline_);
2522
- const onEnterRegion = (region, seeking) => {
2540
+
2541
+ regionObserver.addEventListener('enter', (event) => {
2542
+ /** @type {shaka.extern.TimelineRegionInfo} */
2543
+ const region = event['region'];
2523
2544
  this.onRegionEvent_(shaka.Player.EventName.TimelineRegionEnter, region);
2524
- };
2525
- const onExitRegion = (region, seeking) => {
2545
+ });
2546
+
2547
+ regionObserver.addEventListener('exit', (event) => {
2548
+ /** @type {shaka.extern.TimelineRegionInfo} */
2549
+ const region = event['region'];
2526
2550
  this.onRegionEvent_(shaka.Player.EventName.TimelineRegionExit, region);
2527
- };
2528
- const onSkipRegion = (region, seeking) => {
2551
+ });
2552
+
2553
+ regionObserver.addEventListener('skip', (event) => {
2554
+ /** @type {shaka.extern.TimelineRegionInfo} */
2555
+ const region = event['region'];
2556
+ /** @type {boolean} */
2557
+ const seeking = event['seeking'];
2529
2558
  // If we are seeking, we don't want to surface the enter/exit events since
2530
2559
  // they didn't play through them.
2531
2560
  if (!seeking) {
2532
2561
  this.onRegionEvent_(shaka.Player.EventName.TimelineRegionEnter, region);
2533
2562
  this.onRegionEvent_(shaka.Player.EventName.TimelineRegionExit, region);
2534
2563
  }
2535
- };
2536
- regionObserver.setListeners(onEnterRegion, onExitRegion, onSkipRegion);
2564
+ });
2537
2565
 
2538
2566
  // Now that we have all our observers, create a manager for them.
2539
2567
  const manager = new shaka.media.PlayheadObserverManager(this.video_);
@@ -3439,7 +3467,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3439
3467
  this.streamingEngine_.switchTextStream(stream);
3440
3468
  this.onTextChanged_();
3441
3469
 
3442
- // Workaround for https://github.com/google/shaka-player/issues/1299
3470
+ // Workaround for
3471
+ // https://github.com/shaka-project/shaka-player/issues/1299
3443
3472
  // When track is selected, back-propagate the language to
3444
3473
  // currentTextLanguage_.
3445
3474
  this.currentTextLanguage_ = stream.language;
@@ -3515,7 +3544,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
3515
3544
  this.switchVariant_(variant, /* fromAdaptation= */ false, clearBuffer,
3516
3545
  safeMargin);
3517
3546
 
3518
- // Workaround for https://github.com/google/shaka-player/issues/1299
3547
+ // Workaround for
3548
+ // https://github.com/shaka-project/shaka-player/issues/1299
3519
3549
  // When track is selected, back-propagate the language to
3520
3550
  // currentAudioLanguage_.
3521
3551
  this.currentAdaptationSetCriteria_ = new shaka.media.ExampleBasedCriteria(
@@ -4838,7 +4868,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
4838
4868
  // If the playback rate changes while seeking, Edge will cache the playback
4839
4869
  // rate and use it after seeking.
4840
4870
  //
4841
- // https://github.com/google/shaka-player/issues/951
4871
+ // https://github.com/shaka-project/shaka-player/issues/951
4842
4872
  if (newRate == 0) {
4843
4873
  return;
4844
4874
  }
@@ -6102,7 +6132,7 @@ shaka.Player.TYPICAL_BUFFERING_THRESHOLD_ = 0.5;
6102
6132
  * @define {string} A version number taken from git at compile time.
6103
6133
  * @export
6104
6134
  */
6105
- shaka.Player.version = 'v3.1.4-uncompiled';
6135
+ shaka.Player.version = 'v3.1.7-uncompiled';
6106
6136
 
6107
6137
  // Initialize the deprecation system using the version string we just set
6108
6138
  // on the player.
@@ -7,7 +7,6 @@
7
7
  goog.provide('shaka.polyfill');
8
8
 
9
9
  goog.require('shaka.log');
10
- goog.require('shaka.util.Iterables');
11
10
 
12
11
 
13
12
  /**
@@ -40,8 +39,8 @@ shaka.polyfill = class {
40
39
  */
41
40
  static register(polyfill, priority) {
42
41
  const newItem = {priority: priority || 0, callback: polyfill};
43
- const enumerate = (it) => shaka.util.Iterables.enumerate(it);
44
- for (const {i, item} of enumerate(shaka.polyfill.polyfills_)) {
42
+ for (let i = 0; i < shaka.polyfill.polyfills_.length; i++) {
43
+ const item = shaka.polyfill.polyfills_[i];
45
44
  if (item.priority < newItem.priority) {
46
45
  shaka.polyfill.polyfills_.splice(i, 0, newItem);
47
46
  return;
@@ -12,7 +12,7 @@ goog.require('shaka.polyfill');
12
12
  * @summary A polyfill to add support for EncryptionScheme queries in EME.
13
13
  * @see https://wicg.github.io/encrypted-media-encryption-scheme/
14
14
  * @see https://github.com/w3c/encrypted-media/pull/457
15
- * @see https://github.com/google/eme-encryption-scheme-polyfill
15
+ * @see https://github.com/shaka-project/eme-encryption-scheme-polyfill
16
16
  * @export
17
17
  */
18
18
  shaka.polyfill.EncryptionScheme = class {