shaka-player 4.4.3 → 4.6.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 (307) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
  2. package/.github/workflows/release-please.yaml +2 -27
  3. package/AUTHORS +2 -0
  4. package/CHANGELOG.md +156 -39
  5. package/CODE_OF_CONDUCT.md +1 -1
  6. package/CONTRIBUTORS +2 -0
  7. package/README.md +54 -42
  8. package/demo/asset_card.js +18 -21
  9. package/demo/cast_receiver/index.html +0 -1
  10. package/demo/close_button.js +0 -3
  11. package/demo/common/asset.js +33 -22
  12. package/demo/common/assets.js +249 -60
  13. package/demo/config.js +219 -253
  14. package/demo/custom.js +88 -133
  15. package/demo/front.js +7 -10
  16. package/demo/index.html +19 -22
  17. package/demo/input.js +6 -11
  18. package/demo/input_container.js +8 -9
  19. package/demo/main.js +62 -126
  20. package/demo/search.js +29 -34
  21. package/demo/service_worker.js +0 -3
  22. package/demo/tooltip.js +3 -5
  23. package/demo/visualizer.js +3 -5
  24. package/demo/visualizer_button.js +1 -20
  25. package/dist/controls.css +1 -1
  26. package/dist/controls.css.map +1 -1
  27. package/dist/demo.compiled.debug.js +211 -228
  28. package/dist/demo.compiled.debug.map +4 -4
  29. package/dist/demo.compiled.js +211 -228
  30. package/dist/demo.compiled.map +4 -4
  31. package/dist/deps.js +42 -37
  32. package/dist/locales.js +34 -30
  33. package/dist/receiver.compiled.debug.js +64 -77
  34. package/dist/receiver.compiled.debug.map +4 -4
  35. package/dist/receiver.compiled.js +64 -77
  36. package/dist/receiver.compiled.map +4 -4
  37. package/dist/shaka-player.compiled.d.ts +343 -151
  38. package/dist/shaka-player.compiled.debug.d.ts +343 -151
  39. package/dist/shaka-player.compiled.debug.externs.js +356 -117
  40. package/dist/shaka-player.compiled.debug.js +952 -811
  41. package/dist/shaka-player.compiled.debug.map +4 -4
  42. package/dist/shaka-player.compiled.externs.js +356 -117
  43. package/dist/shaka-player.compiled.js +1165 -1078
  44. package/dist/shaka-player.compiled.map +4 -4
  45. package/dist/shaka-player.ui.d.ts +359 -153
  46. package/dist/shaka-player.ui.debug.d.ts +359 -153
  47. package/dist/shaka-player.ui.debug.externs.js +382 -117
  48. package/dist/shaka-player.ui.debug.js +1084 -918
  49. package/dist/shaka-player.ui.debug.map +4 -4
  50. package/dist/shaka-player.ui.externs.js +382 -117
  51. package/dist/shaka-player.ui.js +1377 -1274
  52. package/dist/shaka-player.ui.map +4 -4
  53. package/docs/design/lcevc-integration.md +14 -14
  54. package/docs/tutorials/ad_monetization.md +54 -0
  55. package/docs/tutorials/basic-usage.md +2 -1
  56. package/docs/tutorials/errors.md +2 -1
  57. package/docs/tutorials/faq.md +27 -55
  58. package/docs/tutorials/index.json +2 -1
  59. package/docs/tutorials/lcevc.md +118 -0
  60. package/docs/tutorials/offline.md +10 -8
  61. package/docs/tutorials/plugins.md +5 -0
  62. package/docs/tutorials/ui-customization.md +17 -0
  63. package/docs/tutorials/ui.md +2 -1
  64. package/docs/tutorials/upgrade.md +3 -0
  65. package/externs/css_style_declaration.js +19 -0
  66. package/externs/lcevc.js +37 -13
  67. package/externs/managedmediasource.js +24 -0
  68. package/externs/media_remote.js +68 -0
  69. package/externs/mediatailor.js +193 -0
  70. package/externs/pictureinpicture.js +11 -0
  71. package/externs/shaka/abr_manager.js +6 -2
  72. package/externs/shaka/ads.js +27 -0
  73. package/externs/shaka/cea.js +7 -0
  74. package/externs/shaka/codecs.js +5 -3
  75. package/externs/shaka/manifest.js +31 -10
  76. package/externs/shaka/manifest_parser.js +24 -1
  77. package/externs/shaka/net.js +2 -2
  78. package/externs/shaka/offline.js +13 -2
  79. package/externs/shaka/player.js +65 -8
  80. package/externs/shaka/text.js +3 -1
  81. package/externs/shaka/transmuxer.js +1 -1
  82. package/karma.conf.js +7 -3
  83. package/lib/abr/simple_abr_manager.js +66 -9
  84. package/lib/ads/ad_manager.js +104 -50
  85. package/lib/ads/media_tailor_ad.js +297 -0
  86. package/lib/ads/media_tailor_ad_manager.js +839 -0
  87. package/lib/cast/cast_receiver.js +1 -1
  88. package/lib/cea/cea_decoder.js +28 -0
  89. package/lib/cea/dummy_caption_decoder.js +5 -0
  90. package/lib/cea/ts_cea_parser.js +15 -2
  91. package/lib/config/codec_switching_strategy.js +24 -0
  92. package/lib/dash/content_protection.js +120 -2
  93. package/lib/dash/dash_parser.js +322 -93
  94. package/lib/dash/mpd_utils.js +62 -37
  95. package/lib/dash/segment_base.js +17 -10
  96. package/lib/dash/segment_list.js +18 -9
  97. package/lib/dash/segment_template.js +122 -107
  98. package/lib/dependencies/all.js +8 -7
  99. package/lib/hls/hls_classes.js +28 -43
  100. package/lib/hls/hls_parser.js +798 -658
  101. package/lib/hls/hls_utils.js +64 -5
  102. package/lib/hls/manifest_text_parser.js +7 -11
  103. package/lib/lcevc/lcevc_dec.js +220 -0
  104. package/lib/media/adaptation_set.js +32 -14
  105. package/lib/media/adaptation_set_criteria.js +86 -16
  106. package/lib/media/closed_caption_parser.js +13 -0
  107. package/lib/media/content_workarounds.js +6 -0
  108. package/lib/media/drm_engine.js +8 -13
  109. package/lib/media/manifest_parser.js +8 -113
  110. package/lib/media/media_source_capabilities.js +10 -3
  111. package/lib/media/media_source_engine.js +286 -44
  112. package/lib/media/play_rate_controller.js +8 -38
  113. package/lib/media/presentation_timeline.js +7 -1
  114. package/lib/media/quality_observer.js +1 -1
  115. package/lib/media/segment_index.js +6 -6
  116. package/lib/media/segment_prefetch.js +92 -24
  117. package/lib/media/segment_reference.js +73 -7
  118. package/lib/media/segment_utils.js +343 -0
  119. package/lib/media/stall_detector.js +0 -3
  120. package/lib/media/streaming_engine.js +73 -38
  121. package/lib/mss/mss_parser.js +19 -2
  122. package/lib/net/networking_engine.js +67 -12
  123. package/lib/net/networking_utils.js +95 -0
  124. package/lib/offline/indexeddb/v1_storage_cell.js +3 -0
  125. package/lib/offline/indexeddb/v2_storage_cell.js +3 -0
  126. package/lib/offline/manifest_converter.js +3 -0
  127. package/lib/offline/offline_manifest_parser.js +10 -0
  128. package/lib/offline/storage.js +14 -7
  129. package/lib/player.js +1098 -1537
  130. package/lib/polyfill/mediasource.js +22 -1
  131. package/lib/text/cue.js +15 -0
  132. package/lib/text/mp4_ttml_parser.js +2 -2
  133. package/lib/text/srt_text_parser.js +2 -2
  134. package/lib/text/stub_text_displayer.js +51 -0
  135. package/lib/text/text_engine.js +3 -2
  136. package/lib/text/ttml_text_parser.js +45 -5
  137. package/lib/text/ui_text_displayer.js +8 -0
  138. package/lib/text/vtt_text_parser.js +40 -22
  139. package/lib/transmuxer/aac_transmuxer.js +1 -1
  140. package/lib/transmuxer/ac3_transmuxer.js +1 -1
  141. package/lib/transmuxer/ec3_transmuxer.js +1 -1
  142. package/lib/transmuxer/h264.js +5 -4
  143. package/lib/transmuxer/h265.js +863 -0
  144. package/lib/transmuxer/mp3_transmuxer.js +1 -1
  145. package/lib/transmuxer/mpeg_ts_transmuxer.js +4 -3
  146. package/lib/transmuxer/mss_transmuxer.js +1 -1
  147. package/lib/transmuxer/ts_transmuxer.js +187 -22
  148. package/lib/util/buffer_utils.js +26 -4
  149. package/lib/util/content_steering_manager.js +358 -0
  150. package/lib/util/error.js +30 -15
  151. package/lib/util/exp_golomb.js +30 -2
  152. package/lib/util/fairplay_utils.js +1 -1
  153. package/lib/util/fake_event.js +8 -1
  154. package/lib/util/id3_utils.js +50 -1
  155. package/lib/util/manifest_parser_utils.js +12 -8
  156. package/lib/util/mp4_generator.js +6 -8
  157. package/lib/util/mutex.js +59 -0
  158. package/lib/util/object_utils.js +1 -1
  159. package/lib/util/periods.js +156 -179
  160. package/lib/util/platform.js +44 -3
  161. package/lib/util/player_configuration.js +43 -6
  162. package/lib/util/state_history.js +6 -2
  163. package/lib/util/stream_utils.js +206 -283
  164. package/lib/util/ts_parser.js +335 -98
  165. package/lib/util/uint8array_utils.js +5 -1
  166. package/lib/util/xml_utils.js +5 -0
  167. package/maintained-branches.md +3 -2
  168. package/package.json +4 -6
  169. package/roadmap.md +25 -5
  170. package/shaka-player.uncompiled.js +2 -2
  171. package/support.html +0 -1
  172. package/test/abr/simple_abr_manager_unit.js +33 -33
  173. package/test/ads/ad_manager_unit.js +3 -2
  174. package/test/cast/cast_receiver_integration.js +50 -4
  175. package/test/cast/cast_utils_unit.js +2 -0
  176. package/test/cea/cea_decoder_unit.js +7 -0
  177. package/test/codec_switching/codec_switching_integration.js +182 -0
  178. package/test/dash/dash_parser_content_protection_unit.js +2 -0
  179. package/test/dash/dash_parser_integration.js +74 -0
  180. package/test/dash/dash_parser_live_unit.js +2 -19
  181. package/test/dash/dash_parser_manifest_unit.js +536 -2
  182. package/test/dash/dash_parser_segment_base_unit.js +2 -0
  183. package/test/dash/dash_parser_segment_list_unit.js +2 -0
  184. package/test/dash/dash_parser_segment_template_unit.js +2 -0
  185. package/test/dash/mpd_utils_unit.js +61 -30
  186. package/test/demo/demo_unit.js +0 -16
  187. package/test/hls/hls_live_unit.js +14 -3
  188. package/test/hls/hls_parser_unit.js +385 -33
  189. package/test/hls/manifest_text_parser_unit.js +32 -99
  190. package/test/media/adaptation_set_criteria_unit.js +284 -15
  191. package/test/media/adaptation_set_unit.js +2 -0
  192. package/test/media/content_workarounds_unit.js +1 -1
  193. package/test/media/drm_engine_unit.js +3 -3
  194. package/test/media/media_source_engine_unit.js +166 -2
  195. package/test/media/play_rate_controller_unit.js +0 -48
  196. package/test/media/segment_index_unit.js +5 -4
  197. package/test/media/segment_prefetch_unit.js +1 -1
  198. package/test/media/streaming_engine_unit.js +17 -17
  199. package/test/mss/mss_parser_unit.js +2 -0
  200. package/test/mss/mss_player_integration.js +3 -2
  201. package/test/net/networking_engine_unit.js +3 -3
  202. package/test/{media/manifest_parser_unit.js → net/networking_utils_unit.js} +2 -2
  203. package/test/offline/manifest_convert_unit.js +14 -0
  204. package/test/offline/offline_integration.js +2 -1
  205. package/test/offline/storage_integration.js +22 -13
  206. package/test/player_external.js +4 -2
  207. package/test/player_integration.js +15 -4
  208. package/test/player_load_graph_integration.js +47 -151
  209. package/test/player_src_equals_external.js +1 -0
  210. package/test/player_src_equals_integration.js +71 -4
  211. package/test/player_unit.js +182 -158
  212. package/test/test/assets/dash-aes-128/Fragments(video=0,format=mpd-time-csf) +0 -0
  213. package/test/test/assets/dash-aes-128/Fragments(video=20000000,format=mpd-time-csf) +0 -0
  214. package/test/test/assets/dash-aes-128/Fragments(video=40000000,format=mpd-time-csf) +0 -0
  215. package/test/test/assets/dash-aes-128/Fragments(video=60000000,format=mpd-time-csf) +0 -0
  216. package/test/test/assets/dash-aes-128/Fragments(video=i,format=mpd-time-csf) +0 -0
  217. package/test/test/assets/dash-aes-128/dash.mpd +18 -0
  218. package/test/test/assets/dash-aes-128/license +1 -0
  219. package/test/test/assets/dash-multi-codec/audio_en_2c_128k_aac.mp4 +0 -0
  220. package/test/test/assets/dash-multi-codec/audio_es_2c_64k_opus.webm +0 -0
  221. package/test/test/assets/dash-multi-codec/dash.mpd +32 -0
  222. package/test/test/assets/dash-multi-codec/video_144p_108k_h264.mp4 +0 -0
  223. package/test/test/assets/hls-ts-h265/0.ts +0 -0
  224. package/test/test/assets/hls-ts-h265/hevc.m3u8 +6 -0
  225. package/test/test/assets/hls-ts-h265/index.m3u8 +7 -0
  226. package/test/test/assets/hls-ts-muxed-aac-h265/0.ts +0 -0
  227. package/test/test/assets/hls-ts-muxed-aac-h265/1.ts +0 -0
  228. package/test/test/assets/hls-ts-muxed-aac-h265/media.m3u8 +9 -0
  229. package/test/test/assets/hls-ts-muxed-ac3-h264/media.m3u8 +24 -0
  230. package/test/test/assets/hls-ts-muxed-ac3-h264/s_00000.ts +0 -0
  231. package/test/test/assets/hls-ts-muxed-ac3-h264/s_00001.ts +0 -0
  232. package/test/test/assets/hls-ts-muxed-ac3-h264/s_00002.ts +0 -0
  233. package/test/test/assets/hls-ts-muxed-ac3-h264/s_00003.ts +0 -0
  234. package/test/test/assets/hls-ts-muxed-ac3-h264/s_00004.ts +0 -0
  235. package/test/test/assets/hls-ts-muxed-ac3-h264/s_00005.ts +0 -0
  236. package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0000.ts +0 -0
  237. package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0001.ts +0 -0
  238. package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0002.ts +0 -0
  239. package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0003.ts +0 -0
  240. package/test/test/assets/hls-ts-muxed-ec3-h264/prog_index.m3u8 +14 -0
  241. package/test/test/assets/hls-ts-muxed-mp3-h264/index.m3u8 +23 -0
  242. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-1-v1-a1.ts +0 -0
  243. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-2-v1-a1.ts +0 -0
  244. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-3-v1-a1.ts +0 -0
  245. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-4-v1-a1.ts +0 -0
  246. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-5-v1-a1.ts +0 -0
  247. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-6-v1-a1.ts +0 -0
  248. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-7-v1-a1.ts +0 -0
  249. package/test/test/assets/hls-ts-muxed-mp3-h264/seg-8-v1-a1.ts +0 -0
  250. package/test/test/util/dash_parser_util.js +4 -0
  251. package/test/test/util/fake_ad_manager.js +20 -0
  252. package/test/test/util/fake_media_source_engine.js +13 -2
  253. package/test/test/util/fake_networking_engine.js +9 -1
  254. package/test/test/util/fake_segment_prefetch.js +3 -0
  255. package/test/test/util/manifest_generator.js +11 -3
  256. package/test/test/util/manifest_parser_util.js +14 -2
  257. package/test/test/util/mss_parser_util.js +4 -0
  258. package/test/test/util/offline_utils.js +2 -0
  259. package/test/test/util/simple_fakes.js +2 -2
  260. package/test/test/util/streaming_engine_util.js +10 -4
  261. package/test/test/util/test_scheme.js +6 -0
  262. package/test/test/util/ui_utils.js +4 -3
  263. package/test/text/mp4_ttml_parser_unit.js +4 -4
  264. package/test/text/srt_text_parser_unit.js +1 -1
  265. package/test/text/text_displayer_layout_unit.js +1 -1
  266. package/test/text/text_engine_unit.js +6 -0
  267. package/test/text/ttml_text_parser_unit.js +85 -2
  268. package/test/text/vtt_text_parser_unit.js +103 -31
  269. package/test/transmuxer/transmuxer_engine_integration.js +9 -0
  270. package/test/transmuxer/transmuxer_integration.js +150 -3
  271. package/test/ui/ad_ui_unit.js +2 -2
  272. package/test/ui/ui_customization_unit.js +17 -16
  273. package/test/ui/ui_integration.js +30 -20
  274. package/test/ui/ui_unit.js +28 -29
  275. package/test/util/buffer_utils_unit.js +1 -1
  276. package/test/util/content_steering_manager_unit.js +427 -0
  277. package/test/util/id3_utils_unit.js +52 -0
  278. package/test/util/stream_utils_unit.js +207 -169
  279. package/test/util/ts_parser_unit.js +3 -3
  280. package/third_party/closure-uri/uri.js +13 -1
  281. package/ui/audio_language_selection.js +9 -2
  282. package/ui/controls.js +125 -0
  283. package/ui/externs/ui.js +24 -2
  284. package/ui/language_utils.js +43 -8
  285. package/ui/less/range_elements.less +33 -0
  286. package/ui/locales/en.json +1 -0
  287. package/ui/locales/es-419.json +1 -0
  288. package/ui/locales/es.json +1 -0
  289. package/ui/locales/source.json +4 -0
  290. package/ui/localization.js +10 -0
  291. package/ui/pip_button.js +22 -120
  292. package/ui/remote_button.js +203 -0
  293. package/ui/resolution_selection.js +47 -10
  294. package/ui/seek_bar.js +296 -3
  295. package/ui/text_selection.js +2 -1
  296. package/ui/ui.js +11 -4
  297. package/demo/common/message_ids.js +0 -309
  298. package/demo/locales/en.json +0 -288
  299. package/demo/locales/source.json +0 -1146
  300. package/externs/mux.js +0 -69
  301. package/lib/lcevc/lcevc_dil.js +0 -152
  302. package/lib/routing/node.js +0 -23
  303. package/lib/routing/payload.js +0 -43
  304. package/lib/routing/walker.js +0 -587
  305. package/lib/transmuxer/muxjs_transmuxer.js +0 -242
  306. package/test/routing/walker_unit.js +0 -504
  307. package/test/transmuxer/muxjs_transmuxer_integration.js +0 -177
@@ -105,6 +105,7 @@ describe('TextEngine', () => {
105
105
  expect(mockParseMedia).toHaveBeenCalledOnceMoreWith([
106
106
  dummyData,
107
107
  {periodStart: 0, segmentStart: 0, segmentEnd: 3, vttOffset: 0},
108
+ undefined,
108
109
  ]);
109
110
 
110
111
  expect(mockDisplayer.appendSpy).toHaveBeenCalledOnceMoreWith([
@@ -120,6 +121,7 @@ describe('TextEngine', () => {
120
121
  expect(mockParseMedia).toHaveBeenCalledOnceMoreWith([
121
122
  dummyData,
122
123
  {periodStart: 0, segmentStart: 3, segmentEnd: 5, vttOffset: 0},
124
+ undefined,
123
125
  ]);
124
126
 
125
127
  expect(mockDisplayer.appendSpy).toHaveBeenCalledOnceMoreWith([
@@ -272,6 +274,7 @@ describe('TextEngine', () => {
272
274
  expect(mockParseMedia).toHaveBeenCalledOnceMoreWith([
273
275
  dummyData,
274
276
  {periodStart: 0, segmentStart: 0, segmentEnd: 3, vttOffset: 0},
277
+ undefined,
275
278
  ]);
276
279
  expect(mockDisplayer.appendSpy).toHaveBeenCalledOnceMoreWith([
277
280
  [
@@ -286,6 +289,7 @@ describe('TextEngine', () => {
286
289
  expect(mockParseMedia).toHaveBeenCalledOnceMoreWith([
287
290
  dummyData,
288
291
  {periodStart: 4, segmentStart: 4, segmentEnd: 7, vttOffset: 4},
292
+ undefined,
289
293
  ]);
290
294
  expect(mockDisplayer.appendSpy).toHaveBeenCalledOnceMoreWith([
291
295
  [
@@ -316,6 +320,7 @@ describe('TextEngine', () => {
316
320
  expect(mockParseMedia).toHaveBeenCalledOnceMoreWith([
317
321
  dummyData,
318
322
  {periodStart: 0, segmentStart: 0, segmentEnd: 3, vttOffset: 0},
323
+ undefined,
319
324
  ]);
320
325
 
321
326
  textEngine.setTimestampOffset(8);
@@ -325,6 +330,7 @@ describe('TextEngine', () => {
325
330
  expect(mockParseMedia).toHaveBeenCalledOnceMoreWith([
326
331
  dummyData,
327
332
  {periodStart: 8, segmentStart: 4, segmentEnd: 7, vttOffset: 4},
333
+ undefined,
328
334
  ]);
329
335
  });
330
336
  });
@@ -1147,6 +1147,31 @@ describe('TtmlTextParser', () => {
1147
1147
  {startTime: 62.05, endTime: 3723.2});
1148
1148
  });
1149
1149
 
1150
+ it('supports textCombine setting', () => {
1151
+ verifyHelper(
1152
+ [
1153
+ {
1154
+ startTime: 62.05,
1155
+ endTime: 3723.2,
1156
+ payload: 'Test',
1157
+ textCombineUpright: 'all',
1158
+ writingMode: Cue.writingMode.VERTICAL_LEFT_TO_RIGHT,
1159
+ },
1160
+ ],
1161
+ '<tt xmlns:tts="http://www.w3.org/ns/ttml#styling">' +
1162
+ '<layout>' +
1163
+ '<region xml:id="subtitleArea" ' +
1164
+ 'tts:writingMode="tb" ' +
1165
+ 'tts:textCombine="all"/>' +
1166
+ '</layout>' +
1167
+ '<body region="subtitleArea"><div>' +
1168
+ '<p begin="01:02.05" end="01:02:03.200">Test</p>' +
1169
+ '</div></body></tt>',
1170
+ {periodStart: 0, segmentStart: 60, segmentEnd: 3730, vttOffset: 0},
1171
+ {startTime: 62.05, endTime: 3723.2, region: {id: 'subtitleArea'}},
1172
+ {startTime: 62.05, endTime: 3723.2});
1173
+ });
1174
+
1150
1175
  it('disregards empty divs and ps', () => {
1151
1176
  verifyHelper(
1152
1177
  [
@@ -1238,6 +1263,35 @@ describe('TtmlTextParser', () => {
1238
1263
  });
1239
1264
  });
1240
1265
 
1266
+ it('supports smpte:backgroundImage attribute with url', () => {
1267
+ verifyHelper(
1268
+ [
1269
+ {
1270
+ startTime: 62.05,
1271
+ endTime: 3723.2,
1272
+ payload: '',
1273
+ },
1274
+ ],
1275
+ '<tt ' +
1276
+ 'xmlns:ttm="http://www.w3.org/ns/ttml#metadata" ' +
1277
+ 'xmlns:smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt">' +
1278
+ '<metadata>' +
1279
+ '<smpte:image imageType="PNG" encoding="Base64" xml:id="img_0">' +
1280
+ 'base64EncodedImage</smpte:image>' +
1281
+ '</metadata>' +
1282
+ '<body><div smpte:backgroundImage="img_0.png">' +
1283
+ '<p begin="01:02.05" end="01:02:03.200"></p>' +
1284
+ '</div></body></tt>',
1285
+ {periodStart: 0, segmentStart: 60, segmentEnd: 3730, vttOffset: 0},
1286
+ {startTime: 62.05, endTime: 3723.2},
1287
+ {
1288
+ startTime: 62.05,
1289
+ endTime: 3723.2,
1290
+ backgroundImage: 'foo://bar/img_0.png',
1291
+ isContainer: false,
1292
+ });
1293
+ });
1294
+
1241
1295
  it('supports smpte:backgroundImage attribute in div element', () => {
1242
1296
  verifyHelper(
1243
1297
  [],
@@ -1286,6 +1340,33 @@ describe('TtmlTextParser', () => {
1286
1340
  {startTime: 62.05, endTime: 3723.2});
1287
1341
  });
1288
1342
 
1343
+ it('supports tts:ruby', () => {
1344
+ verifyHelper(
1345
+ [{
1346
+ startTime: 62.05,
1347
+ endTime: 3723.2,
1348
+ payload: '',
1349
+ nestedCues: [{
1350
+ startTime: 62.05,
1351
+ endTime: 3723.2,
1352
+ payload: 'Line1',
1353
+ }, {
1354
+ startTime: 62.05,
1355
+ endTime: 3723.2,
1356
+ payload: 'Line2',
1357
+ rubyTag: 'rt',
1358
+ }],
1359
+ rubyTag: 'ruby',
1360
+ }],
1361
+ // With anonymous spans
1362
+ '<tt xmlns:tts="http://www.w3.org/ns/ttml#styling"><body><div>' +
1363
+ '<p begin="01:02.05" end="01:02:03.200" tts:ruby="container">' +
1364
+ '<span tts:ruby="base">Line1</span><span tts:ruby="text">Line2' +
1365
+ '</span></p></div></body></tt>',
1366
+ {periodStart: 0, segmentStart: 60, segmentEnd: 3730, vttOffset: 0},
1367
+ {startTime: 62.05, endTime: 3723.2});
1368
+ });
1369
+
1289
1370
  it('inserts line breaks for <br> tags', () => {
1290
1371
  verifyHelper(
1291
1372
  [{
@@ -2060,7 +2141,8 @@ describe('TtmlTextParser', () => {
2060
2141
  function verifyHelper(cues, text, time, bodyProperties, divProperties) {
2061
2142
  const data =
2062
2143
  shaka.util.BufferUtils.toUint8(shaka.util.StringUtils.toUTF8(text));
2063
- const result = new shaka.text.TtmlTextParser().parseMedia(data, time);
2144
+ const result = new shaka.text.TtmlTextParser()
2145
+ .parseMedia(data, time, 'foo://bar');
2064
2146
  shaka.test.TtmlUtils.verifyHelper(
2065
2147
  cues, result, bodyProperties, divProperties);
2066
2148
  }
@@ -2087,7 +2169,8 @@ describe('TtmlTextParser', () => {
2087
2169
  expect(() => {
2088
2170
  new shaka.text.TtmlTextParser().parseMedia(
2089
2171
  shaka.util.BufferUtils.toUint8(data),
2090
- {periodStart: 0, segmentStart: 0, segmentEnd: 10, vttOffset: 0});
2172
+ {periodStart: 0, segmentStart: 0, segmentEnd: 10, vttOffset: 0},
2173
+ 'foo://bar');
2091
2174
  }).toThrow(error);
2092
2175
  }
2093
2176
  });
@@ -646,6 +646,7 @@ describe('VttTextParser', () => {
646
646
  payload: 'Test',
647
647
  color: 'cyan',
648
648
  fontSize: '10px',
649
+ textCombineUpright: 'all',
649
650
  textShadow: textShadow,
650
651
  },
651
652
  {
@@ -654,6 +655,7 @@ describe('VttTextParser', () => {
654
655
  payload: 'Test2',
655
656
  color: 'cyan',
656
657
  fontSize: '10px',
658
+ textCombineUpright: 'all',
657
659
  textShadow: textShadow,
658
660
  },
659
661
  ],
@@ -663,6 +665,7 @@ describe('VttTextParser', () => {
663
665
  'color: cyan;\n'+
664
666
  'font-size: 10px;\n'+
665
667
  `text-shadow: ${textShadow};\n`+
668
+ 'text-combine-upright: all;\n'+
666
669
  '}\n\n' +
667
670
  '00:00:20.000 --> 00:00:40.000\n' +
668
671
  'Test\n\n' +
@@ -761,16 +764,21 @@ describe('VttTextParser', () => {
761
764
  {
762
765
  startTime: 50,
763
766
  endTime: 60,
764
- payload: 'Test',
765
- fontWeight: Cue.fontWeight.BOLD,
766
- fontStyle: Cue.fontStyle.NORMAL,
767
- },
768
- {
769
- startTime: 50,
770
- endTime: 60,
771
- payload: '5',
767
+ payload: '',
772
768
  fontWeight: Cue.fontWeight.BOLD,
773
- fontStyle: Cue.fontStyle.ITALIC,
769
+ nestedCues: [
770
+ {
771
+ startTime: 50,
772
+ endTime: 60,
773
+ payload: 'Test',
774
+ },
775
+ {
776
+ startTime: 50,
777
+ endTime: 60,
778
+ payload: '5',
779
+ fontStyle: Cue.fontStyle.ITALIC,
780
+ },
781
+ ],
774
782
  },
775
783
  ],
776
784
  },
@@ -801,16 +809,21 @@ describe('VttTextParser', () => {
801
809
  {
802
810
  startTime: 80,
803
811
  endTime: 90,
804
- payload: 'Test ',
805
- fontWeight: Cue.fontWeight.BOLD,
806
- fontStyle: Cue.fontStyle.NORMAL,
807
- },
808
- {
809
- startTime: 80,
810
- endTime: 90,
811
- payload: '7',
812
+ payload: '',
812
813
  fontWeight: Cue.fontWeight.BOLD,
813
- fontStyle: Cue.fontStyle.ITALIC,
814
+ nestedCues: [
815
+ {
816
+ startTime: 80,
817
+ endTime: 90,
818
+ payload: 'Test ',
819
+ },
820
+ {
821
+ startTime: 80,
822
+ endTime: 90,
823
+ payload: '7',
824
+ fontStyle: Cue.fontStyle.ITALIC,
825
+ },
826
+ ],
814
827
  },
815
828
  ],
816
829
  },
@@ -903,6 +916,48 @@ describe('VttTextParser', () => {
903
916
  {periodStart: 0, segmentStart: 0, segmentEnd: 0, vttOffset: 0});
904
917
  });
905
918
 
919
+ it('supports ruby html tags', () => {
920
+ verifyHelper(
921
+ [
922
+ {
923
+ startTime: 20,
924
+ endTime: 40,
925
+ payload: '',
926
+ nestedCues: [
927
+ {
928
+ startTime: 20,
929
+ endTime: 40,
930
+ payload: '',
931
+ rubyTag: 'ruby',
932
+ nestedCues: [
933
+ {
934
+ startTime: 20,
935
+ endTime: 40,
936
+ payload: 'Test',
937
+ },
938
+ {
939
+ startTime: 20,
940
+ endTime: 40,
941
+ payload: '2',
942
+ rubyTag: 'rt',
943
+ },
944
+ {
945
+ startTime: 20,
946
+ endTime: 40,
947
+ payload: '3',
948
+ rubyTag: 'rp',
949
+ },
950
+ ],
951
+ },
952
+ ],
953
+ },
954
+ ],
955
+ 'WEBVTT\n\n' +
956
+ '00:00:20.000 --> 00:00:40.000\n' +
957
+ '<ruby>Test<rt>2</rt><rp>3</rp></ruby>',
958
+ {periodStart: 0, segmentStart: 0, segmentEnd: 0, vttOffset: 0});
959
+ });
960
+
906
961
  it('supports only two digits in the timestamp', () => {
907
962
  verifyHelper(
908
963
  [
@@ -998,14 +1053,22 @@ describe('VttTextParser', () => {
998
1053
  {
999
1054
  startTime: 70,
1000
1055
  endTime: 80,
1001
- payload: 'Test5.1',
1056
+ payload: '',
1002
1057
  color: 'red',
1003
- },
1004
- {
1005
- startTime: 70,
1006
- endTime: 80,
1007
- payload: 'Test5.2',
1008
- color: 'lime',
1058
+ nestedCues: [
1059
+ {
1060
+ startTime: 70,
1061
+ endTime: 80,
1062
+ payload: 'Test5.1',
1063
+ color: 'red',
1064
+ },
1065
+ {
1066
+ startTime: 70,
1067
+ endTime: 80,
1068
+ payload: 'Test5.2',
1069
+ color: 'lime',
1070
+ },
1071
+ ],
1009
1072
  },
1010
1073
  ],
1011
1074
  },
@@ -1185,9 +1248,17 @@ describe('VttTextParser', () => {
1185
1248
  {
1186
1249
  startTime: 10,
1187
1250
  endTime: 20,
1188
- payload: '2',
1251
+ payload: '',
1189
1252
  color: 'magenta',
1190
- fontStyle: Cue.fontStyle.ITALIC,
1253
+ nestedCues: [
1254
+ {
1255
+ startTime: 10,
1256
+ endTime: 20,
1257
+ payload: '2',
1258
+ color: 'magenta',
1259
+ fontStyle: Cue.fontStyle.ITALIC,
1260
+ },
1261
+ ],
1191
1262
  },
1192
1263
  ],
1193
1264
  },
@@ -1255,13 +1326,14 @@ describe('VttTextParser', () => {
1255
1326
  parser.setSequenceMode(sequenceMode);
1256
1327
  const result = parser.parseMedia(data, time);
1257
1328
 
1258
- const expected = cues.map((cue) => {
1329
+ const checkCue = (cue) => {
1259
1330
  if (cue.nestedCues) {
1260
- cue.nestedCues = cue.nestedCues.map(
1261
- (nestedCue) => jasmine.objectContaining(nestedCue));
1331
+ cue.nestedCues = cue.nestedCues.map((nestedCue) => checkCue(nestedCue));
1262
1332
  }
1263
1333
  return jasmine.objectContaining(cue);
1264
- });
1334
+ };
1335
+
1336
+ const expected = cues.map(checkCue);
1265
1337
  expect(result).toEqual(expected);
1266
1338
  }
1267
1339
 
@@ -56,5 +56,14 @@ describe('TransmuxerEngine', () => {
56
56
  ContentType.VIDEO, 'video/MP2T; codecs="avc1.420001"'))
57
57
  .toBe('video/mp4; codecs="avc1.420001"');
58
58
  });
59
+
60
+ it('converts legacy avc1 codec strings', () => {
61
+ expect(convertCodecs(
62
+ ContentType.VIDEO, 'video/mp2t; codecs="avc1.100.42"'))
63
+ .toBe('video/mp4; codecs="avc1.64002a"');
64
+ expect(convertCodecs(
65
+ ContentType.VIDEO, 'video/mp2t; codecs="avc1.66.1"'))
66
+ .toBe('video/mp4; codecs="avc1.420001"');
67
+ });
59
68
  });
60
69
  });
@@ -4,7 +4,36 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- describe('Transmuxer Player', () => {
7
+ /**
8
+ * For unknown reasons, these tests fail in the test labs for Edge on Windows,
9
+ * in ways that do not seem to be unrelated to transmuxers.
10
+ * Practical testing has not found any sign that playback is actually broken in
11
+ * Edge, so these tests are disabled on Edge for the time being.
12
+ * TODO(#5834): Remove this filter once the tests are fixed.
13
+ * @return {boolean}
14
+ */
15
+ function checkNoBrokenEdge() {
16
+ const chromeVersion = shaka.util.Platform.chromeVersion();
17
+ if (shaka.util.Platform.isWindows() && shaka.util.Platform.isEdge() &&
18
+ chromeVersion && chromeVersion <= 118) {
19
+ // When the tests fail, it's due to the manifest parser failing to find a
20
+ // factory. Attempt to find a factory first, to avoid filtering the tests
21
+ // when running in a non-broken Edge environment.
22
+ const uri = 'fakeuri.m3u8';
23
+ const mimeType = 'application/x-mpegurl';
24
+ /* eslint-disable no-restricted-syntax */
25
+ try {
26
+ shaka.media.ManifestParser.getFactory(uri, mimeType);
27
+ return true;
28
+ } catch (error) {
29
+ return false;
30
+ }
31
+ /* eslint-enable no-restricted-syntax */
32
+ }
33
+ return true;
34
+ }
35
+
36
+ filterDescribe('Transmuxer Player', checkNoBrokenEdge, () => {
8
37
  const Util = shaka.test.Util;
9
38
 
10
39
  /** @type {!jasmine.Spy} */
@@ -73,7 +102,8 @@ describe('Transmuxer Player', () => {
73
102
 
74
103
  beforeEach(async () => {
75
104
  await shaka.test.TestScheme.createManifests(compiledShaka, '_compiled');
76
- player = new compiledShaka.Player(video);
105
+ player = new compiledShaka.Player();
106
+ await player.attach(video);
77
107
 
78
108
  player.configure('mediaSource.forceTransmux', true);
79
109
  player.configure('streaming.useNativeHlsOnSafari', false);
@@ -161,7 +191,7 @@ describe('Transmuxer Player', () => {
161
191
  pending('Codec EC-3 is not supported by the platform.');
162
192
  }
163
193
 
164
- await player.load('/base/test/test/assets/hls-raw-ac3/prog_index.m3u8');
194
+ await player.load('/base/test/test/assets/hls-raw-ec3/prog_index.m3u8');
165
195
  await video.play();
166
196
  expect(player.isLive()).toBe(false);
167
197
 
@@ -273,6 +303,33 @@ describe('Transmuxer Player', () => {
273
303
 
274
304
  await player.unload();
275
305
  });
306
+
307
+ it('H.265 in TS', async () => {
308
+ const chromeVersion = shaka.util.Platform.chromeVersion();
309
+ if (shaka.util.Platform.isWindows() &&
310
+ chromeVersion && chromeVersion === 117) {
311
+ // It appears that Chrome 117 beta in Windows is incorrectly reporting
312
+ // H.265 in MediaCapabilities
313
+ pending('Codec H.265 is not supported by the platform.');
314
+ }
315
+ const mimeType = 'video/mp4; codecs="hvc1.2.4.L123.B0"';
316
+ if (!MediaSource.isTypeSupported(mimeType)) {
317
+ pending('Codec H.265 is not supported by the platform.');
318
+ }
319
+ await player.load('/base/test/test/assets/hls-ts-h265/hevc.m3u8');
320
+ await video.play();
321
+ expect(player.isLive()).toBe(false);
322
+
323
+ // Wait for the video to start playback. If it takes longer than 10
324
+ // seconds, fail the test.
325
+ await waiter.waitForMovementOrFailOnTimeout(video, 10);
326
+
327
+ // Play for 15 seconds, but stop early if the video ends. If it takes
328
+ // longer than 45 seconds, fail the test.
329
+ await waiter.waitUntilPlayheadReachesOrFailOnTimeout(video, 15, 45);
330
+
331
+ await player.unload();
332
+ });
276
333
  });
277
334
 
278
335
  describe('for muxed content', () => {
@@ -292,5 +349,95 @@ describe('Transmuxer Player', () => {
292
349
 
293
350
  await player.unload();
294
351
  });
352
+
353
+ it('H.265+AAC in TS', async () => {
354
+ const chromeVersion = shaka.util.Platform.chromeVersion();
355
+ if (shaka.util.Platform.isWindows() &&
356
+ chromeVersion && chromeVersion === 117) {
357
+ // It appears that Chrome 117 beta in Windows is incorrectly reporting
358
+ // H.265 in MediaCapabilities
359
+ pending('Codec H.265 is not supported by the platform.');
360
+ }
361
+ if (!MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.90"')) {
362
+ pending('Codec H.265 is not supported by the platform.');
363
+ }
364
+ // eslint-disable-next-line max-len
365
+ await player.load('/base/test/test/assets/hls-ts-muxed-aac-h265/media.m3u8');
366
+ await video.play();
367
+ expect(player.isLive()).toBe(false);
368
+
369
+ // Wait for the video to start playback. If it takes longer than 10
370
+ // seconds, fail the test.
371
+ await waiter.waitForMovementOrFailOnTimeout(video, 10);
372
+
373
+ // Play for 15 seconds, but stop early if the video ends. If it takes
374
+ // longer than 45 seconds, fail the test.
375
+ await waiter.waitUntilPlayheadReachesOrFailOnTimeout(video, 15, 45);
376
+
377
+ await player.unload();
378
+ });
379
+
380
+ it('H.264+MP3 in TS', async () => {
381
+ if (!MediaSource.isTypeSupported('audio/mp4; codecs="mp3"')) {
382
+ pending('Codec MP3 in MP4 is not supported by the platform.');
383
+ }
384
+
385
+ // eslint-disable-next-line max-len
386
+ await player.load('/base/test/test/assets/hls-ts-muxed-mp3-h264/index.m3u8');
387
+ await video.play();
388
+ expect(player.isLive()).toBe(false);
389
+
390
+ // Wait for the video to start playback. If it takes longer than 10
391
+ // seconds, fail the test.
392
+ await waiter.waitForMovementOrFailOnTimeout(video, 10);
393
+
394
+ // Play for 15 seconds, but stop early if the video ends. If it takes
395
+ // longer than 45 seconds, fail the test.
396
+ await waiter.waitUntilPlayheadReachesOrFailOnTimeout(video, 15, 45);
397
+
398
+ await player.unload();
399
+ });
400
+
401
+ it('H.264+AC3 in TS', async () => {
402
+ if (!isAc3Supported()) {
403
+ pending('Codec AC-3 is not supported by the platform.');
404
+ }
405
+
406
+ // eslint-disable-next-line max-len
407
+ await player.load('/base/test/test/assets/hls-ts-muxed-ac3-h264/media.m3u8');
408
+ await video.play();
409
+ expect(player.isLive()).toBe(false);
410
+
411
+ // Wait for the video to start playback. If it takes longer than 10
412
+ // seconds, fail the test.
413
+ await waiter.waitForMovementOrFailOnTimeout(video, 10);
414
+
415
+ // Play for 15 seconds, but stop early if the video ends. If it takes
416
+ // longer than 45 seconds, fail the test.
417
+ await waiter.waitUntilPlayheadReachesOrFailOnTimeout(video, 15, 45);
418
+
419
+ await player.unload();
420
+ });
421
+
422
+ it('H.264+EC3 in TS', async () => {
423
+ if (!isEc3Supported()) {
424
+ pending('Codec EC-3 is not supported by the platform.');
425
+ }
426
+
427
+ // eslint-disable-next-line max-len
428
+ await player.load('/base/test/test/assets/hls-ts-muxed-ec3-h264/prog_index.m3u8');
429
+ await video.play();
430
+ expect(player.isLive()).toBe(false);
431
+
432
+ // Wait for the video to start playback. If it takes longer than 10
433
+ // seconds, fail the test.
434
+ await waiter.waitForMovementOrFailOnTimeout(video, 10);
435
+
436
+ // Play for 15 seconds, but stop early if the video ends. If it takes
437
+ // longer than 45 seconds, fail the test.
438
+ await waiter.waitUntilPlayheadReachesOrFailOnTimeout(video, 15, 45);
439
+
440
+ await player.unload();
441
+ });
295
442
  });
296
443
  });
@@ -25,14 +25,14 @@ describe('Ad UI', () => {
25
25
  shaka.Player.setAdManagerFactory(() => new shaka.test.FakeAdManager());
26
26
  });
27
27
 
28
- beforeEach(() => {
28
+ beforeEach(async () => {
29
29
  container =
30
30
  /** @type {!HTMLElement} */ (document.createElement('div'));
31
31
  document.body.appendChild(container);
32
32
 
33
33
  video = shaka.test.UiUtils.createVideoElement();
34
34
  container.appendChild(video);
35
- UiUtils.createUIThroughAPI(container, video);
35
+ await UiUtils.createUIThroughAPI(container, video);
36
36
  adManager = video['ui'].getControls().getPlayer().getAdManager();
37
37
  });
38
38
 
@@ -36,9 +36,9 @@ describe('UI Customization', () => {
36
36
  container.appendChild(video);
37
37
  });
38
38
 
39
- it('only the specified controls are created', () => {
39
+ it('only the specified controls are created', async () => {
40
40
  const config = {controlPanelElements: ['time_and_duration', 'mute']};
41
- UiUtils.createUIThroughAPI(container, video, config);
41
+ await UiUtils.createUIThroughAPI(container, video, config);
42
42
 
43
43
  // Only current time and mute button should've been created
44
44
  UiUtils.confirmElementFound(container, 'shaka-current-time');
@@ -49,9 +49,9 @@ describe('UI Customization', () => {
49
49
  UiUtils.confirmElementMissing(container, 'shaka-overflow-menu-button');
50
50
  });
51
51
 
52
- it('only the specified overflow menu buttons are created', () => {
52
+ it('only the specified overflow menu buttons are created', async () => {
53
53
  const config = {overflowMenuButtons: ['cast']};
54
- UiUtils.createUIThroughAPI(container, video, config);
54
+ await UiUtils.createUIThroughAPI(container, video, config);
55
55
 
56
56
  UiUtils.confirmElementFound(container, 'shaka-cast-button');
57
57
 
@@ -59,30 +59,31 @@ describe('UI Customization', () => {
59
59
  });
60
60
 
61
61
  it('seek bar only created when configured', async () => {
62
- const ui =
63
- UiUtils.createUIThroughAPI(container, video, {addSeekBar: false});
62
+ const ui = await UiUtils.createUIThroughAPI(
63
+ container, video, {addSeekBar: false});
64
64
  UiUtils.confirmElementMissing(container, 'shaka-seek-bar');
65
65
  await ui.destroy();
66
66
 
67
- UiUtils.createUIThroughAPI(container, video, {addSeekBar: true});
67
+ await UiUtils.createUIThroughAPI(container, video, {addSeekBar: true});
68
68
  UiUtils.confirmElementFound(container, 'shaka-seek-bar');
69
69
  });
70
70
 
71
71
  it('big play button only created when configured', async () => {
72
- const ui =
73
- UiUtils.createUIThroughAPI(container, video, {addBigPlayButton: false});
72
+ const ui = await UiUtils.createUIThroughAPI(
73
+ container, video, {addBigPlayButton: false});
74
74
  UiUtils.confirmElementMissing(container, 'shaka-play-button-container');
75
75
  UiUtils.confirmElementMissing(container, 'shaka-play-button');
76
76
  await ui.destroy();
77
77
 
78
- UiUtils.createUIThroughAPI(container, video, {addBigPlayButton: true});
78
+ await UiUtils.createUIThroughAPI(
79
+ container, video, {addBigPlayButton: true});
79
80
  UiUtils.confirmElementFound(container, 'shaka-play-button-container');
80
81
  UiUtils.confirmElementFound(container, 'shaka-play-button');
81
82
  });
82
83
 
83
- it('settings menus are positioned lower when seek bar is absent', () => {
84
+ it('settings menus are lower when seek bar is absent', async () => {
84
85
  const config = {addSeekBar: false};
85
- UiUtils.createUIThroughAPI(container, video, config);
86
+ await UiUtils.createUIThroughAPI(container, video, config);
86
87
 
87
88
  function confirmLowPosition(className) {
88
89
  const elements =
@@ -101,7 +102,7 @@ describe('UI Customization', () => {
101
102
  confirmLowPosition('shaka-playback-rates');
102
103
  });
103
104
 
104
- it('controls are created in specified order', () => {
105
+ it('controls are created in specified order', async () => {
105
106
  const config = {
106
107
  controlPanelElements: [
107
108
  'mute',
@@ -110,7 +111,7 @@ describe('UI Customization', () => {
110
111
  ],
111
112
  };
112
113
 
113
- UiUtils.createUIThroughAPI(container, video, config);
114
+ await UiUtils.createUIThroughAPI(container, video, config);
114
115
 
115
116
  const controlsButtonPanels =
116
117
  container.getElementsByClassName('shaka-controls-button-panel');
@@ -131,7 +132,7 @@ describe('UI Customization', () => {
131
132
 
132
133
  it('layout can be re-configured after the creation', async () => {
133
134
  const config = {controlPanelElements: ['time_and_duration', 'mute']};
134
- const ui = UiUtils.createUIThroughAPI(container, video, config);
135
+ const ui = await UiUtils.createUIThroughAPI(container, video, config);
135
136
 
136
137
  // Only current time and mute button should've been created
137
138
  UiUtils.confirmElementFound(container, 'shaka-current-time');
@@ -177,7 +178,7 @@ describe('UI Customization', () => {
177
178
  it('cast proxy and controls are unchanged by reconfiguration', async () => {
178
179
  const config = {controlPanelElements: ['time_and_duration', 'mute']};
179
180
  /** @type {!shaka.ui.Overlay} */
180
- const ui = UiUtils.createUIThroughAPI(container, video, config);
181
+ const ui = await UiUtils.createUIThroughAPI(container, video, config);
181
182
 
182
183
  const eventManager = new shaka.util.EventManager();
183
184
  const waiter = new shaka.test.Waiter(eventManager);