shaka-player 3.3.0 → 3.3.3
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/.csslintrc +11 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
- package/.github/pull_request_template.md +6 -34
- package/.github/workflows/build-and-test.yaml +130 -0
- package/.github/workflows/custom-actions/prep-for-appspot/action.yaml +56 -0
- package/.github/workflows/custom-actions/set-commit-status/action.yaml +41 -0
- package/.github/workflows/demo-version-index.yaml +29 -0
- package/.github/workflows/nightly-demo.yaml +42 -0
- package/.github/workflows/release-please.yaml +145 -0
- package/.github/workflows/safari-homedir-launcher.sh +18 -0
- package/.github/workflows/selenium-lab-tests.yaml +93 -0
- package/AUTHORS +2 -0
- package/CHANGELOG.md +1722 -1640
- package/CONTRIBUTING.md +2 -2
- package/CONTRIBUTORS +2 -0
- package/README.md +7 -7
- package/app-engine/README.md +9 -0
- package/app-engine/demo-version-index/README.md +14 -0
- package/app-engine/demo-version-index/app.yaml +2 -0
- package/app-engine/demo-version-index/main.py +162 -0
- package/app-engine/demo-version-index/requirements.txt +6 -0
- package/app-engine/demo-version-index/templates/index.html +114 -0
- package/app-engine/shaka-player-demo/README.md +18 -0
- package/app-engine/shaka-player-demo/app.yaml +61 -0
- package/app-engine/shaka-player-demo/main.py +95 -0
- package/app-engine/shaka-player-demo/posters/10yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/10yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/1yo.jpg +0 -0
- package/app-engine/shaka-player-demo/posters/2yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/2yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/3yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/3yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/4yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/4yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/5yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/5yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/6yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/6yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/7yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/7yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/8yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/8yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/9yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/9yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/audioOnly.gif +0 -0
- package/app-engine/shaka-player-demo/posters/audioRickRoll.gif +0 -0
- package/app-engine/shaka-player-demo/posters/colorbars.gif +0 -0
- package/app-engine/shaka-player-demo/posters/fireworks.jpg +0 -0
- package/app-engine/shaka-player-demo/posters/party-hat.png +0 -0
- package/app-engine/shaka-player-demo/posters/sources.txt +46 -0
- package/app-engine/shaka-player-demo/posters/standard.png +0 -0
- package/app-engine/shaka-player-demo/posters/trek.jpg +0 -0
- package/app-engine/shaka-player-demo/posters/valentines.png +0 -0
- package/app-engine/shaka-player-demo/posters/zombie.jpg +0 -0
- package/app-engine/shaka-player-demo/posters.py +110 -0
- package/app-engine/shaka-player-demo/requirements.txt +5 -0
- package/app-engine/shaka-player-demo/time.txt +1 -0
- package/build/README.md +1 -1
- package/build/checkversion.py +1 -1
- package/build/conformance.textproto +196 -169
- package/build/docker/Dockerfile +20 -0
- package/build/docker/docker-compose.yml +10 -0
- package/build/gendeps.py +18 -15
- package/build/shaka-lab.yaml +163 -0
- package/build/shakaBuildHelpers.py +4 -29
- package/build/test.py +93 -28
- package/build/types/polyfill +1 -0
- package/build/wrapper.template.js +2 -2
- package/demo/TengwarTelcontar.woff2 +0 -0
- package/demo/asset_card.js +1 -2
- package/demo/cast_receiver/index.html +1 -1
- package/demo/cast_receiver/receiver_app.css +14 -14
- package/demo/common/assets.js +2 -0
- package/demo/config.js +0 -1
- package/demo/custom.js +0 -1
- package/demo/customWarning.txt +2 -2
- package/demo/demo.less +29 -18
- package/demo/demo_uncompiled.js +1 -13
- package/demo/index.html +1 -1
- package/demo/main.js +3 -3
- package/dist/controls.css +3 -3
- package/dist/controls.css.map +1 -1
- package/dist/demo.compiled.debug.js +191 -194
- package/dist/demo.compiled.debug.map +4 -4
- package/dist/demo.compiled.js +191 -194
- package/dist/demo.compiled.map +4 -4
- package/dist/demo.css +1 -1
- package/dist/demo.css.map +1 -1
- package/dist/deps.js +233 -226
- package/dist/locales.js +30 -30
- package/dist/receiver.compiled.debug.js +43 -45
- package/dist/receiver.compiled.debug.map +4 -4
- package/dist/receiver.compiled.js +43 -45
- package/dist/receiver.compiled.map +4 -4
- package/dist/shaka-player.compiled.d.ts +272 -238
- package/dist/shaka-player.compiled.debug.d.ts +272 -238
- package/dist/shaka-player.compiled.debug.externs.js +53 -16
- package/dist/shaka-player.compiled.debug.js +393 -394
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +53 -16
- package/dist/shaka-player.compiled.js +840 -843
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +318 -293
- package/dist/shaka-player.ui.debug.d.ts +318 -293
- package/dist/shaka-player.ui.debug.externs.js +55 -27
- package/dist/shaka-player.ui.debug.js +415 -417
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +55 -27
- package/dist/shaka-player.ui.js +997 -1000
- package/dist/shaka-player.ui.map +4 -4
- package/docs/design/REDESIGN.md +33 -33
- package/docs/design/bg-fetch.md +2 -2
- package/docs/design/codec_preferences.md +1 -1
- package/docs/design/dash-audio-channels.md +3 -3
- package/docs/design/dash-manifests.md +1 -1
- package/docs/design/gap-jumping.md +3 -3
- package/docs/design/preload.md +2 -2
- package/docs/tutorials/faq.md +8 -8
- package/docs/tutorials/index.json +1 -0
- package/docs/tutorials/plugins.md +3 -3
- package/docs/tutorials/selenium-grid-config.md +122 -0
- package/docs/tutorials/welcome.md +10 -2
- package/externs/cmcd.js +186 -0
- package/externs/shaka/player.js +8 -0
- package/externs/shaka/text.js +10 -0
- package/karma.conf.js +156 -45
- package/lib/abr/simple_abr_manager.js +12 -6
- package/lib/ads/ad_manager.js +1 -0
- package/lib/cast/cast_proxy.js +6 -4
- package/lib/cast/cast_receiver.js +3 -0
- package/lib/cea/cea608_data_channel.js +2 -2
- package/lib/cea/cea708_service.js +5 -4
- package/lib/cea/mp4_cea_parser.js +11 -5
- package/lib/cea/sei_processor.js +6 -3
- package/lib/dash/dash_parser.js +40 -30
- package/lib/dash/mpd_utils.js +4 -5
- package/lib/dash/segment_list.js +1 -2
- package/lib/dash/segment_template.js +3 -3
- package/lib/hls/hls_parser.js +41 -9
- package/lib/hls/manifest_text_parser.js +4 -3
- package/lib/media/adaptation_set.js +1 -2
- package/lib/media/content_workarounds.js +2 -2
- package/lib/media/drm_engine.js +3 -2
- package/lib/media/media_source_engine.js +3 -2
- package/lib/media/mp4_segment_index_parser.js +1 -4
- package/lib/media/playhead.js +2 -2
- package/lib/media/presentation_timeline.js +18 -8
- package/lib/media/quality_observer.js +17 -34
- package/lib/media/region_observer.js +39 -33
- package/lib/media/region_timeline.js +17 -19
- package/lib/media/segment_index.js +2 -1
- package/lib/media/segment_reference.js +19 -1
- package/lib/media/streaming_engine.js +12 -9
- package/lib/media/time_ranges_utils.js +1 -3
- package/lib/media/video_wrapper.js +1 -1
- package/lib/net/networking_engine.js +5 -1
- package/lib/offline/storage.js +12 -13
- package/lib/player.js +87 -41
- package/lib/polyfill/all.js +2 -3
- package/lib/polyfill/encryption_scheme.js +1 -1
- package/lib/polyfill/media_capabilities.js +32 -17
- package/lib/polyfill/mediasource.js +1 -1
- package/lib/polyfill/symbol.js +46 -0
- package/lib/text/cue.js +7 -1
- package/lib/text/simple_text_displayer.js +2 -1
- package/lib/text/ttml_text_parser.js +92 -63
- package/lib/text/ui_text_displayer.js +18 -12
- package/lib/util/buffer_utils.js +1 -3
- package/lib/util/cmcd_manager.js +47 -201
- package/lib/util/ebml_parser.js +3 -3
- package/lib/util/error.js +1 -1
- package/lib/util/fake_event_target.js +21 -1
- package/lib/util/iterables.js +0 -46
- package/lib/util/mp4_box_parsers.js +1 -4
- package/lib/util/mp4_parser.js +5 -7
- package/lib/util/periods.js +10 -11
- package/lib/util/platform.js +3 -3
- package/lib/util/pssh.js +1 -4
- package/lib/util/stream_utils.js +88 -11
- package/lib/util/string_utils.js +3 -5
- package/lib/util/uint8array_utils.js +3 -5
- package/lib/util/xml_utils.js +34 -7
- package/package.json +62 -40
- package/roadmap.md +17 -17
- package/shaka-player.uncompiled.js +1 -0
- package/test/abr/simple_abr_manager_unit.js +3 -8
- package/test/ads/ad_manager_unit.js +0 -6
- package/test/cast/cast_proxy_unit.js +0 -8
- package/test/cast/cast_receiver_integration.js +1 -18
- package/test/cast/cast_receiver_unit.js +1 -9
- package/test/cast/cast_sender_unit.js +0 -6
- package/test/cast/cast_utils_unit.js +0 -13
- package/test/cea/cea608_memory_unit.js +0 -5
- package/test/cea/cea708_service_unit.js +0 -7
- package/test/cea/cea708_window_unit.js +0 -5
- package/test/cea/cea_decoder_unit.js +0 -6
- package/test/cea/dtvcc_packet_builder_unit.js +0 -3
- package/test/cea/dtvcc_packet_unit.js +0 -5
- package/test/cea/mp4_cea_parser_unit.js +0 -4
- package/test/dash/dash_parser_content_protection_unit.js +1 -10
- package/test/dash/dash_parser_live_unit.js +45 -15
- package/test/dash/dash_parser_manifest_unit.js +4 -17
- package/test/dash/dash_parser_segment_base_unit.js +1 -8
- package/test/dash/dash_parser_segment_list_unit.js +1 -7
- package/test/dash/dash_parser_segment_template_unit.js +0 -9
- package/test/dash/mpd_utils_unit.js +3 -11
- package/test/demo/demo_unit.js +0 -5
- package/test/deprecate/enforcer_unit.js +0 -4
- package/test/deprecate/version_unit.js +0 -2
- package/test/hls/hls_live_unit.js +2 -14
- package/test/hls/hls_parser_unit.js +76 -15
- package/test/hls/manifest_text_parser_unit.js +0 -10
- package/test/media/adaptation_set_criteria_unit.js +3 -7
- package/test/media/adaptation_set_unit.js +0 -2
- package/test/media/buffering_observer_unit.js +1 -4
- package/test/media/closed_caption_parser_unit.js +0 -3
- package/test/media/drm_engine_integration.js +2 -15
- package/test/media/drm_engine_unit.js +7 -27
- package/test/media/manifest_parser_unit.js +0 -4
- package/test/media/media_source_engine_integration.js +0 -7
- package/test/media/media_source_engine_unit.js +1 -14
- package/test/media/mp4_segment_index_parser_unit.js +0 -4
- package/test/media/play_rate_controller_unit.js +0 -4
- package/test/media/playhead_unit.js +8 -16
- package/test/media/presentation_timeline_unit.js +4 -7
- package/test/media/quality_observer_unit.js +4 -5
- package/test/media/region_observer_unit.js +40 -10
- package/test/media/region_timeline_unit.js +40 -25
- package/test/media/segment_index_unit.js +0 -6
- package/test/media/segment_reference_unit.js +0 -3
- package/test/media/stall_detector_unit.js +0 -5
- package/test/media/streaming_engine_integration.js +11 -37
- package/test/media/streaming_engine_unit.js +155 -34
- package/test/media/time_ranges_utils_unit.js +0 -2
- package/test/media/transmuxer_integration.js +0 -6
- package/test/media/webm_segment_index_parser_unit.js +0 -4
- package/test/net/data_uri_plugin_unit.js +0 -7
- package/test/net/http_plugin_unit.js +0 -9
- package/test/net/networking_engine_unit.js +0 -11
- package/test/offline/download_progress_estimator_unit.js +0 -2
- package/test/offline/indexeddb_storage_unit.js +0 -6
- package/test/offline/manifest_convert_unit.js +0 -8
- package/test/offline/offline_integration.js +1 -10
- package/test/offline/offline_manifest_parser_unit.js +0 -6
- package/test/offline/offline_scheme_unit.js +0 -8
- package/test/offline/offline_uri_unit.js +0 -2
- package/test/offline/storage_compatibility_unit.js +1 -14
- package/test/offline/storage_integration.js +1 -27
- package/test/player_external.js +2 -10
- package/test/player_integration.js +63 -36
- package/test/player_load_graph_integration.js +1 -6
- package/test/player_src_equals_external.js +3 -9
- package/test/player_src_equals_integration.js +41 -15
- package/test/player_unit.js +71 -46
- package/test/routing/walker_unit.js +0 -8
- package/test/test/assets/chapters.vtt +2 -2
- package/test/test/assets/chapters2.vtt +10 -0
- package/test/test/assets/large_file.mpd +1 -1
- package/test/test/boot.js +75 -22
- package/test/test/externs/jasmine.js +2 -2
- package/test/test/externs/karma.js +4 -0
- package/test/test/namespace.js +10 -0
- package/test/test/util/canned_idb.js +0 -8
- package/test/test/util/cea_utils.js +0 -6
- package/test/test/util/dash_parser_util.js +0 -13
- package/test/test/util/fake_ad.js +0 -3
- package/test/test/util/fake_ad_manager.js +0 -9
- package/test/test/util/fake_demo_main.js +0 -5
- package/test/test/util/fake_drm_engine.js +0 -6
- package/test/test/util/fake_media_source_engine.js +0 -7
- package/test/test/util/fake_networking_engine.js +0 -5
- package/test/test/util/fake_text_displayer.js +0 -5
- package/test/test/util/indexeddb_utils.js +1 -10
- package/test/test/util/jasmine_fetch.js +0 -1
- package/test/test/util/loader.js +0 -18
- package/test/test/util/manifest_generator.js +9 -14
- package/test/test/util/manifest_parser_util.js +0 -6
- package/test/test/util/offline_utils.js +0 -5
- package/test/test/util/simple_fakes.js +9 -26
- package/test/test/util/stream_generator.js +0 -14
- package/test/test/util/streaming_engine_util.js +0 -15
- package/test/test/util/test_scheme.js +1 -19
- package/test/test/util/ttml_utils.js +79 -0
- package/test/test/util/ui_utils.js +0 -9
- package/test/test/util/util.js +15 -26
- package/test/test/util/waiter.js +84 -43
- package/test/text/cue_integration.js +0 -4
- package/test/text/lrc_text_parser_unit.js +0 -4
- package/test/text/mp4_ttml_parser_unit.js +10 -23
- package/test/text/mp4_vtt_parser_unit.js +1 -7
- package/test/text/sbv_text_parser_unit.js +0 -4
- package/test/text/simple_text_displayer_unit.js +1 -8
- package/test/text/srt_text_parser_unit.js +0 -4
- package/test/text/ssa_text_parser_unit.js +0 -5
- package/test/text/text_engine_unit.js +2 -7
- package/test/text/text_track_integration.js +0 -2
- package/test/text/ttml_text_parser_unit.js +499 -239
- package/test/text/ui_text_displayer_unit.js +44 -41
- package/test/text/vtt_text_parser_unit.js +0 -9
- package/test/text/web_vtt_generator_unit.js +0 -3
- package/test/ui/ad_ui_unit.js +0 -11
- package/test/ui/localization_unit.js +0 -3
- package/test/ui/text_displayer_layout_unit.js +9 -19
- package/test/ui/ui_customization_unit.js +0 -6
- package/test/ui/ui_integration.js +0 -16
- package/test/ui/ui_unit.js +1 -17
- package/test/util/abortable_operation_unit.js +4 -9
- package/test/util/array_utils_unit.js +0 -2
- package/test/util/buffer_utils_unit.js +0 -2
- package/test/util/cmcd_manager_unit.js +29 -18
- package/test/util/data_view_reader_unit.js +0 -4
- package/test/util/ebml_parser_unit.js +0 -4
- package/test/util/event_manager_unit.js +0 -3
- package/test/util/fake_event_target_unit.js +0 -5
- package/test/util/functional_unit.js +1 -1
- package/test/util/iterables_unit.js +0 -64
- package/test/util/language_utils_unit.js +0 -3
- package/test/util/manifest_parser_utils_unit.js +0 -2
- package/test/util/mp4_box_parsers_unit.js +0 -5
- package/test/util/mp4_parser_unit.js +0 -4
- package/test/util/multi_map_unit.js +0 -3
- package/test/util/object_utils_unit.js +0 -2
- package/test/util/periods_unit.js +14 -7
- package/test/util/pssh_unit.js +0 -5
- package/test/util/state_history_unit.js +0 -2
- package/test/util/stream_utils_unit.js +39 -38
- package/test/util/string_utils_unit.js +0 -6
- package/test/util/text_parser_unit.js +0 -2
- package/test/util/xml_utils_unit.js +0 -4
- package/third_party/closure-uri/uri.js +21 -0
- package/ui/controls.js +3 -0
- package/ui/less/ad_controls.less +4 -4
- package/ui/less/buttons.less +5 -5
- package/ui/less/containers.less +9 -11
- package/ui/less/overflow_menu.less +4 -4
- package/ui/less/range_elements.less +5 -0
- package/ui/less/tooltip.less +1 -1
- package/ui/locales/sjn-translations.yaml +257 -0
- package/ui/locales/sjn.json +42 -0
- package/ui/localization.js +12 -36
- package/ui/text_selection.js +1 -0
- package/externs/media_capabilities.js +0 -16
- package/externs/svgelement.js +0 -18
- package/externs/webcrypto.js +0 -18
package/docs/design/REDESIGN.md
CHANGED
|
@@ -28,11 +28,11 @@ often requiring [multiple][] [fixes][] to get certain dependencies removed.
|
|
|
28
28
|
This means users all end up using the same monolithic player library.
|
|
29
29
|
Features in Shaka 2 should be modular and easy to exclude from the build.
|
|
30
30
|
|
|
31
|
-
[difficult]: https://github.com/
|
|
32
|
-
[to exclude]: https://github.com/
|
|
33
|
-
[from the build]: https://github.com/
|
|
34
|
-
[multiple]: https://github.com/
|
|
35
|
-
[fixes]: https://github.com/
|
|
31
|
+
[difficult]: https://github.com/shaka-project/shaka-player/commit/671611ef3722169b9f6b51ab44bdd6b4098d959e
|
|
32
|
+
[to exclude]: https://github.com/shaka-project/shaka-player/commit/603fae969550c69ea38a61249da905857c67b9f1
|
|
33
|
+
[from the build]: https://github.com/shaka-project/shaka-player/commit/f248647685b92ba928bbfd06d45d2b99023d60c2
|
|
34
|
+
[multiple]: https://github.com/shaka-project/shaka-player/commit/39be45d3d55cdcef20a6a529a87246b0ea11cb33
|
|
35
|
+
[fixes]: https://github.com/shaka-project/shaka-player/commit/6fe239150a8939728876e93e1a4269032530d9f1
|
|
36
36
|
|
|
37
37
|
Some operations, in particular [starting playback and filling the buffer][],
|
|
38
38
|
take longer than they need to. Startup and buffering in Shaka 2 should be as
|
|
@@ -46,54 +46,54 @@ us from updating MediaSource duration][] and makes it [difficult to set initial
|
|
|
46
46
|
playback time][] on browsers other than Chrome. Shaka 2 should have a simpler
|
|
47
47
|
streaming core that works better across browsers.
|
|
48
48
|
|
|
49
|
-
[StreamVideoSource]: https://github.com/
|
|
50
|
-
[Stream]: https://github.com/
|
|
51
|
-
[SourceBufferManager]: https://github.com/
|
|
52
|
-
[prevents us from updating MediaSource duration]: https://github.com/
|
|
53
|
-
[difficult to set initial playback time]: https://github.com/
|
|
49
|
+
[StreamVideoSource]: https://github.com/shaka-project/shaka-player/blob/v1.5.x/lib/player/stream_video_source.js
|
|
50
|
+
[Stream]: https://github.com/shaka-project/shaka-player/blob/v1.5.x/lib/media/stream.js
|
|
51
|
+
[SourceBufferManager]: https://github.com/shaka-project/shaka-player/blob/v1.5.x/lib/media/source_buffer_manager.js
|
|
52
|
+
[prevents us from updating MediaSource duration]: https://github.com/shaka-project/shaka-player/blob/v1.5.1/lib/player/stream_video_source.js#L1807
|
|
53
|
+
[difficult to set initial playback time]: https://github.com/shaka-project/shaka-player/issues/101
|
|
54
54
|
|
|
55
55
|
[Buffering state][] in Shaka 1 involves coordination between several layers
|
|
56
56
|
(from [Player][] to [Stream][]) and has been [tough][] [to][] [get][]
|
|
57
57
|
[right][]. Buffering state in Shaka 2 should be simple and consistent.
|
|
58
58
|
|
|
59
|
-
[Buffering state]: https://github.com/
|
|
60
|
-
[Player]: https://github.com/
|
|
61
|
-
[Stream]: https://github.com/
|
|
62
|
-
[tough]: https://github.com/
|
|
63
|
-
[to]: https://github.com/
|
|
64
|
-
[get]: https://github.com/
|
|
65
|
-
[right]: https://github.com/
|
|
59
|
+
[Buffering state]: https://github.com/shaka-project/shaka-player/blob/v1.5.1/lib/player/player.js#L994
|
|
60
|
+
[Player]: https://github.com/shaka-project/shaka-player/blob/v1.5.x/lib/player/player.js
|
|
61
|
+
[Stream]: https://github.com/shaka-project/shaka-player/blob/v1.5.x/lib/media/stream.js
|
|
62
|
+
[tough]: https://github.com/shaka-project/shaka-player/issues/44
|
|
63
|
+
[to]: https://github.com/shaka-project/shaka-player/issues/63
|
|
64
|
+
[get]: https://github.com/shaka-project/shaka-player/issues/127
|
|
65
|
+
[right]: https://github.com/shaka-project/shaka-player/issues/221#issuecomment-152781243
|
|
66
66
|
|
|
67
67
|
Shaka 1 relies on the browser to implement support for text types, and is
|
|
68
68
|
therefore limited to non-segmented WebVTT. Shaka 2 should also support
|
|
69
69
|
[segmented text types][] and [types not natively supported by the browser][].
|
|
70
70
|
|
|
71
|
-
[segmented text types]: https://github.com/
|
|
72
|
-
[types not natively supported by the browser]: https://github.com/
|
|
71
|
+
[segmented text types]: https://github.com/shaka-project/shaka-player/issues/150
|
|
72
|
+
[types not natively supported by the browser]: https://github.com/shaka-project/shaka-player/issues/111
|
|
73
73
|
|
|
74
74
|
Bandwidth estimation in Shaka 1 relies on the assumption that segments are not
|
|
75
75
|
cached locally. Use of [cache-busting techniques][] to enforce this makes
|
|
76
76
|
Shaka very [cache][]-[unfriendly][]. Shaka 2 should be cache-friendly.
|
|
77
77
|
|
|
78
|
-
[cache-busting techniques]: https://github.com/
|
|
79
|
-
[cache]: https://github.com/
|
|
80
|
-
[unfriendly]: https://github.com/
|
|
78
|
+
[cache-busting techniques]: https://github.com/shaka-project/shaka-player/blob/v1.5.1/lib/util/ajax_request.js#L241
|
|
79
|
+
[cache]: https://github.com/shaka-project/shaka-player/issues/76
|
|
80
|
+
[unfriendly]: https://github.com/shaka-project/shaka-player/issues/191
|
|
81
81
|
|
|
82
82
|
Shaka 1 [uses HTTP headers to synchronize the user's clock][] with the server.
|
|
83
83
|
This is [error-prone for some CDNs][] and also raises [CORS issues][], so Shaka
|
|
84
84
|
2 should avoid using HTTP headers.
|
|
85
85
|
|
|
86
|
-
[uses HTTP headers to synchronize the user's clock]: https://github.com/
|
|
87
|
-
[error-prone for some CDNs]: https://github.com/
|
|
88
|
-
[CORS issues]: https://github.com/
|
|
86
|
+
[uses HTTP headers to synchronize the user's clock]: https://github.com/shaka-project/shaka-player/blob/v1.5.1/lib/util/ajax_request.js#L448
|
|
87
|
+
[error-prone for some CDNs]: https://github.com/shaka-project/shaka-player/issues/205
|
|
88
|
+
[CORS issues]: https://github.com/shaka-project/shaka-player/issues/159
|
|
89
89
|
|
|
90
90
|
[HttpVideoSource][] does not build on MSE and classes like [EmeManager][] have
|
|
91
91
|
special cases to support it. Since it was originally created for debugging
|
|
92
92
|
purposes, Shaka 2 should drop HttpVideoSource and only support MSE-based
|
|
93
93
|
playback.
|
|
94
94
|
|
|
95
|
-
[HttpVideoSource]: https://github.com/
|
|
96
|
-
[EmeManager]: https://github.com/
|
|
95
|
+
[HttpVideoSource]: https://github.com/shaka-project/shaka-player/blob/v1.5.x/lib/player/http_video_source.js
|
|
96
|
+
[EmeManager]: https://github.com/shaka-project/shaka-player/blob/v1.5.x/lib/media/eme_manager.js
|
|
97
97
|
|
|
98
98
|
Integration tests using externally-hosted resources [can be flaky][],
|
|
99
99
|
especially when run outside of Google's network. Shaka 2 should avoid tests
|
|
@@ -106,34 +106,34 @@ and application developers sometimes [have to use error message strings][]
|
|
|
106
106
|
hard-coded into the library. Shaka 2 should have a consistent error format
|
|
107
107
|
that is easy to read.
|
|
108
108
|
|
|
109
|
-
[have to use error message strings]: https://github.com/
|
|
109
|
+
[have to use error message strings]: https://github.com/shaka-project/shaka-player/issues/201
|
|
110
110
|
|
|
111
111
|
Networking abstractions in Shaka 1 are built inside of AjaxRequest, which
|
|
112
112
|
requires non-HTTP requests to [pretend to come from XmlHttpRequest][]. The
|
|
113
113
|
networking abstraction in Shaka 2 should be simpler and should not treat
|
|
114
114
|
XHR as the basis for all networking.
|
|
115
115
|
|
|
116
|
-
[pretend to come from XmlHttpRequest]: https://github.com/
|
|
116
|
+
[pretend to come from XmlHttpRequest]: https://github.com/shaka-project/shaka-player/blob/v1.5.1/lib/util/ajax_request.js#L305
|
|
117
117
|
|
|
118
118
|
A developer who wishes to use a custom network protocol or a custom manifest
|
|
119
119
|
format in Shaka 1 will have to modify the library to do so. Shaka 2 should
|
|
120
120
|
[support external plugins for networking][] and manifest support.
|
|
121
121
|
|
|
122
|
-
[support external plugins for networking]: https://github.com/
|
|
122
|
+
[support external plugins for networking]: https://github.com/shaka-project/shaka-player/issues/198
|
|
123
123
|
|
|
124
124
|
The functionality that can be injected into Shaka 1 ([IBandwidthEstimator][],
|
|
125
125
|
[IAbrManager][]) is based on implementing class interfaces, which can be complex
|
|
126
126
|
for those unfamiliar with the Closure compiler. Plugins and extensions to Shaka
|
|
127
127
|
2 should be as simple as possible.
|
|
128
128
|
|
|
129
|
-
[IBandwidthEstimator]: https://github.com/
|
|
130
|
-
[IAbrManager]: https://github.com/
|
|
129
|
+
[IBandwidthEstimator]: https://github.com/shaka-project/shaka-player/blob/v1.5.1/lib/util/i_bandwidth_estimator.js
|
|
130
|
+
[IAbrManager]: https://github.com/shaka-project/shaka-player/blob/v1.5.1/lib/media/i_abr_manager.js
|
|
131
131
|
|
|
132
132
|
[Static members][] in Shaka 1 make it impossible in some cases to host multiple
|
|
133
133
|
Player instances with different settings. Player instances should be completely
|
|
134
134
|
independent in Shaka 1.
|
|
135
135
|
|
|
136
|
-
[Static members]: https://github.com/
|
|
136
|
+
[Static members]: https://github.com/shaka-project/shaka-player/issues/126
|
|
137
137
|
|
|
138
138
|
|
|
139
139
|
## Shaka v2 Design Principles
|
package/docs/design/bg-fetch.md
CHANGED
|
@@ -12,7 +12,7 @@ At the time it was added to the backlog, the feature was not quite ready for
|
|
|
12
12
|
use. Since then, it has matured, and now is something we could feasibly use, but
|
|
13
13
|
it has still been a low-priority feature.
|
|
14
14
|
|
|
15
|
-
[since 2017]: https://github.com/
|
|
15
|
+
[since 2017]: https://github.com/shaka-project/shaka-player/issues/879
|
|
16
16
|
|
|
17
17
|
## Design Concept
|
|
18
18
|
|
|
@@ -131,4 +131,4 @@ unrelated service worker for our own.
|
|
|
131
131
|
1. This message can also be used to make sure the versions are the same.
|
|
132
132
|
|
|
133
133
|
[the documentation]: https://developers.google.com/web/updates/2018/12/background-fetch#starting_a_background_fetch
|
|
134
|
-
[a given scope]: https://developers.google.com/web/fundamentals/primers/service-workers#register_a_service_worker
|
|
134
|
+
[a given scope]: https://developers.google.com/web/fundamentals/primers/service-workers#register_a_service_worker
|
|
@@ -97,7 +97,7 @@ A platform may support multiple DRM key systems, (for example, Widevine and
|
|
|
97
97
|
PlayReady). The `drm.preferredKeySystems` configuration allows the application
|
|
98
98
|
to specify which key systems it wants to choose.
|
|
99
99
|
|
|
100
|
-
[Github issue](https://github.com/
|
|
100
|
+
[Github issue](https://github.com/shaka-project/shaka-player/issues/3002)
|
|
101
101
|
|
|
102
102
|
Previously, Shaka Player chose a DRM key system based on:
|
|
103
103
|
1. Only use the key systems supported by the platform.
|
|
@@ -4,7 +4,7 @@ Shaka Player parses channel count information from HLS manifests, but not yet
|
|
|
4
4
|
from DASH manifests. We have had an [open request][dash_channels_request] to
|
|
5
5
|
do this for a year.
|
|
6
6
|
|
|
7
|
-
[dash_channels_request]: https://github.com/
|
|
7
|
+
[dash_channels_request]: https://github.com/shaka-project/shaka-player/issues/424
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
## The DASH Spec
|
|
@@ -79,7 +79,7 @@ Neither 23003-3 nor the DASH spec corrigenda were freely available at the time
|
|
|
79
79
|
of this writing, so we have not confirmed these assumptions.
|
|
80
80
|
|
|
81
81
|
[cast_labs_23003]: https://github.com/castlabs/dashencrypt/blob/1d604896/dash.fragmencrypter/src/main/java/com/castlabs/dash/helpers/DashHelper.java#L193
|
|
82
|
-
[shaka_packager_23003]: https://github.com/
|
|
82
|
+
[shaka_packager_23003]: https://github.com/shaka-project/shaka-packager/blob/4ba5bec6/packager/mpd/base/xml/xml_node.cc#L378
|
|
83
83
|
|
|
84
84
|
|
|
85
85
|
### tag:dolby.com,2014:dash:audio\_channel\_configuration:2011
|
|
@@ -101,7 +101,7 @@ Packager][shaka_packager_ec3_enum] supports this interpretation. This has not
|
|
|
101
101
|
been confirmed from primary sources.
|
|
102
102
|
|
|
103
103
|
[dash_if_audio_config]: http://dashif.org/identifiers/audio-source-data/
|
|
104
|
-
[shaka_packager_ec3_enum]: https://github.com/
|
|
104
|
+
[shaka_packager_ec3_enum]: https://github.com/shaka-project/shaka-packager/blob/47363dd0/packager/media/codecs/ec3_audio_util.cc#L34
|
|
105
105
|
|
|
106
106
|
|
|
107
107
|
### urn:dts:dash:audio\_channel\_configuration:2012
|
|
@@ -244,5 +244,5 @@ segments. You can follow progress in [#999][]. But note that DASH requires
|
|
|
244
244
|
accurate clock times, so even after that feature is added, your manifest may
|
|
245
245
|
not play in other DASH players.
|
|
246
246
|
|
|
247
|
-
[#999]: https://github.com/
|
|
247
|
+
[#999]: https://github.com/shaka-project/shaka-player/issues/999
|
|
248
248
|
|
|
@@ -21,13 +21,13 @@ buffered ranges.
|
|
|
21
21
|
|
|
22
22
|
There have been a number of bugs filed asking for this feature.
|
|
23
23
|
|
|
24
|
-
#### [#180](https://github.com/
|
|
24
|
+
#### [#180](https://github.com/shaka-project/shaka-player/issues/180)
|
|
25
25
|
One of the first bugs asking for gap jumping. The author talks about how live
|
|
26
26
|
streams can commonly lose source content (e.g. from network outages or weather).
|
|
27
27
|
This can cause the packagers to introduce gaps in either the media segments or
|
|
28
28
|
the manifest.
|
|
29
29
|
|
|
30
|
-
#### [#555](https://github.com/
|
|
30
|
+
#### [#555](https://github.com/shaka-project/shaka-player/issues/555)
|
|
31
31
|
This one is also asking about live streams and outages. The author discusses
|
|
32
32
|
several options for dealing with interruptions in the live streams. The
|
|
33
33
|
suggestions were:
|
|
@@ -41,7 +41,7 @@ can’t tell if a segment will never be available or is just not created yet.
|
|
|
41
41
|
Also that dummy content is usually generated by the server; however, the author
|
|
42
42
|
notes that this may not be feasible.
|
|
43
43
|
|
|
44
|
-
#### [#661](https://github.com/
|
|
44
|
+
#### [#661](https://github.com/shaka-project/shaka-player/issues/661)
|
|
45
45
|
This content with small gaps in the media that result in playback stalling.
|
|
46
46
|
Chrome and Firefox will actually play through the gap, but we don’t allow it
|
|
47
47
|
since it wouldn’t work on Safari.
|
package/docs/design/preload.md
CHANGED
|
@@ -15,7 +15,7 @@ This allows an application using Shaka Player to:
|
|
|
15
15
|
the user is making a decision on which video to play.
|
|
16
16
|
- Start to play the selected video almost immediately.
|
|
17
17
|
|
|
18
|
-
[Github issue](https://github.com/
|
|
18
|
+
[Github issue](https://github.com/shaka-project/shaka-player/issues/880)
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
## Background & Context
|
|
@@ -296,4 +296,4 @@ When preloading, the MediaSourceEngine appends the data to the SourceBuffer.
|
|
|
296
296
|
to the MediaSource.
|
|
297
297
|
3. For a live stream video, StreamingEngine can keep fetching the latest piece
|
|
298
298
|
of the content. The MediaSourceEngine stores the latest data, and abandons
|
|
299
|
-
the older data.
|
|
299
|
+
the older data.
|
package/docs/tutorials/faq.md
CHANGED
|
@@ -274,18 +274,18 @@ so don't declare it using a ref(), and if you put your player instance into a
|
|
|
274
274
|
data() object, you can prefix the property name with "$" or "_" to make Vue not
|
|
275
275
|
proxy them.
|
|
276
276
|
|
|
277
|
-
[386]: https://github.com/
|
|
278
|
-
[489]: https://github.com/
|
|
279
|
-
[743]: https://github.com/
|
|
280
|
-
[887]: https://github.com/
|
|
281
|
-
[999]: https://github.com/
|
|
282
|
-
[1667]: https://github.com/
|
|
277
|
+
[386]: https://github.com/shaka-project/shaka-player/issues/386#issuecomment-227898001
|
|
278
|
+
[489]: https://github.com/shaka-project/shaka-player/issues/489#issuecomment-240466224
|
|
279
|
+
[743]: https://github.com/shaka-project/shaka-player/issues/743
|
|
280
|
+
[887]: https://github.com/shaka-project/shaka-player/issues/887
|
|
281
|
+
[999]: https://github.com/shaka-project/shaka-player/issues/999
|
|
282
|
+
[1667]: https://github.com/shaka-project/shaka-player/issues/1667
|
|
283
283
|
[BigInteger.js]: https://github.com/peterolson/BigInteger.js
|
|
284
284
|
[CORS]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
|
|
285
|
-
[Shaka Player Embedded]: https://github.com/
|
|
285
|
+
[Shaka Player Embedded]: https://github.com/shaka-project/shaka-player-embedded
|
|
286
286
|
[auth]: https://shaka-player-demo.appspot.com/docs/api/tutorial-license-server-auth.html
|
|
287
287
|
[buffering]: https://shaka-player-demo.appspot.com/docs/api/tutorial-network-and-buffering-config.html
|
|
288
288
|
[drm_tutorial]: https://shaka-player-demo.appspot.com/docs/api/tutorial-drm-config.html
|
|
289
289
|
[eme_https]: https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins
|
|
290
290
|
[wrapping]: https://shaka-player-demo.appspot.com/docs/api/tutorial-license-wrapping.html
|
|
291
|
-
[including mux.js]: https://github.com/
|
|
291
|
+
[including mux.js]: https://github.com/shaka-project/shaka-player/blob/967f3399/demo/index.html#L39
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
{ "fairplay": { "title": "FairPlay support" } },
|
|
20
20
|
{ "application-level-redirects": { "title": "Application-Level Redirects" } },
|
|
21
21
|
{ "blob-url": { "title": "Blob URL" } },
|
|
22
|
+
{ "selenium-grid-config": { "title": "Selenium Grid Config" } },
|
|
22
23
|
{ "faq": { "title": "Frequently Asked Questions" } },
|
|
23
24
|
{ "upgrade": {
|
|
24
25
|
"title": "Upgrade Guide",
|
|
@@ -108,7 +108,7 @@ python build/build.py +@complete -@polyfill
|
|
|
108
108
|
python build/build.py +@complete -@polyfill -@text
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
To see the complete list of categories, its in [`build/types/`](https://github.com/
|
|
111
|
+
To see the complete list of categories, its in [`build/types/`](https://github.com/shaka-project/shaka-player/tree/main/build/types)
|
|
112
112
|
|
|
113
113
|
#### Build Configs
|
|
114
114
|
|
|
@@ -177,5 +177,5 @@ If you have a great plugin that you'd like to contribute back to the community,
|
|
|
177
177
|
we'd love to hear from you. You can get in touch via our [issue tracker][] to
|
|
178
178
|
discuss it, and once it's ready, you can send a [pull request][] on github.
|
|
179
179
|
|
|
180
|
-
[issue tracker]: https://github.com/
|
|
181
|
-
[pull request]: https://github.com/
|
|
180
|
+
[issue tracker]: https://github.com/shaka-project/shaka-player/issues/new/choose
|
|
181
|
+
[pull request]: https://github.com/shaka-project/shaka-player/pull/new/main
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Selenium Grid Config
|
|
2
|
+
|
|
3
|
+
Shaka Player's test runner (Karma) can be directed to run tests on a Selenium
|
|
4
|
+
grid. For this, you need a config file that defines what browsers are
|
|
5
|
+
available, and how to request them via WebDriver.
|
|
6
|
+
|
|
7
|
+
For a fully-worked, detailed example, see the config for the private grid in
|
|
8
|
+
our lab at [build/shaka-lab.yaml](https://github.com/shaka-project/shaka-player/blob/main/build/shaka-lab.yaml)
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
python build/test.py \
|
|
14
|
+
--grid-config grid-config.yaml \
|
|
15
|
+
--grid-address selenium-hub-hostname:4444
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Syntax
|
|
19
|
+
|
|
20
|
+
The config file is written in YAML. We chose YAML because it has two big
|
|
21
|
+
advantages over JSON:
|
|
22
|
+
|
|
23
|
+
1. You can add comments
|
|
24
|
+
2. You can define variables (with YAML "anchors") to factor out common configs
|
|
25
|
+
|
|
26
|
+
### Variables
|
|
27
|
+
|
|
28
|
+
You can define any common variables in the `vars` section, then refer to them
|
|
29
|
+
elsewhere. For example:
|
|
30
|
+
|
|
31
|
+
```yaml
|
|
32
|
+
vars:
|
|
33
|
+
# Generates an "anchor" with the given name. Later, you can inject the
|
|
34
|
+
# contents of the variable with "*name".
|
|
35
|
+
firefox_config: &firefox_config
|
|
36
|
+
moz:firefoxOptions:
|
|
37
|
+
# Override Firefox default preferences in the temporary profile created
|
|
38
|
+
# for each test run.
|
|
39
|
+
prefs:
|
|
40
|
+
# Overrides Selenium's explicit default setting, to allow Firefox to
|
|
41
|
+
# install the Widevine CDM on demand.
|
|
42
|
+
media.gmp-manager.updateEnabled: true
|
|
43
|
+
# Overrides Firefox's Linux-specific default setting to disable DRM.
|
|
44
|
+
media.eme.enabled: true
|
|
45
|
+
|
|
46
|
+
# These three browser definitions share the same config from above.
|
|
47
|
+
FirefoxMac:
|
|
48
|
+
browser: firefox
|
|
49
|
+
os: Mac
|
|
50
|
+
extra_config: *firefox_config
|
|
51
|
+
|
|
52
|
+
FirefoxWindows:
|
|
53
|
+
browser: firefox
|
|
54
|
+
os: Windows
|
|
55
|
+
extra_config: *firefox_config
|
|
56
|
+
|
|
57
|
+
FirefoxLinux:
|
|
58
|
+
browser: firefox
|
|
59
|
+
os: Linux
|
|
60
|
+
extra_config: *firefox_config
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Browsers
|
|
64
|
+
|
|
65
|
+
Each top-level key in the config file (except for `vars`) is the name of a
|
|
66
|
+
browser made available to Karma. Within each of those keys are the following:
|
|
67
|
+
|
|
68
|
+
- `browser`: The name of the browser. This is case-sensitive, and must match
|
|
69
|
+
the string and case used by Selenium.
|
|
70
|
+
- `os` (optional): The name of the OS. This is case-INsensitive, and must
|
|
71
|
+
match the name of the platform as used by Selenium. For Generic
|
|
72
|
+
WebDriver Server, this can be omitted or set to the name of the host
|
|
73
|
+
platform.
|
|
74
|
+
- `version` (optional): The version of the browser. This is case-sensitive,
|
|
75
|
+
and must match the string and case used in the Selenium node config.
|
|
76
|
+
- `disabled` (optional): If true, this browser is disabled and will not be
|
|
77
|
+
used unless explicitly requested.
|
|
78
|
+
- `extra_config` (optional): A dictionary of extra configs which will be
|
|
79
|
+
merged with the WebDriver launcher config in Karma.
|
|
80
|
+
|
|
81
|
+
Examples of basic desktop browsers definitions:
|
|
82
|
+
|
|
83
|
+
```yaml
|
|
84
|
+
ChromeMac:
|
|
85
|
+
browser: chrome
|
|
86
|
+
os: Mac
|
|
87
|
+
|
|
88
|
+
FirefoxMac:
|
|
89
|
+
browser: firefox
|
|
90
|
+
os: Mac
|
|
91
|
+
|
|
92
|
+
Safari:
|
|
93
|
+
browser: safari
|
|
94
|
+
os: Mac
|
|
95
|
+
|
|
96
|
+
SafariTP:
|
|
97
|
+
browser: safari
|
|
98
|
+
os: Mac
|
|
99
|
+
extra_config:
|
|
100
|
+
safari.options:
|
|
101
|
+
technologyPreview: true
|
|
102
|
+
|
|
103
|
+
ChromeWindows:
|
|
104
|
+
browser: chrome
|
|
105
|
+
os: Windows
|
|
106
|
+
|
|
107
|
+
FirefoxWindows:
|
|
108
|
+
browser: firefox
|
|
109
|
+
os: Windows
|
|
110
|
+
|
|
111
|
+
Edge:
|
|
112
|
+
browser: msedge
|
|
113
|
+
os: Windows
|
|
114
|
+
|
|
115
|
+
ChromeLinux:
|
|
116
|
+
browser: chrome
|
|
117
|
+
os: Linux
|
|
118
|
+
|
|
119
|
+
FirefoxLinux:
|
|
120
|
+
browser: firefox
|
|
121
|
+
os: Linux
|
|
122
|
+
```
|
|
@@ -35,11 +35,13 @@ To get the sources and compile the library, you will need:
|
|
|
35
35
|
* _NOTE: A local web server is required because browsers place restrictions
|
|
36
36
|
on applications from file:/// URLs._
|
|
37
37
|
|
|
38
|
+
If you just want to compile for export to other projects, you might consider compiling through a docker container. (see compile instructions)
|
|
39
|
+
|
|
38
40
|
To quickly install these prerequisites on Ubuntu or Debian, you can run this
|
|
39
41
|
script:
|
|
40
42
|
|
|
41
43
|
```sh
|
|
42
|
-
curl https://raw.githubusercontent.com/
|
|
44
|
+
curl https://raw.githubusercontent.com/shaka-project/shaka-player/main/build/install-linux-prereqs.sh | bash
|
|
43
45
|
```
|
|
44
46
|
|
|
45
47
|
We do not provide detailed instructions or scripts for installing these
|
|
@@ -51,7 +53,7 @@ links above to download and install the prerequisites manually on any OS.
|
|
|
51
53
|
#### Get the source
|
|
52
54
|
|
|
53
55
|
```sh
|
|
54
|
-
git clone https://github.com/
|
|
56
|
+
git clone https://github.com/shaka-project/shaka-player.git
|
|
55
57
|
cd shaka-player
|
|
56
58
|
```
|
|
57
59
|
|
|
@@ -62,6 +64,12 @@ cd shaka-player
|
|
|
62
64
|
python build/all.py
|
|
63
65
|
```
|
|
64
66
|
|
|
67
|
+
Alternatively you can use a docker container:
|
|
68
|
+
```sh
|
|
69
|
+
cd build/docker
|
|
70
|
+
docker-compose run --rm shaka-compiler
|
|
71
|
+
```
|
|
72
|
+
|
|
65
73
|
The output is:
|
|
66
74
|
* dist/shaka-player.compiled.js (compiled bundle)
|
|
67
75
|
* dist/shaka-player.compiled.debug.js (debug bundle)
|
package/externs/cmcd.js
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/*! @license
|
|
2
|
+
* Shaka Player
|
|
3
|
+
* Copyright 2016 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Externs for CMCD data.
|
|
9
|
+
* @see https://github.com/shaka-project/shaka-player/issues/3619
|
|
10
|
+
* @see https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf
|
|
11
|
+
*
|
|
12
|
+
* @externs
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @typedef {{
|
|
17
|
+
* br: (number|undefined),
|
|
18
|
+
* d: (number|undefined),
|
|
19
|
+
* ot: (string|undefined),
|
|
20
|
+
* tb: (number|undefined),
|
|
21
|
+
* bl: (number|undefined),
|
|
22
|
+
* dl: (number|undefined),
|
|
23
|
+
* mtp: (number|undefined),
|
|
24
|
+
* nor: (string|undefined),
|
|
25
|
+
* nrr: (string|undefined),
|
|
26
|
+
* su: (boolean|undefined),
|
|
27
|
+
* cid: (string|undefined),
|
|
28
|
+
* pr: (number|undefined),
|
|
29
|
+
* sf: (string|undefined),
|
|
30
|
+
* sid: (string|undefined),
|
|
31
|
+
* st: (string|undefined),
|
|
32
|
+
* v: (number|undefined),
|
|
33
|
+
* bs: (boolean|undefined),
|
|
34
|
+
* rtp: (number|undefined)
|
|
35
|
+
* }}
|
|
36
|
+
*
|
|
37
|
+
* @description
|
|
38
|
+
* Client Media Common Data (CMCD) data.
|
|
39
|
+
*
|
|
40
|
+
* @property {number} br
|
|
41
|
+
* The encoded bitrate of the audio or video object being requested. This may
|
|
42
|
+
* not be known precisely by the player; however, it MAY be estimated based
|
|
43
|
+
* upon playlist/manifest declarations. If the playlist declares both peak and
|
|
44
|
+
* average bitrate values, the peak value should be transmitted.
|
|
45
|
+
*
|
|
46
|
+
* @property {number} d
|
|
47
|
+
* The playback duration in milliseconds of the object being requested. If a
|
|
48
|
+
* partial segment is being requested, then this value MUST indicate the
|
|
49
|
+
* playback duration of that part and not that of its parent segment. This
|
|
50
|
+
* value can be an approximation of the estimated duration if the explicit
|
|
51
|
+
* value is not known.
|
|
52
|
+
*
|
|
53
|
+
* @property {string} ot
|
|
54
|
+
* The media type of the current object being requested:
|
|
55
|
+
* - `m` = text file, such as a manifest or playlist
|
|
56
|
+
* - `a` = audio only
|
|
57
|
+
* - `v` = video only
|
|
58
|
+
* - `av` = muxed audio and video
|
|
59
|
+
* - `i` = init segment
|
|
60
|
+
* - `c` = caption or subtitle
|
|
61
|
+
* - `tt` = ISOBMFF timed text track
|
|
62
|
+
* - `k` = cryptographic key, license or certificate.
|
|
63
|
+
* - `o` = other
|
|
64
|
+
*
|
|
65
|
+
* If the object type being requested is unknown, then this key MUST NOT be
|
|
66
|
+
* used.
|
|
67
|
+
*
|
|
68
|
+
* @property {number} tb
|
|
69
|
+
* The highest bitrate rendition in the manifest or playlist that the client
|
|
70
|
+
* is allowed to play, given current codec, licensing and sizing constraints.
|
|
71
|
+
*
|
|
72
|
+
* @property {number} bl
|
|
73
|
+
* The buffer length associated with the media object being requested. This
|
|
74
|
+
* value MUST be rounded to the nearest 100 ms. This key SHOULD only be sent
|
|
75
|
+
* with an object type of ‘a’, ‘v’ or ‘av’.
|
|
76
|
+
*
|
|
77
|
+
* @property {number} dl
|
|
78
|
+
* Deadline from the request time until the first sample of this
|
|
79
|
+
* Segment/Object needs to be available in order to not create a buffer
|
|
80
|
+
* underrun or any other playback problems. This value MUST be rounded to the
|
|
81
|
+
* nearest 100ms. For a playback rate of 1, this may be equivalent to the
|
|
82
|
+
* player’s remaining buffer length.
|
|
83
|
+
*
|
|
84
|
+
* @property {number} mtp
|
|
85
|
+
* The throughput between client and server, as measured by the client and
|
|
86
|
+
* MUST be rounded to the nearest 100 kbps. This value, however derived,
|
|
87
|
+
* SHOULD be the value that the client is using to make its next Adaptive
|
|
88
|
+
* Bitrate switching decision. If the client is connected to multiple
|
|
89
|
+
* servers concurrently, it must take care to report only the throughput
|
|
90
|
+
* measured against the receiving server. If the client has multiple
|
|
91
|
+
* concurrent connections to the server, then the intent is that this value
|
|
92
|
+
* communicates the aggregate throughput the client sees across all those
|
|
93
|
+
* connections.
|
|
94
|
+
*
|
|
95
|
+
* @property {string} nor
|
|
96
|
+
* Relative path of the next object to be requested. This can be used to
|
|
97
|
+
* trigger pre-fetching by the CDN. This MUST be a path relative to the
|
|
98
|
+
* current request. This string MUST be URLEncoded. The client SHOULD NOT
|
|
99
|
+
* depend upon any pre-fetch action being taken - it is merely a request for
|
|
100
|
+
* such a pre-fetch to take place.
|
|
101
|
+
*
|
|
102
|
+
* @property {string} nrr
|
|
103
|
+
* If the next request will be a partial object request, then this string
|
|
104
|
+
* denotes the byte range to be requested. If the ‘nor’ field is not set, then
|
|
105
|
+
* the object is assumed to match the object currently being requested. The
|
|
106
|
+
* client SHOULD NOT depend upon any pre-fetch action being taken – it is
|
|
107
|
+
* merely a request for such a pre-fetch to take place. Formatting is similar
|
|
108
|
+
* to the HTTP Range header, except that the unit MUST be ‘byte’, the ‘Range:’
|
|
109
|
+
* prefix is NOT required and specifying multiple ranges is NOT allowed. Valid
|
|
110
|
+
* combinations are:
|
|
111
|
+
*
|
|
112
|
+
* - `"\<range-start\>-"`
|
|
113
|
+
* - `"\<range-start\>-\<range-end\>"`
|
|
114
|
+
* - `"-\<suffix-length\>"`
|
|
115
|
+
*
|
|
116
|
+
* @property {boolean} su
|
|
117
|
+
* Key is included without a value if the object is needed urgently due to
|
|
118
|
+
* startup, seeking or recovery after a buffer-empty event. The media SHOULD
|
|
119
|
+
* not be rendering when this request is made. This key MUST not be sent if it
|
|
120
|
+
* is FALSE.
|
|
121
|
+
*
|
|
122
|
+
* @property {string} cid
|
|
123
|
+
* A unique string identifying the current content. Maximum length is 64
|
|
124
|
+
* characters. This value is consistent across multiple different sessions and
|
|
125
|
+
* devices and is defined and updated at the discretion of the service
|
|
126
|
+
* provider.
|
|
127
|
+
*
|
|
128
|
+
* @property {number} pr
|
|
129
|
+
* The playback rate. `1` if real-time, `2` if double speed, `0` if not
|
|
130
|
+
* playing. SHOULD only be sent if not equal to `1`.
|
|
131
|
+
*
|
|
132
|
+
* @property {string} sf
|
|
133
|
+
* The streaming format that defines the current request.
|
|
134
|
+
*
|
|
135
|
+
* - `d` = MPEG DASH
|
|
136
|
+
* - `h` = HTTP Live Streaming (HLS)
|
|
137
|
+
* - `s` = Smooth Streaming
|
|
138
|
+
* - `o` = other
|
|
139
|
+
*
|
|
140
|
+
* If the streaming format being requested is unknown, then this key MUST NOT
|
|
141
|
+
* be used.
|
|
142
|
+
*
|
|
143
|
+
* @property {string} sid
|
|
144
|
+
* A GUID identifying the current playback session. A playback session
|
|
145
|
+
* typically ties together segments belonging to a single media asset. Maximum
|
|
146
|
+
* length is 64 characters. It is RECOMMENDED to conform to the UUID
|
|
147
|
+
* specification.
|
|
148
|
+
*
|
|
149
|
+
* @property {string} st
|
|
150
|
+
* Stream type
|
|
151
|
+
* - `v` = all segments are available – e.g., VOD
|
|
152
|
+
* - `l` = segments become available over time – e.g., LIVE
|
|
153
|
+
*
|
|
154
|
+
* @property {number} v
|
|
155
|
+
* The version of this specification used for interpreting the defined key
|
|
156
|
+
* names and values. If this key is omitted, the client and server MUST
|
|
157
|
+
* interpret the values as being defined by version 1. Client SHOULD omit this
|
|
158
|
+
* field if the version is 1.
|
|
159
|
+
*
|
|
160
|
+
* @property {boolean} bs
|
|
161
|
+
* Buffer starvation key is included without a value if the buffer was starved
|
|
162
|
+
* at some point between the prior request and this object request, resulting
|
|
163
|
+
* in the player being in a rebuffering state and the video or audio playback
|
|
164
|
+
* being stalled. This key MUST NOT be sent if the buffer was not starved
|
|
165
|
+
* since the prior request.
|
|
166
|
+
*
|
|
167
|
+
* If the object type `ot` key is sent along with this key, then the `bs` key
|
|
168
|
+
* refers to the buffer associated with the particular object type. If no
|
|
169
|
+
* object type is communicated, then the buffer state applies to the current
|
|
170
|
+
* session.
|
|
171
|
+
*
|
|
172
|
+
* @property {number} rtp
|
|
173
|
+
* Requested maximum throughput
|
|
174
|
+
*
|
|
175
|
+
* The requested maximum throughput that the client considers sufficient for
|
|
176
|
+
* delivery of the asset. Values MUST be rounded to the nearest 100kbps. For
|
|
177
|
+
* example, a client would indicate that the current segment, encoded at
|
|
178
|
+
* 2Mbps, is to be delivered at no more than 10Mbps, by using rtp=10000.
|
|
179
|
+
*
|
|
180
|
+
* Note: This can benefit clients by preventing buffer saturation through
|
|
181
|
+
* over-delivery and can also deliver a community benefit through fair-share
|
|
182
|
+
* delivery. The concept is that each client receives the throughput necessary
|
|
183
|
+
* for great performance, but no more. The CDN may not support the rtp
|
|
184
|
+
* feature.
|
|
185
|
+
*/
|
|
186
|
+
var CmcdData;
|