shaka-player 4.6.4 → 4.7.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/README.md +1 -0
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/deps.js +9 -5
- package/dist/locales.js +29 -29
- package/dist/shaka-player.compiled.d.ts +46 -3
- package/dist/shaka-player.compiled.debug.d.ts +46 -3
- package/dist/shaka-player.compiled.debug.externs.js +45 -0
- package/dist/shaka-player.compiled.debug.js +382 -351
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +45 -0
- package/dist/shaka-player.compiled.js +1135 -1121
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +68 -4
- package/dist/shaka-player.ui.debug.d.ts +68 -4
- package/dist/shaka-player.ui.debug.externs.js +77 -0
- package/dist/shaka-player.ui.debug.js +428 -392
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +77 -0
- package/dist/shaka-player.ui.js +1304 -1290
- package/dist/shaka-player.ui.map +4 -4
- package/externs/mediasession.js +7 -0
- package/externs/shaka/abr_manager.js +8 -0
- package/externs/shaka/manifest.js +3 -3
- package/externs/shaka/player.js +59 -4
- package/lib/abr/simple_abr_manager.js +41 -15
- package/lib/cea/cea708_service.js +1 -1
- package/lib/cea/cea708_window.js +95 -7
- package/lib/dash/dash_parser.js +55 -11
- package/lib/media/adaptation_set_criteria.js +76 -10
- package/lib/media/media_source_engine.js +42 -18
- package/lib/media/segment_reference.js +12 -0
- package/lib/media/streaming_engine.js +55 -3
- package/lib/player.js +92 -6
- package/lib/util/cmsd_manager.js +269 -0
- package/lib/util/content_steering_manager.js +5 -1
- package/lib/util/mime_utils.js +6 -2
- package/lib/util/periods.js +108 -39
- package/lib/util/player_configuration.js +19 -5
- package/lib/util/stream_utils.js +82 -13
- package/package.json +1 -1
- package/ui/audio_language_selection.js +3 -0
- package/ui/controls.js +60 -0
- package/ui/externs/ui.js +12 -1
- package/ui/hidden_fast_forward_button.js +32 -0
- package/ui/hidden_rewind_button.js +32 -0
- package/ui/hidden_seek_button.js +121 -0
- package/ui/less/buttons.less +50 -0
- package/ui/less/containers.less +18 -0
- package/ui/resolution_selection.js +2 -0
- package/ui/ui.js +2 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -75
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -26
- package/.github/ISSUE_TEMPLATE/question.md +0 -26
- package/.github/config.yml +0 -1
- package/.github/workflows/appspot.yaml +0 -39
- package/.github/workflows/build-and-test.yaml +0 -222
- package/.github/workflows/compute-incremental-coverage.py +0 -265
- package/.github/workflows/custom-actions/prep-for-appspot/action.yaml +0 -56
- package/.github/workflows/custom-actions/set-commit-status/action.yaml +0 -37
- package/.github/workflows/deflake.yaml +0 -31
- package/.github/workflows/demo-version-index.yaml +0 -43
- package/.github/workflows/nightly-demo.yaml +0 -42
- package/.github/workflows/release-please.yaml +0 -193
- package/.github/workflows/report-incremental-coverage.yaml +0 -39
- package/.github/workflows/safari-homedir-launcher.sh +0 -18
- package/.github/workflows/selenium-lab-tests.yaml +0 -370
- package/.github/workflows/shaka-bot-commands/command-help.sh +0 -27
- package/.github/workflows/shaka-bot-commands/command-test.sh +0 -56
- package/.github/workflows/shaka-bot-commands/lib.sh +0 -83
- package/.github/workflows/shaka-bot-commands/main.sh +0 -51
- package/.github/workflows/sync-labels.yaml +0 -33
- package/.github/workflows/talk-to-shaka-bot.yaml +0 -29
- package/.github/workflows/update-issues.yaml +0 -31
- package/.github/workflows/update-screenshots.yaml +0 -142
- package/.github/workflows/validate-pr-title.yaml +0 -27
- package/CHANGELOG.md +0 -5774
- package/CODE_OF_CONDUCT.md +0 -93
- package/CONTRIBUTING.md +0 -76
- package/demo/TengwarTelcontar.woff2 +0 -0
- package/demo/app_logo_144.png +0 -0
- package/demo/app_logo_192.png +0 -0
- package/demo/app_logo_256.png +0 -0
- package/demo/app_logo_384.png +0 -0
- package/demo/app_logo_512.png +0 -0
- package/demo/app_manifest.json +0 -29
- package/demo/asset_card.js +0 -410
- package/demo/autoTemplate.txt +0 -61
- package/demo/cast_receiver/idle1.jpg +0 -0
- package/demo/cast_receiver/idle2.jpg +0 -0
- package/demo/cast_receiver/idle3.jpg +0 -0
- package/demo/cast_receiver/index.html +0 -75
- package/demo/cast_receiver/receiver_app.css +0 -111
- package/demo/cast_receiver/receiver_app.js +0 -158
- package/demo/close_button.js +0 -60
- package/demo/common/asset.js +0 -510
- package/demo/common/assets.js +0 -1634
- package/demo/config.js +0 -859
- package/demo/custom.js +0 -907
- package/demo/customWarning.txt +0 -8
- package/demo/demo.less +0 -591
- package/demo/demo_uncompiled.js +0 -11
- package/demo/demo_utils.js +0 -113
- package/demo/favicon.ico +0 -0
- package/demo/front.js +0 -156
- package/demo/icons/README.md +0 -4
- package/demo/icons/baseline-audiotrack-24px.svg +0 -1
- package/demo/icons/baseline-closed_caption-24px.svg +0 -1
- package/demo/icons/baseline-fast_forward-24px.svg +0 -1
- package/demo/icons/baseline-language-24px.svg +0 -1
- package/demo/icons/baseline-live_tv-24px.svg +0 -1
- package/demo/icons/baseline-subtitles-24px.svg +0 -1
- package/demo/icons/baseline-surround_sound-24px.svg +0 -1
- package/demo/icons/custom_ad.svg +0 -1
- package/demo/icons/custom_box_with_text.svg +0 -1
- package/demo/icons/custom_clear_key.svg +0 -1
- package/demo/icons/custom_high_definition.svg +0 -1
- package/demo/icons/custom_playready.svg +0 -1
- package/demo/icons/custom_ultra_high_definition.svg +0 -1
- package/demo/icons/custom_widevine.svg +0 -1
- package/demo/index.html +0 -173
- package/demo/input.js +0 -270
- package/demo/input_container.js +0 -218
- package/demo/load.js +0 -156
- package/demo/main.js +0 -1854
- package/demo/search.js +0 -452
- package/demo/service_worker.js +0 -355
- package/demo/shaka_logo_trans.png +0 -0
- package/demo/tooltip.js +0 -29
- package/demo/visualizer.js +0 -335
- package/demo/visualizer_button.js +0 -84
- package/dist/demo.compiled.debug.js +0 -340
- package/dist/demo.compiled.debug.map +0 -8
- package/dist/demo.compiled.js +0 -340
- package/dist/demo.compiled.map +0 -8
- package/dist/demo.css +0 -6
- package/dist/demo.css.map +0 -1
- package/dist/receiver.compiled.debug.js +0 -187
- package/dist/receiver.compiled.debug.map +0 -8
- package/dist/receiver.compiled.js +0 -187
- package/dist/receiver.compiled.map +0 -8
- package/docs/announcement-list-join-group.png +0 -0
- package/docs/api-mainpage.md +0 -28
- package/docs/design/REDESIGN.md +0 -283
- package/docs/design/architecture.md +0 -13
- package/docs/design/bg-fetch-after.gv +0 -29
- package/docs/design/bg-fetch-after.gv.png +0 -0
- package/docs/design/bg-fetch-before.gv +0 -18
- package/docs/design/bg-fetch-before.gv.png +0 -0
- package/docs/design/bg-fetch.md +0 -134
- package/docs/design/cast.gv +0 -35
- package/docs/design/cast.gv.png +0 -0
- package/docs/design/chromecast.md +0 -151
- package/docs/design/codec_preferences.md +0 -158
- package/docs/design/dash-audio-channels.md +0 -123
- package/docs/design/dash-manifests.md +0 -248
- package/docs/design/dash-timeline.svg +0 -4
- package/docs/design/dataflow.gv +0 -66
- package/docs/design/dataflow.gv.png +0 -0
- package/docs/design/export.md +0 -70
- package/docs/design/fuzzy-locale-matching.md +0 -40
- package/docs/design/gap-jumping.md +0 -151
- package/docs/design/lcevc-architecture.png +0 -0
- package/docs/design/lcevc-demo.png +0 -0
- package/docs/design/lcevc-integration.md +0 -72
- package/docs/design/locale_compatibility.svg +0 -1
- package/docs/design/locales_tree.svg +0 -1
- package/docs/design/localization-design-principles.md +0 -158
- package/docs/design/newdemo.gv +0 -83
- package/docs/design/newdemo.gv.png +0 -0
- package/docs/design/offline.gv +0 -43
- package/docs/design/offline.gv.png +0 -0
- package/docs/design/offline.md +0 -153
- package/docs/design/ownership.gv +0 -76
- package/docs/design/ownership.gv.png +0 -0
- package/docs/design/preload.md +0 -299
- package/docs/design/preload.png +0 -0
- package/docs/design/talking-about-languages.md +0 -46
- package/docs/design/timeline.svg +0 -152
- package/docs/design/ui.md +0 -31
- package/docs/design/ui_player_relationships.svg +0 -1
- package/docs/jsdoc-plugin.js +0 -74
- package/docs/jsdoc-template/README.md +0 -1
- package/docs/jsdoc-template/publish.js +0 -879
- package/docs/jsdoc-template/static/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/jsdoc-template/static/fonts/OpenSans-Bold-webfont.svg +0 -1830
- package/docs/jsdoc-template/static/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/jsdoc-template/static/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/jsdoc-template/static/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
- package/docs/jsdoc-template/static/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/jsdoc-template/static/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/jsdoc-template/static/fonts/OpenSans-Italic-webfont.svg +0 -1830
- package/docs/jsdoc-template/static/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/jsdoc-template/static/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/jsdoc-template/static/fonts/OpenSans-Light-webfont.svg +0 -1831
- package/docs/jsdoc-template/static/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/jsdoc-template/static/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/jsdoc-template/static/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
- package/docs/jsdoc-template/static/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/jsdoc-template/static/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/jsdoc-template/static/fonts/OpenSans-Regular-webfont.svg +0 -1831
- package/docs/jsdoc-template/static/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/jsdoc-template/static/scripts/linenumber.js +0 -44
- package/docs/jsdoc-template/static/scripts/show-widget.js +0 -55
- package/docs/jsdoc-template/static/styles/jsdoc-default.css +0 -438
- package/docs/jsdoc-template/tmpl/augments.tmpl +0 -10
- package/docs/jsdoc-template/tmpl/container.tmpl +0 -205
- package/docs/jsdoc-template/tmpl/details.tmpl +0 -152
- package/docs/jsdoc-template/tmpl/example.tmpl +0 -2
- package/docs/jsdoc-template/tmpl/examples.tmpl +0 -13
- package/docs/jsdoc-template/tmpl/exceptions.tmpl +0 -32
- package/docs/jsdoc-template/tmpl/layout.tmpl +0 -50
- package/docs/jsdoc-template/tmpl/mainpage.tmpl +0 -14
- package/docs/jsdoc-template/tmpl/members.tmpl +0 -47
- package/docs/jsdoc-template/tmpl/method.tmpl +0 -140
- package/docs/jsdoc-template/tmpl/modifies.tmpl +0 -14
- package/docs/jsdoc-template/tmpl/params.tmpl +0 -131
- package/docs/jsdoc-template/tmpl/properties.tmpl +0 -125
- package/docs/jsdoc-template/tmpl/returns.tmpl +0 -19
- package/docs/jsdoc-template/tmpl/source.tmpl +0 -8
- package/docs/jsdoc-template/tmpl/tutorial.tmpl +0 -21
- package/docs/jsdoc-template/tmpl/type.tmpl +0 -7
- package/docs/jsdoc.conf.json +0 -38
- package/docs/shaka-player-logo.png +0 -0
- package/docs/style.md +0 -174
- package/docs/tutorials/a11y.md +0 -64
- package/docs/tutorials/ad_monetization.md +0 -292
- package/docs/tutorials/application-level-redirects.md +0 -94
- package/docs/tutorials/architecture.md +0 -32
- package/docs/tutorials/basic-usage.md +0 -89
- package/docs/tutorials/blob-url.md +0 -15
- package/docs/tutorials/config.md +0 -148
- package/docs/tutorials/debugging.md +0 -189
- package/docs/tutorials/drm-config.md +0 -274
- package/docs/tutorials/errors.md +0 -95
- package/docs/tutorials/fairplay.md +0 -242
- package/docs/tutorials/faq.md +0 -252
- package/docs/tutorials/index.json +0 -29
- package/docs/tutorials/lcevc.md +0 -118
- package/docs/tutorials/license-server-auth.md +0 -248
- package/docs/tutorials/license-wrapping.md +0 -168
- package/docs/tutorials/manifest-parser.md +0 -365
- package/docs/tutorials/network-and-buffering-config.md +0 -119
- package/docs/tutorials/offline.md +0 -683
- package/docs/tutorials/plugins.md +0 -184
- package/docs/tutorials/selenium-grid-config.md +0 -174
- package/docs/tutorials/service-worker.md +0 -106
- package/docs/tutorials/ui-customization.md +0 -288
- package/docs/tutorials/ui.md +0 -232
- package/docs/tutorials/upgrade-manifest.md +0 -281
- package/docs/tutorials/upgrade.md +0 -104
- package/docs/tutorials/welcome.md +0 -108
- package/docs/tutorials/widevine-service-certs.md +0 -45
- package/karma.conf.js +0 -879
- package/maintained-branches.md +0 -15
- package/roadmap.md +0 -186
- package/test/abr/simple_abr_manager_unit.js +0 -398
- package/test/ads/ad_manager_unit.js +0 -260
- package/test/assumptions/uint8_array_unit.js +0 -22
- package/test/cast/cast_proxy_unit.js +0 -736
- package/test/cast/cast_receiver_integration.js +0 -488
- package/test/cast/cast_receiver_unit.js +0 -1183
- package/test/cast/cast_sender_unit.js +0 -973
- package/test/cast/cast_utils_unit.js +0 -311
- package/test/cea/cea608_memory_unit.js +0 -411
- package/test/cea/cea708_service_unit.js +0 -674
- package/test/cea/cea708_window_unit.js +0 -373
- package/test/cea/cea_decoder_unit.js +0 -615
- package/test/cea/dtvcc_packet_builder_unit.js +0 -158
- package/test/cea/dtvcc_packet_unit.js +0 -60
- package/test/cea/mp4_cea_parser_unit.js +0 -127
- package/test/codec_switching/codec_switching_integration.js +0 -182
- package/test/dash/dash_parser_content_protection_unit.js +0 -998
- package/test/dash/dash_parser_integration.js +0 -74
- package/test/dash/dash_parser_live_unit.js +0 -1542
- package/test/dash/dash_parser_manifest_unit.js +0 -3121
- package/test/dash/dash_parser_segment_base_unit.js +0 -421
- package/test/dash/dash_parser_segment_list_unit.js +0 -380
- package/test/dash/dash_parser_segment_template_unit.js +0 -910
- package/test/dash/mpd_utils_unit.js +0 -794
- package/test/demo/demo_unit.js +0 -108
- package/test/deprecate/enforcer_unit.js +0 -74
- package/test/deprecate/version_unit.js +0 -57
- package/test/hls/hls_live_unit.js +0 -1330
- package/test/hls/hls_parser_unit.js +0 -5276
- package/test/hls/manifest_text_parser_unit.js +0 -545
- package/test/media/adaptation_set_criteria_unit.js +0 -806
- package/test/media/adaptation_set_unit.js +0 -229
- package/test/media/buffering_observer_unit.js +0 -143
- package/test/media/closed_caption_parser_unit.js +0 -18
- package/test/media/content_workarounds_unit.js +0 -43
- package/test/media/drm_engine_integration.js +0 -356
- package/test/media/drm_engine_unit.js +0 -2805
- package/test/media/media_source_engine_integration.js +0 -691
- package/test/media/media_source_engine_unit.js +0 -1512
- package/test/media/mp4_segment_index_parser_unit.js +0 -80
- package/test/media/play_rate_controller_unit.js +0 -69
- package/test/media/playhead_unit.js +0 -1394
- package/test/media/presentation_timeline_unit.js +0 -477
- package/test/media/quality_observer_unit.js +0 -138
- package/test/media/region_observer_unit.js +0 -374
- package/test/media/region_timeline_unit.js +0 -139
- package/test/media/segment_index_unit.js +0 -1080
- package/test/media/segment_prefetch_unit.js +0 -243
- package/test/media/segment_reference_unit.js +0 -63
- package/test/media/stall_detector_unit.js +0 -184
- package/test/media/streaming_engine_integration.js +0 -632
- package/test/media/streaming_engine_unit.js +0 -4211
- package/test/media/time_ranges_utils_unit.js +0 -123
- package/test/media/webm_segment_index_parser_unit.js +0 -90
- package/test/mss/mss_parser_content_protection_unit.js +0 -49
- package/test/mss/mss_parser_unit.js +0 -474
- package/test/mss/mss_player_integration.js +0 -124
- package/test/net/data_uri_plugin_unit.js +0 -105
- package/test/net/http_plugin_unit.js +0 -439
- package/test/net/networking_engine_unit.js +0 -1236
- package/test/net/networking_utils_unit.js +0 -37
- package/test/offline/download_progress_estimator_unit.js +0 -90
- package/test/offline/indexeddb_storage_unit.js +0 -192
- package/test/offline/manifest_convert_unit.js +0 -622
- package/test/offline/offline_integration.js +0 -168
- package/test/offline/offline_manifest_parser_unit.js +0 -231
- package/test/offline/offline_scheme_unit.js +0 -154
- package/test/offline/offline_uri_unit.js +0 -59
- package/test/offline/storage_compatibility_unit.js +0 -344
- package/test/offline/storage_integration.js +0 -1858
- package/test/player_external.js +0 -237
- package/test/player_integration.js +0 -1371
- package/test/player_load_graph_integration.js +0 -865
- package/test/player_src_equals_external.js +0 -154
- package/test/player_src_equals_integration.js +0 -527
- package/test/player_unit.js +0 -4434
- package/test/polyfill/media_capabilities_unit.js +0 -277
- package/test/polyfill/patchedmediakeys_apple_unit.js +0 -130
- package/test/test/assets/3675/chunk-stream0-00001.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00002.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00003.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00004.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00005.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00006.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00007.m4s +0 -0
- package/test/test/assets/3675/dash_0.mpd +0 -30
- package/test/test/assets/3675/dash_1.mpd +0 -30
- package/test/test/assets/3675/dash_2.mpd +0 -30
- package/test/test/assets/3675/dash_3.mpd +0 -30
- package/test/test/assets/3675/dash_4.mpd +0 -30
- package/test/test/assets/3675/dash_5.mpd +0 -26
- package/test/test/assets/3675/init-stream0.m4s +0 -0
- package/test/test/assets/audio-xhe-aac.mp4 +0 -0
- package/test/test/assets/audio.ts +0 -0
- package/test/test/assets/captions-test.ts +0 -0
- package/test/test/assets/cea-init.mp4 +0 -0
- package/test/test/assets/cea-segment.mp4 +0 -0
- package/test/test/assets/chapters.srt +0 -11
- package/test/test/assets/chapters.vtt +0 -10
- package/test/test/assets/chapters2.vtt +0 -10
- 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 +0 -18
- package/test/test/assets/dash-aes-128/license +0 -1
- 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 +0 -32
- package/test/test/assets/dash-multi-codec/video_144p_108k_h264.mp4 +0 -0
- package/test/test/assets/db-dump-v1.json +0 -1
- package/test/test/assets/db-dump-v2-broken.json +0 -1
- package/test/test/assets/db-dump-v2-clean.json +0 -1
- package/test/test/assets/db-dump-v3.json +0 -1
- package/test/test/assets/db-dump-v4-broken.json +0 -1
- package/test/test/assets/db-dump-v5.json +0 -1
- package/test/test/assets/empty_caption_video_init.mp4 +0 -0
- package/test/test/assets/empty_caption_video_segment.mp4 +0 -0
- package/test/test/assets/encrypted-sintel-audio-init.mp4 +0 -0
- package/test/test/assets/encrypted-sintel-audio-segment.mp4 +0 -0
- package/test/test/assets/encrypted-sintel-video-init.mp4 +0 -0
- package/test/test/assets/encrypted-sintel-video-segment.mp4 +0 -0
- package/test/test/assets/green-pixel.mp4 +0 -0
- package/test/test/assets/green-pixel.txt +0 -15
- package/test/test/assets/h265-cea-init.mp4 +0 -0
- package/test/test/assets/h265-cea-segment.mp4 +0 -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 +0 -4
- package/test/test/assets/hls-raw-aac/stream.m4a.m3u8 +0 -14
- 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 +0 -31
- 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 +0 -31
- package/test/test/assets/hls-raw-mp3/chunklist_w905519204.m3u8 +0 -13
- 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 +0 -4
- package/test/test/assets/hls-ts-aac/playlist.m3u8 +0 -23
- 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 +0 -19
- 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 +0 -19
- 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 +0 -25
- package/test/test/assets/hls-ts-h265/0.ts +0 -0
- package/test/test/assets/hls-ts-h265/hevc.m3u8 +0 -6
- package/test/test/assets/hls-ts-h265/index.m3u8 +0 -7
- package/test/test/assets/hls-ts-mp3/manifest.m3u8 +0 -13
- 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 +0 -17
- 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 +0 -4
- 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 +0 -9
- package/test/test/assets/hls-ts-muxed-ac3-h264/media.m3u8 +0 -24
- 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 +0 -14
- package/test/test/assets/hls-ts-muxed-mp3-h264/index.m3u8 +0 -23
- 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/assets/id3-metadata.aac +0 -0
- package/test/test/assets/id3-metadata.ts +0 -0
- package/test/test/assets/index-segment.mp4 +0 -0
- package/test/test/assets/index-segment.webm +0 -0
- package/test/test/assets/init-segment.webm +0 -0
- package/test/test/assets/large_file.mpd +0 -4930
- package/test/test/assets/multidrm-audio-init.mp4 +0 -0
- package/test/test/assets/multidrm-audio-segment.mp4 +0 -0
- package/test/test/assets/multidrm-video-init.mp4 +0 -0
- package/test/test/assets/multidrm-video-segment.mp4 +0 -0
- package/test/test/assets/multiple-trun-init.mp4 +0 -0
- package/test/test/assets/multiple-trun-segment.mp4 +0 -0
- package/test/test/assets/sintel-audio-init.mp4 +0 -0
- package/test/test/assets/sintel-audio-segment.mp4 +0 -0
- package/test/test/assets/sintel-video-init.mp4 +0 -0
- package/test/test/assets/sintel-video-segment.mp4 +0 -0
- package/test/test/assets/small.mp4 +0 -0
- package/test/test/assets/text-clip-alt.vtt +0 -63
- package/test/test/assets/text-clip.vtt +0 -63
- package/test/test/assets/thumbnails-sprites.vtt +0 -10
- package/test/test/assets/thumbnails.vtt +0 -10
- package/test/test/assets/ttml-init.mp4 +0 -0
- package/test/test/assets/ttml-segment-multiplemdat.mp4 +0 -0
- package/test/test/assets/ttml-segment.mp4 +0 -0
- package/test/test/assets/video.ts +0 -0
- package/test/test/assets/vtt-init.mp4 +0 -0
- package/test/test/assets/vtt-segment-multi-payload.mp4 +0 -0
- package/test/test/assets/vtt-segment-no-duration.mp4 +0 -0
- package/test/test/assets/vtt-segment-settings.mp4 +0 -0
- package/test/test/assets/vtt-segment.mp4 +0 -0
- package/test/test/boot.js +0 -495
- package/test/test/externs/filters.js +0 -44
- package/test/test/externs/fontfaceonload.js +0 -29
- package/test/test/externs/jasmine.js +0 -670
- package/test/test/externs/karma.js +0 -26
- package/test/test/externs/require.js +0 -21
- package/test/test/externs/sprintf.js +0 -18
- package/test/test/namespace.js +0 -10
- package/test/test/util/canned_idb.js +0 -379
- package/test/test/util/cea_utils.js +0 -60
- package/test/test/util/dash_parser_util.js +0 -329
- package/test/test/util/fake_ad.js +0 -321
- package/test/test/util/fake_ad_manager.js +0 -122
- package/test/test/util/fake_demo_main.js +0 -144
- package/test/test/util/fake_drm_engine.js +0 -103
- package/test/test/util/fake_media_source_engine.js +0 -464
- package/test/test/util/fake_networking_engine.js +0 -381
- package/test/test/util/fake_segment_prefetch.js +0 -84
- package/test/test/util/fake_text_displayer.js +0 -60
- package/test/test/util/id3_generator.js +0 -100
- package/test/test/util/indexeddb_utils.js +0 -124
- package/test/test/util/jasmine_fetch.js +0 -382
- package/test/test/util/layout_tests.js +0 -435
- package/test/test/util/loader.js +0 -88
- package/test/test/util/manifest_generator.js +0 -705
- package/test/test/util/manifest_parser_util.js +0 -101
- package/test/test/util/mss_parser_util.js +0 -119
- package/test/test/util/offline_utils.js +0 -105
- package/test/test/util/simple_fakes.js +0 -535
- package/test/test/util/stream_generator.js +0 -676
- package/test/test/util/streaming_engine_util.js +0 -506
- package/test/test/util/test_scheme.js +0 -778
- package/test/test/util/ttml_utils.js +0 -77
- package/test/test/util/ui_utils.js +0 -183
- package/test/test/util/util.js +0 -374
- package/test/test/util/waiter.js +0 -406
- package/test/text/cue_integration.js +0 -51
- package/test/text/lrc_text_parser_unit.js +0 -98
- package/test/text/mp4_ttml_parser_unit.js +0 -171
- package/test/text/mp4_vtt_parser_unit.js +0 -195
- package/test/text/sbv_text_parser_unit.js +0 -81
- package/test/text/simple_text_displayer_unit.js +0 -468
- package/test/text/srt_text_parser_unit.js +0 -163
- package/test/text/ssa_text_parser_unit.js +0 -382
- package/test/text/text_displayer_layout_unit.js +0 -323
- package/test/text/text_engine_unit.js +0 -500
- package/test/text/text_track_integration.js +0 -186
- package/test/text/ttml_text_parser_unit.js +0 -2176
- package/test/text/ui_text_displayer_unit.js +0 -608
- package/test/text/vtt_text_parser_unit.js +0 -1363
- package/test/text/web_vtt_generator_unit.js +0 -144
- package/test/text/web_vtt_layout_integration.js +0 -524
- package/test/transmuxer/transmuxer_engine_integration.js +0 -69
- package/test/transmuxer/transmuxer_integration.js +0 -443
- package/test/ui/ad_ui_unit.js +0 -369
- package/test/ui/localization_unit.js +0 -508
- package/test/ui/ui_customization_unit.js +0 -208
- package/test/ui/ui_integration.js +0 -669
- package/test/ui/ui_unit.js +0 -902
- package/test/util/abortable_operation_unit.js +0 -624
- package/test/util/array_utils_unit.js +0 -58
- package/test/util/buffer_utils_unit.js +0 -185
- package/test/util/cmcd_manager_unit.js +0 -440
- package/test/util/content_steering_manager_unit.js +0 -427
- package/test/util/data_view_reader_unit.js +0 -254
- package/test/util/ebml_parser_unit.js +0 -297
- package/test/util/event_manager_unit.js +0 -185
- package/test/util/fake_event_target_unit.js +0 -123
- package/test/util/id3_utils_unit.js +0 -168
- package/test/util/iterables_unit.js +0 -68
- package/test/util/language_utils_unit.js +0 -240
- package/test/util/manifest_parser_utils_unit.js +0 -55
- package/test/util/mime_utils_unit.js +0 -64
- package/test/util/mp4_box_parsers_unit.js +0 -246
- package/test/util/mp4_parser_unit.js +0 -373
- package/test/util/multi_map_unit.js +0 -94
- package/test/util/object_utils_unit.js +0 -79
- package/test/util/periods_unit.js +0 -1623
- package/test/util/pssh_unit.js +0 -226
- package/test/util/state_history_unit.js +0 -101
- package/test/util/stream_utils_unit.js +0 -1068
- package/test/util/string_utils_unit.js +0 -166
- package/test/util/text_parser_unit.js +0 -165
- package/test/util/ts_parser_unit.js +0 -77
- package/test/util/xml_utils_unit.js +0 -444
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/*! @license
|
|
2
|
+
* Shaka Player
|
|
3
|
+
* Copyright 2016 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
goog.provide('shaka.util.CmsdManager');
|
|
8
|
+
|
|
9
|
+
goog.require('shaka.log');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @summary
|
|
14
|
+
* A CmsdManager maintains CMSD state as well as a collection of utility
|
|
15
|
+
* functions.
|
|
16
|
+
* @export
|
|
17
|
+
*/
|
|
18
|
+
shaka.util.CmsdManager = class {
|
|
19
|
+
/**
|
|
20
|
+
* @param {shaka.extern.CmsdConfiguration} config
|
|
21
|
+
*/
|
|
22
|
+
constructor(config) {
|
|
23
|
+
/** @private {shaka.extern.CmsdConfiguration} */
|
|
24
|
+
this.config_ = config;
|
|
25
|
+
|
|
26
|
+
/** @private {?Map.<string, (boolean|number|string)>} */
|
|
27
|
+
this.staticParams_ = null;
|
|
28
|
+
|
|
29
|
+
/** @private {?Map.<string, (boolean|number|string)>} */
|
|
30
|
+
this.dynamicParams_ = null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Called by the Player to provide an updated configuration any time it
|
|
35
|
+
* changes.
|
|
36
|
+
*
|
|
37
|
+
* @param {shaka.extern.CmsdConfiguration} config
|
|
38
|
+
*/
|
|
39
|
+
configure(config) {
|
|
40
|
+
this.config_ = config;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Resets the CmsdManager.
|
|
46
|
+
*/
|
|
47
|
+
reset() {
|
|
48
|
+
this.staticParams_ = null;
|
|
49
|
+
this.dynamicParams_ = null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Called by the Player to provide the headers of the latest request.
|
|
54
|
+
*
|
|
55
|
+
* @param {!Object.<string, string>} headers
|
|
56
|
+
*/
|
|
57
|
+
processHeaders(headers) {
|
|
58
|
+
if (!this.config_.enabled) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const CmsdManager = shaka.util.CmsdManager;
|
|
62
|
+
const cmsdStatic = headers[CmsdManager.CMSD_STATIC_HEADER_NAME_];
|
|
63
|
+
if (cmsdStatic) {
|
|
64
|
+
const staticParams = this.parseCMSDStatic_(cmsdStatic);
|
|
65
|
+
if (staticParams) {
|
|
66
|
+
this.staticParams_ = staticParams;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const cmsdDynamic = headers[CmsdManager.CMSD_DYNAMIC_HEADER_NAME_];
|
|
70
|
+
if (cmsdDynamic) {
|
|
71
|
+
const dynamicParams = this.parseCMSDDynamic_(cmsdDynamic);
|
|
72
|
+
if (dynamicParams) {
|
|
73
|
+
this.dynamicParams_ = dynamicParams;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Returns the max bitrate in bits per second. If there is no max bitrate or
|
|
80
|
+
* it's not enabled, it returns null.
|
|
81
|
+
*
|
|
82
|
+
* @return {?number}
|
|
83
|
+
* @export
|
|
84
|
+
*/
|
|
85
|
+
getMaxBitrate() {
|
|
86
|
+
const key = shaka.util.CmsdManager.KEYS_.MAX_SUGGESTED_BITRATE;
|
|
87
|
+
if (!this.config_.enabled || !this.config_.applyMaximumSuggestedBitrate ||
|
|
88
|
+
!this.dynamicParams_ || !this.dynamicParams_.has(key)) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
return /** @type {number} */(this.dynamicParams_.get(key)) * 1000;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Returns the estimated throughput in bits per second. If there is no
|
|
96
|
+
* estimated throughput or it's not enabled, it returns null.
|
|
97
|
+
*
|
|
98
|
+
* @return {?number}
|
|
99
|
+
* @export
|
|
100
|
+
*/
|
|
101
|
+
getEstimatedThroughput() {
|
|
102
|
+
const key = shaka.util.CmsdManager.KEYS_.ESTIMATED_THROUGHPUT;
|
|
103
|
+
if (!this.config_.enabled || !this.dynamicParams_ ||
|
|
104
|
+
!this.dynamicParams_.has(key)) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
return /** @type {number} */(this.dynamicParams_.get(key)) * 1000;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Returns the response delay in milliseconds. If there is no response delay
|
|
112
|
+
* or it's not enabled, it returns null.
|
|
113
|
+
*
|
|
114
|
+
* @return {?number}
|
|
115
|
+
* @export
|
|
116
|
+
*/
|
|
117
|
+
getResponseDelay() {
|
|
118
|
+
const key = shaka.util.CmsdManager.KEYS_.RESPONSE_DELAY;
|
|
119
|
+
if (!this.config_.enabled || !this.dynamicParams_ ||
|
|
120
|
+
!this.dynamicParams_.has(key)) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
return /** @type {number} */(this.dynamicParams_.get(key));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Returns the RTT in milliseconds. If there is no RTT or it's not enabled,
|
|
128
|
+
* it returns null.
|
|
129
|
+
*
|
|
130
|
+
* @return {?number}
|
|
131
|
+
* @export
|
|
132
|
+
*/
|
|
133
|
+
getRoundTripTime() {
|
|
134
|
+
const key = shaka.util.CmsdManager.KEYS_.ROUND_TRIP_TIME;
|
|
135
|
+
if (!this.config_.enabled || !this.dynamicParams_ ||
|
|
136
|
+
!this.dynamicParams_.has(key)) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
return /** @type {number} */(this.dynamicParams_.get(key));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Gets the current bandwidth estimate.
|
|
144
|
+
*
|
|
145
|
+
* @param {number} defaultEstimate
|
|
146
|
+
* @return {number} The bandwidth estimate in bits per second.
|
|
147
|
+
* @export
|
|
148
|
+
*/
|
|
149
|
+
getBandwidthEstimate(defaultEstimate) {
|
|
150
|
+
const estimatedThroughput = this.getEstimatedThroughput();
|
|
151
|
+
if (!estimatedThroughput) {
|
|
152
|
+
return defaultEstimate;
|
|
153
|
+
}
|
|
154
|
+
const etpWeightRatio = this.config_.estimatedThroughputWeightRatio;
|
|
155
|
+
if (etpWeightRatio > 0 && etpWeightRatio <= 1) {
|
|
156
|
+
return (defaultEstimate * (1 - etpWeightRatio)) +
|
|
157
|
+
(estimatedThroughput * etpWeightRatio);
|
|
158
|
+
}
|
|
159
|
+
return defaultEstimate;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* @param {string} headerValue
|
|
164
|
+
* @return {?Map.<string, (boolean|number|string)>}
|
|
165
|
+
* @private
|
|
166
|
+
*/
|
|
167
|
+
parseCMSDStatic_(headerValue) {
|
|
168
|
+
try {
|
|
169
|
+
const params = new Map();
|
|
170
|
+
const items = headerValue.split(',');
|
|
171
|
+
for (let i = 0; i < items.length; i++) {
|
|
172
|
+
// <key>=<value>
|
|
173
|
+
const substrs = items[i].split('=');
|
|
174
|
+
const key = substrs[0];
|
|
175
|
+
const value = this.parseParameterValue_(substrs[1]);
|
|
176
|
+
params.set(key, value);
|
|
177
|
+
}
|
|
178
|
+
return params;
|
|
179
|
+
} catch (e) {
|
|
180
|
+
shaka.log.warning(
|
|
181
|
+
'Failed to parse CMSD-Static response header value:', e);
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* @param {string} headerValue
|
|
188
|
+
* @return {?Map.<string, (boolean|number|string)>}
|
|
189
|
+
* @private
|
|
190
|
+
*/
|
|
191
|
+
parseCMSDDynamic_(headerValue) {
|
|
192
|
+
try {
|
|
193
|
+
const params = new Map();
|
|
194
|
+
const items = headerValue.split(';');
|
|
195
|
+
// Server identifier as 1st item
|
|
196
|
+
for (let i = 1; i < items.length; i++) {
|
|
197
|
+
// <key>=<value>
|
|
198
|
+
const substrs = items[i].split('=');
|
|
199
|
+
const key = substrs[0];
|
|
200
|
+
const value = this.parseParameterValue_(substrs[1]);
|
|
201
|
+
params.set(key, value);
|
|
202
|
+
}
|
|
203
|
+
return params;
|
|
204
|
+
} catch (e) {
|
|
205
|
+
shaka.log.warning(
|
|
206
|
+
'Failed to parse CMSD-Dynamic response header value:', e);
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @param {string} value
|
|
213
|
+
* @return {(boolean|number|string)}
|
|
214
|
+
* @private
|
|
215
|
+
*/
|
|
216
|
+
parseParameterValue_(value) {
|
|
217
|
+
// If the value type is BOOLEAN and the value is TRUE, then the equals
|
|
218
|
+
// sign and the value are omitted
|
|
219
|
+
if (!value) {
|
|
220
|
+
return true;
|
|
221
|
+
}
|
|
222
|
+
// Check if boolean 'false'
|
|
223
|
+
if (value.toLowerCase() === 'false') {
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
// Check if a number
|
|
227
|
+
if (/^[-0-9]/.test(value)) {
|
|
228
|
+
return parseInt(value, 10);
|
|
229
|
+
}
|
|
230
|
+
// Value is a string, remove double quotes from string value
|
|
231
|
+
return value.replace(/["]+/g, '');
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* @const {string}
|
|
237
|
+
* @private
|
|
238
|
+
*/
|
|
239
|
+
shaka.util.CmsdManager.CMSD_STATIC_HEADER_NAME_ = 'cmsd-static';
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @const {string}
|
|
243
|
+
* @private
|
|
244
|
+
*/
|
|
245
|
+
shaka.util.CmsdManager.CMSD_DYNAMIC_HEADER_NAME_ = 'cmsd-dynamic';
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @enum {string}
|
|
249
|
+
* @private
|
|
250
|
+
*/
|
|
251
|
+
shaka.util.CmsdManager.KEYS_ = {
|
|
252
|
+
AVAILABILITY_TIME: 'at',
|
|
253
|
+
DURESS: 'du',
|
|
254
|
+
ENCODED_BITRATE: 'br',
|
|
255
|
+
ESTIMATED_THROUGHPUT: 'etp',
|
|
256
|
+
HELD_TIME: 'ht',
|
|
257
|
+
INTERMEDIARY_IDENTIFIER: 'n',
|
|
258
|
+
MAX_SUGGESTED_BITRATE: 'mb',
|
|
259
|
+
NEXT_OBJECT_RESPONSE: 'nor',
|
|
260
|
+
NEXT_RANGE_RESPONSE: 'nrr',
|
|
261
|
+
OBJECT_DURATION: 'd',
|
|
262
|
+
OBJECT_TYPE: 'ot',
|
|
263
|
+
RESPONSE_DELAY: 'rd',
|
|
264
|
+
ROUND_TRIP_TIME: 'rtt',
|
|
265
|
+
STARTUP: 'su',
|
|
266
|
+
STREAM_TYPE: 'st',
|
|
267
|
+
STREAMING_FORMAT: 'sf',
|
|
268
|
+
VERSION: 'v',
|
|
269
|
+
};
|
|
@@ -236,9 +236,10 @@ shaka.util.ContentSteeringManager = class {
|
|
|
236
236
|
* Get the base locations ordered according the priority.
|
|
237
237
|
*
|
|
238
238
|
* @param {string|number} streamId
|
|
239
|
+
* @param {boolean=} ignoreBaseUrls
|
|
239
240
|
* @return {!Array.<string>}
|
|
240
241
|
*/
|
|
241
|
-
getLocations(streamId) {
|
|
242
|
+
getLocations(streamId, ignoreBaseUrls = false) {
|
|
242
243
|
const streamLocations = this.locations_.get(streamId) || new Map();
|
|
243
244
|
/** @type {!Array.<!{pathwayId: string, location: string}>} */
|
|
244
245
|
let locationsPathwayIdMap = [];
|
|
@@ -305,6 +306,9 @@ shaka.util.ContentSteeringManager = class {
|
|
|
305
306
|
locations.push(location);
|
|
306
307
|
}
|
|
307
308
|
}
|
|
309
|
+
if (ignoreBaseUrls) {
|
|
310
|
+
return locations;
|
|
311
|
+
}
|
|
308
312
|
return shaka.util.ManifestParserUtils.resolveUris(
|
|
309
313
|
this.baseUris_, locations);
|
|
310
314
|
}
|
package/lib/util/mime_utils.js
CHANGED
|
@@ -181,8 +181,12 @@ shaka.util.MimeUtils = class {
|
|
|
181
181
|
* @return {string}
|
|
182
182
|
*/
|
|
183
183
|
static getCodecBase(codecString) {
|
|
184
|
-
const
|
|
185
|
-
|
|
184
|
+
const codecsBase = [];
|
|
185
|
+
for (const codec of codecString.split(',')) {
|
|
186
|
+
const parts = shaka.util.MimeUtils.getCodecParts_(codec);
|
|
187
|
+
codecsBase.push(parts[0]);
|
|
188
|
+
}
|
|
189
|
+
return codecsBase.sort().join(',');
|
|
186
190
|
}
|
|
187
191
|
|
|
188
192
|
/**
|
package/lib/util/periods.js
CHANGED
|
@@ -44,6 +44,9 @@ shaka.util.PeriodCombiner = class {
|
|
|
44
44
|
/** @private {!Array.<shaka.extern.Stream>} */
|
|
45
45
|
this.imageStreams_ = [];
|
|
46
46
|
|
|
47
|
+
/** @private {boolean} */
|
|
48
|
+
this.multiTypeVariantsAllowed_ = false;
|
|
49
|
+
|
|
47
50
|
/**
|
|
48
51
|
* The IDs of the periods we have already used to generate streams.
|
|
49
52
|
* This helps us identify the periods which have been added when a live
|
|
@@ -201,25 +204,25 @@ shaka.util.PeriodCombiner = class {
|
|
|
201
204
|
}
|
|
202
205
|
|
|
203
206
|
await Promise.all([
|
|
204
|
-
|
|
207
|
+
this.combine_(
|
|
205
208
|
this.audioStreams_,
|
|
206
209
|
audioStreamsPerPeriod,
|
|
207
210
|
firstNewPeriodIndex,
|
|
208
211
|
shaka.util.PeriodCombiner.cloneStream_,
|
|
209
212
|
shaka.util.PeriodCombiner.concatenateStreams_),
|
|
210
|
-
|
|
213
|
+
this.combine_(
|
|
211
214
|
this.videoStreams_,
|
|
212
215
|
videoStreamsPerPeriod,
|
|
213
216
|
firstNewPeriodIndex,
|
|
214
217
|
shaka.util.PeriodCombiner.cloneStream_,
|
|
215
218
|
shaka.util.PeriodCombiner.concatenateStreams_),
|
|
216
|
-
|
|
219
|
+
this.combine_(
|
|
217
220
|
this.textStreams_,
|
|
218
221
|
textStreamsPerPeriod,
|
|
219
222
|
firstNewPeriodIndex,
|
|
220
223
|
shaka.util.PeriodCombiner.cloneStream_,
|
|
221
224
|
shaka.util.PeriodCombiner.concatenateStreams_),
|
|
222
|
-
|
|
225
|
+
this.combine_(
|
|
223
226
|
this.imageStreams_,
|
|
224
227
|
imageStreamsPerPeriod,
|
|
225
228
|
firstNewPeriodIndex,
|
|
@@ -417,28 +420,30 @@ shaka.util.PeriodCombiner = class {
|
|
|
417
420
|
ContentType.IMAGE));
|
|
418
421
|
}
|
|
419
422
|
|
|
420
|
-
const
|
|
423
|
+
const periodCombiner = new shaka.util.PeriodCombiner();
|
|
424
|
+
|
|
425
|
+
const combinedAudioStreamDbs = await periodCombiner.combine_(
|
|
421
426
|
/* outputStreams= */ [],
|
|
422
427
|
audioStreamDbsPerPeriod,
|
|
423
428
|
/* firstNewPeriodIndex= */ 0,
|
|
424
429
|
shaka.util.PeriodCombiner.cloneStreamDB_,
|
|
425
430
|
shaka.util.PeriodCombiner.concatenateStreamDBs_);
|
|
426
431
|
|
|
427
|
-
const combinedVideoStreamDbs = await
|
|
432
|
+
const combinedVideoStreamDbs = await periodCombiner.combine_(
|
|
428
433
|
/* outputStreams= */ [],
|
|
429
434
|
videoStreamDbsPerPeriod,
|
|
430
435
|
/* firstNewPeriodIndex= */ 0,
|
|
431
436
|
shaka.util.PeriodCombiner.cloneStreamDB_,
|
|
432
437
|
shaka.util.PeriodCombiner.concatenateStreamDBs_);
|
|
433
438
|
|
|
434
|
-
const combinedTextStreamDbs = await
|
|
439
|
+
const combinedTextStreamDbs = await periodCombiner.combine_(
|
|
435
440
|
/* outputStreams= */ [],
|
|
436
441
|
textStreamDbsPerPeriod,
|
|
437
442
|
/* firstNewPeriodIndex= */ 0,
|
|
438
443
|
shaka.util.PeriodCombiner.cloneStreamDB_,
|
|
439
444
|
shaka.util.PeriodCombiner.concatenateStreamDBs_);
|
|
440
445
|
|
|
441
|
-
const combinedImageStreamDbs = await
|
|
446
|
+
const combinedImageStreamDbs = await periodCombiner.combine_(
|
|
442
447
|
/* outputStreams= */ [],
|
|
443
448
|
imageStreamDbsPerPeriod,
|
|
444
449
|
/* firstNewPeriodIndex= */ 0,
|
|
@@ -499,7 +504,7 @@ shaka.util.PeriodCombiner = class {
|
|
|
499
504
|
*
|
|
500
505
|
* @private
|
|
501
506
|
*/
|
|
502
|
-
|
|
507
|
+
async combine_(
|
|
503
508
|
outputStreams, streamsPerPeriod, firstNewPeriodIndex, clone, concat) {
|
|
504
509
|
const ContentType = shaka.util.ManifestParserUtils.ContentType;
|
|
505
510
|
|
|
@@ -517,7 +522,7 @@ shaka.util.PeriodCombiner = class {
|
|
|
517
522
|
// First, extend all existing output Streams into the new periods.
|
|
518
523
|
for (const outputStream of outputStreams) {
|
|
519
524
|
// eslint-disable-next-line no-await-in-loop
|
|
520
|
-
const ok = await
|
|
525
|
+
const ok = await this.extendExistingOutputStream_(
|
|
521
526
|
outputStream, streamsPerPeriod, firstNewPeriodIndex, concat,
|
|
522
527
|
unusedStreamsPerPeriod);
|
|
523
528
|
if (!ok) {
|
|
@@ -537,10 +542,9 @@ shaka.util.PeriodCombiner = class {
|
|
|
537
542
|
for (const unusedStreams of unusedStreamsPerPeriod) {
|
|
538
543
|
for (const stream of unusedStreams) {
|
|
539
544
|
// Create a new output stream which includes this input stream.
|
|
540
|
-
const outputStream =
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
unusedStreamsPerPeriod);
|
|
545
|
+
const outputStream = this.createNewOutputStream_(
|
|
546
|
+
stream, streamsPerPeriod, clone, concat,
|
|
547
|
+
unusedStreamsPerPeriod);
|
|
544
548
|
if (outputStream) {
|
|
545
549
|
outputStreams.push(outputStream);
|
|
546
550
|
} else {
|
|
@@ -562,11 +566,8 @@ shaka.util.PeriodCombiner = class {
|
|
|
562
566
|
}
|
|
563
567
|
// If this stream has a different codec/MIME than any other stream,
|
|
564
568
|
// then we can't play it.
|
|
565
|
-
// TODO(#1528): Consider changing this when we support codec switching.
|
|
566
569
|
const hasCodec = outputStreams.some((s) => {
|
|
567
|
-
return
|
|
568
|
-
shaka.util.MimeUtils.getNormalizedCodec(s.codecs) ==
|
|
569
|
-
shaka.util.MimeUtils.getNormalizedCodec(stream.codecs);
|
|
570
|
+
return this.areAVStreamsCompatible_(stream, s);
|
|
570
571
|
});
|
|
571
572
|
if (!hasCodec) {
|
|
572
573
|
continue;
|
|
@@ -606,11 +607,10 @@ shaka.util.PeriodCombiner = class {
|
|
|
606
607
|
*
|
|
607
608
|
* @private
|
|
608
609
|
*/
|
|
609
|
-
|
|
610
|
+
async extendExistingOutputStream_(
|
|
610
611
|
outputStream, streamsPerPeriod, firstNewPeriodIndex, concat,
|
|
611
612
|
unusedStreamsPerPeriod) {
|
|
612
|
-
|
|
613
|
-
outputStream);
|
|
613
|
+
this.findMatchesInAllPeriods_(streamsPerPeriod, outputStream);
|
|
614
614
|
|
|
615
615
|
// This only exists where T == Stream, and this should only ever be called
|
|
616
616
|
// on Stream types. StreamDB should not have pre-existing output streams.
|
|
@@ -668,6 +668,14 @@ shaka.util.PeriodCombiner = class {
|
|
|
668
668
|
goog.asserts.assert(match.segmentIndex,
|
|
669
669
|
'stream should have a segmentIndex.');
|
|
670
670
|
if (match.segmentIndex) {
|
|
671
|
+
match.segmentIndex.forEachTopLevelReference((ref) => {
|
|
672
|
+
ref.codecs = match.codecs;
|
|
673
|
+
ref.mimeType = match.mimeType;
|
|
674
|
+
if (ref.initSegmentReference) {
|
|
675
|
+
ref.initSegmentReference.codecs = match.codecs;
|
|
676
|
+
ref.initSegmentReference.mimeType = match.mimeType;
|
|
677
|
+
}
|
|
678
|
+
});
|
|
671
679
|
outputStream.segmentIndex.appendSegmentIndex(match.segmentIndex);
|
|
672
680
|
}
|
|
673
681
|
}
|
|
@@ -697,14 +705,13 @@ shaka.util.PeriodCombiner = class {
|
|
|
697
705
|
*
|
|
698
706
|
* @private
|
|
699
707
|
*/
|
|
700
|
-
|
|
708
|
+
createNewOutputStream_(
|
|
701
709
|
stream, streamsPerPeriod, clone, concat, unusedStreamsPerPeriod) {
|
|
702
710
|
// Start by cloning the stream without segments, key IDs, etc.
|
|
703
711
|
const outputStream = clone(stream);
|
|
704
712
|
|
|
705
713
|
// Find best-matching streams in all periods.
|
|
706
|
-
|
|
707
|
-
outputStream);
|
|
714
|
+
this.findMatchesInAllPeriods_(streamsPerPeriod, outputStream);
|
|
708
715
|
|
|
709
716
|
// This only exists where T == Stream.
|
|
710
717
|
if (outputStream.createSegmentIndex) {
|
|
@@ -778,6 +785,12 @@ shaka.util.PeriodCombiner = class {
|
|
|
778
785
|
|
|
779
786
|
if (used) {
|
|
780
787
|
unusedStreamsPerPeriod[i].delete(match);
|
|
788
|
+
// Add the codec of this stream to the output stream's codecs.
|
|
789
|
+
const codecs = new Set(outputStream.codecs.split(','));
|
|
790
|
+
for (const codec of match.codecs.split(',')) {
|
|
791
|
+
codecs.add(codec);
|
|
792
|
+
}
|
|
793
|
+
outputStream.codecs = Array.from(codecs).join(',');
|
|
781
794
|
}
|
|
782
795
|
}
|
|
783
796
|
}
|
|
@@ -973,11 +986,10 @@ shaka.util.PeriodCombiner = class {
|
|
|
973
986
|
*
|
|
974
987
|
* @private
|
|
975
988
|
*/
|
|
976
|
-
|
|
989
|
+
findMatchesInAllPeriods_(streamsPerPeriod, outputStream) {
|
|
977
990
|
const matches = [];
|
|
978
991
|
for (const streams of streamsPerPeriod) {
|
|
979
|
-
const match =
|
|
980
|
-
streams, outputStream);
|
|
992
|
+
const match = this.findBestMatchInPeriod_(streams, outputStream);
|
|
981
993
|
if (!match) {
|
|
982
994
|
return;
|
|
983
995
|
}
|
|
@@ -998,10 +1010,10 @@ shaka.util.PeriodCombiner = class {
|
|
|
998
1010
|
*
|
|
999
1011
|
* @private
|
|
1000
1012
|
*/
|
|
1001
|
-
|
|
1013
|
+
findBestMatchInPeriod_(streams, outputStream) {
|
|
1002
1014
|
const areCompatible = {
|
|
1003
|
-
'audio':
|
|
1004
|
-
'video':
|
|
1015
|
+
'audio': (os, s) => this.areAVStreamsCompatible_(os, s),
|
|
1016
|
+
'video': (os, s) => this.areAVStreamsCompatible_(os, s),
|
|
1005
1017
|
'text': shaka.util.PeriodCombiner.areTextStreamsCompatible_,
|
|
1006
1018
|
'image': shaka.util.PeriodCombiner.areImageStreamsCompatible_,
|
|
1007
1019
|
}[outputStream.type];
|
|
@@ -1029,17 +1041,23 @@ shaka.util.PeriodCombiner = class {
|
|
|
1029
1041
|
}
|
|
1030
1042
|
|
|
1031
1043
|
/**
|
|
1032
|
-
* @param {T}
|
|
1033
|
-
* @param {T}
|
|
1034
|
-
* @return {boolean}
|
|
1035
|
-
* output stream
|
|
1044
|
+
* @param {T} a
|
|
1045
|
+
* @param {T} b
|
|
1046
|
+
* @return {boolean}
|
|
1036
1047
|
*
|
|
1037
1048
|
* @template T
|
|
1038
1049
|
* Accepts either a StreamDB or Stream type.
|
|
1039
1050
|
*
|
|
1040
1051
|
* @private
|
|
1041
1052
|
*/
|
|
1042
|
-
static
|
|
1053
|
+
static areAVStreamsExactMatch_(a, b) {
|
|
1054
|
+
if (a.mimeType != b.mimeType) {
|
|
1055
|
+
return false;
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* @param {string} codecs
|
|
1059
|
+
* @return {string}
|
|
1060
|
+
*/
|
|
1043
1061
|
const getCodec = (codecs) => {
|
|
1044
1062
|
if (!shaka.util.PeriodCombiner.memoizedCodecs.has(codecs)) {
|
|
1045
1063
|
const normalizedCodec = shaka.util.MimeUtils.getNormalizedCodec(codecs);
|
|
@@ -1047,10 +1065,37 @@ shaka.util.PeriodCombiner = class {
|
|
|
1047
1065
|
}
|
|
1048
1066
|
return shaka.util.PeriodCombiner.memoizedCodecs.get(codecs);
|
|
1049
1067
|
};
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1068
|
+
return getCodec(a.codecs) == getCodec(b.codecs);
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* @param {boolean} allowed If set to true, multi-mimeType or multi-codec
|
|
1073
|
+
* variants will be allowed.
|
|
1074
|
+
*/
|
|
1075
|
+
setAllowMultiTypeVariants(allowed) {
|
|
1076
|
+
this.multiTypeVariantsAllowed_ = allowed;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* @param {T} outputStream An audio or video output stream
|
|
1081
|
+
* @param {T} candidate A candidate stream to be combined with the output
|
|
1082
|
+
* @return {boolean} True if the candidate could be combined with the
|
|
1083
|
+
* output stream
|
|
1084
|
+
*
|
|
1085
|
+
* @template T
|
|
1086
|
+
* Accepts either a StreamDB or Stream type.
|
|
1087
|
+
*
|
|
1088
|
+
* @private
|
|
1089
|
+
*/
|
|
1090
|
+
areAVStreamsCompatible_(outputStream, candidate) {
|
|
1091
|
+
// Check for an exact match.
|
|
1092
|
+
if (!shaka.util.PeriodCombiner.areAVStreamsExactMatch_(
|
|
1093
|
+
outputStream, candidate)) {
|
|
1094
|
+
// It's not an exact match. See if we can do multi-codec or multi-mimeType
|
|
1095
|
+
// stream instead, using SourceBuffer.changeType.
|
|
1096
|
+
if (!this.multiTypeVariantsAllowed_) {
|
|
1097
|
+
return false;
|
|
1098
|
+
}
|
|
1054
1099
|
}
|
|
1055
1100
|
|
|
1056
1101
|
// This field is only available on Stream, not StreamDB.
|
|
@@ -1158,6 +1203,18 @@ shaka.util.PeriodCombiner = class {
|
|
|
1158
1203
|
return true;
|
|
1159
1204
|
}
|
|
1160
1205
|
|
|
1206
|
+
// An exact match is better than a non-exact match.
|
|
1207
|
+
const bestIsExact = shaka.util.PeriodCombiner.areAVStreamsExactMatch_(
|
|
1208
|
+
outputStream, best);
|
|
1209
|
+
const candidateIsExact = shaka.util.PeriodCombiner.areAVStreamsExactMatch_(
|
|
1210
|
+
outputStream, candidate);
|
|
1211
|
+
if (bestIsExact && !candidateIsExact) {
|
|
1212
|
+
return false;
|
|
1213
|
+
}
|
|
1214
|
+
if (!bestIsExact && candidateIsExact) {
|
|
1215
|
+
return true;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1161
1218
|
// Otherwise, compare the streams' characteristics to determine the best
|
|
1162
1219
|
// match.
|
|
1163
1220
|
|
|
@@ -1281,6 +1338,18 @@ shaka.util.PeriodCombiner = class {
|
|
|
1281
1338
|
return true;
|
|
1282
1339
|
}
|
|
1283
1340
|
|
|
1341
|
+
// An exact match is better than a non-exact match.
|
|
1342
|
+
const bestIsExact = shaka.util.PeriodCombiner.areAVStreamsExactMatch_(
|
|
1343
|
+
outputStream, best);
|
|
1344
|
+
const candidateIsExact = shaka.util.PeriodCombiner.areAVStreamsExactMatch_(
|
|
1345
|
+
outputStream, candidate);
|
|
1346
|
+
if (bestIsExact && !candidateIsExact) {
|
|
1347
|
+
return false;
|
|
1348
|
+
}
|
|
1349
|
+
if (!bestIsExact && candidateIsExact) {
|
|
1350
|
+
return true;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1284
1353
|
// Otherwise, compare the streams' characteristics to determine the best
|
|
1285
1354
|
// match.
|
|
1286
1355
|
|
|
@@ -94,6 +94,13 @@ shaka.util.PlayerConfiguration = class {
|
|
|
94
94
|
ignoreDuplicateInitData: !shaka.util.Platform.isTizen2(),
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
+
let codecSwitchingStrategy = shaka.config.CodecSwitchingStrategy.RELOAD;
|
|
98
|
+
let multiTypeVariantsAllowed = false;
|
|
99
|
+
if (shaka.util.Platform.supportsSmoothCodecSwitching()) {
|
|
100
|
+
codecSwitchingStrategy = shaka.config.CodecSwitchingStrategy.SMOOTH;
|
|
101
|
+
multiTypeVariantsAllowed = true;
|
|
102
|
+
}
|
|
103
|
+
|
|
97
104
|
const manifest = {
|
|
98
105
|
retryParameters: shaka.net.NetworkingEngine.defaultRetryParameters(),
|
|
99
106
|
availabilityWindowOverride: NaN,
|
|
@@ -136,6 +143,7 @@ shaka.util.PlayerConfiguration = class {
|
|
|
136
143
|
},
|
|
137
144
|
sequenceMode: false,
|
|
138
145
|
enableAudioGroups: false,
|
|
146
|
+
multiTypeVariantsAllowed,
|
|
139
147
|
},
|
|
140
148
|
hls: {
|
|
141
149
|
ignoreTextStreamFailures: false,
|
|
@@ -220,6 +228,8 @@ shaka.util.PlayerConfiguration = class {
|
|
|
220
228
|
liveSyncPlaybackRate: 1.1,
|
|
221
229
|
liveSyncMinLatency: 0,
|
|
222
230
|
liveSyncMinPlaybackRate: 1,
|
|
231
|
+
allowMediaSourceRecoveries: true,
|
|
232
|
+
minTimeBetweenRecoveries: 5,
|
|
223
233
|
};
|
|
224
234
|
|
|
225
235
|
// WebOS, Tizen, Chromecast and Hisense have long hardware pipelines
|
|
@@ -309,6 +319,12 @@ shaka.util.PlayerConfiguration = class {
|
|
|
309
319
|
useHeaders: false,
|
|
310
320
|
};
|
|
311
321
|
|
|
322
|
+
const cmsd = {
|
|
323
|
+
enabled: true,
|
|
324
|
+
applyMaximumSuggestedBitrate: true,
|
|
325
|
+
estimatedThroughputWeightRatio: 0.5,
|
|
326
|
+
};
|
|
327
|
+
|
|
312
328
|
const lcevc = {
|
|
313
329
|
enabled: false,
|
|
314
330
|
dynamicPerformanceScaling: true,
|
|
@@ -316,11 +332,6 @@ shaka.util.PlayerConfiguration = class {
|
|
|
316
332
|
drawLogo: false,
|
|
317
333
|
};
|
|
318
334
|
|
|
319
|
-
let codecSwitchingStrategy = shaka.config.CodecSwitchingStrategy.RELOAD;
|
|
320
|
-
if (shaka.util.Platform.supportsSmoothCodecSwitching()) {
|
|
321
|
-
codecSwitchingStrategy = shaka.config.CodecSwitchingStrategy.SMOOTH;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
335
|
const mediaSource = {
|
|
325
336
|
codecSwitchingStrategy: codecSwitchingStrategy,
|
|
326
337
|
sourceBufferExtraFeatures: '',
|
|
@@ -352,9 +363,11 @@ shaka.util.PlayerConfiguration = class {
|
|
|
352
363
|
preferredAudioChannelCount: 2,
|
|
353
364
|
preferredVideoHdrLevel: 'AUTO',
|
|
354
365
|
preferredVideoLayout: '',
|
|
366
|
+
preferredVideoLabel: '',
|
|
355
367
|
preferredVideoCodecs: [],
|
|
356
368
|
preferredAudioCodecs: [],
|
|
357
369
|
preferForcedSubs: false,
|
|
370
|
+
preferSpatialAudio: false,
|
|
358
371
|
preferredDecodingAttributes: [],
|
|
359
372
|
restrictions: {
|
|
360
373
|
minWidth: 0,
|
|
@@ -372,6 +385,7 @@ shaka.util.PlayerConfiguration = class {
|
|
|
372
385
|
playRangeEnd: Infinity,
|
|
373
386
|
textDisplayFactory: () => null,
|
|
374
387
|
cmcd: cmcd,
|
|
388
|
+
cmsd: cmsd,
|
|
375
389
|
lcevc: lcevc,
|
|
376
390
|
ads: ads,
|
|
377
391
|
};
|