shaka-player 4.3.10 → 4.4.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/workflows/release-please.yaml +7 -0
- package/AUTHORS +9 -0
- package/CHANGELOG.md +295 -200
- package/CONTRIBUTORS +8 -0
- package/LICENSE +32 -0
- package/README.md +63 -10
- package/demo/autoTemplate.txt +40 -5
- package/demo/close_button.js +11 -0
- package/demo/common/asset.js +13 -1
- package/demo/common/assets.js +53 -3
- package/demo/common/message_ids.js +25 -1
- package/demo/config.js +69 -10
- package/demo/customWarning.txt +2 -2
- package/demo/index.html +3 -1
- package/demo/locales/en.json +26 -2
- package/demo/locales/source.json +105 -9
- package/demo/main.js +52 -9
- package/demo/search.js +3 -1
- package/demo/service_worker.js +3 -0
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/demo.compiled.debug.js +124 -112
- package/dist/demo.compiled.debug.map +3 -3
- package/dist/demo.compiled.js +124 -112
- package/dist/demo.compiled.map +3 -3
- package/dist/deps.js +46 -28
- package/dist/locales.js +28 -28
- package/dist/receiver.compiled.debug.js +52 -46
- package/dist/receiver.compiled.debug.map +3 -3
- package/dist/receiver.compiled.js +52 -46
- package/dist/receiver.compiled.map +3 -3
- package/dist/shaka-player.compiled.d.ts +676 -391
- package/dist/shaka-player.compiled.debug.d.ts +676 -391
- package/dist/shaka-player.compiled.debug.externs.js +1188 -616
- package/dist/shaka-player.compiled.debug.js +1045 -700
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +1188 -616
- package/dist/shaka-player.compiled.js +1094 -933
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +677 -392
- package/dist/shaka-player.ui.debug.d.ts +677 -392
- package/dist/shaka-player.ui.debug.externs.js +1023 -451
- package/dist/shaka-player.ui.debug.js +1100 -739
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +1023 -451
- package/dist/shaka-player.ui.js +1244 -1071
- package/dist/shaka-player.ui.map +4 -4
- package/docs/tutorials/ad_monetization.md +15 -1
- package/docs/tutorials/application-level-redirects.md +1 -1
- package/docs/tutorials/config.md +9 -5
- package/docs/tutorials/drm-config.md +61 -0
- package/docs/tutorials/fairplay.md +19 -4
- package/docs/tutorials/license-server-auth.md +4 -4
- package/docs/tutorials/license-wrapping.md +2 -2
- package/docs/tutorials/ui-customization.md +7 -3
- package/docs/tutorials/ui.md +7 -7
- package/docs/tutorials/upgrade.md +3 -0
- package/externs/ima.js +123 -2
- package/externs/isoboxer.js +217 -0
- package/externs/mediakeys.js +18 -0
- package/externs/mux.js +1 -105
- package/externs/pictureinpicture.js +48 -0
- package/externs/shaka/ads.js +61 -1
- package/externs/shaka/cea.js +110 -0
- package/externs/shaka/codecs.js +32 -0
- package/externs/shaka/manifest.js +101 -1
- package/externs/shaka/manifest_parser.js +0 -10
- package/externs/shaka/net.js +36 -7
- package/externs/shaka/offline.js +8 -1
- package/externs/shaka/player.js +220 -21
- package/externs/shaka/text.js +1 -382
- package/externs/shaka/transmuxer.js +59 -0
- package/karma.conf.js +13 -0
- package/lib/abr/simple_abr_manager.js +6 -3
- package/lib/ads/ad_manager.js +60 -2
- package/lib/ads/client_side_ad.js +86 -0
- package/lib/ads/client_side_ad_manager.js +79 -3
- package/lib/ads/server_side_ad.js +86 -0
- package/lib/ads/server_side_ad_manager.js +13 -0
- package/lib/cast/cast_utils.js +1 -0
- package/lib/cea/cea608_data_channel.js +24 -14
- package/lib/cea/cea608_memory.js +5 -2
- package/lib/cea/cea708_service.js +8 -9
- package/lib/cea/cea708_window.js +1 -2
- package/lib/cea/cea_decoder.js +23 -6
- package/lib/cea/cea_utils.js +25 -2
- package/lib/cea/dummy_caption_decoder.js +21 -0
- package/lib/cea/dummy_cea_parser.js +1 -3
- package/lib/cea/mp4_cea_parser.js +15 -10
- package/lib/cea/ts_cea_parser.js +69 -0
- package/lib/dash/content_protection.js +32 -2
- package/lib/dash/dash_parser.js +93 -31
- package/lib/dash/mpd_utils.js +6 -25
- package/lib/dash/segment_base.js +12 -14
- package/lib/dash/segment_list.js +10 -6
- package/lib/dash/segment_template.js +349 -32
- package/lib/dependencies/all.js +8 -0
- package/lib/hls/hls_classes.js +33 -8
- package/lib/hls/hls_parser.js +805 -191
- package/lib/hls/manifest_text_parser.js +4 -14
- package/lib/media/adaptation_set_criteria.js +43 -3
- package/lib/media/closed_caption_parser.js +74 -12
- package/lib/media/drm_engine.js +189 -49
- package/lib/media/gap_jumping_controller.js +1 -1
- package/lib/media/manifest_parser.js +34 -0
- package/lib/media/media_source_capabilities.js +10 -0
- package/lib/media/media_source_engine.js +475 -231
- package/lib/media/playhead.js +1 -1
- package/lib/media/presentation_timeline.js +62 -0
- package/lib/media/segment_index.js +50 -14
- package/lib/media/segment_prefetch.js +277 -0
- package/lib/media/segment_reference.js +70 -4
- package/lib/media/streaming_engine.js +258 -81
- package/lib/media/video_wrapper.js +15 -7
- package/lib/mss/content_protection.js +353 -0
- package/lib/mss/mss_parser.js +1081 -0
- package/lib/net/networking_engine.js +60 -10
- package/lib/offline/indexeddb/v1_storage_cell.js +1 -0
- package/lib/offline/indexeddb/v2_storage_cell.js +1 -0
- package/lib/offline/manifest_converter.js +6 -0
- package/lib/offline/storage.js +2 -4
- package/lib/player.js +309 -105
- package/lib/polyfill/media_capabilities.js +43 -3
- package/lib/polyfill/patchedmediakeys_apple.js +5 -0
- package/lib/polyfill/patchedmediakeys_nop.js +5 -0
- package/lib/polyfill/patchedmediakeys_webkit.js +5 -0
- package/lib/text/cue.js +208 -130
- package/lib/text/lrc_text_parser.js +2 -2
- package/lib/text/mp4_vtt_parser.js +2 -2
- package/lib/text/sbv_text_parser.js +1 -1
- package/lib/text/simple_text_displayer.js +2 -1
- package/lib/text/srt_text_parser.js +9 -1
- package/lib/text/ssa_text_parser.js +2 -2
- package/lib/text/text_engine.js +3 -21
- package/lib/text/text_utils.js +71 -20
- package/lib/text/ui_text_displayer.js +14 -14
- package/lib/text/vtt_text_parser.js +22 -14
- package/lib/transmuxer/aac_transmuxer.js +224 -0
- package/lib/transmuxer/ac3.js +142 -0
- package/lib/transmuxer/ac3_transmuxer.js +212 -0
- package/lib/transmuxer/adts.js +232 -0
- package/lib/transmuxer/ec3.js +103 -0
- package/lib/transmuxer/ec3_transmuxer.js +212 -0
- package/lib/transmuxer/h264.js +324 -0
- package/lib/transmuxer/mp3_transmuxer.js +204 -0
- package/lib/transmuxer/mpeg_audio.js +196 -0
- package/lib/transmuxer/mpeg_ts_transmuxer.js +182 -0
- package/lib/transmuxer/mss_transmuxer.js +389 -0
- package/lib/{media/transmuxer.js → transmuxer/muxjs_transmuxer.js} +34 -80
- package/lib/transmuxer/transmuxer_engine.js +161 -0
- package/lib/transmuxer/ts_transmuxer.js +738 -0
- package/lib/util/cmcd_manager.js +131 -71
- package/lib/util/error.js +62 -26
- package/lib/util/exp_golomb.js +220 -0
- package/lib/util/fairplay_utils.js +64 -13
- package/lib/util/id3_utils.js +56 -3
- package/lib/util/language_utils.js +11 -8
- package/lib/util/manifest_parser_utils.js +3 -0
- package/lib/util/mime_utils.js +44 -7
- package/lib/util/mp4_box_parsers.js +233 -5
- package/lib/util/mp4_generator.js +1381 -0
- package/lib/util/periods.js +40 -34
- package/lib/util/platform.js +17 -3
- package/lib/util/player_configuration.js +38 -1
- package/lib/util/stream_utils.js +138 -27
- package/lib/util/text_parser.js +1 -1
- package/lib/util/ts_parser.js +470 -47
- package/lib/util/xml_utils.js +16 -3
- package/maintained-branches.md +2 -2
- package/package.json +3 -1
- package/roadmap.md +21 -6
- package/shaka-player.uncompiled.js +18 -0
- package/test/abr/simple_abr_manager_unit.js +32 -4
- package/test/ads/ad_manager_unit.js +18 -2
- package/test/cast/cast_utils_unit.js +7 -2
- package/test/cea/cea608_memory_unit.js +24 -0
- package/test/cea/cea_decoder_unit.js +33 -0
- package/test/dash/dash_parser_content_protection_unit.js +93 -3
- package/test/dash/dash_parser_live_unit.js +56 -13
- package/test/dash/dash_parser_manifest_unit.js +70 -2
- package/test/dash/dash_parser_segment_base_unit.js +14 -9
- package/test/dash/dash_parser_segment_template_unit.js +286 -6
- package/test/demo/demo_unit.js +5 -1
- package/test/hls/hls_live_unit.js +188 -28
- package/test/hls/hls_parser_unit.js +250 -109
- package/test/hls/manifest_text_parser_unit.js +18 -13
- package/test/media/adaptation_set_criteria_unit.js +46 -14
- package/test/media/adaptation_set_unit.js +2 -0
- package/test/media/drm_engine_integration.js +11 -8
- package/test/media/drm_engine_unit.js +220 -7
- package/test/media/media_source_engine_integration.js +122 -38
- package/test/media/media_source_engine_unit.js +133 -153
- package/test/media/playhead_unit.js +3 -0
- package/test/media/presentation_timeline_unit.js +51 -0
- package/test/media/segment_index_unit.js +52 -0
- package/test/media/segment_prefetch_unit.js +243 -0
- package/test/media/streaming_engine_integration.js +9 -3
- package/test/media/streaming_engine_unit.js +440 -59
- package/test/mss/mss_parser_content_protection_unit.js +49 -0
- package/test/mss/mss_parser_unit.js +472 -0
- package/test/mss/mss_player_integration.js +123 -0
- package/test/offline/manifest_convert_unit.js +9 -0
- package/test/offline/storage_integration.js +6 -1
- package/test/player_unit.js +386 -133
- package/test/polyfill/media_capabilities_unit.js +18 -0
- package/test/test/assets/hls-raw-aac/fileSequence0.aac +0 -0
- package/test/test/assets/hls-raw-aac/fileSequence1.aac +0 -0
- package/test/test/assets/hls-raw-aac/fileSequence2.aac +0 -0
- package/test/test/assets/hls-raw-aac/fileSequence3.aac +0 -0
- package/test/test/assets/hls-raw-aac/manifest.m3u8 +4 -0
- package/test/test/assets/hls-raw-aac/stream.m4a.m3u8 +14 -0
- package/test/test/assets/hls-raw-ac3/fileSequence0.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/fileSequence1.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/fileSequence2.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/fileSequence3.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/fileSequence4.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/fileSequence5.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/fileSequence6.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/fileSequence7.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/prog_index.m3u8 +31 -0
- package/test/test/assets/hls-raw-ec3/fileSequence0.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/fileSequence1.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/fileSequence2.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/fileSequence3.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/fileSequence4.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/fileSequence5.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/fileSequence6.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/fileSequence7.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/prog_index.m3u8 +31 -0
- package/test/test/assets/hls-raw-mp3/chunklist_w905519204.m3u8 +13 -0
- package/test/test/assets/hls-raw-mp3/media_w905519204_0.mp3 +0 -0
- package/test/test/assets/hls-raw-mp3/media_w905519204_1.mp3 +0 -0
- package/test/test/assets/hls-raw-mp3/media_w905519204_2.mp3 +0 -0
- package/test/test/assets/hls-raw-mp3/media_w905519204_3.mp3 +0 -0
- package/test/test/assets/hls-raw-mp3/playlist.m3u8 +4 -0
- package/test/test/assets/hls-ts-aac/playlist.m3u8 +23 -0
- package/test/test/assets/hls-ts-aac/segment_0.ts +0 -0
- package/test/test/assets/hls-ts-aac/segment_1.ts +0 -0
- package/test/test/assets/hls-ts-aac/segment_2.ts +0 -0
- package/test/test/assets/hls-ts-aac/segment_3.ts +0 -0
- package/test/test/assets/hls-ts-aac/segment_4.ts +0 -0
- package/test/test/assets/hls-ts-aac/segment_5.ts +0 -0
- package/test/test/assets/hls-ts-aac/segment_6.ts +0 -0
- package/test/test/assets/hls-ts-aac/segment_7.ts +0 -0
- package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0000.ts +0 -0
- package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0001.ts +0 -0
- package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0002.ts +0 -0
- package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0003.ts +0 -0
- package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0004.ts +0 -0
- package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0005.ts +0 -0
- package/test/test/assets/hls-ts-ac3/prog_index.m3u8 +19 -0
- package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0000.ts +0 -0
- package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0001.ts +0 -0
- package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0002.ts +0 -0
- package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0003.ts +0 -0
- package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0004.ts +0 -0
- package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0005.ts +0 -0
- package/test/test/assets/hls-ts-ec3/prog_index.m3u8 +19 -0
- package/test/test/assets/hls-ts-h264/fileSequence0.ts +0 -0
- package/test/test/assets/hls-ts-h264/fileSequence1.ts +0 -0
- package/test/test/assets/hls-ts-h264/fileSequence2.ts +0 -0
- package/test/test/assets/hls-ts-h264/fileSequence3.ts +0 -0
- package/test/test/assets/hls-ts-h264/fileSequence4.ts +0 -0
- package/test/test/assets/hls-ts-h264/fileSequence5.ts +0 -0
- package/test/test/assets/hls-ts-h264/prog_index.m3u8 +25 -0
- package/test/test/assets/hls-ts-mp3/manifest.m3u8 +13 -0
- package/test/test/assets/hls-ts-mp3/media_w239891843_0.ts +0 -0
- package/test/test/assets/hls-ts-mp3/media_w239891843_1.ts +0 -0
- package/test/test/assets/hls-ts-mp3/media_w239891843_2.ts +0 -0
- package/test/test/assets/hls-ts-mp3/media_w239891843_3.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/chunk.m3u8 +17 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/n_0_0_0.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/n_1_0_0.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/n_2_0_0.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/n_3_0_0.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/n_4_0_0.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/n_5_0_0.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/playlist.m3u8 +4 -0
- package/test/test/boot.js +7 -2
- package/test/test/util/fake_ad.js +99 -0
- package/test/test/util/fake_ad_manager.js +7 -1
- package/test/test/util/fake_networking_engine.js +41 -14
- package/test/test/util/fake_segment_prefetch.js +81 -0
- package/test/test/util/manifest_generator.js +19 -5
- package/test/test/util/mss_parser_util.js +115 -0
- package/test/test/util/offline_utils.js +1 -0
- package/test/test/util/simple_fakes.js +12 -3
- package/test/test/util/streaming_engine_util.js +14 -4
- package/test/test/util/ttml_utils.js +2 -2
- package/test/text/cue_integration.js +1 -1
- package/test/text/srt_text_parser_unit.js +78 -0
- package/test/text/text_engine_unit.js +17 -8
- package/test/text/ui_text_displayer_unit.js +4 -4
- package/test/text/vtt_text_parser_unit.js +59 -40
- package/test/text/web_vtt_generator_unit.js +9 -3
- package/test/{media/transmuxer_integration.js → transmuxer/muxjs_transmuxer_integration.js} +30 -33
- package/test/transmuxer/transmuxer_engine_integration.js +60 -0
- package/test/transmuxer/transmuxer_integration.js +296 -0
- package/test/util/cmcd_manager_unit.js +162 -13
- package/test/util/language_utils_unit.js +9 -2
- package/test/util/mp4_box_parsers_unit.js +39 -4
- package/test/util/periods_unit.js +34 -26
- package/test/util/stream_utils_unit.js +60 -107
- package/ui/controls.js +19 -1
- package/ui/controls.less +1 -0
- package/ui/externs/ui.js +11 -1
- package/ui/language_utils.js +15 -0
- package/ui/less/thumbnails.less +26 -0
- package/ui/locales/oc.json +42 -0
- package/ui/pip_button.js +83 -2
- package/ui/range_element.js +15 -0
- package/ui/resolution_selection.js +9 -2
- package/ui/seek_bar.js +223 -0
- package/ui/ui.js +5 -0
- package/lib/cea/i_caption_decoder.js +0 -51
- package/lib/cea/i_cea_parser.js +0 -68
package/lib/util/xml_utils.js
CHANGED
|
@@ -321,6 +321,19 @@ shaka.util.XmlUtils = class {
|
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
|
|
324
|
+
/**
|
|
325
|
+
* Parses a boolean.
|
|
326
|
+
* @param {string} booleanString The boolean string.
|
|
327
|
+
* @return {boolean} The boolean
|
|
328
|
+
*/
|
|
329
|
+
static parseBoolean(booleanString) {
|
|
330
|
+
if (!booleanString) {
|
|
331
|
+
return false;
|
|
332
|
+
}
|
|
333
|
+
return booleanString.toLowerCase() === 'true';
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
|
|
324
337
|
/**
|
|
325
338
|
* Evaluate a division expressed as a string.
|
|
326
339
|
* @param {string} exprString
|
|
@@ -404,15 +417,15 @@ shaka.util.XmlUtils = class {
|
|
|
404
417
|
|
|
405
418
|
|
|
406
419
|
/**
|
|
407
|
-
* Parse some
|
|
408
|
-
* it was valid XML.
|
|
420
|
+
* Parse some data (auto-detecting the encoding) and return the resulting
|
|
421
|
+
* root element if it was valid XML.
|
|
409
422
|
* @param {BufferSource} data
|
|
410
423
|
* @param {string} expectedRootElemName
|
|
411
424
|
* @return {Element}
|
|
412
425
|
*/
|
|
413
426
|
static parseXml(data, expectedRootElemName) {
|
|
414
427
|
try {
|
|
415
|
-
const string = shaka.util.StringUtils.
|
|
428
|
+
const string = shaka.util.StringUtils.fromBytesAutoDetect(data);
|
|
416
429
|
return shaka.util.XmlUtils.parseXmlString(string, expectedRootElemName);
|
|
417
430
|
} catch (exception) {
|
|
418
431
|
shaka.log.error('parseXmlString threw!', exception);
|
package/maintained-branches.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
We are currently maintaining the following branches of Shaka Player:
|
|
4
4
|
|
|
5
|
-
- v4.
|
|
6
|
-
- v4.
|
|
5
|
+
- v4.4 (latest)
|
|
6
|
+
- v4.3 (previous, also in use by the Cast Application Framework)
|
|
7
7
|
- No active LTS branches at this time
|
|
8
8
|
|
|
9
9
|
Other branches are no longer receiving bug fixes, and we recommend you upgrade
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shaka-player",
|
|
3
3
|
"description": "DASH/EME video player library",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.4.0",
|
|
5
5
|
"homepage": "https://github.com/shaka-project/shaka-player",
|
|
6
6
|
"author": "Google",
|
|
7
7
|
"maintainers": [
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"cajon": "^0.4.4",
|
|
22
22
|
"clean-package": "^2.2.0",
|
|
23
23
|
"code-prettify": "^0.1.0",
|
|
24
|
+
"codem-isoboxer": "^0.3.7",
|
|
24
25
|
"color-themes-for-google-code-prettify": "^2.0.4",
|
|
25
26
|
"core-js": "^3.21.1",
|
|
26
27
|
"dialog-polyfill": "^0.5.6",
|
|
@@ -68,6 +69,7 @@
|
|
|
68
69
|
"demoDeps": [
|
|
69
70
|
"awesomplete/awesomplete.css",
|
|
70
71
|
"awesomplete/awesomplete.min.js",
|
|
72
|
+
"codem-isoboxer/dist/iso_boxer.min.js",
|
|
71
73
|
"dialog-polyfill/dialog-polyfill.css",
|
|
72
74
|
"dialog-polyfill/dist/dialog-polyfill.js",
|
|
73
75
|
"eme-encryption-scheme-polyfill/index.js",
|
package/roadmap.md
CHANGED
|
@@ -8,23 +8,38 @@ CHANGELOG.md.
|
|
|
8
8
|
The goals of future milestones are fluid until we begin that development cycle,
|
|
9
9
|
so the exact milestone for future features is not pre-determined.
|
|
10
10
|
|
|
11
|
-
Priority features up next:
|
|
12
|
-
- HLS improvements
|
|
13
|
-
https://github.com/shaka-project/shaka-player/projects/6
|
|
14
|
-
|
|
15
11
|
Candidate features for future release cycles:
|
|
16
12
|
- Preload API
|
|
17
13
|
https://github.com/shaka-project/shaka-player/issues/880
|
|
18
14
|
- Official TypeScript defs, generated from source
|
|
19
15
|
https://github.com/shaka-project/shaka-player/issues/1030
|
|
20
|
-
- Codec-switching
|
|
21
|
-
https://github.com/shaka-project/shaka-player/issues/1528
|
|
22
16
|
- Background fetch for offline storage
|
|
23
17
|
https://github.com/shaka-project/shaka-player/issues/879
|
|
24
18
|
- Smaller, more modular binary
|
|
25
19
|
|
|
20
|
+
v4.5 - 2023 Q4 or 2024 Q1
|
|
21
|
+
- Built-in transmuxer support for muxed content streams (audio+video)
|
|
22
|
+
- Built-in transmuxer support for H265 streams
|
|
23
|
+
- Remove optional mux.js dependency
|
|
24
|
+
- Codec switching
|
|
25
|
+
https://github.com/shaka-project/shaka-player/issues/1528
|
|
26
|
+
|
|
26
27
|
=====
|
|
27
28
|
|
|
29
|
+
v4.4 - 2023 Q3
|
|
30
|
+
- Built-in transmuxer for common cases, no mux.js required:
|
|
31
|
+
- Raw AAC, AC3, or EC3 to MP4 container
|
|
32
|
+
- AAC, AC3, EC3, MP3, or H264 in TS to MP4 container
|
|
33
|
+
- MP3-in-TS to raw MP3
|
|
34
|
+
- Ads API improvements
|
|
35
|
+
- CEA parser for TS
|
|
36
|
+
- HLS support for non-sequence mode (as we had in v3)
|
|
37
|
+
- Partial support for large timestamps
|
|
38
|
+
- UI support for thumbnails on seek
|
|
39
|
+
- Microsoft SmoothStreaming support
|
|
40
|
+
- Segment prefetch
|
|
41
|
+
- Low latency improvements
|
|
42
|
+
|
|
28
43
|
v4.3 - 2022 Q4
|
|
29
44
|
- Support ID3 tags in mp4
|
|
30
45
|
https://github.com/shaka-project/shaka-player/issues/3351
|
|
@@ -17,6 +17,7 @@ goog.require('shaka.cast.CastProxy');
|
|
|
17
17
|
goog.require('shaka.cast.CastReceiver');
|
|
18
18
|
goog.require('shaka.dash.DashParser');
|
|
19
19
|
goog.require('shaka.hls.HlsParser');
|
|
20
|
+
goog.require('shaka.mss.MssParser');
|
|
20
21
|
goog.require('shaka.log');
|
|
21
22
|
goog.require('shaka.media.AdaptationSetCriteria');
|
|
22
23
|
goog.require('shaka.media.InitSegmentReference');
|
|
@@ -61,6 +62,23 @@ goog.require('shaka.text.SsaTextParser');
|
|
|
61
62
|
goog.require('shaka.text.TtmlTextParser');
|
|
62
63
|
goog.require('shaka.text.VttTextParser');
|
|
63
64
|
goog.require('shaka.text.WebVttGenerator');
|
|
65
|
+
goog.require('shaka.cea.CeaDecoder');
|
|
66
|
+
goog.require('shaka.cea.Mp4CeaParser');
|
|
67
|
+
goog.require('shaka.cea.TsCeaParser');
|
|
68
|
+
goog.require('shaka.transmuxer.AacTransmuxer');
|
|
69
|
+
goog.require('shaka.transmuxer.Ac3');
|
|
70
|
+
goog.require('shaka.transmuxer.Ac3Transmuxer');
|
|
71
|
+
goog.require('shaka.transmuxer.ADTS');
|
|
72
|
+
goog.require('shaka.transmuxer.Ec3');
|
|
73
|
+
goog.require('shaka.transmuxer.Ec3Transmuxer');
|
|
74
|
+
goog.require('shaka.transmuxer.H264');
|
|
75
|
+
goog.require('shaka.transmuxer.Mp3Transmuxer');
|
|
76
|
+
goog.require('shaka.transmuxer.MpegAudio');
|
|
77
|
+
goog.require('shaka.transmuxer.MpegTsTransmuxer');
|
|
78
|
+
goog.require('shaka.transmuxer.TransmuxerEngine');
|
|
79
|
+
goog.require('shaka.transmuxer.MssTransmuxer');
|
|
80
|
+
goog.require('shaka.transmuxer.MuxjsTransmuxer');
|
|
81
|
+
goog.require('shaka.transmuxer.TsTransmuxer');
|
|
64
82
|
goog.require('shaka.ui.Controls');
|
|
65
83
|
goog.require('shaka.ui.PlayButton');
|
|
66
84
|
goog.require('shaka.ui.SettingsMenu');
|
|
@@ -158,7 +158,7 @@ describe('SimpleAbrManager', () => {
|
|
|
158
158
|
// and variant 5 - for bandwidth = 6e5
|
|
159
159
|
const expectedVariant = (bandwidth == 6e5) ? variants[5] : variants[2];
|
|
160
160
|
|
|
161
|
-
expect(switchCallback).toHaveBeenCalledWith(expectedVariant);
|
|
161
|
+
expect(switchCallback).toHaveBeenCalledWith(expectedVariant, false, 0);
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
|
|
@@ -205,7 +205,7 @@ describe('SimpleAbrManager', () => {
|
|
|
205
205
|
// Expect variants 4 to be chosen
|
|
206
206
|
const expectedVariant = variants[3];
|
|
207
207
|
|
|
208
|
-
expect(switchCallback).toHaveBeenCalledWith(expectedVariant);
|
|
208
|
+
expect(switchCallback).toHaveBeenCalledWith(expectedVariant, false, 0);
|
|
209
209
|
});
|
|
210
210
|
|
|
211
211
|
it('does not call switchCallback() if not enabled', () => {
|
|
@@ -283,7 +283,35 @@ describe('SimpleAbrManager', () => {
|
|
|
283
283
|
|
|
284
284
|
// The second parameter is missing to indicate that the buffer should not be
|
|
285
285
|
// cleared.
|
|
286
|
-
expect(switchCallback).toHaveBeenCalledWith(jasmine.any(Object));
|
|
286
|
+
expect(switchCallback).toHaveBeenCalledWith(jasmine.any(Object), false, 0);
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
it('does clear the buffer on upgrade with safemargin to 4', () => {
|
|
290
|
+
// Simulate some segments being downloaded at a high rate, to trigger an
|
|
291
|
+
// upgrade.
|
|
292
|
+
const bandwidth = 5e5;
|
|
293
|
+
const bytesPerSecond = sufficientBWMultiplier * bandwidth / 8.0;
|
|
294
|
+
|
|
295
|
+
// Set the clear buffer to true and the safe margin to 4.
|
|
296
|
+
config.clearBufferSwitch = true;
|
|
297
|
+
config.safeMarginSwitch = 4;
|
|
298
|
+
abrManager.configure(config);
|
|
299
|
+
|
|
300
|
+
abrManager.setVariants(variants);
|
|
301
|
+
abrManager.chooseVariant();
|
|
302
|
+
|
|
303
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
304
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
305
|
+
|
|
306
|
+
abrManager.enable();
|
|
307
|
+
|
|
308
|
+
// Make another call to segmentDownloaded(). switchCallback() will be
|
|
309
|
+
// called to upgrade.
|
|
310
|
+
abrManager.segmentDownloaded(1000, bytesPerSecond);
|
|
311
|
+
|
|
312
|
+
// The second parameter is missing to indicate that the buffer should not be
|
|
313
|
+
// cleared.
|
|
314
|
+
expect(switchCallback).toHaveBeenCalledWith(jasmine.any(Object), true, 4);
|
|
287
315
|
});
|
|
288
316
|
|
|
289
317
|
it('does not clear the buffer on downgrade', () => {
|
|
@@ -310,7 +338,7 @@ describe('SimpleAbrManager', () => {
|
|
|
310
338
|
|
|
311
339
|
// The second parameter is missing to indicate that the buffer should not be
|
|
312
340
|
// cleared.
|
|
313
|
-
expect(switchCallback).toHaveBeenCalledWith(jasmine.any(Object));
|
|
341
|
+
expect(switchCallback).toHaveBeenCalledWith(jasmine.any(Object), false, 0);
|
|
314
342
|
});
|
|
315
343
|
|
|
316
344
|
it('will respect restrictions', () => {
|
|
@@ -13,6 +13,8 @@ describe('Ad manager', () => {
|
|
|
13
13
|
let adManager;
|
|
14
14
|
/** @type {!HTMLElement} */
|
|
15
15
|
let adContainer;
|
|
16
|
+
/** @type {google.ima.AdsRenderingSettings} */
|
|
17
|
+
let adsRenderingSettings;
|
|
16
18
|
|
|
17
19
|
beforeEach(() => {
|
|
18
20
|
window['google'] = null;
|
|
@@ -21,6 +23,9 @@ describe('Ad manager', () => {
|
|
|
21
23
|
adManager = player.getAdManager();
|
|
22
24
|
expect(adManager instanceof shaka.ads.AdManager).toBe(true);
|
|
23
25
|
|
|
26
|
+
const config = shaka.util.PlayerConfiguration.createDefault().ads;
|
|
27
|
+
adManager.configure(config);
|
|
28
|
+
|
|
24
29
|
adContainer =
|
|
25
30
|
/** @type {!HTMLElement} */ (document.createElement('div'));
|
|
26
31
|
});
|
|
@@ -32,7 +37,7 @@ describe('Ad manager', () => {
|
|
|
32
37
|
shaka.util.Error.Code.CS_IMA_SDK_MISSING);
|
|
33
38
|
|
|
34
39
|
expect(() => adManager.initClientSide(
|
|
35
|
-
adContainer, mockVideo)).toThrow(error);
|
|
40
|
+
adContainer, mockVideo, adsRenderingSettings)).toThrow(error);
|
|
36
41
|
});
|
|
37
42
|
|
|
38
43
|
it('doesn\'t request ads until CS is initialized', () => {
|
|
@@ -83,6 +88,10 @@ describe('Ad manager', () => {
|
|
|
83
88
|
requestAds(imaRequest) {
|
|
84
89
|
numAdsRequested += 1;
|
|
85
90
|
}
|
|
91
|
+
|
|
92
|
+
contentComplete() {
|
|
93
|
+
// Nothing
|
|
94
|
+
}
|
|
86
95
|
};
|
|
87
96
|
window['google'].ima.AdsLoader = mockAdsLoader;
|
|
88
97
|
|
|
@@ -97,6 +106,10 @@ describe('Ad manager', () => {
|
|
|
97
106
|
/** @type {!google.ima.AdsManager} */ (this);
|
|
98
107
|
}
|
|
99
108
|
|
|
109
|
+
destroy() {
|
|
110
|
+
// Nothing
|
|
111
|
+
}
|
|
112
|
+
|
|
100
113
|
getCuePoints() {
|
|
101
114
|
return [];
|
|
102
115
|
}
|
|
@@ -135,7 +148,7 @@ describe('Ad manager', () => {
|
|
|
135
148
|
});
|
|
136
149
|
|
|
137
150
|
// Set up the ad manager.
|
|
138
|
-
adManager.initClientSide(adContainer, mockVideo);
|
|
151
|
+
adManager.initClientSide(adContainer, mockVideo, adsRenderingSettings);
|
|
139
152
|
goog.asserts.assert(loadEvent != null, 'loadEvent exists');
|
|
140
153
|
mockAdsLoaderInstance.dispatchEvent(/** @type {!Event} */ (loadEvent));
|
|
141
154
|
expect(loaded).toBe(true);
|
|
@@ -196,11 +209,14 @@ describe('Ad manager', () => {
|
|
|
196
209
|
window['google'].ima = {};
|
|
197
210
|
window['google'].ima.AdsLoader = {};
|
|
198
211
|
window['google'].ima.dai = {};
|
|
212
|
+
window['google'].ima.AdsRenderingSettings = class {};
|
|
199
213
|
window['google'].ima.AdsRequest = class {};
|
|
200
214
|
window['google'].ima.dai.api = {};
|
|
201
215
|
window['google'].ima.dai.api.StreamRequest = class {};
|
|
202
216
|
window['google'].ima.settings = {};
|
|
203
217
|
window['google'].ima.settings.setLocale = (locale) => {};
|
|
218
|
+
// eslint-disable-next-line max-len
|
|
219
|
+
window['google'].ima.settings.setDisableCustomPlaybackForIOS10Plus = (disable) => {};
|
|
204
220
|
window['google'].ima.AdsManagerLoadedEvent = {};
|
|
205
221
|
window['google'].ima.AdsManagerLoadedEvent.Type = {
|
|
206
222
|
ADS_MANAGER_LOADED: 'ADS_MANAGER_LOADED',
|
|
@@ -8,6 +8,9 @@ describe('CastUtils', () => {
|
|
|
8
8
|
const CastUtils = shaka.cast.CastUtils;
|
|
9
9
|
const FakeEvent = shaka.util.FakeEvent;
|
|
10
10
|
|
|
11
|
+
/** @type {shaka.extern.Stream} */
|
|
12
|
+
const fakeStream = shaka.test.StreamingEngineUtil.createMockVideoStream(1);
|
|
13
|
+
|
|
11
14
|
it('includes every Player member', () => {
|
|
12
15
|
const ignoredMembers = [
|
|
13
16
|
'constructor', // JavaScript added field
|
|
@@ -22,6 +25,7 @@ describe('CastUtils', () => {
|
|
|
22
25
|
'getManifest', // Too large to proxy
|
|
23
26
|
'getManifestParserFactory', // Would not serialize.
|
|
24
27
|
'setVideoContainer',
|
|
28
|
+
'getActiveSessionsMetadata',
|
|
25
29
|
|
|
26
30
|
// Test helper methods (not @export'd)
|
|
27
31
|
'createDrmEngine',
|
|
@@ -29,6 +33,7 @@ describe('CastUtils', () => {
|
|
|
29
33
|
'createPlayhead',
|
|
30
34
|
'createMediaSourceEngine',
|
|
31
35
|
'createStreamingEngine',
|
|
36
|
+
'disableStream',
|
|
32
37
|
];
|
|
33
38
|
|
|
34
39
|
const castMembers = CastUtils.PlayerVoidMethods
|
|
@@ -221,11 +226,11 @@ describe('CastUtils', () => {
|
|
|
221
226
|
await mediaSourceEngine.init(initObject, false);
|
|
222
227
|
const data = await shaka.test.Util.fetch(initSegmentUrl);
|
|
223
228
|
await mediaSourceEngine.appendBuffer(
|
|
224
|
-
ContentType.VIDEO, data, null,
|
|
229
|
+
ContentType.VIDEO, data, null, fakeStream,
|
|
225
230
|
/* hasClosedCaptions= */ false);
|
|
226
231
|
const data2 = await shaka.test.Util.fetch(videoSegmentUrl);
|
|
227
232
|
await mediaSourceEngine.appendBuffer(
|
|
228
|
-
ContentType.VIDEO, data2, null,
|
|
233
|
+
ContentType.VIDEO, data2, null, fakeStream,
|
|
229
234
|
/* hasClosedCaptions= */ false);
|
|
230
235
|
});
|
|
231
236
|
|
|
@@ -31,6 +31,9 @@ describe('Cea608Memory', () => {
|
|
|
31
31
|
const caption = memory.forceEmit(startTime, endTime);
|
|
32
32
|
|
|
33
33
|
const topLevelCue = new shaka.text.Cue(startTime, endTime, '');
|
|
34
|
+
topLevelCue.line = 6.25;
|
|
35
|
+
topLevelCue.lineInterpretation =
|
|
36
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
34
37
|
topLevelCue.nestedCues = [
|
|
35
38
|
CeaUtils.createDefaultCue(startTime, endTime, text),
|
|
36
39
|
];
|
|
@@ -79,6 +82,9 @@ describe('Cea608Memory', () => {
|
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
const topLevelCue = new shaka.text.Cue(startTime, endTime, '');
|
|
85
|
+
topLevelCue.line = 6.25;
|
|
86
|
+
topLevelCue.lineInterpretation =
|
|
87
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
82
88
|
topLevelCue.nestedCues = [
|
|
83
89
|
CeaUtils.createDefaultCue(startTime, endTime, expectedText),
|
|
84
90
|
];
|
|
@@ -113,6 +119,9 @@ describe('Cea608Memory', () => {
|
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
const topLevelCue = new shaka.text.Cue(startTime, endTime, '');
|
|
122
|
+
topLevelCue.line = 6.25;
|
|
123
|
+
topLevelCue.lineInterpretation =
|
|
124
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
116
125
|
topLevelCue.nestedCues = [
|
|
117
126
|
CeaUtils.createStyledCue(startTime, endTime,
|
|
118
127
|
expectedText, /* underline= */ true,
|
|
@@ -164,6 +173,9 @@ describe('Cea608Memory', () => {
|
|
|
164
173
|
// ...
|
|
165
174
|
// So we expect that test\n\ntest is emitted
|
|
166
175
|
const topLevelCue = new shaka.text.Cue(startTime, endTime, '');
|
|
176
|
+
topLevelCue.line = 37.5;
|
|
177
|
+
topLevelCue.lineInterpretation =
|
|
178
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
167
179
|
topLevelCue.nestedCues = [
|
|
168
180
|
CeaUtils.createDefaultCue(startTime, endTime, text),
|
|
169
181
|
CeaUtils.createLineBreakCue(startTime, endTime),
|
|
@@ -205,6 +217,9 @@ describe('Cea608Memory', () => {
|
|
|
205
217
|
memory.eraseChar(); // Erase the last 't' from 'testt'
|
|
206
218
|
|
|
207
219
|
const topLevelCue = new shaka.text.Cue(startTime, endTime, '');
|
|
220
|
+
topLevelCue.line = 6.25;
|
|
221
|
+
topLevelCue.lineInterpretation =
|
|
222
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
208
223
|
topLevelCue.nestedCues = [
|
|
209
224
|
CeaUtils.createDefaultCue(startTime, endTime, expectedText),
|
|
210
225
|
];
|
|
@@ -276,6 +291,9 @@ describe('Cea608Memory', () => {
|
|
|
276
291
|
|
|
277
292
|
// Expected text is 's\nt\nt\ne'
|
|
278
293
|
const topLevelCue = new shaka.text.Cue(startTime, endTime, '');
|
|
294
|
+
topLevelCue.line = 31.25;
|
|
295
|
+
topLevelCue.lineInterpretation =
|
|
296
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
279
297
|
topLevelCue.nestedCues = [
|
|
280
298
|
CeaUtils.createDefaultCue(startTime, endTime, 's'),
|
|
281
299
|
CeaUtils.createLineBreakCue(startTime, endTime),
|
|
@@ -320,6 +338,9 @@ describe('Cea608Memory', () => {
|
|
|
320
338
|
|
|
321
339
|
// Expected text is 't\ne\ns\nt'
|
|
322
340
|
const topLevelCue = new shaka.text.Cue(startTime, endTime, '');
|
|
341
|
+
topLevelCue.line = 31.25;
|
|
342
|
+
topLevelCue.lineInterpretation =
|
|
343
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
323
344
|
topLevelCue.nestedCues = [
|
|
324
345
|
CeaUtils.createDefaultCue(startTime, endTime, 't'),
|
|
325
346
|
CeaUtils.createLineBreakCue(startTime, endTime),
|
|
@@ -364,6 +385,9 @@ describe('Cea608Memory', () => {
|
|
|
364
385
|
|
|
365
386
|
// Expected text is 't\ne\ns\nt'
|
|
366
387
|
const topLevelCue = new shaka.text.Cue(startTime, endTime, '');
|
|
388
|
+
topLevelCue.line = 31.25;
|
|
389
|
+
topLevelCue.lineInterpretation =
|
|
390
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
367
391
|
topLevelCue.nestedCues = [
|
|
368
392
|
CeaUtils.createDefaultCue(startTime, endTime, 't'),
|
|
369
393
|
CeaUtils.createLineBreakCue(startTime, endTime),
|
|
@@ -65,6 +65,9 @@ describe('CeaDecoder', () => {
|
|
|
65
65
|
|
|
66
66
|
const topLevelCue = new shaka.text.Cue(
|
|
67
67
|
startTimeCaption1, startTimeCaption2, '');
|
|
68
|
+
topLevelCue.line = 81.25;
|
|
69
|
+
topLevelCue.lineInterpretation =
|
|
70
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
68
71
|
topLevelCue.nestedCues = [
|
|
69
72
|
CeaUtils.createStyledCue(
|
|
70
73
|
startTimeCaption1, startTimeCaption2, expectedText,
|
|
@@ -110,6 +113,9 @@ describe('CeaDecoder', () => {
|
|
|
110
113
|
// Since there are three style changes, there should be three nested cues.
|
|
111
114
|
const topLevelCue = new shaka.text.Cue(
|
|
112
115
|
startTimeCaption1, startTimeCaption2, '');
|
|
116
|
+
topLevelCue.line = 6.25;
|
|
117
|
+
topLevelCue.lineInterpretation =
|
|
118
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
113
119
|
|
|
114
120
|
topLevelCue.nestedCues = [
|
|
115
121
|
CeaUtils.createDefaultCue(
|
|
@@ -160,6 +166,9 @@ describe('CeaDecoder', () => {
|
|
|
160
166
|
// A single nested cue containing yellow, italicized text.
|
|
161
167
|
const topLevelCue = new shaka.text.Cue(startTimeCaption1,
|
|
162
168
|
startTimeCaption2, '');
|
|
169
|
+
topLevelCue.line = 12.5;
|
|
170
|
+
topLevelCue.lineInterpretation =
|
|
171
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
163
172
|
topLevelCue.nestedCues = [
|
|
164
173
|
CeaUtils.createStyledCue(
|
|
165
174
|
startTimeCaption1, startTimeCaption2, expectedText,
|
|
@@ -199,6 +208,9 @@ describe('CeaDecoder', () => {
|
|
|
199
208
|
|
|
200
209
|
const topLevelCue = new shaka.text.Cue(startTimeCaption1,
|
|
201
210
|
startTimeCaption2, '');
|
|
211
|
+
topLevelCue.line = 6.25;
|
|
212
|
+
topLevelCue.lineInterpretation =
|
|
213
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
202
214
|
topLevelCue.nestedCues = [
|
|
203
215
|
CeaUtils.createDefaultCue(
|
|
204
216
|
startTimeCaption1, startTimeCaption2, expectedText),
|
|
@@ -231,6 +243,9 @@ describe('CeaDecoder', () => {
|
|
|
231
243
|
|
|
232
244
|
const topLevelCue = new shaka.text.Cue(startTimeCaption1,
|
|
233
245
|
startTimeCaption2, '');
|
|
246
|
+
topLevelCue.line = 6.25;
|
|
247
|
+
topLevelCue.lineInterpretation =
|
|
248
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
234
249
|
topLevelCue.nestedCues = [
|
|
235
250
|
CeaUtils.createDefaultCue(
|
|
236
251
|
startTimeCaption1, startTimeCaption2, expectedText),
|
|
@@ -300,6 +315,9 @@ describe('CeaDecoder', () => {
|
|
|
300
315
|
// Top level cue corresponding to the first closed caption.
|
|
301
316
|
const topLevelCue1 = new shaka.text.Cue(
|
|
302
317
|
/* startTime= */ time1, /* endTime= */ time2, '');
|
|
318
|
+
topLevelCue1.line = 93.75;
|
|
319
|
+
topLevelCue1.lineInterpretation =
|
|
320
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
303
321
|
topLevelCue1.nestedCues = [
|
|
304
322
|
CeaUtils.createDefaultCue(
|
|
305
323
|
/* startTime= */ time1, /* endTime= */ time2, /* payload= */ '1.'),
|
|
@@ -308,6 +326,9 @@ describe('CeaDecoder', () => {
|
|
|
308
326
|
// Top level cue corresponding to the second closed caption.
|
|
309
327
|
const topLevelCue2 = new shaka.text.Cue(
|
|
310
328
|
/* startTime= */ time2, /* endTime= */ time3, '');
|
|
329
|
+
topLevelCue2.line = 93.75;
|
|
330
|
+
topLevelCue2.lineInterpretation =
|
|
331
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
311
332
|
topLevelCue2.nestedCues = [
|
|
312
333
|
CeaUtils.createDefaultCue(
|
|
313
334
|
/* startTime= */ time2, /* endTime= */ time3, /* payload= */ '1.'),
|
|
@@ -322,6 +343,9 @@ describe('CeaDecoder', () => {
|
|
|
322
343
|
// Top level cue corresponding to the third closed caption.
|
|
323
344
|
const topLevelCue3 = new shaka.text.Cue(
|
|
324
345
|
/* startTime= */ time3, /* endTime= */ time4, '');
|
|
346
|
+
topLevelCue3.line = 93.75;
|
|
347
|
+
topLevelCue3.lineInterpretation =
|
|
348
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
325
349
|
topLevelCue3.nestedCues = [
|
|
326
350
|
CeaUtils.createDefaultCue(
|
|
327
351
|
/* startTime= */ time3, /* endTime= */ time4, /* payload= */ '2.'),
|
|
@@ -336,6 +360,9 @@ describe('CeaDecoder', () => {
|
|
|
336
360
|
// Top level cue corresponding to the fourth closed caption.
|
|
337
361
|
const topLevelCue4 = new shaka.text.Cue(
|
|
338
362
|
/* startTime= */ time4, /* endTime= */ time5, '');
|
|
363
|
+
topLevelCue4.line = 93.75;
|
|
364
|
+
topLevelCue4.lineInterpretation =
|
|
365
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
339
366
|
topLevelCue4.nestedCues = [
|
|
340
367
|
CeaUtils.createDefaultCue(
|
|
341
368
|
/* startTime= */ time4, /* endTime= */ time5, /* payload= */ '3.'),
|
|
@@ -406,6 +433,9 @@ describe('CeaDecoder', () => {
|
|
|
406
433
|
// Top level cue corresponding to the first closed caption.
|
|
407
434
|
const topLevelCue1 = new shaka.text.Cue(/* startTime= */ 1,
|
|
408
435
|
/* endTime= */ 2, '');
|
|
436
|
+
topLevelCue1.line = 93.75;
|
|
437
|
+
topLevelCue1.lineInterpretation =
|
|
438
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
409
439
|
topLevelCue1.nestedCues = [
|
|
410
440
|
CeaUtils.createDefaultCue(
|
|
411
441
|
/* startTime= */ 1, /* endTime= */ 2, /* payload= */ '1.'),
|
|
@@ -414,6 +444,9 @@ describe('CeaDecoder', () => {
|
|
|
414
444
|
// Top level cue corresponding to the second closed caption.
|
|
415
445
|
const topLevelCue2 = new shaka.text.Cue(/* startTime= */ 2,
|
|
416
446
|
/* endTime= */ 3, '');
|
|
447
|
+
topLevelCue2.line = 25;
|
|
448
|
+
topLevelCue2.lineInterpretation =
|
|
449
|
+
shaka.text.Cue.lineInterpretation.PERCENTAGE;
|
|
417
450
|
topLevelCue2.nestedCues = [
|
|
418
451
|
CeaUtils.createDefaultCue(
|
|
419
452
|
/* startTime= */ 2, /* endTime= */ 3, /* payload= */ '1.'),
|
|
@@ -795,7 +795,37 @@ describe('DashParser ContentProtection', () => {
|
|
|
795
795
|
expect(actual).toBe('');
|
|
796
796
|
});
|
|
797
797
|
|
|
798
|
-
it('
|
|
798
|
+
it('valid dashif:Laurl node', () => {
|
|
799
|
+
const input = {
|
|
800
|
+
init: null,
|
|
801
|
+
keyId: null,
|
|
802
|
+
schemeUri: '',
|
|
803
|
+
node: strToXml([
|
|
804
|
+
'<test xmlns:dashif="https://dashif.org/CPS">',
|
|
805
|
+
' <dashif:Laurl>www.example.com</dashif:Laurl>',
|
|
806
|
+
'</test>',
|
|
807
|
+
].join('\n')),
|
|
808
|
+
};
|
|
809
|
+
const actual = ContentProtection.getWidevineLicenseUrl(input);
|
|
810
|
+
expect(actual).toBe('www.example.com');
|
|
811
|
+
});
|
|
812
|
+
|
|
813
|
+
it('dashif:Laurl without license url', () => {
|
|
814
|
+
const input = {
|
|
815
|
+
init: null,
|
|
816
|
+
keyId: null,
|
|
817
|
+
schemeUri: '',
|
|
818
|
+
node: strToXml([
|
|
819
|
+
'<test xmlns:dashif="https://dashif.org/CPS">',
|
|
820
|
+
' <dashif:Laurl></dashif:Laurl>',
|
|
821
|
+
'</test>',
|
|
822
|
+
].join('\n')),
|
|
823
|
+
};
|
|
824
|
+
const actual = ContentProtection.getWidevineLicenseUrl(input);
|
|
825
|
+
expect(actual).toBe('');
|
|
826
|
+
});
|
|
827
|
+
|
|
828
|
+
it('no ms:laurl node or dashif:Laurl node', () => {
|
|
799
829
|
const input = {
|
|
800
830
|
init: null,
|
|
801
831
|
keyId: null,
|
|
@@ -839,7 +869,37 @@ describe('DashParser ContentProtection', () => {
|
|
|
839
869
|
expect(actual).toBe('');
|
|
840
870
|
});
|
|
841
871
|
|
|
842
|
-
it('
|
|
872
|
+
it('valid dashif:Laurl node', () => {
|
|
873
|
+
const input = {
|
|
874
|
+
init: null,
|
|
875
|
+
keyId: null,
|
|
876
|
+
schemeUri: '',
|
|
877
|
+
node: strToXml([
|
|
878
|
+
'<test xmlns:dashif="https://dashif.org/CPS">',
|
|
879
|
+
' <dashif:Laurl>www.example.com</dashif:Laurl>',
|
|
880
|
+
'</test>',
|
|
881
|
+
].join('\n')),
|
|
882
|
+
};
|
|
883
|
+
const actual = ContentProtection.getClearKeyLicenseUrl(input);
|
|
884
|
+
expect(actual).toBe('www.example.com');
|
|
885
|
+
});
|
|
886
|
+
|
|
887
|
+
it('dashif:Laurl without license url', () => {
|
|
888
|
+
const input = {
|
|
889
|
+
init: null,
|
|
890
|
+
keyId: null,
|
|
891
|
+
schemeUri: '',
|
|
892
|
+
node: strToXml([
|
|
893
|
+
'<test xmlns:dashif="https://dashif.org/CPS">',
|
|
894
|
+
' <dashif:Laurl></dashif:Laurl>',
|
|
895
|
+
'</test>',
|
|
896
|
+
].join('\n')),
|
|
897
|
+
};
|
|
898
|
+
const actual = ContentProtection.getClearKeyLicenseUrl(input);
|
|
899
|
+
expect(actual).toBe('');
|
|
900
|
+
});
|
|
901
|
+
|
|
902
|
+
it('no clearkey:Laurl or dashif:Laurl node', () => {
|
|
843
903
|
const input = {
|
|
844
904
|
init: null,
|
|
845
905
|
keyId: null,
|
|
@@ -892,7 +952,37 @@ describe('DashParser ContentProtection', () => {
|
|
|
892
952
|
expect(actual).toBe('www.example.com');
|
|
893
953
|
});
|
|
894
954
|
|
|
895
|
-
it('
|
|
955
|
+
it('valid dashif:Laurl node', () => {
|
|
956
|
+
const input = {
|
|
957
|
+
init: null,
|
|
958
|
+
keyId: null,
|
|
959
|
+
schemeUri: '',
|
|
960
|
+
node: strToXml([
|
|
961
|
+
'<test xmlns:dashif="https://dashif.org/CPS">',
|
|
962
|
+
' <dashif:Laurl>www.example.com</dashif:Laurl>',
|
|
963
|
+
'</test>',
|
|
964
|
+
].join('\n')),
|
|
965
|
+
};
|
|
966
|
+
const actual = ContentProtection.getPlayReadyLicenseUrl(input);
|
|
967
|
+
expect(actual).toBe('www.example.com');
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
it('dashif:Laurl without license url', () => {
|
|
971
|
+
const input = {
|
|
972
|
+
init: null,
|
|
973
|
+
keyId: null,
|
|
974
|
+
schemeUri: '',
|
|
975
|
+
node: strToXml([
|
|
976
|
+
'<test xmlns:dashif="https://dashif.org/CPS">',
|
|
977
|
+
' <dashif:Laurl></dashif:Laurl>',
|
|
978
|
+
'</test>',
|
|
979
|
+
].join('\n')),
|
|
980
|
+
};
|
|
981
|
+
const actual = ContentProtection.getPlayReadyLicenseUrl(input);
|
|
982
|
+
expect(actual).toBe('');
|
|
983
|
+
});
|
|
984
|
+
|
|
985
|
+
it('no mspro or dashif:Laurl node', () => {
|
|
896
986
|
const input = {
|
|
897
987
|
init: null,
|
|
898
988
|
keyId: null,
|