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
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
# FairPlay Support
|
|
2
|
-
|
|
3
|
-
We support FairPlay with EME on compatible environments or native `src=`.
|
|
4
|
-
|
|
5
|
-
By default Shaka Player supports Modern EME, if your provider doesn't support
|
|
6
|
-
Modern EME yet, you can use legacy Apple Media Keys with:
|
|
7
|
-
```js
|
|
8
|
-
shaka.polyfill.PatchedMediaKeysApple.install();
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
If you need to use both legacy and Modern EME, for example if you have to support
|
|
12
|
-
multiple DRM providers, it is possible to enable uninstalling the polyfill:
|
|
13
|
-
```js
|
|
14
|
-
shaka.polyfill.PatchedMediaKeysApple.install(/* enableUninstall= */ true);
|
|
15
|
-
shaka.polyfill.PatchedMediaKeysApple.uninstall();
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
The support in each case would be the following:
|
|
19
|
-
|
|
20
|
-
| |Modern EME |legacy Apple Media Keys|
|
|
21
|
-
|:----------:|:---------:|:---------------------:|
|
|
22
|
-
|src= (CMAF) |**Y** |**Y** |
|
|
23
|
-
|src= (TS) |**Y** |**Y** |
|
|
24
|
-
|MSE (CMAF) |**Y** | - |
|
|
25
|
-
|MSE (TS) | - | - |
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Adding FairPlay support involves a bit more work than other key systems.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
## Keysystem used in EME
|
|
32
|
-
|
|
33
|
-
Depending on the EME implementation that is being used, the Fairplay keysystem
|
|
34
|
-
varies.
|
|
35
|
-
|
|
36
|
-
For Modern EME:
|
|
37
|
-
```
|
|
38
|
-
com.apple.fps
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
For legacy Apple Media Keys:
|
|
42
|
-
```
|
|
43
|
-
com.apple.fps.1_0
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Server certificate
|
|
47
|
-
|
|
48
|
-
All FairPlay content requires setting a server certificate. You can either
|
|
49
|
-
provide it directly or set a serverCertificateUri for Shaka to fetch it for
|
|
50
|
-
you.
|
|
51
|
-
|
|
52
|
-
```js
|
|
53
|
-
const req = await fetch('https://example.com/cert.der');
|
|
54
|
-
const cert = await req.arrayBuffer();
|
|
55
|
-
|
|
56
|
-
player.configure('drm.advanced.com\\.apple\\.fps.serverCertificate',
|
|
57
|
-
new Uint8Array(cert));
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
```js
|
|
61
|
-
player.configure('drm.advanced.com\\.apple\\.fps.serverCertificateUri',
|
|
62
|
-
'https://example.com/cert.der');
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Content ID
|
|
66
|
-
|
|
67
|
-
Note: Normally only applies to legacy Apple Media Keys but some providers also
|
|
68
|
-
need it in Modern EME.
|
|
69
|
-
|
|
70
|
-
Some FairPlay content use custom signaling for the content ID. The content ID
|
|
71
|
-
is used by the browser to generate the license request. If you don't use the
|
|
72
|
-
default content ID derivation, you need to specify a custom init data transform:
|
|
73
|
-
|
|
74
|
-
```js
|
|
75
|
-
player.configure('drm.initDataTransform', (initData, initDataType, drmInfo) => {
|
|
76
|
-
if (initDataType != 'skd')
|
|
77
|
-
return initData;
|
|
78
|
-
// 'initData' is a buffer containing an 'skd://' URL as a UTF-8 string.
|
|
79
|
-
const skdUri = shaka.util.StringUtils.fromBytesAutoDetect(initData);
|
|
80
|
-
const contentId = getMyContentId(skdUri);
|
|
81
|
-
const cert = drmInfo.serverCertificate;
|
|
82
|
-
return shaka.util.FairPlayUtils.initDataTransform(initData, contentId, cert);
|
|
83
|
-
});
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## License wrapping
|
|
87
|
-
|
|
88
|
-
Some FairPlay servers need to accept the license request in a different format
|
|
89
|
-
or give the response in a different format. For more info, see the general
|
|
90
|
-
{@tutorial license-wrapping} tutorial:
|
|
91
|
-
|
|
92
|
-
```js
|
|
93
|
-
player.getNetworkingEngine().registerRequestFilter((type, request, context) => {
|
|
94
|
-
if (type != shaka.net.NetworkingEngine.RequestType.LICENSE) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const originalPayload = new Uint8Array(request.body);
|
|
99
|
-
const base64Payload =
|
|
100
|
-
shaka.util.Uint8ArrayUtils.toStandardBase64(originalPayload);
|
|
101
|
-
const params = 'spc=' + base64Payload;
|
|
102
|
-
request.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
103
|
-
request.body = shaka.util.StringUtils.toUTF8(encodeURIComponent(params));
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
player.getNetworkingEngine().registerResponseFilter((type, response, context) => {
|
|
107
|
-
if (type != shaka.net.NetworkingEngine.RequestType.LICENSE) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
let responseText = shaka.util.StringUtils.fromUTF8(response.data);
|
|
112
|
-
// Trim whitespace.
|
|
113
|
-
responseText = responseText.trim();
|
|
114
|
-
|
|
115
|
-
// Look for <ckc> wrapper and remove it.
|
|
116
|
-
if (responseText.substr(0, 5) === '<ckc>' &&
|
|
117
|
-
responseText.substr(-6) === '</ckc>') {
|
|
118
|
-
responseText = responseText.slice(5, -6);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// Decode the base64-encoded data into the format the browser expects.
|
|
122
|
-
response.data = shaka.util.Uint8ArrayUtils.fromBase64(responseText).buffer;
|
|
123
|
-
});
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### Integration with some DRMs providers
|
|
127
|
-
|
|
128
|
-
Note: Some providers support both Modern EME and legacy Apple Media Keys.
|
|
129
|
-
|
|
130
|
-
#### EZDRM (Modern EME)
|
|
131
|
-
|
|
132
|
-
For integration with EZDRM the following can be used:
|
|
133
|
-
|
|
134
|
-
```js
|
|
135
|
-
const FairPlayUtils = shaka.util.FairPlayUtils;
|
|
136
|
-
player.getNetworkingEngine()
|
|
137
|
-
.registerRequestFilter(FairPlayUtils.ezdrmFairPlayRequest);
|
|
138
|
-
player.getNetworkingEngine()
|
|
139
|
-
.registerResponseFilter(FairPlayUtils.commonFairPlayResponse);
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
Note: If the url of the license server has to undergo any transformation
|
|
143
|
-
(eg: add the contentId), you would have to create your filter manually.
|
|
144
|
-
|
|
145
|
-
```js
|
|
146
|
-
player.getNetworkingEngine().registerRequestFilter((type, request, context) => {
|
|
147
|
-
if (type != shaka.net.NetworkingEngine.RequestType.LICENSE) {
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
const uri = request.uris[0];
|
|
151
|
-
const FairPlayUtils = shaka.util.FairPlayUtils;
|
|
152
|
-
const contentId = FairPlayUtils.defaultGetContentId(request.initData);
|
|
153
|
-
const newUri = uri.replace('^assetId^', contentId);
|
|
154
|
-
request.uris = [newUri];
|
|
155
|
-
request.headers['Content-Type'] = 'application/octet-stream'
|
|
156
|
-
});
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
#### EZDRM (legacy Apple Media Keys)
|
|
160
|
-
|
|
161
|
-
For integration with EZDRM the following can be used:
|
|
162
|
-
|
|
163
|
-
```js
|
|
164
|
-
shaka.polyfill.PatchedMediaKeysApple.install();
|
|
165
|
-
const FairPlayUtils = shaka.util.FairPlayUtils;
|
|
166
|
-
player.getNetworkingEngine()
|
|
167
|
-
.registerRequestFilter(FairPlayUtils.ezdrmFairPlayRequest);
|
|
168
|
-
player.getNetworkingEngine()
|
|
169
|
-
.registerResponseFilter(FairPlayUtils.commonFairPlayResponse);
|
|
170
|
-
player.configure('drm.initDataTransform',
|
|
171
|
-
FairPlayUtils.ezdrmInitDataTransform);
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
Note: If the url of the license server has to undergo any transformation
|
|
175
|
-
(eg: add the contentId), you would have to create your filter manually.
|
|
176
|
-
|
|
177
|
-
```js
|
|
178
|
-
player.getNetworkingEngine().registerRequestFilter((type, request, context) => {
|
|
179
|
-
if (type != shaka.net.NetworkingEngine.RequestType.LICENSE) {
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
const uri = request.uris[0];
|
|
183
|
-
const FairPlayUtils = shaka.util.FairPlayUtils;
|
|
184
|
-
const contentId = FairPlayUtils.defaultGetContentId(request.initData);
|
|
185
|
-
const newUri = uri.replace('^assetId^', contentId);
|
|
186
|
-
request.uris = [newUri];
|
|
187
|
-
request.headers['Content-Type'] = 'application/octet-stream'
|
|
188
|
-
});
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
#### Verimatrix (legacy Apple Media Keys)
|
|
192
|
-
|
|
193
|
-
For integration with Verimatrix the following can be used:
|
|
194
|
-
|
|
195
|
-
```js
|
|
196
|
-
shaka.polyfill.PatchedMediaKeysApple.install();
|
|
197
|
-
const FairPlayUtils = shaka.util.FairPlayUtils;
|
|
198
|
-
player.getNetworkingEngine()
|
|
199
|
-
.registerRequestFilter(FairPlayUtils.verimatrixFairPlayRequest);
|
|
200
|
-
player.getNetworkingEngine()
|
|
201
|
-
.registerResponseFilter(FairPlayUtils.commonFairPlayResponse);
|
|
202
|
-
player.configure('drm.initDataTransform',
|
|
203
|
-
FairPlayUtils.verimatrixInitDataTransform);
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
#### Conax (legacy Apple Media Keys)
|
|
207
|
-
|
|
208
|
-
For integration with Conax the following can be used:
|
|
209
|
-
|
|
210
|
-
```js
|
|
211
|
-
shaka.polyfill.PatchedMediaKeysApple.install();
|
|
212
|
-
const FairPlayUtils = shaka.util.FairPlayUtils;
|
|
213
|
-
player.getNetworkingEngine()
|
|
214
|
-
.registerRequestFilter(FairPlayUtils.conaxFairPlayRequest);
|
|
215
|
-
player.getNetworkingEngine()
|
|
216
|
-
.registerResponseFilter(FairPlayUtils.commonFairPlayResponse);
|
|
217
|
-
player.configure('drm.initDataTransform',
|
|
218
|
-
FairPlayUtils.conaxInitDataTransform);
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
#### ExpressPlay (legacy Apple Media Keys)
|
|
222
|
-
|
|
223
|
-
For integration with ExpressPlay the following can be used:
|
|
224
|
-
|
|
225
|
-
```js
|
|
226
|
-
shaka.polyfill.PatchedMediaKeysApple.install();
|
|
227
|
-
const FairPlayUtils = shaka.util.FairPlayUtils;
|
|
228
|
-
player.getNetworkingEngine()
|
|
229
|
-
.registerRequestFilter(FairPlayUtils.expressplayFairPlayRequest);
|
|
230
|
-
player.getNetworkingEngine()
|
|
231
|
-
.registerResponseFilter(FairPlayUtils.commonFairPlayResponse);
|
|
232
|
-
player.configure('drm.initDataTransform',
|
|
233
|
-
FairPlayUtils.expressplayInitDataTransform);
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
#### Nagra (legacy Apple Media Keys)
|
|
237
|
-
|
|
238
|
-
For integration with Nagra the following can be used:
|
|
239
|
-
|
|
240
|
-
```js
|
|
241
|
-
shaka.polyfill.PatchedMediaKeysApple.install();
|
|
242
|
-
```
|
package/docs/tutorials/faq.md
DELETED
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
# Frequently Asked Questions
|
|
2
|
-
|
|
3
|
-
**Q:** Does Shaka Player support IE11?
|
|
4
|
-
|
|
5
|
-
**A:** Shaka Player no longer supports IE11 beyond v3.1. If you need Shaka
|
|
6
|
-
Player with IE support, checkout v3.0.x and previous versions.
|
|
7
|
-
|
|
8
|
-
<hr>
|
|
9
|
-
|
|
10
|
-
**Q:** My live stream is buffering forever or doesn't play.
|
|
11
|
-
|
|
12
|
-
**A:** Check your time-sync. In v1 we would adjust automatically to account for
|
|
13
|
-
bad content. But now in v2, we don't.
|
|
14
|
-
|
|
15
|
-
This requires setting up clock sync for live streams. This can be done by
|
|
16
|
-
adding a `<UTCTiming>` element to the manifest or by setting the
|
|
17
|
-
{@link shaka.extern.html.DashManifestConfiguration|
|
|
18
|
-
`.manifest.dash.clockSyncUri`} configuration. See [#386(comment)][386]
|
|
19
|
-
for more info.
|
|
20
|
-
|
|
21
|
-
We also have issues with "drifting" DASH streams. If your encoder experiences
|
|
22
|
-
drift, you may need to address that with the encoder. We have plans to be
|
|
23
|
-
more tolerant of drift in future. See [#999][999] for more info.
|
|
24
|
-
|
|
25
|
-
<hr>
|
|
26
|
-
|
|
27
|
-
**Q:** I am getting decoder errors or `VIDEO_ERROR` or error code 3016.
|
|
28
|
-
|
|
29
|
-
**A:** This error is given to us when the browser can't play the content. This
|
|
30
|
-
is out of our control and is usually caused by bad content. On Chrome you can
|
|
31
|
-
check `chrome://media-internals` for more info (see [#489(comment)][489]).
|
|
32
|
-
|
|
33
|
-
<hr>
|
|
34
|
-
|
|
35
|
-
**Q:** I am getting `HTTP_ERROR` or error code 1002.
|
|
36
|
-
|
|
37
|
-
**A:** The browser rejected the request. Look at the browser logs for more
|
|
38
|
-
info. This is usually a [CORS][] error, which means you need particular
|
|
39
|
-
headers in the response. Additionally, with some manifests, we will send a
|
|
40
|
-
`Range` header. This will require explicit approval through the CORS header
|
|
41
|
-
`Access-Control-Allow-Headers`.
|
|
42
|
-
|
|
43
|
-
This can also happen with mixed-content restrictions. If the site is using
|
|
44
|
-
`https:`, then your manifest and segments must also.
|
|
45
|
-
|
|
46
|
-
<hr>
|
|
47
|
-
|
|
48
|
-
**Q:** I am getting `REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE` or error code
|
|
49
|
-
6001.
|
|
50
|
-
|
|
51
|
-
**A:** The most common cause is that you are not using a secure origin. The
|
|
52
|
-
EME API in the browser requires a secure origin, which means `https` or
|
|
53
|
-
`localhost`. Chrome enforces this requirement, but other browsers may not yet.
|
|
54
|
-
See the [announcement][eme_https] for more info.
|
|
55
|
-
|
|
56
|
-
You should also check that your platform/browser actually supports the key
|
|
57
|
-
system. If your manifest contains only PlayReady, it will need to be played on
|
|
58
|
-
IE/Edge, a Chromecast, or another device with PlayReady.
|
|
59
|
-
See the [DRM tutorial][drm_tutorial] for more info.
|
|
60
|
-
|
|
61
|
-
This will also happen if you use `Storage` to store protected content (when
|
|
62
|
-
`usePersistentLicense` is true). Currently, persistent licenses are supported
|
|
63
|
-
on Chromebooks and Chrome 64+ on Mac/Windows. On other platforms, you can only
|
|
64
|
-
store clear content or store only the content offline (i.e. set
|
|
65
|
-
`usePersistentLicense` configuration to false).
|
|
66
|
-
|
|
67
|
-
<hr>
|
|
68
|
-
|
|
69
|
-
**Q:** I am getting `LICENSE_REQUEST_FAILED` or error code 6007.
|
|
70
|
-
|
|
71
|
-
**A:** See `HTTP_ERROR`. If you are getting a bad HTTP status, the server
|
|
72
|
-
rejected the request. Your proxy may require [wrapping][wrapping] the request
|
|
73
|
-
or it may require [extra authentication][auth].
|
|
74
|
-
|
|
75
|
-
<hr>
|
|
76
|
-
|
|
77
|
-
**Q:** I am getting `INVALID_SERVER_CERTIFICATE` or error code 6004.
|
|
78
|
-
|
|
79
|
-
**A:** You need to get the license certificate from your DRM provider. This is
|
|
80
|
-
**not** the HTTPS certificate of the proxy or any files on your proxy. This
|
|
81
|
-
should be the certificate of the license server given by your provider.
|
|
82
|
-
|
|
83
|
-
The certificate can only be used for that license server, but can be used with
|
|
84
|
-
different proxies so long as they use the same license server. For Widevine,
|
|
85
|
-
the certificate should be binary, so avoid fetching the response as a string
|
|
86
|
-
(e.g. with `responseText`).
|
|
87
|
-
|
|
88
|
-
<hr>
|
|
89
|
-
|
|
90
|
-
**Q:** I am getting `LICENSE_RESPONSE_REJECTED` or error code 6008.
|
|
91
|
-
|
|
92
|
-
**A:** Check the DevTools network tab for the response. Verify that the
|
|
93
|
-
response data looks correct. For Widevine, the response should be binary. If
|
|
94
|
-
you see JSON, you will need to [unwrap the response][wrapping].
|
|
95
|
-
|
|
96
|
-
<hr>
|
|
97
|
-
|
|
98
|
-
**Q:** Why does it take so long to switch to HD?
|
|
99
|
-
|
|
100
|
-
**A:** When Shaka Player's `AbrManager` makes a decision to adapt, we don't
|
|
101
|
-
clear any of the content that has already been buffered. (We used to, but it
|
|
102
|
-
does not work consistently across browsers and created a bad experience.)
|
|
103
|
-
|
|
104
|
-
This means that if you want to see the results of a new decision sooner, you
|
|
105
|
-
should have a less aggressive buffering goal. See the tutorial on [buffering
|
|
106
|
-
configuration][buffering] and the docs for the {@link
|
|
107
|
-
shaka.extern.StreamingConfiguration|`.streaming.bufferingGoal`} configuration.
|
|
108
|
-
|
|
109
|
-
Another factor is the segment size. It may take up to 2 segments before Shaka
|
|
110
|
-
Player has enough information to form a bandwidth estimate and make a decision.
|
|
111
|
-
If your content uses 10-second segments, this means we may buffer 20 seconds
|
|
112
|
-
of low quality video before we make a decision. If it is too late to change
|
|
113
|
-
the segment size in your content library, you may want to adjust the "default"
|
|
114
|
-
bandwidth estimate used by Shaka Player to select the first segments. Use the
|
|
115
|
-
{@link shaka.extern.AbrConfiguration|`.abr.defaultBandwidthEstimate`}
|
|
116
|
-
configuration to control these initial decisions.
|
|
117
|
-
|
|
118
|
-
<hr>
|
|
119
|
-
|
|
120
|
-
**Q:** I am getting `UNSUPPORTED_SCHEME` or error code 1000 when loading from
|
|
121
|
-
`file://`.
|
|
122
|
-
|
|
123
|
-
**A:** In a browser environment, trying to load a file from `file://` is
|
|
124
|
-
inappropriate. Therefore, we do not provide a default network plugin for such
|
|
125
|
-
requests.
|
|
126
|
-
|
|
127
|
-
In other environments, for example Electron, it is appropriate.
|
|
128
|
-
In those cases, before Shaka Player loads a manifest, you can register the
|
|
129
|
-
existing http plugin for `file://` requests:
|
|
130
|
-
```js
|
|
131
|
-
shaka.net.NetworkingEngine.registerScheme('file', shaka.net.HttpXHRPlugin.parse);
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
<hr>
|
|
135
|
-
|
|
136
|
-
**Q:** Why do I get 404 errors with very large timescales?
|
|
137
|
-
|
|
138
|
-
**A:** Some content creates timestamps too large to be represented as Numbers
|
|
139
|
-
in JavaScript (2^53). Very large timescales require very large timestamps (in
|
|
140
|
-
timescale units), which means we are unable to substitute the correct values
|
|
141
|
-
for `$Time$` in a `<SegmentTemplate>`.
|
|
142
|
-
|
|
143
|
-
We can work around this for platforms that support [`BigInt`][], or in cases
|
|
144
|
-
where we can live with a rounding error (not `$Time$` in `<SegmentTemplate>`).
|
|
145
|
-
|
|
146
|
-
If you must use `$Time` in `<SegmentTemplate>` and you must play on devices
|
|
147
|
-
that do not support [`BigInt`][], we recommend reducing your timescale.
|
|
148
|
-
See discussion in [#1667][1667] for details.
|
|
149
|
-
|
|
150
|
-
<hr>
|
|
151
|
-
|
|
152
|
-
**Q:** I get logs like: `It is recommended that a robustness level be
|
|
153
|
-
specified...`.
|
|
154
|
-
|
|
155
|
-
**A:** This is a warning from Chrome about setting the robustness level for EME.
|
|
156
|
-
For most content, this warning can be safely ignored (see
|
|
157
|
-
<https://crbug.com/720013>). If your content requires a specific robustness
|
|
158
|
-
level, it is suggested to set it in the player configuration to ensure playback
|
|
159
|
-
works: `.drm.advanced.<key_system>.audioRobustness` and
|
|
160
|
-
`.drm.advanced.<key_system>.videoRobustness` (see {@link
|
|
161
|
-
shaka.extern.AdvancedDrmConfiguration|docs}).
|
|
162
|
-
|
|
163
|
-
<hr>
|
|
164
|
-
|
|
165
|
-
**Q:** Does Shaka Player support iOS?
|
|
166
|
-
|
|
167
|
-
**A:** Starting in v2.5, we support it through Apple's native HLS player. So
|
|
168
|
-
you can use the same top-level APIs; but we are dependent on the browser
|
|
169
|
-
handling the streaming. So we won't support DASH on iOS since the browser
|
|
170
|
-
doesn't support it.
|
|
171
|
-
|
|
172
|
-
In a future version, we plan to support `ManagedMediaSource` on iOS to achieve
|
|
173
|
-
control over both DASH and HLS playback on iOS. See [#5271][] and the
|
|
174
|
-
[`ManagedMediaSource` W3C spec proposal][]
|
|
175
|
-
|
|
176
|
-
<hr>
|
|
177
|
-
|
|
178
|
-
**Q:** The Nightly Demo isn't loading for me!
|
|
179
|
-
|
|
180
|
-
**A:** Are you looking at the uncompiled build with an AdBlocker enabled?
|
|
181
|
-
|
|
182
|
-
Some ad blockers decide to block requests for some of our source files simply
|
|
183
|
-
because they have `ad` in the file name. This only affects the uncompiled
|
|
184
|
-
build.
|
|
185
|
-
|
|
186
|
-
Switch to the compiled build (add "build=compiled" to the url) or temporarily
|
|
187
|
-
disable your ad blocker to see the nightly in uncompiled mode.
|
|
188
|
-
|
|
189
|
-
Please note that if you want to test our ad logic, you might have to disable
|
|
190
|
-
the ad blocker in compiled mode as well.
|
|
191
|
-
|
|
192
|
-
<hr>
|
|
193
|
-
|
|
194
|
-
**Q:** Why does some DASH content take a long time to start playback?
|
|
195
|
-
|
|
196
|
-
**A:** Shaka Player honors the `minBufferTime` field in DASH. If this field is
|
|
197
|
-
set to a large value, Shaka Player will buffer that much content before
|
|
198
|
-
beginning playback. To override this behavior and ignore the `minBufferTime`
|
|
199
|
-
field, we offer the following configuration:
|
|
200
|
-
|
|
201
|
-
```js
|
|
202
|
-
player.configure('manifest.dash.ignoreMinBufferTime', true);
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
<hr>
|
|
206
|
-
|
|
207
|
-
**Q:** My HLS stream is failing on Chrome, with a chunk demuxer append failed
|
|
208
|
-
error.
|
|
209
|
-
|
|
210
|
-
**A:** For a stream to play properly on some browsers, we need to know ahead of
|
|
211
|
-
time what the codecs of the stream are. If no codec information is provided in
|
|
212
|
-
an HLS manifest, we do our best to guess what the codecs might be, but those
|
|
213
|
-
guesses might not always be accurate. If an HLS manifest has no codec
|
|
214
|
-
information provided, we default to guessing that the video codec is
|
|
215
|
-
`avc1.42E01E` and the audio codec is `mp4a.40.2`, which can cause problems if
|
|
216
|
-
the stream is actually video-only or audio-only.
|
|
217
|
-
|
|
218
|
-
To change our default assumptions about codecs in HLS, please see
|
|
219
|
-
{@link shaka.extern.HlsManifestConfiguration|`.manifest.hls`} in the player
|
|
220
|
-
config.
|
|
221
|
-
|
|
222
|
-
<hr>
|
|
223
|
-
|
|
224
|
-
**Q:** How can I make Shaka Player work with Vue?
|
|
225
|
-
|
|
226
|
-
**A:** Currently, Shaka Player does not support being made into a Vue reactive
|
|
227
|
-
object. When Vue wraps an object in a reactive Proxy, it
|
|
228
|
-
{@link https://v3.vuejs.org/guide/reactivity.html#proxied-objects|also wraps
|
|
229
|
-
nested objects}. This results in Vue converting some of our internal values into
|
|
230
|
-
Proxy objects, which causes failures at load-time.
|
|
231
|
-
If you want to use Shaka Player in Vue, avoid making it into a reactive object;
|
|
232
|
-
so don't declare it using a ref(), and if you put your player instance into a
|
|
233
|
-
data() object, you can prefix the property name with "$" or "_" to make Vue not
|
|
234
|
-
proxy them.
|
|
235
|
-
|
|
236
|
-
[386]: https://github.com/shaka-project/shaka-player/issues/386#issuecomment-227898001
|
|
237
|
-
[489]: https://github.com/shaka-project/shaka-player/issues/489#issuecomment-240466224
|
|
238
|
-
[743]: https://github.com/shaka-project/shaka-player/issues/743
|
|
239
|
-
[887]: https://github.com/shaka-project/shaka-player/issues/887
|
|
240
|
-
[999]: https://github.com/shaka-project/shaka-player/issues/999
|
|
241
|
-
[1667]: https://github.com/shaka-project/shaka-player/issues/1667
|
|
242
|
-
[#5271]: https://github.com/shaka-project/shaka-player/issues/5271
|
|
243
|
-
[BigInt]: https://caniuse.com/bigint
|
|
244
|
-
[CORS]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
|
|
245
|
-
[`ManagedMediaSource` W3C spec proposal]: https://github.com/w3c/media-source/issues/320
|
|
246
|
-
[Shaka Player Embedded]: https://github.com/shaka-project/shaka-player-embedded
|
|
247
|
-
[auth]: https://shaka-player-demo.appspot.com/docs/api/tutorial-license-server-auth.html
|
|
248
|
-
[buffering]: https://shaka-player-demo.appspot.com/docs/api/tutorial-network-and-buffering-config.html
|
|
249
|
-
[drm_tutorial]: https://shaka-player-demo.appspot.com/docs/api/tutorial-drm-config.html
|
|
250
|
-
[eme_https]: https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins
|
|
251
|
-
[wrapping]: https://shaka-player-demo.appspot.com/docs/api/tutorial-license-wrapping.html
|
|
252
|
-
[including mux.js]: https://github.com/shaka-project/shaka-player/blob/967f3399/demo/index.html#L39
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{ "welcome": { "title": "Welcome to Shaka Player" } },
|
|
3
|
-
{ "basic-usage": { "title": "Basic Usage" } },
|
|
4
|
-
{ "debugging": { "title": "Debugging" } },
|
|
5
|
-
{ "config": { "title": "Configuration" } },
|
|
6
|
-
{ "network-and-buffering-config": { "title": "Network and Buffering Configuration" } },
|
|
7
|
-
{ "drm-config": { "title": "DRM Configuration" } },
|
|
8
|
-
{ "license-server-auth": { "title": "License Server Authentication" } },
|
|
9
|
-
{ "license-wrapping": { "title": "License Wrapping" } },
|
|
10
|
-
{ "ui": { "title": "UI Library" } },
|
|
11
|
-
{ "ui-customization": { "title": "Configuring the UI" } },
|
|
12
|
-
{ "errors": { "title": "Error Handling" } },
|
|
13
|
-
{ "a11y": { "title": "Creating accessible buttons" } },
|
|
14
|
-
{ "ad_monetization": { "title": "Serving ads with our IMA SDK integration" } },
|
|
15
|
-
{ "plugins": { "title": "Plugins and Customizing the Build" } },
|
|
16
|
-
{ "manifest-parser": { "title": "Manifest Parser Plugins" } },
|
|
17
|
-
{ "architecture": { "title": "Architecture Diagrams" } },
|
|
18
|
-
{ "service-worker": { "title": "Service Worker Caching" } },
|
|
19
|
-
{ "offline": { "title": "Offline Storage and Playback" } },
|
|
20
|
-
{ "widevine-service-certs": { "title": "Widevine Service Certificates" } },
|
|
21
|
-
{ "fairplay": { "title": "FairPlay support" } },
|
|
22
|
-
{ "application-level-redirects": { "title": "Application-Level Redirects" } },
|
|
23
|
-
{ "blob-url": { "title": "Blob URL" } },
|
|
24
|
-
{ "selenium-grid-config": { "title": "Selenium Grid Config" } },
|
|
25
|
-
{ "faq": { "title": "Frequently Asked Questions" } },
|
|
26
|
-
{ "upgrade": { "title": "Upgrade Guide" } },
|
|
27
|
-
{ "upgrade-manifest": { "title": "ManifestParser Upgrade Guide" } },
|
|
28
|
-
{ "lcevc": { "title": "LCEVC Quick Start" } }
|
|
29
|
-
]
|
package/docs/tutorials/lcevc.md
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
# LCEVC Quick Start
|
|
2
|
-
|
|
3
|
-
#### Requirements
|
|
4
|
-
|
|
5
|
-
- Only supported on browsers with Media Source Extensions SourceBuffer support
|
|
6
|
-
|
|
7
|
-
- MPEG-5 Part2 LCEVC decoding support (decoding provided by [lcevc_dec.js][],
|
|
8
|
-
must be separately included)
|
|
9
|
-
|
|
10
|
-
##### Integration documentation : [docs](../design/lcevc-integration.md)
|
|
11
|
-
|
|
12
|
-
##### More on [MPEG-5 Part2 LCEVC][]
|
|
13
|
-
|
|
14
|
-
[lcevc_dec.js]: https://www.npmjs.com/package/lcevc_dec.js?activeTab=readme
|
|
15
|
-
[MPEG-5 Part2 LCEVC]: https://www.lcevc.org
|
|
16
|
-
|
|
17
|
-
#### Configure LCEVC
|
|
18
|
-
|
|
19
|
-
LCEVC Decoder library needs to be included in the HTML page:
|
|
20
|
-
|
|
21
|
-
- Local `npm install lcevc_dec.js`
|
|
22
|
-
```html
|
|
23
|
-
<script src="../node_modules/lcevc_dec.js/dist/lcevc_dec.min.js"></script>
|
|
24
|
-
```
|
|
25
|
-
- Or use `unpkg.com` for latest LCEVC Decoder libraries.
|
|
26
|
-
```html
|
|
27
|
-
<script src="https://unpkg.com/lcevc_dec.js@1.0.1/dist/lcevc_dec.min.js"></script>
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Configuration to enable LCEVC enhancement:
|
|
31
|
-
```js
|
|
32
|
-
player.configure('lcevc.enabled', true);
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
#### LCEVC setup via UI library
|
|
36
|
-
|
|
37
|
-
Sample setup using the Shaka Player UI library:
|
|
38
|
-
|
|
39
|
-
```html
|
|
40
|
-
<!DOCTYPE html>
|
|
41
|
-
<html>
|
|
42
|
-
<head>
|
|
43
|
-
<!-- Shaka Player UI compiled library and default CSS for player controls: -->
|
|
44
|
-
<script src="dist/shaka-player.ui.js"></script>
|
|
45
|
-
<link rel="stylesheet" href="dist/controls.css" />
|
|
46
|
-
|
|
47
|
-
<!-- LCEVC decoder compiled library -->
|
|
48
|
-
<script src="https://unpkg.com/lcevc_dec.js@1.0.1/dist/lcevc_dec.min.js"></script>
|
|
49
|
-
|
|
50
|
-
<!-- Application source: -->
|
|
51
|
-
<script src="app.js"></script>
|
|
52
|
-
</head>
|
|
53
|
-
|
|
54
|
-
<body>
|
|
55
|
-
<!-- The data-shaka-player-container tag will make the UI library place the controls in this div. -->
|
|
56
|
-
<div data-shaka-player-container style="max-width:40em">
|
|
57
|
-
<!-- The data-shaka-player tag will make the UI library use this video element. -->
|
|
58
|
-
<video data-shaka-player id="video" style="width:100%;height:100%"></video>
|
|
59
|
-
</div>
|
|
60
|
-
</body>
|
|
61
|
-
</html>
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
```js
|
|
65
|
-
// app.js
|
|
66
|
-
|
|
67
|
-
const manifestUri = 'https://dyctis843rxh5.cloudfront.net/vnIAZIaowG1K7qOt/master.m3u8';
|
|
68
|
-
|
|
69
|
-
// Initialise Shaka Player with LCEVC enhancement.
|
|
70
|
-
async function init() {
|
|
71
|
-
// When using the UI, the player is made automatically by the UI object.
|
|
72
|
-
const video = document.getElementById('video');
|
|
73
|
-
const ui = video['ui'];
|
|
74
|
-
const controls = ui.getControls();
|
|
75
|
-
const player = controls.getPlayer();
|
|
76
|
-
|
|
77
|
-
// Enable the LCEVC enhancement.
|
|
78
|
-
player.configure('lcevc.enabled', true);
|
|
79
|
-
|
|
80
|
-
// Listen for error events.
|
|
81
|
-
player.addEventListener('error', onError);
|
|
82
|
-
controls.addEventListener('error', onError);
|
|
83
|
-
|
|
84
|
-
// Try to load a manifest.
|
|
85
|
-
// This is an asynchronous process.
|
|
86
|
-
try {
|
|
87
|
-
await player.load(manifestUri);
|
|
88
|
-
// This runs if the asynchronous load is successful.
|
|
89
|
-
console.log('The video has now been loaded!');
|
|
90
|
-
} catch (error) {
|
|
91
|
-
onError(error);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Handle errors.
|
|
96
|
-
function onError(error) {
|
|
97
|
-
console.error('Error', error);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Listen to the custom shaka-ui-loaded event, to wait until the UI is loaded.
|
|
101
|
-
document.addEventListener('shaka-ui-loaded', init);
|
|
102
|
-
// Listen to the custom shaka-ui-load-failed event, in case Shaka Player fails
|
|
103
|
-
// to load (e.g. due to lack of browser support).
|
|
104
|
-
document.addEventListener('shaka-ui-load-failed', onError);
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
#### User provided canvas
|
|
109
|
-
|
|
110
|
-
User can also provide a canvas to the player though `attachCanvas` function:
|
|
111
|
-
|
|
112
|
-
```js
|
|
113
|
-
player.attachCanvas(canvas);
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Note: If external canvas is used, user is responsible for managing
|
|
117
|
-
the canvas. If no canvas is provided for Shaka UI library, the player
|
|
118
|
-
will generate and manage the canvas.
|