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
package/docs/design/offline.md
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
# Shaka Player v2 Offline Design
|
|
2
|
-
|
|
3
|
-
last update: 2016-05-24
|
|
4
|
-
|
|
5
|
-
by: [joeyparrish@google.com](mailto:joeyparrish@google.com)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
Offline storage in Shaka Player v2 will be represented by an instance of
|
|
11
|
-
`shaka.offline.Storage`. The API for offline storage will not be on
|
|
12
|
-
`shaka.Player` so that offline capabilities can be trivially omitted from the
|
|
13
|
-
build. Internal classes used to implement offline storage/playback will live in
|
|
14
|
-
the `shaka.offline` namespace. Everything in the `shaka.offline` namespace will
|
|
15
|
-
be listed in `build/types/offline` for quick exclusion of the feature.
|
|
16
|
-
|
|
17
|
-
`Storage` will store streams for offline playback, allow selection of which
|
|
18
|
-
tracks to store, provide progress information while storing streams, allow the
|
|
19
|
-
listing of stored content, and allow the removal of stored content. To reduce
|
|
20
|
-
the number of parameters in the `store()` method, we will offer a `configure()`
|
|
21
|
-
interface to set callbacks. We will also provide a default track-selection
|
|
22
|
-
callback to make it easier to get started.
|
|
23
|
-
|
|
24
|
-
Backward compatibility with stored content from v1 is an explicit non-goal. If
|
|
25
|
-
it turns out that there is a need in the community to migrate stored content
|
|
26
|
-
from v1 to v2, a simple migration utility can be written later.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
#### `Storage` API sketch
|
|
30
|
-
|
|
31
|
-
```js
|
|
32
|
-
new shaka.offline.Storage(player)
|
|
33
|
-
|
|
34
|
-
shaka.offline.Storage.support => boolean
|
|
35
|
-
|
|
36
|
-
// NOTE: Not connected to player.configure().
|
|
37
|
-
shaka.offline.Storage.prototype.configure({
|
|
38
|
-
trackSelectionCallback: function(allTracks) {
|
|
39
|
-
// The default callback selects:
|
|
40
|
-
// 1. highest bandwidth video track with height <= 480,
|
|
41
|
-
// 2. middle bandwidth audio track with best audio pref language match,
|
|
42
|
-
// 3. all text tracks with any text pref language match.
|
|
43
|
-
// Return an array of selected Tracks.
|
|
44
|
-
},
|
|
45
|
-
progressCallback: function(storedContent, percentComplete) {}
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
// Store content and metadata.
|
|
49
|
-
shaka.offline.Storage.prototype.store(manifestUri, appMetadata, manifestParser) => Promise.<StoredContent>
|
|
50
|
-
|
|
51
|
-
// Remove stored content and metadata.
|
|
52
|
-
shaka.offline.Storage.prototype.remove(storedContent) => Promise
|
|
53
|
-
|
|
54
|
-
// List stored content.
|
|
55
|
-
shaka.offline.Storage.prototype.list() => Promise.<Array.<StoredContent>>
|
|
56
|
-
|
|
57
|
-
StoredContent:
|
|
58
|
-
offlineUri: string // at which the stored content can be accessed
|
|
59
|
-
originalManifestUri: string // the original manifest URI of the content we stored
|
|
60
|
-
duration: number // length of the stored content in seconds
|
|
61
|
-
size: number // size of the stored content in bytes
|
|
62
|
-
tracks: !Array.<shaka.extern.Track> // the tracks we stored
|
|
63
|
-
appMetadata: object // arbitrary format, provided by the application to store()
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
#### Implementation
|
|
68
|
-
|
|
69
|
-
Like v1, v2 will use IndexedDB for storage.
|
|
70
|
-
|
|
71
|
-
In v1, applications were required to persist the list of stored content and any
|
|
72
|
-
app metadata in window.localStorage. In v2, we will provide an API to list
|
|
73
|
-
stored content and we will store app metadata along-side the content.
|
|
74
|
-
|
|
75
|
-
In v1, progress was inaccurate. It was calculated in terms of segments, even
|
|
76
|
-
though segment sizes are very different between audio and video. In v2,
|
|
77
|
-
progress can be calculated in terms of bytes, which will provide a more accurate
|
|
78
|
-
percentage. If the index does not have byte ranges for segments, presumed
|
|
79
|
-
segment sizes can be calculated based on average bitrate and duration. This
|
|
80
|
-
will be accurate enough on average to provide a smooth progress bar. (Smooth
|
|
81
|
-
relative to v1.) Actual bytes transferred will be tracked in the
|
|
82
|
-
`StoredContent` structure.
|
|
83
|
-
|
|
84
|
-
In v1, segments were combined into larger chunks to reduce the overhead of
|
|
85
|
-
reading from the disk. This was premature optimization, as we had no data to
|
|
86
|
-
suggest this was necessary. In v2, all segments will be stored in their
|
|
87
|
-
original form.
|
|
88
|
-
|
|
89
|
-
`store()` will transfer segment types (audio, video) in parallel, since some
|
|
90
|
-
CDNs limit download rate based on the bandwidth requirements of the stream.
|
|
91
|
-
|
|
92
|
-
`Storage` will have to load a manifest using the correct parser, filter the
|
|
93
|
-
tracks as `Player` does, and invoke a callback to select streams. This should
|
|
94
|
-
involve a factoring of the load and filtering logic of `Player`, perhaps into
|
|
95
|
-
`ManifestParser` or `PlayerUtil`. These methods will not be exported. A
|
|
96
|
-
`Player` instance is required to instantiate a `Storage`, and `Storage` will get
|
|
97
|
-
manifest configuration from that instance.
|
|
98
|
-
|
|
99
|
-
`Storage` will also need to use `DrmEngine` directly to persist licenses and get
|
|
100
|
-
the session IDs. The session IDs will be stored in the database as part of the
|
|
101
|
-
content. Removing a piece of content should result in any associated persistent
|
|
102
|
-
sessions being released.
|
|
103
|
-
|
|
104
|
-
A scheme plugin will register itself with `NetworkingEngine` to implement the
|
|
105
|
-
`offline` scheme. Manifest URIs will be of the form `offline:123`, where `123`
|
|
106
|
-
is an automatically-assigned ID representing the stored content. Segment URIs
|
|
107
|
-
will be of the form `offline:123/7/99`, where `7` is an auto-ID for the track
|
|
108
|
-
and `99` is an auto-ID for the segment.
|
|
109
|
-
|
|
110
|
-
The scheme handler will handle `HEAD` requests and return a `Content-Type`
|
|
111
|
-
header with the value `application/x-offline-manifest`. This type will be
|
|
112
|
-
registered with `ManifestParser` in order to "parse the manifest" (load it from
|
|
113
|
-
the database).
|
|
114
|
-
|
|
115
|
-
To include offline support info in `Player.probeSupport()` but still make it
|
|
116
|
-
possible to exclude offline from the build, `Player.probeSupport()` will now
|
|
117
|
-
have a plugin interface. `Storage` will register its `support()` method with
|
|
118
|
-
`Player` under the key `offline`. Overall library support is not contingent on
|
|
119
|
-
the `basic` support of any of the plugins, including offline. Support plugins
|
|
120
|
-
are synchronous, for simplicity.
|
|
121
|
-
|
|
122
|
-
It's okay if the app selects multiple streams of a type. For text, this may be
|
|
123
|
-
necessary, for example, to store subtitles for all languages. For audio it may
|
|
124
|
-
be necessary as well, for similar reasons. For video it makes little sense, but
|
|
125
|
-
we won't restrict it. Apps can make whatever decision they want about tracks to
|
|
126
|
-
store, but we should document best practice.
|
|
127
|
-
|
|
128
|
-
We could also issue a warning if multiple tracks of same type, kind, and
|
|
129
|
-
language are selected, since offline adaptation is currently an uncommon
|
|
130
|
-
scenario and may indicate a mistake on the part of the app developer. For
|
|
131
|
-
example, this would trigger on two video with different bitrate or size, or two
|
|
132
|
-
audio of same language but different bitrate, or two text of same language and
|
|
133
|
-
kind.
|
|
134
|
-
|
|
135
|
-
`Storage` will need good unit and integration tests. Integration tests should
|
|
136
|
-
store a stream created by `StreamGenerator` and verify that the `StoredContent`
|
|
137
|
-
structure is correct. A test should also load the stored data and verify that
|
|
138
|
-
it matches the generated segments.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
#### Error conditions
|
|
142
|
-
|
|
143
|
-
Errors during `store()`:
|
|
144
|
-
- No IndexedDB support
|
|
145
|
-
- No persistent license support
|
|
146
|
-
- Out of storage space
|
|
147
|
-
- Can't store a live stream
|
|
148
|
-
- Any error that could occur during player.load()
|
|
149
|
-
|
|
150
|
-
Errors while loading content:
|
|
151
|
-
- Content not found
|
|
152
|
-
- Persistent license cannot be loaded (may have been cleared by browser)
|
|
153
|
-
- Any error that could occur during player.load()
|
package/docs/design/ownership.gv
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# Generate png with: dot -Tpng -O ownership.gv
|
|
2
|
-
|
|
3
|
-
digraph shaka2_ownership {
|
|
4
|
-
label=<<u>Shaka 2 Ownership Diagram</u>>
|
|
5
|
-
labelloc=t
|
|
6
|
-
node [ shape=rectangle ]
|
|
7
|
-
|
|
8
|
-
MediaSource [ shape=oval ]
|
|
9
|
-
SourceBuffer [ shape=oval ]
|
|
10
|
-
TextTrack [ shape=oval ]
|
|
11
|
-
|
|
12
|
-
AbrManager [ shape=trapezium ]
|
|
13
|
-
HttpFetchPlugin [ shape=trapezium ]
|
|
14
|
-
ManifestParser [ shape=trapezium ]
|
|
15
|
-
TextDisplayer [ shape=trapezium ]
|
|
16
|
-
TextParser [ shape=trapezium ]
|
|
17
|
-
|
|
18
|
-
Player -> AbrManager
|
|
19
|
-
Player -> NetworkingEngine
|
|
20
|
-
Player -> ManifestParser
|
|
21
|
-
Player -> MediaSourceEngine
|
|
22
|
-
Player -> StreamingEngine
|
|
23
|
-
Player -> DrmEngine
|
|
24
|
-
Player -> Manifest
|
|
25
|
-
Player -> TextDisplayer
|
|
26
|
-
|
|
27
|
-
TextDisplayer -> TextTrack
|
|
28
|
-
|
|
29
|
-
NetworkingEngine -> HttpFetchPlugin
|
|
30
|
-
|
|
31
|
-
ManifestParser -> NetworkingEngine [ style=dotted ]
|
|
32
|
-
|
|
33
|
-
DrmEngine -> NetworkingEngine [ style=dotted ]
|
|
34
|
-
|
|
35
|
-
StreamingEngine -> MediaSourceEngine [ style=dotted ]
|
|
36
|
-
StreamingEngine -> Manifest [ style=dotted ]
|
|
37
|
-
StreamingEngine -> NetworkingEngine [ style=dotted ]
|
|
38
|
-
|
|
39
|
-
MediaSourceEngine -> MediaSource
|
|
40
|
-
# MediaSourceEngine owns multiple SourceBuffers, so we represent that here
|
|
41
|
-
# with two edges:
|
|
42
|
-
MediaSourceEngine -> SourceBuffer
|
|
43
|
-
MediaSourceEngine -> SourceBuffer
|
|
44
|
-
MediaSourceEngine -> Transmuxer
|
|
45
|
-
MediaSourceEngine -> TextEngine
|
|
46
|
-
|
|
47
|
-
TextEngine -> TextDisplayer [ style=dotted ]
|
|
48
|
-
TextEngine -> TextParser
|
|
49
|
-
|
|
50
|
-
# Player does not own MediaSource since v2.4, but without this link, the graph
|
|
51
|
-
# becomes unbalanced and harder to read. This is a hack.
|
|
52
|
-
Player -> MediaSource [ style=invisible arrowhead=none ]
|
|
53
|
-
|
|
54
|
-
subgraph cluster_legend {
|
|
55
|
-
style=rounded
|
|
56
|
-
color="#444444"
|
|
57
|
-
label=<<u>Legend</u>>
|
|
58
|
-
fontsize=12
|
|
59
|
-
fontcolor="#444444"
|
|
60
|
-
|
|
61
|
-
node [ shape=plaintext color="#444444" fontsize=10 fontcolor="#444444" ]
|
|
62
|
-
edge [ color="#444444" ]
|
|
63
|
-
|
|
64
|
-
blank1 [ label="" fixedsize=true height=0 ]
|
|
65
|
-
blank2 [ label="" fixedsize=true height=0 ]
|
|
66
|
-
"weak reference" -> blank2 [ style=dotted ]
|
|
67
|
-
ownership -> blank1
|
|
68
|
-
|
|
69
|
-
plugin [ shape=trapezium ]
|
|
70
|
-
"browser built-in" [ shape=oval ]
|
|
71
|
-
"internal class" [ shape=rectangle ]
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
# Hack to move the legend beneath the main graph:
|
|
75
|
-
TextParser -> "internal class" [ style=invisible arrowhead=none ]
|
|
76
|
-
}
|
|
Binary file
|
package/docs/design/preload.md
DELETED
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
# Shaka Player Preload API Design
|
|
2
|
-
|
|
3
|
-
Last updated: 2020-03-01
|
|
4
|
-
|
|
5
|
-
by: [michellezhuo@google.com](mailto:michellezhuo@google.com)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
## Objective
|
|
9
|
-
|
|
10
|
-
Enable Shaka Player to pre-load content before involving MediaSource or a
|
|
11
|
-
`<video>` element.
|
|
12
|
-
|
|
13
|
-
This allows an application using Shaka Player to:
|
|
14
|
-
- Pre-load the beginning of several pieces of video content speculatively, while
|
|
15
|
-
the user is making a decision on which video to play.
|
|
16
|
-
- Start to play the selected video almost immediately.
|
|
17
|
-
|
|
18
|
-
[Github issue](https://github.com/shaka-project/shaka-player/issues/880)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## Background & Context
|
|
22
|
-
|
|
23
|
-
### Media Source
|
|
24
|
-
|
|
25
|
-
The [MediaSource][] API, formally known as Media Source Extensions (MSE),
|
|
26
|
-
provides functionality enabling plugin-free web-based streaming media. Using
|
|
27
|
-
MSE, media streams can be created via JavaScript, and played using `<audio>` and
|
|
28
|
-
`<video>` elements.
|
|
29
|
-
|
|
30
|
-
The MediaSource interface of the [Media Source Extensions API][] represents a
|
|
31
|
-
source of media data for an HTMLMediaElement object. A MediaSource object can be
|
|
32
|
-
attached to an HTMLMediaElement to be played.
|
|
33
|
-
|
|
34
|
-
The SourceBuffer interface represents a chunk of media to be passed into an
|
|
35
|
-
HTMLMediaElement and played, via a MediaSource object. This can be made up of
|
|
36
|
-
one or several media segments.
|
|
37
|
-
|
|
38
|
-
[Media Source Extensions API]:https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API
|
|
39
|
-
[MediaSource]: https://developer.mozilla.org/en-US/docs/Web/API/MediaSource
|
|
40
|
-
|
|
41
|
-
### StreamingEngine & MediaSourceEngine
|
|
42
|
-
|
|
43
|
-
The StreamingEngine is the streaming component in Shaka Player. It’s responsible
|
|
44
|
-
for fetching the content, and pipelines the content to MediaSourceEngine.
|
|
45
|
-
The MediaSourceEngine manages the MediaSource and the SourceBuffers.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
## Design Overview
|
|
49
|
-
|
|
50
|
-
The design will address two major requirements:
|
|
51
|
-
1. Enable preloading a manifest in Player before attaching to a video element
|
|
52
|
-
2. Enable StreamingEngine to fetch and store a segment in memory without a video
|
|
53
|
-
element
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
## Design Goals
|
|
57
|
-
|
|
58
|
-
### Compatibility
|
|
59
|
-
|
|
60
|
-
Currently, the Shaka Player loads a manifest and streams a video via its Load
|
|
61
|
-
API. The Preload API should be backward compatible with the existing Load API.
|
|
62
|
-
|
|
63
|
-
An application should be able to:
|
|
64
|
-
- Attach a video element and load a manifest, and start playback with Shaka
|
|
65
|
-
Player
|
|
66
|
-
- Preload manifests and attach a video element later to start playback with
|
|
67
|
-
Shaka Player
|
|
68
|
-
|
|
69
|
-
### Reusability
|
|
70
|
-
|
|
71
|
-
The Preload API implementation should reuse the current Load API logic as much
|
|
72
|
-
as possible.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
## Design Details
|
|
76
|
-
|
|
77
|
-
### Player
|
|
78
|
-
Currently, with the Load API, the Player:
|
|
79
|
-
- must attach a `<video>` element before loading a manifest
|
|
80
|
-
- can load only one manifest at one time.
|
|
81
|
-
|
|
82
|
-
With the new Preload API enabled, the Player should be able to:
|
|
83
|
-
- pre-load a manifest, and attach a video element later to start playback.
|
|
84
|
-
- pre-load more than one manifest, and finish loading one of them at a time.
|
|
85
|
-
|
|
86
|
-
#### APIs
|
|
87
|
-
|
|
88
|
-
**Existing: Load API**
|
|
89
|
-
|
|
90
|
-
```js
|
|
91
|
-
const player = new shaka.Player();
|
|
92
|
-
player.attach(video);
|
|
93
|
-
await player.load('foo.mpd');
|
|
94
|
-
```
|
|
95
|
-
The Player constructor takes a `<video>` element (HTMLMediaElement) as an
|
|
96
|
-
optional parameter. If the `<video>` element is available, we attach the
|
|
97
|
-
`<video>` element to the player, and set up the MediaSource.
|
|
98
|
-
|
|
99
|
-
A `<video>` element must be attached to the Player before `load()` gets called.
|
|
100
|
-
The Player can load only one video at one time.
|
|
101
|
-
`load()` loads the manifest, initializes the playback components and starts
|
|
102
|
-
playback, including:
|
|
103
|
-
- Parsing the manifest
|
|
104
|
-
- Initializing the DRM Engine
|
|
105
|
-
- Attaching the playback-related listeners to the video element
|
|
106
|
-
- Initializing playback and observers
|
|
107
|
-
- Initializing ABR Manager and StreamingEngine
|
|
108
|
-
- Starting playback
|
|
109
|
-
|
|
110
|
-
**New: Preload API**
|
|
111
|
-
|
|
112
|
-
```js
|
|
113
|
-
const player = new shaka.Player();
|
|
114
|
-
|
|
115
|
-
const loader1 = player.preload('foo1.mpd');
|
|
116
|
-
const loader2 = player.preload('foo2.mpd');
|
|
117
|
-
|
|
118
|
-
player.attach(video);
|
|
119
|
-
|
|
120
|
-
player.load(loader1); // The buffered data in loader1 is transferred to
|
|
121
|
-
// the Player and the MediaSource. loader1 is
|
|
122
|
-
// invalidated.
|
|
123
|
-
loader2.destroy(); // loader2 is invalidated.
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
The new Preload API doesn’t require a `<video>` element before the Player
|
|
127
|
-
preloads a manifest. The `<video>` element must be attached to the Player
|
|
128
|
-
before `load()` gets called.
|
|
129
|
-
|
|
130
|
-
`preload()` parses a manifest, and pipelines the manifest to the
|
|
131
|
-
StreamingEngine. StreamingEngine fetches the beginning piece of the content,
|
|
132
|
-
and stores it in memory.
|
|
133
|
-
|
|
134
|
-
The Player can preload multiple manifests in parallel, and store each of them as
|
|
135
|
-
a loader.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
After `preload()`, `load(loader)` will start playback by opening the MediaSource
|
|
139
|
-
and pipelining the fetched content to MediaSourceEngine.
|
|
140
|
-
|
|
141
|
-
`load()` invalidates the loader instance once the playback starts.
|
|
142
|
-
|
|
143
|
-
After the playback starts, the application can invalidate the other loaders when
|
|
144
|
-
they are no longer needed by calling `destroy()`.
|
|
145
|
-
|
|
146
|
-
When the Player is destroyed, the remaining loaders will also be destroyed.
|
|
147
|
-
|
|
148
|
-
The `load()` function will take either an asset Uri or a loader instance as the
|
|
149
|
-
first parameter.
|
|
150
|
-
```js
|
|
151
|
-
load(assetUri | loader, startTime, mimeType) {}
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
If `load()` gets an uri as the input, it goes to the original loading process.
|
|
155
|
-
|
|
156
|
-
If `load()` gets a loader instance, it means the content is preloaded, and the
|
|
157
|
-
Player goes to the following steps after preload to finish loading and start
|
|
158
|
-
playback.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
### the Load Graph
|
|
162
|
-
|
|
163
|
-
The Player uses a state machine (the “load graph”) to go through the steps of
|
|
164
|
-
attaching a video element, parsing a manifest, initializing components, etc.
|
|
165
|
-
to start the video playback.
|
|
166
|
-
|
|
167
|
-
Currently the Player can only have one load graph, so it can only load one
|
|
168
|
-
manifest.
|
|
169
|
-
|
|
170
|
-
To enable preloading multiple manifests in parallel, we’ll extract the load
|
|
171
|
-
graph and the loading process to a Loader class. The Player can have multiple
|
|
172
|
-
Loader instances when preloading.
|
|
173
|
-
|
|
174
|
-
Once the user decides to load one of the manifests, the Player will invalidate
|
|
175
|
-
the chosen Loader passed to load(), and the Loader will be responsible for the
|
|
176
|
-
life cycle of loading and playback. The application can use other preloaded
|
|
177
|
-
Loader instances later, or invalidate them if they are no longer needed.
|
|
178
|
-
|
|
179
|
-
The load graph contains the following states (nodes):
|
|
180
|
-
- Attach Node
|
|
181
|
-
- Media Source Node
|
|
182
|
-
- Manifest Parser Node
|
|
183
|
-
- Manifest Node
|
|
184
|
-
- Drm Engine Node
|
|
185
|
-
- Load Node
|
|
186
|
-
- Unloading Node
|
|
187
|
-
- Src Equals Node
|
|
188
|
-
|
|
189
|
-
To enable the Preload API, we’ll separate the original Load Node into two nodes,
|
|
190
|
-
one “Preload node” and a “Load Node”. We’ll add a new path of “preload manifest
|
|
191
|
-
-> attach video -> load” in the graph.
|
|
192
|
-
|
|
193
|
-

|
|
194
|
-
|
|
195
|
-
#### Implementation steps
|
|
196
|
-
|
|
197
|
-
1. Extract the load graph from the Player into a Loader class.
|
|
198
|
-
2. The Player’s APIs should have the same behavior as before. The Player should
|
|
199
|
-
forward the API calls to the Loader class.
|
|
200
|
-
3. Add a Preload node in the Load Graph.
|
|
201
|
-
4. Make a path of preload manifest -> attach video -> load in the graph. We can
|
|
202
|
-
check if the video element is available to see which path we are on.
|
|
203
|
-
5. Attach the video element to the MediaSource when `load()` is called.
|
|
204
|
-
|
|
205
|
-
#### Alternative approach
|
|
206
|
-
|
|
207
|
-
To enable preloading multiple manifests, another approach is to have two load
|
|
208
|
-
graphs, one in the Player class and another one in the Loader class.
|
|
209
|
-
|
|
210
|
-
The load graph in Player is responsible for the overall life cycle, including
|
|
211
|
-
attaching / detaching the video, and parsing / loading / unloading the manifest.
|
|
212
|
-
the load graph in Loader is responsible for a part of the overall graph,
|
|
213
|
-
the parsing / loading manifest process.
|
|
214
|
-
|
|
215
|
-
However, with that approach, the life cycle of the video playback, and the
|
|
216
|
-
components needed for playback may be managed and accessed in two places. It may
|
|
217
|
-
be more complex to implement.
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
### StreamingEngine & MediaSourceEngine
|
|
221
|
-
|
|
222
|
-
When loading a media content, the Player initializes the MediaSource when the
|
|
223
|
-
StreamingEngine starts to stream a piece of content. The MediaSource gets open
|
|
224
|
-
once a video gets attached to it. We can append buffers to the MediaSource once
|
|
225
|
-
it’s open.
|
|
226
|
-
|
|
227
|
-
With the Preload API, the StreamingEngine should be able to download an
|
|
228
|
-
audio/video/text stream without the video element attached. The
|
|
229
|
-
MediaSourceEngine should be able to start without the video element, and store
|
|
230
|
-
the downloaded content in memory.
|
|
231
|
-
|
|
232
|
-
This way, the initialization steps of StreamingEngine, MediaSourceEngine,
|
|
233
|
-
MediaSource when preloading remain almost the same with the original loading
|
|
234
|
-
process. The state of MediaSourceEngine remains the same, and StreamingEngine
|
|
235
|
-
doesn't need to know the state of MediaSource. The downloaded content is kept
|
|
236
|
-
in and managed by MediaSourceEngine, whether stored in memory or appended to the
|
|
237
|
-
SourceBuffer. This approach requires the least changes in StreamingEngine and
|
|
238
|
-
MediaSourceEngine.
|
|
239
|
-
|
|
240
|
-
New field added to MediaSourceEngine:
|
|
241
|
-
|
|
242
|
-
`preloadBuffers_` map
|
|
243
|
-
- key: `contentType`
|
|
244
|
-
- value: an object of `{ bufferedData, mimeType }`
|
|
245
|
-
|
|
246
|
-
However, the Player can also have a MediaSourceEngine attached to a video
|
|
247
|
-
element, before content is loaded or preloaded. So we won't always be able to
|
|
248
|
-
attach the Loader's MediaSourceEngine to a video element.
|
|
249
|
-
|
|
250
|
-
In that case, we need to replace the Loader's MediaSourceEngine with the
|
|
251
|
-
Player's copy, and transfer the stored buffered data.
|
|
252
|
-
|
|
253
|
-
And since MediaSourceEngine operations are sync, and StreamingEngine runs on its
|
|
254
|
-
own timers, we need to handle new segments being streamed while this process of
|
|
255
|
-
transferring buffered segments is in progress. We can pause StreamingEngine
|
|
256
|
-
update timers while you do the transfer.
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
#### Implementation Steps
|
|
260
|
-
|
|
261
|
-
When preloading:
|
|
262
|
-
1. When the Player initializes the MediaSourceEngine:
|
|
263
|
-
1. In MediaSourceEngine, skip attaching the video to the media source for
|
|
264
|
-
now. The MediaSource’s readyState is closed.
|
|
265
|
-
2. In Player.onInitializeMediaSourceEngine_(), do not wait for the
|
|
266
|
-
MediaSource to be open.
|
|
267
|
-
3. Add a preloadBuffers map in the MediaSourceEngine.
|
|
268
|
-
2. When the Player initializes the StreamingEngine, and starts streaming:
|
|
269
|
-
1. In `MediaSourceEngine.init()`, skip adding the SourceBuffer for now.
|
|
270
|
-
Instead, store a `<contentType, { bufferedData, mimeType } >` key-value pair
|
|
271
|
-
in a preloadBuffers map.
|
|
272
|
-
|
|
273
|
-
When loading with the loader instance:
|
|
274
|
-
1. If the Player hasn't got an attached MediaSource already, attach the video
|
|
275
|
-
element to the MediaSource, and the MediaSource gets open.
|
|
276
|
-
2. Append the buffered data to the SourceBuffers.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
### Constraints
|
|
280
|
-
The Preload API can't work with src=. Preloading hinges on using MediaSource to
|
|
281
|
-
keep segments in memory and parse them later, and this can't be done with src=.
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
## Test Plans
|
|
285
|
-
|
|
286
|
-
### Existing use case
|
|
287
|
-
|
|
288
|
-
StreamingEngine fetches a piece of content and appends to MediaSourceEngine.
|
|
289
|
-
When preloading, the MediaSourceEngine appends the data to the SourceBuffer.
|
|
290
|
-
|
|
291
|
-
### New use cases
|
|
292
|
-
|
|
293
|
-
1. When preloading, the StreamingEngine fetches a piece of content and appends
|
|
294
|
-
to MediaSourceEngine, and the MediaSourceEngine stores the data in memory.
|
|
295
|
-
2. When the MediaSource is ready, StreamingEngine pipelines the fetched content
|
|
296
|
-
to the MediaSource.
|
|
297
|
-
3. For a live stream video, StreamingEngine can keep fetching the latest piece
|
|
298
|
-
of the content. The MediaSourceEngine stores the latest data, and abandons
|
|
299
|
-
the older data.
|
package/docs/design/preload.png
DELETED
|
Binary file
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# Shaka Player - Talking About Language
|
|
2
|
-
|
|
3
|
-
## Summary
|
|
4
|
-
This document outlines the standard set of terms and definitions used by Shaka Player when working with language.
|
|
5
|
-
|
|
6
|
-
## Locales
|
|
7
|
-
A __locale__ is the top level "object" and is composed of three __components__:
|
|
8
|
-
- __language__, a lowercase 2-character code. Preferably from [ISO 639](http://www.loc.gov/standards/iso639-2/php/code_list.php).
|
|
9
|
-
- __region__, an uppercase 2-character code. Preferably from ISO 3166.
|
|
10
|
-
- __dialect__, a lowercase n-character code.
|
|
11
|
-
|
|
12
|
-
A locale is not required to use every component but must follow one of three patterns:
|
|
13
|
-
- language (e.g. "en")
|
|
14
|
-
- language-REGION (e.g. "en-US")
|
|
15
|
-
- language-REGION-dialect (e.g. "en-US-wa")
|
|
16
|
-
|
|
17
|
-
## Relationships
|
|
18
|
-
Locales follow a tree-like structure, so we use tree-like terms to talk about the relationships between locales:
|
|
19
|
-
|
|
20
|
-

|
|
21
|
-
|
|
22
|
-
- "en" is the parent of "en-US".
|
|
23
|
-
- "en-US" is the parent of "en-US-tx".
|
|
24
|
-
- "en" is the grandparent of "en-US-tx".
|
|
25
|
-
- "en-US" and "en-CA" are siblings.
|
|
26
|
-
- "en-US-tx" and "en-US-wa" are siblings.
|
|
27
|
-
|
|
28
|
-
## Compatibility
|
|
29
|
-
There are three types of compatibility:
|
|
30
|
-
- Locale Compatible - When two locales share the same language, region, and dialect.
|
|
31
|
-
- "en" and "en"
|
|
32
|
-
- "en-US" and "en-US"
|
|
33
|
-
- "en-US-wa" and "en-US-wa"
|
|
34
|
-
- Region Compatible - When two locales share the same language and region.
|
|
35
|
-
- "en-US" and "en-US"
|
|
36
|
-
- "en-US" and "en-US-wa"
|
|
37
|
-
- "en-US-wa" and "en-US-tx"
|
|
38
|
-
- Language Compatible - When two locales share the same language.
|
|
39
|
-
- "en-US" and "en-US"
|
|
40
|
-
- "en-US" and "en-CA"
|
|
41
|
-
- "en-US-wa" and "en-US-tx"
|
|
42
|
-
- "en-US-wa" and "en-CA-mb"
|
|
43
|
-
- "en" and "en-US-wa"
|
|
44
|
-
- "en-US" and "en-US-wa"
|
|
45
|
-
|
|
46
|
-

|