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.
- package/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
- package/.github/workflows/release-please.yaml +2 -27
- package/AUTHORS +2 -0
- package/CHANGELOG.md +156 -39
- package/CODE_OF_CONDUCT.md +1 -1
- package/CONTRIBUTORS +2 -0
- package/README.md +54 -42
- package/demo/asset_card.js +18 -21
- package/demo/cast_receiver/index.html +0 -1
- package/demo/close_button.js +0 -3
- package/demo/common/asset.js +33 -22
- package/demo/common/assets.js +249 -60
- package/demo/config.js +219 -253
- package/demo/custom.js +88 -133
- package/demo/front.js +7 -10
- package/demo/index.html +19 -22
- package/demo/input.js +6 -11
- package/demo/input_container.js +8 -9
- package/demo/main.js +62 -126
- package/demo/search.js +29 -34
- package/demo/service_worker.js +0 -3
- package/demo/tooltip.js +3 -5
- package/demo/visualizer.js +3 -5
- package/demo/visualizer_button.js +1 -20
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/demo.compiled.debug.js +211 -228
- package/dist/demo.compiled.debug.map +4 -4
- package/dist/demo.compiled.js +211 -228
- package/dist/demo.compiled.map +4 -4
- package/dist/deps.js +42 -37
- package/dist/locales.js +34 -30
- package/dist/receiver.compiled.debug.js +64 -77
- package/dist/receiver.compiled.debug.map +4 -4
- package/dist/receiver.compiled.js +64 -77
- package/dist/receiver.compiled.map +4 -4
- package/dist/shaka-player.compiled.d.ts +343 -151
- package/dist/shaka-player.compiled.debug.d.ts +343 -151
- package/dist/shaka-player.compiled.debug.externs.js +356 -117
- package/dist/shaka-player.compiled.debug.js +952 -811
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +356 -117
- package/dist/shaka-player.compiled.js +1165 -1078
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +359 -153
- package/dist/shaka-player.ui.debug.d.ts +359 -153
- package/dist/shaka-player.ui.debug.externs.js +382 -117
- package/dist/shaka-player.ui.debug.js +1084 -918
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +382 -117
- package/dist/shaka-player.ui.js +1377 -1274
- package/dist/shaka-player.ui.map +4 -4
- package/docs/design/lcevc-integration.md +14 -14
- package/docs/tutorials/ad_monetization.md +54 -0
- package/docs/tutorials/basic-usage.md +2 -1
- package/docs/tutorials/errors.md +2 -1
- package/docs/tutorials/faq.md +27 -55
- package/docs/tutorials/index.json +2 -1
- package/docs/tutorials/lcevc.md +118 -0
- package/docs/tutorials/offline.md +10 -8
- package/docs/tutorials/plugins.md +5 -0
- package/docs/tutorials/ui-customization.md +17 -0
- package/docs/tutorials/ui.md +2 -1
- package/docs/tutorials/upgrade.md +3 -0
- package/externs/css_style_declaration.js +19 -0
- package/externs/lcevc.js +37 -13
- package/externs/managedmediasource.js +24 -0
- package/externs/media_remote.js +68 -0
- package/externs/mediatailor.js +193 -0
- package/externs/pictureinpicture.js +11 -0
- package/externs/shaka/abr_manager.js +6 -2
- package/externs/shaka/ads.js +27 -0
- package/externs/shaka/cea.js +7 -0
- package/externs/shaka/codecs.js +5 -3
- package/externs/shaka/manifest.js +31 -10
- package/externs/shaka/manifest_parser.js +24 -1
- package/externs/shaka/net.js +2 -2
- package/externs/shaka/offline.js +13 -2
- package/externs/shaka/player.js +65 -8
- package/externs/shaka/text.js +3 -1
- package/externs/shaka/transmuxer.js +1 -1
- package/karma.conf.js +7 -3
- package/lib/abr/simple_abr_manager.js +66 -9
- package/lib/ads/ad_manager.js +104 -50
- package/lib/ads/media_tailor_ad.js +297 -0
- package/lib/ads/media_tailor_ad_manager.js +839 -0
- package/lib/cast/cast_receiver.js +1 -1
- package/lib/cea/cea_decoder.js +28 -0
- package/lib/cea/dummy_caption_decoder.js +5 -0
- package/lib/cea/ts_cea_parser.js +15 -2
- package/lib/config/codec_switching_strategy.js +24 -0
- package/lib/dash/content_protection.js +120 -2
- package/lib/dash/dash_parser.js +322 -93
- package/lib/dash/mpd_utils.js +62 -37
- package/lib/dash/segment_base.js +17 -10
- package/lib/dash/segment_list.js +18 -9
- package/lib/dash/segment_template.js +122 -107
- package/lib/dependencies/all.js +8 -7
- package/lib/hls/hls_classes.js +28 -43
- package/lib/hls/hls_parser.js +798 -658
- package/lib/hls/hls_utils.js +64 -5
- package/lib/hls/manifest_text_parser.js +7 -11
- package/lib/lcevc/lcevc_dec.js +220 -0
- package/lib/media/adaptation_set.js +32 -14
- package/lib/media/adaptation_set_criteria.js +86 -16
- package/lib/media/closed_caption_parser.js +13 -0
- package/lib/media/content_workarounds.js +6 -0
- package/lib/media/drm_engine.js +8 -13
- package/lib/media/manifest_parser.js +8 -113
- package/lib/media/media_source_capabilities.js +10 -3
- package/lib/media/media_source_engine.js +286 -44
- package/lib/media/play_rate_controller.js +8 -38
- package/lib/media/presentation_timeline.js +7 -1
- package/lib/media/quality_observer.js +1 -1
- package/lib/media/segment_index.js +6 -6
- package/lib/media/segment_prefetch.js +92 -24
- package/lib/media/segment_reference.js +73 -7
- package/lib/media/segment_utils.js +343 -0
- package/lib/media/stall_detector.js +0 -3
- package/lib/media/streaming_engine.js +73 -38
- package/lib/mss/mss_parser.js +19 -2
- package/lib/net/networking_engine.js +67 -12
- package/lib/net/networking_utils.js +95 -0
- package/lib/offline/indexeddb/v1_storage_cell.js +3 -0
- package/lib/offline/indexeddb/v2_storage_cell.js +3 -0
- package/lib/offline/manifest_converter.js +3 -0
- package/lib/offline/offline_manifest_parser.js +10 -0
- package/lib/offline/storage.js +14 -7
- package/lib/player.js +1098 -1537
- package/lib/polyfill/mediasource.js +22 -1
- package/lib/text/cue.js +15 -0
- package/lib/text/mp4_ttml_parser.js +2 -2
- package/lib/text/srt_text_parser.js +2 -2
- package/lib/text/stub_text_displayer.js +51 -0
- package/lib/text/text_engine.js +3 -2
- package/lib/text/ttml_text_parser.js +45 -5
- package/lib/text/ui_text_displayer.js +8 -0
- package/lib/text/vtt_text_parser.js +40 -22
- package/lib/transmuxer/aac_transmuxer.js +1 -1
- package/lib/transmuxer/ac3_transmuxer.js +1 -1
- package/lib/transmuxer/ec3_transmuxer.js +1 -1
- package/lib/transmuxer/h264.js +5 -4
- package/lib/transmuxer/h265.js +863 -0
- package/lib/transmuxer/mp3_transmuxer.js +1 -1
- package/lib/transmuxer/mpeg_ts_transmuxer.js +4 -3
- package/lib/transmuxer/mss_transmuxer.js +1 -1
- package/lib/transmuxer/ts_transmuxer.js +187 -22
- package/lib/util/buffer_utils.js +26 -4
- package/lib/util/content_steering_manager.js +358 -0
- package/lib/util/error.js +30 -15
- package/lib/util/exp_golomb.js +30 -2
- package/lib/util/fairplay_utils.js +1 -1
- package/lib/util/fake_event.js +8 -1
- package/lib/util/id3_utils.js +50 -1
- package/lib/util/manifest_parser_utils.js +12 -8
- package/lib/util/mp4_generator.js +6 -8
- package/lib/util/mutex.js +59 -0
- package/lib/util/object_utils.js +1 -1
- package/lib/util/periods.js +156 -179
- package/lib/util/platform.js +44 -3
- package/lib/util/player_configuration.js +43 -6
- package/lib/util/state_history.js +6 -2
- package/lib/util/stream_utils.js +206 -283
- package/lib/util/ts_parser.js +335 -98
- package/lib/util/uint8array_utils.js +5 -1
- package/lib/util/xml_utils.js +5 -0
- package/maintained-branches.md +3 -2
- package/package.json +4 -6
- package/roadmap.md +25 -5
- package/shaka-player.uncompiled.js +2 -2
- package/support.html +0 -1
- package/test/abr/simple_abr_manager_unit.js +33 -33
- package/test/ads/ad_manager_unit.js +3 -2
- package/test/cast/cast_receiver_integration.js +50 -4
- package/test/cast/cast_utils_unit.js +2 -0
- package/test/cea/cea_decoder_unit.js +7 -0
- package/test/codec_switching/codec_switching_integration.js +182 -0
- package/test/dash/dash_parser_content_protection_unit.js +2 -0
- package/test/dash/dash_parser_integration.js +74 -0
- package/test/dash/dash_parser_live_unit.js +2 -19
- package/test/dash/dash_parser_manifest_unit.js +536 -2
- package/test/dash/dash_parser_segment_base_unit.js +2 -0
- package/test/dash/dash_parser_segment_list_unit.js +2 -0
- package/test/dash/dash_parser_segment_template_unit.js +2 -0
- package/test/dash/mpd_utils_unit.js +61 -30
- package/test/demo/demo_unit.js +0 -16
- package/test/hls/hls_live_unit.js +14 -3
- package/test/hls/hls_parser_unit.js +385 -33
- package/test/hls/manifest_text_parser_unit.js +32 -99
- package/test/media/adaptation_set_criteria_unit.js +284 -15
- package/test/media/adaptation_set_unit.js +2 -0
- package/test/media/content_workarounds_unit.js +1 -1
- package/test/media/drm_engine_unit.js +3 -3
- package/test/media/media_source_engine_unit.js +166 -2
- package/test/media/play_rate_controller_unit.js +0 -48
- package/test/media/segment_index_unit.js +5 -4
- package/test/media/segment_prefetch_unit.js +1 -1
- package/test/media/streaming_engine_unit.js +17 -17
- package/test/mss/mss_parser_unit.js +2 -0
- package/test/mss/mss_player_integration.js +3 -2
- package/test/net/networking_engine_unit.js +3 -3
- package/test/{media/manifest_parser_unit.js → net/networking_utils_unit.js} +2 -2
- package/test/offline/manifest_convert_unit.js +14 -0
- package/test/offline/offline_integration.js +2 -1
- package/test/offline/storage_integration.js +22 -13
- package/test/player_external.js +4 -2
- package/test/player_integration.js +15 -4
- package/test/player_load_graph_integration.js +47 -151
- package/test/player_src_equals_external.js +1 -0
- package/test/player_src_equals_integration.js +71 -4
- package/test/player_unit.js +182 -158
- package/test/test/assets/dash-aes-128/Fragments(video=0,format=mpd-time-csf) +0 -0
- package/test/test/assets/dash-aes-128/Fragments(video=20000000,format=mpd-time-csf) +0 -0
- package/test/test/assets/dash-aes-128/Fragments(video=40000000,format=mpd-time-csf) +0 -0
- package/test/test/assets/dash-aes-128/Fragments(video=60000000,format=mpd-time-csf) +0 -0
- package/test/test/assets/dash-aes-128/Fragments(video=i,format=mpd-time-csf) +0 -0
- package/test/test/assets/dash-aes-128/dash.mpd +18 -0
- package/test/test/assets/dash-aes-128/license +1 -0
- package/test/test/assets/dash-multi-codec/audio_en_2c_128k_aac.mp4 +0 -0
- package/test/test/assets/dash-multi-codec/audio_es_2c_64k_opus.webm +0 -0
- package/test/test/assets/dash-multi-codec/dash.mpd +32 -0
- package/test/test/assets/dash-multi-codec/video_144p_108k_h264.mp4 +0 -0
- package/test/test/assets/hls-ts-h265/0.ts +0 -0
- package/test/test/assets/hls-ts-h265/hevc.m3u8 +6 -0
- package/test/test/assets/hls-ts-h265/index.m3u8 +7 -0
- package/test/test/assets/hls-ts-muxed-aac-h265/0.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h265/1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h265/media.m3u8 +9 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/media.m3u8 +24 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00000.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00001.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00002.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00003.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00004.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00005.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0000.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0001.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0002.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0003.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ec3-h264/prog_index.m3u8 +14 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/index.m3u8 +23 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-1-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-2-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-3-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-4-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-5-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-6-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-7-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-8-v1-a1.ts +0 -0
- package/test/test/util/dash_parser_util.js +4 -0
- package/test/test/util/fake_ad_manager.js +20 -0
- package/test/test/util/fake_media_source_engine.js +13 -2
- package/test/test/util/fake_networking_engine.js +9 -1
- package/test/test/util/fake_segment_prefetch.js +3 -0
- package/test/test/util/manifest_generator.js +11 -3
- package/test/test/util/manifest_parser_util.js +14 -2
- package/test/test/util/mss_parser_util.js +4 -0
- package/test/test/util/offline_utils.js +2 -0
- package/test/test/util/simple_fakes.js +2 -2
- package/test/test/util/streaming_engine_util.js +10 -4
- package/test/test/util/test_scheme.js +6 -0
- package/test/test/util/ui_utils.js +4 -3
- package/test/text/mp4_ttml_parser_unit.js +4 -4
- package/test/text/srt_text_parser_unit.js +1 -1
- package/test/text/text_displayer_layout_unit.js +1 -1
- package/test/text/text_engine_unit.js +6 -0
- package/test/text/ttml_text_parser_unit.js +85 -2
- package/test/text/vtt_text_parser_unit.js +103 -31
- package/test/transmuxer/transmuxer_engine_integration.js +9 -0
- package/test/transmuxer/transmuxer_integration.js +150 -3
- package/test/ui/ad_ui_unit.js +2 -2
- package/test/ui/ui_customization_unit.js +17 -16
- package/test/ui/ui_integration.js +30 -20
- package/test/ui/ui_unit.js +28 -29
- package/test/util/buffer_utils_unit.js +1 -1
- package/test/util/content_steering_manager_unit.js +427 -0
- package/test/util/id3_utils_unit.js +52 -0
- package/test/util/stream_utils_unit.js +207 -169
- package/test/util/ts_parser_unit.js +3 -3
- package/third_party/closure-uri/uri.js +13 -1
- package/ui/audio_language_selection.js +9 -2
- package/ui/controls.js +125 -0
- package/ui/externs/ui.js +24 -2
- package/ui/language_utils.js +43 -8
- package/ui/less/range_elements.less +33 -0
- package/ui/locales/en.json +1 -0
- package/ui/locales/es-419.json +1 -0
- package/ui/locales/es.json +1 -0
- package/ui/locales/source.json +4 -0
- package/ui/localization.js +10 -0
- package/ui/pip_button.js +22 -120
- package/ui/remote_button.js +203 -0
- package/ui/resolution_selection.js +47 -10
- package/ui/seek_bar.js +296 -3
- package/ui/text_selection.js +2 -1
- package/ui/ui.js +11 -4
- package/demo/common/message_ids.js +0 -309
- package/demo/locales/en.json +0 -288
- package/demo/locales/source.json +0 -1146
- package/externs/mux.js +0 -69
- package/lib/lcevc/lcevc_dil.js +0 -152
- package/lib/routing/node.js +0 -23
- package/lib/routing/payload.js +0 -43
- package/lib/routing/walker.js +0 -587
- package/lib/transmuxer/muxjs_transmuxer.js +0 -242
- package/test/routing/walker_unit.js +0 -504
- 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()
|
|
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: '
|
|
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
|
-
|
|
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: '
|
|
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
|
-
|
|
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: '
|
|
1056
|
+
payload: '',
|
|
1002
1057
|
color: 'red',
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
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: '
|
|
1251
|
+
payload: '',
|
|
1189
1252
|
color: 'magenta',
|
|
1190
|
-
|
|
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
|
|
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
|
-
|
|
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(
|
|
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-
|
|
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
|
});
|
package/test/ui/ad_ui_unit.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
|
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);
|