shaka-player 4.6.3 → 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 +13 -9
- package/dist/locales.js +33 -33
- package/dist/shaka-player.compiled.d.ts +47 -4
- package/dist/shaka-player.compiled.debug.d.ts +47 -4
- package/dist/shaka-player.compiled.debug.externs.js +50 -2
- package/dist/shaka-player.compiled.debug.js +408 -376
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +50 -2
- package/dist/shaka-player.compiled.js +1134 -1118
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +69 -5
- package/dist/shaka-player.ui.debug.d.ts +69 -5
- package/dist/shaka-player.ui.debug.externs.js +82 -2
- package/dist/shaka-player.ui.debug.js +457 -420
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +82 -2
- package/dist/shaka-player.ui.js +1305 -1289
- 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/ads/client_side_ad_manager.js +4 -0
- package/lib/ads/media_tailor_ad_manager.js +5 -0
- package/lib/ads/server_side_ad_manager.js +4 -0
- 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/hls/hls_parser.js +17 -5
- package/lib/media/adaptation_set_criteria.js +76 -10
- package/lib/media/drm_engine.js +0 -3
- package/lib/media/media_source_engine.js +42 -18
- package/lib/media/segment_reference.js +12 -0
- package/lib/media/streaming_engine.js +58 -5
- package/lib/media/video_wrapper.js +4 -3
- package/lib/player.js +95 -11
- package/lib/text/simple_text_displayer.js +8 -7
- package/lib/text/text_utils.js +39 -13
- package/lib/text/ui_text_displayer.js +20 -11
- package/lib/text/web_vtt_generator.js +1 -1
- 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 -5764
- 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 -511
- package/demo/common/assets.js +0 -1635
- 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 -230
- 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 -2778
- 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 -434
- 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
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
# Plugins and Customizing the Build
|
|
2
|
-
|
|
3
|
-
Shaka has a plugin system to make it easier to extend and customize the
|
|
4
|
-
library. The plugin interfaces are here to allow you extend or customize Shaka
|
|
5
|
-
Player in one of these areas: manifest parsing, subtitle and caption parsing,
|
|
6
|
-
networking, ABR, and polyfills. Each of these parts of the system has its own
|
|
7
|
-
plugin interface. Even our "built-in" parsers, such as DASH and WebVTT, are
|
|
8
|
-
actually just plugins we build by default.
|
|
9
|
-
|
|
10
|
-
Plugins can be written outside the library (in your application), or
|
|
11
|
-
they can be built into the library to take advantage of the [Closure compiler].
|
|
12
|
-
|
|
13
|
-
[Closure compiler]: https://github.com/google/closure-compiler
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
#### Plugins
|
|
17
|
-
|
|
18
|
-
We will only cover plugin concepts at a high level here and will not go into
|
|
19
|
-
detailed examples of plugin development. If you are interested in customizing
|
|
20
|
-
or extending Shaka in one of these areas, please see the links below.
|
|
21
|
-
|
|
22
|
-
A plugin registers itself with a "core" component. These are the various
|
|
23
|
-
plugin interfaces and the default plugins that Shaka provides:
|
|
24
|
-
|
|
25
|
-
__Manifest parsers__
|
|
26
|
-
- Selected by file extension, with a fall back to manifest MIME type
|
|
27
|
-
- Register with {@link shaka.media.ManifestParser.registerParserByExtension}
|
|
28
|
-
and {@link shaka.media.ManifestParser.registerParserByMime}
|
|
29
|
-
- Default manifest parser plugins:
|
|
30
|
-
- DASH: {@linksource shaka.dash.DashParser}
|
|
31
|
-
- HLS: {@linksource shaka.hls.HlsParser}
|
|
32
|
-
- MSS: {@linksource shaka.mss.MssParser}
|
|
33
|
-
|
|
34
|
-
__Subtitle/caption parsers__
|
|
35
|
-
- Selected by MIME type
|
|
36
|
-
- Register with {@link shaka.text.TextEngine.registerParser}
|
|
37
|
-
- Default text parser plugins:
|
|
38
|
-
- WebVTT: {@linksource shaka.text.VttTextParser} and
|
|
39
|
-
{@linksource shaka.text.Mp4VttParser}
|
|
40
|
-
- TTML: {@linksource shaka.text.TtmlTextParser} and
|
|
41
|
-
{@linksource shaka.text.Mp4TtmlParser}
|
|
42
|
-
- SubRip (SRT): {@linksource shaka.text.SrtTextParser}
|
|
43
|
-
- LyRiCs (LRC): {@linksource shaka.text.LrcTextParser}
|
|
44
|
-
- SubStation Alpha (SSA, ASS): {@linksource shaka.text.SsaTextParser}
|
|
45
|
-
- SubViewer (SBV): {@linksource shaka.text.SbvTextParser}
|
|
46
|
-
|
|
47
|
-
__Subtitle/caption displayers__
|
|
48
|
-
- Configured at runtime on a Player instance
|
|
49
|
-
- Use {@link player.configure} and set the `textDisplayFactory` field
|
|
50
|
-
- Must implement the {@link shaka.extern.TextDisplayer} interface
|
|
51
|
-
- Default TextDisplayer implementation:
|
|
52
|
-
{@linksource shaka.text.SimpleTextDisplayer}
|
|
53
|
-
|
|
54
|
-
__Networking plugins__
|
|
55
|
-
- Selected by URI scheme (http, https, etc.)
|
|
56
|
-
- Register with {@link shaka.net.NetworkingEngine.registerScheme}
|
|
57
|
-
- Returns an {@link shaka.util.AbortableOperation} object, to allow aborting
|
|
58
|
-
- Default networking plugins:
|
|
59
|
-
- HTTP(S) XHR: {@linksource shaka.net.HttpXHRPlugin}
|
|
60
|
-
- HTTP(S) Fetch: {@linksource shaka.net.HttpFetchPlugin}
|
|
61
|
-
- data URIs: {@linksource shaka.net.DataUriPlugin}
|
|
62
|
-
|
|
63
|
-
__ABR plugins__
|
|
64
|
-
- Configured at runtime on a Player instance
|
|
65
|
-
- Use {@link player.configure} and set the `abrFactory` field
|
|
66
|
-
- Must implement the {@link shaka.extern.AbrManager} interface
|
|
67
|
-
- Default AbrManager implementation: {@linksource shaka.abr.SimpleAbrManager}
|
|
68
|
-
|
|
69
|
-
__Polyfills__
|
|
70
|
-
- All polyfills are installed by {@link shaka.polyfill.installAll}
|
|
71
|
-
- Register with {@link shaka.polyfill.register}
|
|
72
|
-
- Default polyfills:
|
|
73
|
-
- prefixed fullscreen implementations:
|
|
74
|
-
{@linksource shaka.polyfill.Fullscreen}
|
|
75
|
-
- prefixed video QoE metrics:
|
|
76
|
-
{@linksource shaka.polyfill.VideoPlaybackQuality}
|
|
77
|
-
- prefixed EME implementations:
|
|
78
|
-
- {@linksource shaka.polyfill.PatchedMediaKeysWebkit}
|
|
79
|
-
- {@linksource shaka.polyfill.PatchedMediaKeysNop}
|
|
80
|
-
- variants of VTTCue and TextTrackCue constructors:
|
|
81
|
-
{@linksource shaka.polyfill.VTTCue}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
#### Excluding Default Plugins
|
|
85
|
-
|
|
86
|
-
Core components cannot be removed from the build, but everything else is
|
|
87
|
-
technically optional. For example, if you don't need WebVTT, you can exclude
|
|
88
|
-
our VTT parser from the build to save space. Any VTT text streams found in a
|
|
89
|
-
manifest would then be ignored.
|
|
90
|
-
|
|
91
|
-
*(At the time of this writing, our default plugins account for 54% of the size
|
|
92
|
-
of our compiled library.)*
|
|
93
|
-
|
|
94
|
-
Because each plugin's source file ends with a call to register itself with the
|
|
95
|
-
core system, a plugin can simply be excluded from the build without changing
|
|
96
|
-
any of the source code.
|
|
97
|
-
|
|
98
|
-
You can start with the complete library (`+@complete`) and exclude any
|
|
99
|
-
individual source file with a minus sign and a path:
|
|
100
|
-
|
|
101
|
-
```sh
|
|
102
|
-
python build/build.py +@complete -lib/text/mp4_ttml_parser.js
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
You can also exclude an entire category of plugins:
|
|
106
|
-
|
|
107
|
-
```sh
|
|
108
|
-
# Build without polyfills:
|
|
109
|
-
python build/build.py +@complete -@polyfill
|
|
110
|
-
# Build without polyfills or text parsers:
|
|
111
|
-
python build/build.py +@complete -@polyfill -@text
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
To see the complete list of categories, its in [`build/types/`](https://github.com/shaka-project/shaka-player/tree/main/build/types)
|
|
115
|
-
|
|
116
|
-
#### Build Configs
|
|
117
|
-
|
|
118
|
-
Each of these arguments that starts with an '@' sign is a build config file in
|
|
119
|
-
`build/types/` containing a list sources or other configs to include. Each
|
|
120
|
-
line in these files is treated as an argument to `build.py`. For example,
|
|
121
|
-
this is what `build/types/networking` looks like:
|
|
122
|
-
|
|
123
|
-
```sh
|
|
124
|
-
# All standard networking scheme plugins.
|
|
125
|
-
+../../lib/net/http_xhr_plugin.js
|
|
126
|
-
+../../lib/net/http_fetch_plugin.js
|
|
127
|
-
+../../lib/net/http_plugin_utils.js
|
|
128
|
-
+../../lib/net/data_uri_plugin.js
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
#### Adding Your Own Plugins
|
|
133
|
-
|
|
134
|
-
If you want to take advantage of the [Closure compiler], you can add your own
|
|
135
|
-
sources to the build. Your plugins, like ours, should register themselves at
|
|
136
|
-
the bottom of the source file.
|
|
137
|
-
|
|
138
|
-
To add a single source file, prefix it with a plus sign:
|
|
139
|
-
|
|
140
|
-
```sh
|
|
141
|
-
python build/build.py +@complete +my_plugin.js
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
You can add multiple sources as well:
|
|
145
|
-
|
|
146
|
-
```sh
|
|
147
|
-
python build/build.py +@complete +my_plugin.js +/path/to/my_other_plugin.js
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
#### Custom Build Configs
|
|
152
|
-
|
|
153
|
-
If you have a long list of customizations, you may want to create your own
|
|
154
|
-
group file. For example:
|
|
155
|
-
|
|
156
|
-
```sh
|
|
157
|
-
# Start with a complete library
|
|
158
|
-
+@complete
|
|
159
|
-
# Drop subtitle support
|
|
160
|
-
-@text
|
|
161
|
-
# Remove default networking plugins
|
|
162
|
-
-@networking
|
|
163
|
-
# Add my custom HTTP implementation
|
|
164
|
-
+/path/to/my_http_plugin.js
|
|
165
|
-
# Add an additional polyfill for some odd platform I'm targeting
|
|
166
|
-
+/path/to/my_platform_polyfill.js
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
#### Plugins in Your Application
|
|
171
|
-
|
|
172
|
-
Every plugin interface is exported from the compiled library so that you don't
|
|
173
|
-
have to customize the build to create a plugin. Just register your plugins
|
|
174
|
-
with the appropriate interfaces after the library is loaded.
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
#### Giving Back
|
|
178
|
-
|
|
179
|
-
If you have a great plugin that you'd like to contribute back to the community,
|
|
180
|
-
we'd love to hear from you. You can get in touch via our [issue tracker][] to
|
|
181
|
-
discuss it, and once it's ready, you can send a [pull request][] on github.
|
|
182
|
-
|
|
183
|
-
[issue tracker]: https://github.com/shaka-project/shaka-player/issues/new/choose
|
|
184
|
-
[pull request]: https://github.com/shaka-project/shaka-player/pull/new/main
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
# Selenium Grid Config
|
|
2
|
-
|
|
3
|
-
Shaka Player's test runner (Karma) can be directed to run tests on a Selenium
|
|
4
|
-
grid. For this, you need a config file that defines what browsers are
|
|
5
|
-
available, and how to request them via WebDriver.
|
|
6
|
-
|
|
7
|
-
For a fully-worked, detailed example, see the config for the private grid in
|
|
8
|
-
our lab at [build/shaka-lab.yaml](https://github.com/shaka-project/shaka-player/blob/main/build/shaka-lab.yaml)
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```sh
|
|
13
|
-
python build/test.py \
|
|
14
|
-
--grid-config grid-config.yaml \
|
|
15
|
-
--grid-address selenium-hub-hostname:4444
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Syntax
|
|
19
|
-
|
|
20
|
-
The config file is written in YAML. We chose YAML because it has two big
|
|
21
|
-
advantages over JSON:
|
|
22
|
-
|
|
23
|
-
1. You can add comments
|
|
24
|
-
2. You can define variables (with YAML "anchors") to factor out common configs
|
|
25
|
-
|
|
26
|
-
### Variables
|
|
27
|
-
|
|
28
|
-
You can define any common variables in the `vars` section, then refer to them
|
|
29
|
-
elsewhere. For example:
|
|
30
|
-
|
|
31
|
-
```yaml
|
|
32
|
-
vars:
|
|
33
|
-
# Generates an "anchor" with the given name. Later, you can inject the
|
|
34
|
-
# contents of the variable with "*name".
|
|
35
|
-
firefox_config: &firefox_config
|
|
36
|
-
moz:firefoxOptions:
|
|
37
|
-
# Override Firefox default preferences in the temporary profile created
|
|
38
|
-
# for each test run.
|
|
39
|
-
prefs:
|
|
40
|
-
# Overrides Selenium's explicit default setting, to allow Firefox to
|
|
41
|
-
# install the Widevine CDM on demand.
|
|
42
|
-
media.gmp-manager.updateEnabled: true
|
|
43
|
-
# Overrides Firefox's Linux-specific default setting to disable DRM.
|
|
44
|
-
media.eme.enabled: true
|
|
45
|
-
|
|
46
|
-
# These three browser definitions share the same config from above.
|
|
47
|
-
FirefoxMac:
|
|
48
|
-
browser: firefox
|
|
49
|
-
os: Mac
|
|
50
|
-
extra_configs:
|
|
51
|
-
- *firefox_config
|
|
52
|
-
|
|
53
|
-
FirefoxWindows:
|
|
54
|
-
browser: firefox
|
|
55
|
-
os: Windows
|
|
56
|
-
extra_configs:
|
|
57
|
-
- *firefox_config
|
|
58
|
-
|
|
59
|
-
FirefoxLinux:
|
|
60
|
-
browser: firefox
|
|
61
|
-
os: Linux
|
|
62
|
-
extra_configs:
|
|
63
|
-
- *firefox_config
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Browsers
|
|
67
|
-
|
|
68
|
-
Each top-level key in the config file (except for `vars`) is the name of a
|
|
69
|
-
browser made available to Karma. Within each of those keys are the following:
|
|
70
|
-
|
|
71
|
-
- `browser`: The name of the browser. This is case-sensitive, and must match
|
|
72
|
-
the string and case used by Selenium.
|
|
73
|
-
- `os` (optional): The name of the OS. This is case-INsensitive, and must
|
|
74
|
-
match the name of the platform as used by Selenium. For Generic
|
|
75
|
-
WebDriver Server, this can be omitted or set to the name of the host
|
|
76
|
-
platform.
|
|
77
|
-
- `version` (optional): The version of the browser. This is case-sensitive,
|
|
78
|
-
and must match the string and case used in the Selenium node config.
|
|
79
|
-
- `disabled` (optional): If true, this browser is disabled and will not be
|
|
80
|
-
used unless explicitly requested.
|
|
81
|
-
- `extra_configs` (optional): An array of dictionaries of extra configs which
|
|
82
|
-
will be merged with the WebDriver launcher config in Karma.
|
|
83
|
-
|
|
84
|
-
Examples of basic desktop browsers definitions:
|
|
85
|
-
|
|
86
|
-
```yaml
|
|
87
|
-
ChromeMac:
|
|
88
|
-
browser: chrome
|
|
89
|
-
os: Mac
|
|
90
|
-
|
|
91
|
-
FirefoxMac:
|
|
92
|
-
browser: firefox
|
|
93
|
-
os: Mac
|
|
94
|
-
|
|
95
|
-
Safari:
|
|
96
|
-
browser: safari
|
|
97
|
-
os: Mac
|
|
98
|
-
|
|
99
|
-
SafariTP:
|
|
100
|
-
browser: safari
|
|
101
|
-
os: Mac
|
|
102
|
-
extra_configs:
|
|
103
|
-
- safari.options:
|
|
104
|
-
technologyPreview: true
|
|
105
|
-
|
|
106
|
-
ChromeWindows:
|
|
107
|
-
browser: chrome
|
|
108
|
-
os: Windows
|
|
109
|
-
|
|
110
|
-
FirefoxWindows:
|
|
111
|
-
browser: firefox
|
|
112
|
-
os: Windows
|
|
113
|
-
|
|
114
|
-
Edge:
|
|
115
|
-
browser: msedge
|
|
116
|
-
os: Windows
|
|
117
|
-
|
|
118
|
-
ChromeLinux:
|
|
119
|
-
browser: chrome
|
|
120
|
-
os: Linux
|
|
121
|
-
|
|
122
|
-
FirefoxLinux:
|
|
123
|
-
browser: firefox
|
|
124
|
-
os: Linux
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### Composing configs
|
|
128
|
-
|
|
129
|
-
You can define variables for browser configs that can be composed together in
|
|
130
|
-
`extra_configs`. For example, below you will see some basic definitions for
|
|
131
|
-
Chrome arguments and parameters, and then an additional config with an argument
|
|
132
|
-
that is only needed for some platforms. `karma.conf.js` will merge those
|
|
133
|
-
argument lists intelligently when it loads the YAML config.
|
|
134
|
-
|
|
135
|
-
```yaml
|
|
136
|
-
vars:
|
|
137
|
-
basic_chrome_config: &basic_chrome_config
|
|
138
|
-
goog:chromeOptions:
|
|
139
|
-
args:
|
|
140
|
-
# Normally, Chrome disallows autoplaying videos in many cases. Enable
|
|
141
|
-
# it for testing.
|
|
142
|
-
- "--autoplay-policy=no-user-gesture-required"
|
|
143
|
-
|
|
144
|
-
# Instruct chromedriver not to disable component updater.
|
|
145
|
-
excludeSwitches:
|
|
146
|
-
- "disable-component-update"
|
|
147
|
-
|
|
148
|
-
headless_chrome_config: &headless_chrome_config
|
|
149
|
-
goog:chromeOptions:
|
|
150
|
-
args:
|
|
151
|
-
# Run in headless mode.
|
|
152
|
-
- "--headless"
|
|
153
|
-
|
|
154
|
-
ChromeLinux:
|
|
155
|
-
browser: chrome
|
|
156
|
-
os: Mac
|
|
157
|
-
extra_configs:
|
|
158
|
-
- *basic_chrome_config
|
|
159
|
-
|
|
160
|
-
ChromeWindows:
|
|
161
|
-
browser: chrome
|
|
162
|
-
os: Mac
|
|
163
|
-
extra_configs:
|
|
164
|
-
- *basic_chrome_config
|
|
165
|
-
|
|
166
|
-
ChromeMac:
|
|
167
|
-
browser: chrome
|
|
168
|
-
os: Mac
|
|
169
|
-
# Take the parameters and arguments for basic_chrome_config, then append the
|
|
170
|
-
# arguments for headless_chrome_config.
|
|
171
|
-
extra_configs:
|
|
172
|
-
- *basic_chrome_config
|
|
173
|
-
- *headless_chrome_config
|
|
174
|
-
```
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
# Service Worker Caching
|
|
2
|
-
|
|
3
|
-
[Service workers][1] provide a way to have a script run in the background even
|
|
4
|
-
when the page is not loaded. It can respond to push events from other sites and
|
|
5
|
-
can act as a transparent cache for the page.
|
|
6
|
-
|
|
7
|
-
We strongly recommend against using service workers to cache content for offline
|
|
8
|
-
playback. There are many subtle issues introduced when you try to cache content
|
|
9
|
-
manifests and segments, and we have built an offline storage system that manages
|
|
10
|
-
all of these issues for you. See {@tutorial offline} and
|
|
11
|
-
{@link shaka.offline.Storage} for more information.
|
|
12
|
-
|
|
13
|
-
For other use cases, this doc will show a basic example of how to create a cache
|
|
14
|
-
that will not interfere with Shaka Player's bandwidth estimation. This is NOT a
|
|
15
|
-
tutorial of service workers in general.
|
|
16
|
-
|
|
17
|
-
[1]: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## Cache Header
|
|
21
|
-
|
|
22
|
-
Shaka looks for a special header `X-Shaka-From-Cache` to indicate that a
|
|
23
|
-
response was from a cache. This tells us to ignore the response for bandwidth
|
|
24
|
-
estimation purposes. If we used these cached responses to estimate bandwidth,
|
|
25
|
-
our estimate would too high, and we would make the wrong adaptation decisions.
|
|
26
|
-
Simply adding this header to the response object will ensure that cached
|
|
27
|
-
segments will not interfere with bandwidth estimates.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## Example Caching Service Worker
|
|
31
|
-
|
|
32
|
-
Registering code in the app:
|
|
33
|
-
|
|
34
|
-
```js
|
|
35
|
-
if ('serviceWorker' in navigator) {
|
|
36
|
-
try {
|
|
37
|
-
await navigator.serviceWorker.register('/service_worker.js');
|
|
38
|
-
console.log('Service worker registered successfully');
|
|
39
|
-
} catch(e) {
|
|
40
|
-
console.error('Error registering service worker', e);
|
|
41
|
-
}
|
|
42
|
-
} else {
|
|
43
|
-
console.error('Browser doesn\'t support service workers');
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Service worker code (`/service_worker.js`):
|
|
48
|
-
|
|
49
|
-
```js
|
|
50
|
-
const CACHE_NAME = 'segment-cache-v1';
|
|
51
|
-
|
|
52
|
-
function shouldCache(url) {
|
|
53
|
-
return url.endsWith('.mp4') || url.endsWith('.m4s');
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function loadFromCacheOrFetch(request) {
|
|
57
|
-
return caches.open(CACHE_NAME).then(function(cache) {
|
|
58
|
-
return cache.match(request).then(function(response) {
|
|
59
|
-
if (response) {
|
|
60
|
-
// The custom header was added before putting it in the cache.
|
|
61
|
-
console.log('Handling cached request', request.url);
|
|
62
|
-
return response;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Request not cached, make a real request for the file.
|
|
66
|
-
return fetch(request).then(function(response) {
|
|
67
|
-
// Cache any successfully request for an MP4 segment. Service
|
|
68
|
-
// workers cannot cache 206 (Partial Content). This means that
|
|
69
|
-
// content that uses range requests (e.g. SegmentBase) will require
|
|
70
|
-
// more work.
|
|
71
|
-
if (response.ok && response.status != 206 && shouldCache(request.url)) {
|
|
72
|
-
console.log('Caching MP4 segment', request.url);
|
|
73
|
-
cacheResponse(cache, request, response);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return response;
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function cacheResponse(cache, request, response) {
|
|
83
|
-
// Response objects are read-only, so to add our custom header, we need to
|
|
84
|
-
// recreate the object.
|
|
85
|
-
const init = {
|
|
86
|
-
status: response.status,
|
|
87
|
-
statusText: response.statusText,
|
|
88
|
-
headers: {'X-Shaka-From-Cache': true}
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
response.headers.forEach(function(value, key) {
|
|
92
|
-
init.headers[key] = value;
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
// Response objects are single use. This means we need to call clone() so
|
|
96
|
-
// we can both store the ArrayBuffer and give the response to the page.
|
|
97
|
-
return response.clone().arrayBuffer().then(function(ab) {
|
|
98
|
-
cache.put(request, new Response(ab, init));
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
self.addEventListener('fetch', function(event) {
|
|
104
|
-
event.respondWith(loadFromCacheOrFetch(event.request));
|
|
105
|
-
});
|
|
106
|
-
```
|