shaka-player 3.1.5 → 3.1.8

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 (331) 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 +147 -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 +1532 -1496
  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/generateTsDefs.py +2 -0
  64. package/build/shaka-lab.yaml +163 -0
  65. package/build/shakaBuildHelpers.py +4 -29
  66. package/build/test.py +93 -28
  67. package/build/wrapper.template.js +2 -2
  68. package/demo/TengwarTelcontar.woff2 +0 -0
  69. package/demo/asset_card.js +1 -2
  70. package/demo/cast_receiver/index.html +1 -1
  71. package/demo/cast_receiver/receiver_app.css +14 -14
  72. package/demo/common/assets.js +2 -0
  73. package/demo/config.js +0 -1
  74. package/demo/custom.js +0 -1
  75. package/demo/customWarning.txt +2 -2
  76. package/demo/demo.less +29 -18
  77. package/demo/demo_uncompiled.js +1 -13
  78. package/demo/index.html +1 -1
  79. package/demo/main.js +3 -3
  80. package/dist/controls.css +2 -2
  81. package/dist/controls.css.map +1 -1
  82. package/dist/demo.compiled.debug.js +191 -194
  83. package/dist/demo.compiled.debug.map +4 -4
  84. package/dist/demo.compiled.js +191 -194
  85. package/dist/demo.compiled.map +4 -4
  86. package/dist/demo.css +1 -1
  87. package/dist/demo.css.map +1 -1
  88. package/dist/deps.js +224 -218
  89. package/dist/locales.js +29 -29
  90. package/dist/receiver.compiled.debug.js +43 -45
  91. package/dist/receiver.compiled.debug.map +4 -4
  92. package/dist/receiver.compiled.js +43 -45
  93. package/dist/receiver.compiled.map +4 -4
  94. package/dist/shaka-player.compiled.d.ts +225 -222
  95. package/dist/shaka-player.compiled.debug.d.ts +225 -222
  96. package/dist/shaka-player.compiled.debug.externs.js +9 -3
  97. package/dist/shaka-player.compiled.debug.js +235 -241
  98. package/dist/shaka-player.compiled.debug.map +4 -4
  99. package/dist/shaka-player.compiled.externs.js +9 -3
  100. package/dist/shaka-player.compiled.js +811 -815
  101. package/dist/shaka-player.compiled.map +4 -4
  102. package/dist/shaka-player.ui.d.ts +269 -275
  103. package/dist/shaka-player.ui.debug.d.ts +269 -275
  104. package/dist/shaka-player.ui.debug.externs.js +23 -26
  105. package/dist/shaka-player.ui.debug.js +255 -262
  106. package/dist/shaka-player.ui.debug.map +4 -4
  107. package/dist/shaka-player.ui.externs.js +23 -26
  108. package/dist/shaka-player.ui.js +945 -950
  109. package/dist/shaka-player.ui.map +4 -4
  110. package/docs/design/REDESIGN.md +33 -33
  111. package/docs/design/codec_preferences.md +1 -1
  112. package/docs/design/dash-audio-channels.md +3 -3
  113. package/docs/design/dash-manifests.md +1 -1
  114. package/docs/design/gap-jumping.md +3 -3
  115. package/docs/design/preload.md +2 -2
  116. package/docs/tutorials/faq.md +8 -8
  117. package/docs/tutorials/index.json +1 -0
  118. package/docs/tutorials/plugins.md +3 -3
  119. package/docs/tutorials/selenium-grid-config.md +122 -0
  120. package/docs/tutorials/welcome.md +10 -2
  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 +40 -30
  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 +7 -7
  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 +3 -3
  158. package/lib/polyfill/mediasource.js +1 -1
  159. package/lib/routing/walker.js +2 -3
  160. package/lib/text/cue.js +1 -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 +8 -5
  164. package/lib/text/ui_text_displayer.js +1 -1
  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 +4 -3
  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 +15 -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 +4 -17
  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 +4 -23
  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 +9 -36
  227. package/test/media/streaming_engine_unit.js +11 -35
  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 +52 -37
  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 +0 -2
  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 +0 -6
  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 +2 -11
  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 +3 -8
  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 +6 -6
  323. package/ui/less/buttons.less +6 -6
  324. package/ui/less/containers.less +9 -11
  325. package/ui/less/overflow_menu.less +4 -4
  326. package/ui/less/range_elements.less +7 -2
  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/seek_bar.js +2 -1
  331. package/externs/svgelement.js +0 -18
@@ -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
  }
@@ -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()) {
@@ -1644,7 +1644,7 @@ shaka.media.StreamingEngine = class {
1644
1644
  // See DASH sec. 5.10.3.3.1
1645
1645
  // If a DASH client detects an event message box with a scheme that is not
1646
1646
  // defined in MPD, the client is expected to ignore it.
1647
- if (emsgSchemeIdUris.includes(schemeId)) {
1647
+ if (emsgSchemeIdUris && emsgSchemeIdUris.includes(schemeId)) {
1648
1648
  // See DASH sec. 5.10.4.1
1649
1649
  // A special scheme in DASH used to signal manifest updates.
1650
1650
  if (schemeId == 'urn:mpeg:dash:event:2012') {
@@ -1702,7 +1702,7 @@ shaka.media.StreamingEngine = class {
1702
1702
  const bufferedBehind = presentationTime - startTime;
1703
1703
 
1704
1704
  const overflow = bufferedBehind - bufferBehind;
1705
- // See: https://github.com/google/shaka-player/issues/2982
1705
+ // See: https://github.com/shaka-project/shaka-player/issues/2982
1706
1706
  if (overflow <= 0.01) {
1707
1707
  shaka.log.v2(logPrefix,
1708
1708
  'buffer behind okay:',
@@ -2041,7 +2041,7 @@ shaka.media.StreamingEngine.MediaState_;
2041
2041
  * of the Period.
2042
2042
  *
2043
2043
  * NOTE: This was increased as part of the solution to
2044
- * https://github.com/google/shaka-player/issues/1281
2044
+ * https://github.com/shaka-project/shaka-player/issues/1281
2045
2045
  *
2046
2046
  * @const {number}
2047
2047
  * @private
@@ -2055,7 +2055,7 @@ shaka.media.StreamingEngine.APPEND_WINDOW_START_FUDGE_ = 0.1;
2055
2055
  * the Period. This rounding error could then create an artificial gap and a
2056
2056
  * stutter when the gap-jumping logic takes over.
2057
2057
  *
2058
- * https://github.com/google/shaka-player/issues/1597
2058
+ * https://github.com/shaka-project/shaka-player/issues/1597
2059
2059
  *
2060
2060
  * @const {number}
2061
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.5-uncompiled';
6135
+ shaka.Player.version = 'v3.1.8-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 {
@@ -29,12 +29,12 @@ shaka.polyfill.MediaCapabilities = class {
29
29
  // TODO: re-evaluate MediaCapabilities in the future versions of Chromecast.
30
30
  // Since MediaCapabilities implementation is buggy in Apple browsers, we
31
31
  // should always install polyfill for Apple browsers.
32
- // See: https://github.com/google/shaka-player/issues/3530
32
+ // See: https://github.com/shaka-project/shaka-player/issues/3530
33
33
  // TODO: re-evaluate MediaCapabilities in the future versions of Apple
34
34
  // Browsers.
35
35
  // Since MediaCapabilities implementation is buggy in PS5 browsers, we
36
36
  // should always install polyfill for PS5 browsers.
37
- // See: https://github.com/google/shaka-player/issues/3582
37
+ // See: https://github.com/shaka-project/shaka-player/issues/3582
38
38
  // TODO: re-evaluate MediaCapabilities in the future versions of PS5
39
39
  // Browsers.
40
40
  if (!shaka.util.Platform.isChromecast() &&
@@ -54,7 +54,7 @@ shaka.polyfill.MediaCapabilities = class {
54
54
 
55
55
  // Keep the patched MediaCapabilities object from being garbage-collected in
56
56
  // Safari.
57
- // See https://github.com/google/shaka-player/issues/3696#issuecomment-1009472718
57
+ // See https://github.com/shaka-project/shaka-player/issues/3696#issuecomment-1009472718
58
58
  shaka.polyfill.MediaCapabilities.originalMcap =
59
59
  navigator.mediaCapabilities;
60
60
 
@@ -39,7 +39,7 @@ shaka.polyfill.MediaSource = class {
39
39
  shaka.polyfill.MediaSource.patchCastIsTypeSupported_();
40
40
  } else if (safariVersion) {
41
41
  // TS content is broken on Safari in general.
42
- // See https://github.com/google/shaka-player/issues/743
42
+ // See https://github.com/shaka-project/shaka-player/issues/743
43
43
  // and https://bugs.webkit.org/show_bug.cgi?id=165342
44
44
  shaka.polyfill.MediaSource.rejectTsContent_();
45
45
 
@@ -5,7 +5,6 @@
5
5
  */
6
6
 
7
7
  goog.provide('shaka.routing.Walker');
8
- goog.provide('shaka.routing.Walker.Implementation');
9
8
 
10
9
  goog.require('goog.asserts');
11
10
  goog.require('shaka.routing.Node');
@@ -81,7 +80,7 @@ shaka.routing.Walker = class {
81
80
  * new work is added (and this is not null) it can be resolved. The only
82
81
  * time when this should be non-null is when we are waiting for more work.
83
82
  *
84
- * @private {shaka.util.PublicPromise}
83
+ * @private {?shaka.util.PublicPromise}
85
84
  */
86
85
  this.waitForWork_ = null;
87
86
 
@@ -91,7 +90,7 @@ shaka.routing.Walker = class {
91
90
  /** @private {?shaka.routing.Walker.ActiveRoute_} */
92
91
  this.currentRoute_ = null;
93
92
 
94
- /** @private {shaka.util.AbortableOperation} */
93
+ /** @private {?shaka.util.AbortableOperation} */
95
94
  this.currentStep_ = null;
96
95
 
97
96
  /**
package/lib/text/cue.js CHANGED
@@ -282,7 +282,7 @@ shaka.text.Cue = class {
282
282
  // Compare the start time, end time and payload of the cues first for
283
283
  // performance optimization. We can avoid the more expensive recursive
284
284
  // checks if the top-level properties don't match.
285
- // See: https://github.com/google/shaka-player/issues/3018
285
+ // See: https://github.com/shaka-project/shaka-player/issues/3018
286
286
  if (cue1.startTime != cue2.startTime || cue1.endTime != cue2.endTime ||
287
287
  cue1.payload != cue2.payload) {
288
288
  return false;
@@ -178,7 +178,8 @@ shaka.text.SimpleTextDisplayer = class {
178
178
  // The browser will display cues with identical time ranges from the
179
179
  // bottom up. Reversing the order of equal cues means the first one
180
180
  // parsed will be at the top, as you would expect.
181
- // See https://github.com/google/shaka-player/issues/848 for more info.
181
+ // See https://github.com/shaka-project/shaka-player/issues/848 for
182
+ // more info.
182
183
  // However, this ordering behavior is part of VTTCue's "line" field.
183
184
  // Some platforms don't have a real VTTCue and use a polyfill instead.
184
185
  // When VTTCue is polyfilled or does not support "line", we should _not_
@@ -12,7 +12,7 @@ goog.require('shaka.util.BufferUtils');
12
12
  goog.require('shaka.util.Functional');
13
13
  goog.require('shaka.util.IDestroyable');
14
14
  goog.require('shaka.util.MimeUtils');
15
- goog.requireType('shaka.cea.ICaptionDecoder.ClosedCaption');
15
+ goog.requireType('shaka.cea.ICaptionDecoder');
16
16
 
17
17
 
18
18
  // TODO: revisit this when Closure Compiler supports partially-exported classes.
@@ -536,8 +536,10 @@ shaka.text.TtmlTextParser = class {
536
536
 
537
537
  cue.textAlign = Cue.textAlign[align.toUpperCase()];
538
538
  } else {
539
- // Default value is START: https://bit.ly/32OGmvo
540
- cue.textAlign = Cue.textAlign.START;
539
+ // Default value is START in the TTML spec: https://bit.ly/32OGmvo
540
+ // But to make the subtitle render consitent with other players and the
541
+ // shaka.text.Cue we use CENTER
542
+ cue.textAlign = Cue.textAlign.CENTER;
541
543
  }
542
544
 
543
545
  const displayAlign = TtmlTextParser.getStyleAttribute_(
@@ -559,7 +561,7 @@ shaka.text.TtmlTextParser = class {
559
561
  // Background color should not be set on a container. If this is a nested
560
562
  // cue, you can set the background. If it's a top-level that happens to
561
563
  // also be a leaf, you can set the background.
562
- // See https://github.com/google/shaka-player/issues/2623
564
+ // See https://github.com/shaka-project/shaka-player/issues/2623
563
565
  // This used to be handled in the displayer, but that is confusing. The Cue
564
566
  // structure should reflect what you want to happen in the displayer, and
565
567
  // the displayer shouldn't have to know about TTML.
@@ -919,8 +921,9 @@ shaka.text.TtmlTextParser = class {
919
921
  let ret = null;
920
922
  const XmlUtils = shaka.util.XmlUtils;
921
923
  while (element) {
922
- ret = nsName ? XmlUtils.getAttributeNS(element, nsName, attributeName)
923
- : element.getAttribute(attributeName);
924
+ ret = nsName ?
925
+ XmlUtils.getAttributeNS(element, nsName, attributeName) :
926
+ element.getAttribute(attributeName);
924
927
  if (ret) {
925
928
  break;
926
929
  }
@@ -108,7 +108,7 @@ shaka.text.UITextDisplayer = class {
108
108
  append(cues) {
109
109
  // Clone the cues list for performace optimization. We can avoid the cues
110
110
  // list growing during the comparisons for duplicate cues.
111
- // See: https://github.com/google/shaka-player/issues/3018
111
+ // See: https://github.com/shaka-project/shaka-player/issues/3018
112
112
  const cuesList = [...this.cues_];
113
113
  for (const cue of cues) {
114
114
  // When a VTT cue spans a segment boundary, the cue will be duplicated
@@ -6,8 +6,6 @@
6
6
 
7
7
  goog.provide('shaka.util.BufferUtils');
8
8
 
9
- goog.require('shaka.util.Iterables');
10
-
11
9
 
12
10
  /**
13
11
  * @summary A set of BufferSource utility functions.
@@ -45,7 +43,7 @@ shaka.util.BufferUtils = class {
45
43
 
46
44
  const uint8A = shaka.util.BufferUtils.toUint8(arr1);
47
45
  const uint8B = shaka.util.BufferUtils.toUint8(arr2);
48
- for (const i of shaka.util.Iterables.range(arr1.byteLength)) {
46
+ for (let i = 0; i < arr1.byteLength; i++) {
49
47
  if (uint8A[i] != uint8B[i]) {
50
48
  return false;
51
49
  }
@@ -11,7 +11,6 @@ goog.require('goog.asserts');
11
11
  goog.require('shaka.util.BufferUtils');
12
12
  goog.require('shaka.util.DataViewReader');
13
13
  goog.require('shaka.util.Error');
14
- goog.require('shaka.util.Iterables');
15
14
 
16
15
 
17
16
  /**
@@ -157,7 +156,8 @@ shaka.util.EbmlParser = class {
157
156
  }
158
157
 
159
158
  let value = 0;
160
- for (const {item, i} of shaka.util.Iterables.enumerate(vint)) {
159
+ for (let i = 0; i < vint.length; i++) {
160
+ const item = vint[i];
161
161
  if (i == 0) {
162
162
  // Mask out the first few bits of |vint|'s first byte to get the most
163
163
  // significant bits of |vint|'s value. If |vint| is 8 bytes wide then
@@ -267,7 +267,7 @@ shaka.util.EbmlElement = class {
267
267
 
268
268
  let value = 0;
269
269
 
270
- for (const i of shaka.util.Iterables.range(this.dataView_.byteLength)) {
270
+ for (let i = 0; i < this.dataView_.byteLength; i++) {
271
271
  const chunk = this.dataView_.getUint8(i);
272
272
  value = (256 * value) + chunk;
273
273
  }
package/lib/util/error.js CHANGED
@@ -467,7 +467,7 @@ shaka.util.Error.Code = {
467
467
  * Content transformations required by the platform could not be performed for
468
468
  * some reason (unsupported container, etc.)
469
469
  *
470
- * @see https://github.com/google/shaka-player/issues/2759
470
+ * @see https://github.com/shaka-project/shaka-player/issues/2759
471
471
  */
472
472
  'CONTENT_TRANSFORMATION_FAILED': 3019,
473
473