shaka-player 3.3.1 → 3.3.4
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 +147 -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 +1707 -1670
- 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 +13 -0
- package/build/docker/Dockerfile +20 -0
- package/build/docker/docker-compose.yml +10 -0
- package/build/gendeps.py +18 -15
- package/build/generateTsDefs.py +2 -0
- 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 +32 -32
- 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 +250 -237
- package/dist/shaka-player.compiled.debug.d.ts +250 -237
- package/dist/shaka-player.compiled.debug.externs.js +31 -15
- package/dist/shaka-player.compiled.debug.js +252 -257
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +31 -15
- package/dist/shaka-player.compiled.js +844 -849
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +296 -292
- package/dist/shaka-player.ui.debug.d.ts +296 -292
- package/dist/shaka-player.ui.debug.externs.js +33 -26
- package/dist/shaka-player.ui.debug.js +345 -351
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +33 -26
- package/dist/shaka-player.ui.js +1002 -1008
- 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 +1 -1
- 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 +11 -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/streaming_engine.js +7 -7
- 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 +65 -25
- package/lib/polyfill/all.js +2 -3
- package/lib/polyfill/encryption_scheme.js +1 -1
- package/lib/polyfill/media_capabilities.js +3 -3
- package/lib/polyfill/mediasource.js +1 -1
- package/lib/polyfill/symbol.js +46 -0
- package/lib/text/cue.js +1 -1
- package/lib/text/simple_text_displayer.js +2 -1
- package/lib/text/ttml_text_parser.js +8 -5
- package/lib/text/ui_text_displayer.js +1 -1
- package/lib/util/buffer_utils.js +1 -3
- 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 +4 -3
- package/lib/util/string_utils.js +3 -5
- package/lib/util/uint8array_utils.js +3 -5
- package/lib/util/xml_utils.js +15 -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 +4 -24
- 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 +9 -36
- package/test/media/streaming_engine_unit.js +11 -35
- 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 +22 -28
- 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 +0 -7
- package/test/player_unit.js +52 -37
- package/test/routing/walker_unit.js +0 -8
- 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 +0 -2
- 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 +0 -6
- 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 +2 -11
- 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 +0 -3
- 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 +3 -8
- 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/ui/controls.js +3 -0
- package/ui/less/ad_controls.less +6 -6
- package/ui/less/buttons.less +6 -6
- package/ui/less/containers.less +13 -15
- package/ui/less/overflow_menu.less +4 -4
- package/ui/less/range_elements.less +7 -2
- package/ui/less/tooltip.less +4 -4
- package/ui/locales/sjn-translations.yaml +257 -0
- package/ui/locales/sjn.json +42 -0
- package/ui/localization.js +12 -36
- package/ui/seek_bar.js +2 -1
- package/externs/svgelement.js +0 -18
- package/externs/webcrypto.js +0 -18
|
@@ -8,16 +8,19 @@ goog.provide('shaka.media.RegionObserver');
|
|
|
8
8
|
|
|
9
9
|
goog.require('shaka.media.IPlayheadObserver');
|
|
10
10
|
goog.require('shaka.media.RegionTimeline');
|
|
11
|
+
goog.require('shaka.util.EventManager');
|
|
12
|
+
goog.require('shaka.util.FakeEvent');
|
|
13
|
+
goog.require('shaka.util.FakeEventTarget');
|
|
11
14
|
|
|
12
15
|
|
|
13
16
|
/**
|
|
14
17
|
* The region observer watches a region timeline and playhead, and fires events
|
|
15
|
-
* (
|
|
18
|
+
* ('enter', 'exit', 'skip') as the playhead moves.
|
|
16
19
|
*
|
|
17
20
|
* @implements {shaka.media.IPlayheadObserver}
|
|
18
21
|
* @final
|
|
19
22
|
*/
|
|
20
|
-
shaka.media.RegionObserver = class {
|
|
23
|
+
shaka.media.RegionObserver = class extends shaka.util.FakeEventTarget {
|
|
21
24
|
/**
|
|
22
25
|
* Create a region observer for the given timeline. The observer does not
|
|
23
26
|
* own the timeline, only uses it. This means that the observer should NOT
|
|
@@ -26,6 +29,8 @@ shaka.media.RegionObserver = class {
|
|
|
26
29
|
* @param {!shaka.media.RegionTimeline} timeline
|
|
27
30
|
*/
|
|
28
31
|
constructor(timeline) {
|
|
32
|
+
super();
|
|
33
|
+
|
|
29
34
|
/** @private {shaka.media.RegionTimeline} */
|
|
30
35
|
this.timeline_ = timeline;
|
|
31
36
|
|
|
@@ -39,13 +44,6 @@ shaka.media.RegionObserver = class {
|
|
|
39
44
|
*/
|
|
40
45
|
this.oldPosition_ = new Map();
|
|
41
46
|
|
|
42
|
-
/** @private {shaka.media.RegionObserver.EventListener} */
|
|
43
|
-
this.onEnter_ = (region, seeking) => {};
|
|
44
|
-
/** @private {shaka.media.RegionObserver.EventListener} */
|
|
45
|
-
this.onExit_ = (region, seeking) => {};
|
|
46
|
-
/** @private {shaka.media.RegionObserver.EventListener} */
|
|
47
|
-
this.onSkip_ = (region, seeking) => {};
|
|
48
|
-
|
|
49
47
|
// To make the rules easier to read, alias all the relative positions.
|
|
50
48
|
const RelativePosition = shaka.media.RegionObserver.RelativePosition_;
|
|
51
49
|
const BEFORE_THE_REGION = RelativePosition.BEFORE_THE_REGION;
|
|
@@ -62,39 +60,48 @@ shaka.media.RegionObserver = class {
|
|
|
62
60
|
{
|
|
63
61
|
weWere: null,
|
|
64
62
|
weAre: IN_THE_REGION,
|
|
65
|
-
invoke: (region, seeking) => this.
|
|
63
|
+
invoke: (region, seeking) => this.onEvent_('enter', region, seeking),
|
|
66
64
|
},
|
|
67
65
|
{
|
|
68
66
|
weWere: BEFORE_THE_REGION,
|
|
69
67
|
weAre: IN_THE_REGION,
|
|
70
|
-
invoke: (region, seeking) => this.
|
|
68
|
+
invoke: (region, seeking) => this.onEvent_('enter', region, seeking),
|
|
71
69
|
},
|
|
72
70
|
{
|
|
73
71
|
weWere: AFTER_THE_REGION,
|
|
74
72
|
weAre: IN_THE_REGION,
|
|
75
|
-
invoke: (region, seeking) => this.
|
|
73
|
+
invoke: (region, seeking) => this.onEvent_('enter', region, seeking),
|
|
76
74
|
},
|
|
77
75
|
{
|
|
78
76
|
weWere: IN_THE_REGION,
|
|
79
77
|
weAre: BEFORE_THE_REGION,
|
|
80
|
-
invoke: (region, seeking) => this.
|
|
78
|
+
invoke: (region, seeking) => this.onEvent_('exit', region, seeking),
|
|
81
79
|
},
|
|
82
80
|
{
|
|
83
81
|
weWere: IN_THE_REGION,
|
|
84
82
|
weAre: AFTER_THE_REGION,
|
|
85
|
-
invoke: (region, seeking) => this.
|
|
83
|
+
invoke: (region, seeking) => this.onEvent_('exit', region, seeking),
|
|
86
84
|
},
|
|
87
85
|
{
|
|
88
86
|
weWere: BEFORE_THE_REGION,
|
|
89
87
|
weAre: AFTER_THE_REGION,
|
|
90
|
-
invoke: (region, seeking) => this.
|
|
88
|
+
invoke: (region, seeking) => this.onEvent_('skip', region, seeking),
|
|
91
89
|
},
|
|
92
90
|
{
|
|
93
91
|
weWere: AFTER_THE_REGION,
|
|
94
92
|
weAre: BEFORE_THE_REGION,
|
|
95
|
-
invoke: (region, seeking) => this.
|
|
93
|
+
invoke: (region, seeking) => this.onEvent_('skip', region, seeking),
|
|
96
94
|
},
|
|
97
95
|
];
|
|
96
|
+
|
|
97
|
+
/** @private {shaka.util.EventManager} */
|
|
98
|
+
this.eventManager_ = new shaka.util.EventManager();
|
|
99
|
+
|
|
100
|
+
this.eventManager_.listen(this.timeline_, 'regionremove', (event) => {
|
|
101
|
+
/** @type {shaka.extern.TimelineRegionInfo} */
|
|
102
|
+
const region = event['region'];
|
|
103
|
+
this.oldPosition_.delete(region);
|
|
104
|
+
});
|
|
98
105
|
}
|
|
99
106
|
|
|
100
107
|
/** @override */
|
|
@@ -105,11 +112,10 @@ shaka.media.RegionObserver = class {
|
|
|
105
112
|
// needed.
|
|
106
113
|
this.oldPosition_.clear();
|
|
107
114
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
this.onSkip_ = (region, seeking) => {};
|
|
115
|
+
this.eventManager_.release();
|
|
116
|
+
this.eventManager_ = null;
|
|
117
|
+
|
|
118
|
+
super.release();
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
/** @override */
|
|
@@ -134,20 +140,20 @@ shaka.media.RegionObserver = class {
|
|
|
134
140
|
}
|
|
135
141
|
|
|
136
142
|
/**
|
|
137
|
-
*
|
|
143
|
+
* Dispatch events of the given type. All event types in this class have the
|
|
144
|
+
* same parameters: region and seeking.
|
|
138
145
|
*
|
|
139
|
-
* @param {
|
|
140
|
-
*
|
|
141
|
-
* @param {
|
|
142
|
-
*
|
|
143
|
-
* @param {shaka.media.RegionObserver.EventListener} onSkip
|
|
144
|
-
* The callback for when we move from before to after a region or from
|
|
145
|
-
* after to before a region.
|
|
146
|
+
* @param {string} eventType
|
|
147
|
+
* @param {shaka.extern.TimelineRegionInfo} region
|
|
148
|
+
* @param {boolean} seeking
|
|
149
|
+
* @private
|
|
146
150
|
*/
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
+
onEvent_(eventType, region, seeking) {
|
|
152
|
+
const event = new shaka.util.FakeEvent(eventType, new Map([
|
|
153
|
+
['region', region],
|
|
154
|
+
['seeking', seeking],
|
|
155
|
+
]));
|
|
156
|
+
this.dispatchEvent(event);
|
|
151
157
|
}
|
|
152
158
|
|
|
153
159
|
/**
|
|
@@ -6,26 +6,30 @@
|
|
|
6
6
|
|
|
7
7
|
goog.provide('shaka.media.RegionTimeline');
|
|
8
8
|
|
|
9
|
+
goog.require('shaka.util.FakeEvent');
|
|
10
|
+
goog.require('shaka.util.FakeEventTarget');
|
|
9
11
|
goog.require('shaka.util.IReleasable');
|
|
10
12
|
goog.require('shaka.util.Timer');
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* The region timeline is a set of unique timeline region info entries. When
|
|
15
|
-
* a new entry is added, the
|
|
17
|
+
* a new entry is added, the 'regionadd' event will be fired. When an entry is
|
|
18
|
+
* deleted, the 'regionremove' event will be fired.
|
|
16
19
|
*
|
|
17
20
|
* @implements {shaka.util.IReleasable}
|
|
18
21
|
* @final
|
|
19
22
|
*/
|
|
20
|
-
shaka.media.RegionTimeline = class {
|
|
23
|
+
shaka.media.RegionTimeline = class extends shaka.util.FakeEventTarget {
|
|
21
24
|
/**
|
|
22
25
|
* @param {!function():{start: number, end: number}} getSeekRange
|
|
23
26
|
*/
|
|
24
27
|
constructor(getSeekRange) {
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
super();
|
|
29
|
+
|
|
27
30
|
/** @private {!Set.<shaka.extern.TimelineRegionInfo>} */
|
|
28
31
|
this.regions_ = new Set();
|
|
32
|
+
|
|
29
33
|
/** @private {!function():{start: number, end: number}} */
|
|
30
34
|
this.getSeekRange_ = getSeekRange;
|
|
31
35
|
|
|
@@ -44,22 +48,9 @@ shaka.media.RegionTimeline = class {
|
|
|
44
48
|
|
|
45
49
|
/** @override */
|
|
46
50
|
release() {
|
|
47
|
-
// Prevent us from holding onto any external references via the callback.
|
|
48
|
-
this.onAddRegion_ = (region) => {};
|
|
49
51
|
this.regions_.clear();
|
|
50
52
|
this.filterTimer_.stop();
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Set the callbacks for events. This will override any previous calls to
|
|
55
|
-
* |setListeners|.
|
|
56
|
-
*
|
|
57
|
-
* @param {function(shaka.extern.TimelineRegionInfo)} onAddRegion
|
|
58
|
-
* Set the callback for when we add a new region. This callback will only
|
|
59
|
-
* be called when a region is unique (we reject duplicate regions).
|
|
60
|
-
*/
|
|
61
|
-
setListeners(onAddRegion) {
|
|
62
|
-
this.onAddRegion_ = onAddRegion;
|
|
53
|
+
super.release();
|
|
63
54
|
}
|
|
64
55
|
|
|
65
56
|
/**
|
|
@@ -72,7 +63,10 @@ shaka.media.RegionTimeline = class {
|
|
|
72
63
|
// instead of making the parser track it.
|
|
73
64
|
if (similarRegion == null) {
|
|
74
65
|
this.regions_.add(region);
|
|
75
|
-
|
|
66
|
+
const event = new shaka.util.FakeEvent('regionadd', new Map([
|
|
67
|
+
['region', region],
|
|
68
|
+
]));
|
|
69
|
+
this.dispatchEvent(event);
|
|
76
70
|
}
|
|
77
71
|
}
|
|
78
72
|
|
|
@@ -89,6 +83,10 @@ shaka.media.RegionTimeline = class {
|
|
|
89
83
|
// reson to store or process them.
|
|
90
84
|
if (region.endTime < seekRange.start) {
|
|
91
85
|
this.regions_.delete(region);
|
|
86
|
+
const event = new shaka.util.FakeEvent('regionremove', new Map([
|
|
87
|
+
['region', region],
|
|
88
|
+
]));
|
|
89
|
+
this.dispatchEvent(event);
|
|
92
90
|
}
|
|
93
91
|
}
|
|
94
92
|
}
|
|
@@ -674,7 +674,7 @@ shaka.media.StreamingEngine = class {
|
|
|
674
674
|
|
|
675
675
|
if (mediaState.waitingToClearBuffer) {
|
|
676
676
|
// May not be performing an update, but an update will still happen.
|
|
677
|
-
// See: https://github.com/
|
|
677
|
+
// See: https://github.com/shaka-project/shaka-player/issues/334
|
|
678
678
|
shaka.log.debug(logPrefix, 'clear: already waiting');
|
|
679
679
|
return;
|
|
680
680
|
}
|
|
@@ -920,9 +920,9 @@ shaka.media.StreamingEngine = class {
|
|
|
920
920
|
// buffering forever at the end.
|
|
921
921
|
// We should only do this if the duration needs to shrink.
|
|
922
922
|
// Growing it by less than 1ms can actually cause buffering on
|
|
923
|
-
// replay, as in https://github.com/
|
|
923
|
+
// replay, as in https://github.com/shaka-project/shaka-player/issues/979
|
|
924
924
|
// On some platforms, this can spuriously be 0, so ignore this case.
|
|
925
|
-
// https://github.com/
|
|
925
|
+
// https://github.com/shaka-project/shaka-player/issues/1967,
|
|
926
926
|
const duration = this.playerInterface_.mediaSourceEngine.getDuration();
|
|
927
927
|
if (duration != 0 &&
|
|
928
928
|
duration < this.manifest_.presentationTimeline.getDuration()) {
|
|
@@ -1659,7 +1659,7 @@ shaka.media.StreamingEngine = class {
|
|
|
1659
1659
|
// See DASH sec. 5.10.3.3.1
|
|
1660
1660
|
// If a DASH client detects an event message box with a scheme that is not
|
|
1661
1661
|
// defined in MPD, the client is expected to ignore it.
|
|
1662
|
-
if (emsgSchemeIdUris.includes(schemeId) ||
|
|
1662
|
+
if ((emsgSchemeIdUris && emsgSchemeIdUris.includes(schemeId)) ||
|
|
1663
1663
|
this.config_.dispatchAllEmsgBoxes) {
|
|
1664
1664
|
// See DASH sec. 5.10.4.1
|
|
1665
1665
|
// A special scheme in DASH used to signal manifest updates.
|
|
@@ -1718,7 +1718,7 @@ shaka.media.StreamingEngine = class {
|
|
|
1718
1718
|
const bufferedBehind = presentationTime - startTime;
|
|
1719
1719
|
|
|
1720
1720
|
const overflow = bufferedBehind - bufferBehind;
|
|
1721
|
-
// See: https://github.com/
|
|
1721
|
+
// See: https://github.com/shaka-project/shaka-player/issues/2982
|
|
1722
1722
|
if (overflow <= 0.01) {
|
|
1723
1723
|
shaka.log.v2(logPrefix,
|
|
1724
1724
|
'buffer behind okay:',
|
|
@@ -2079,7 +2079,7 @@ shaka.media.StreamingEngine.MediaState_;
|
|
|
2079
2079
|
* of the Period.
|
|
2080
2080
|
*
|
|
2081
2081
|
* NOTE: This was increased as part of the solution to
|
|
2082
|
-
* https://github.com/
|
|
2082
|
+
* https://github.com/shaka-project/shaka-player/issues/1281
|
|
2083
2083
|
*
|
|
2084
2084
|
* @const {number}
|
|
2085
2085
|
* @private
|
|
@@ -2093,7 +2093,7 @@ shaka.media.StreamingEngine.APPEND_WINDOW_START_FUDGE_ = 0.1;
|
|
|
2093
2093
|
* the Period. This rounding error could then create an artificial gap and a
|
|
2094
2094
|
* stutter when the gap-jumping logic takes over.
|
|
2095
2095
|
*
|
|
2096
|
-
* https://github.com/
|
|
2096
|
+
* https://github.com/shaka-project/shaka-player/issues/1597
|
|
2097
2097
|
*
|
|
2098
2098
|
* @const {number}
|
|
2099
2099
|
* @private
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
goog.provide('shaka.media.TimeRangesUtils');
|
|
8
8
|
|
|
9
|
-
goog.require('shaka.util.Iterables');
|
|
10
|
-
|
|
11
9
|
|
|
12
10
|
/**
|
|
13
11
|
* @summary A set of utility functions for dealing with TimeRanges objects.
|
|
@@ -157,7 +155,7 @@ shaka.media.TimeRangesUtils = class {
|
|
|
157
155
|
return [];
|
|
158
156
|
}
|
|
159
157
|
const ret = [];
|
|
160
|
-
for (
|
|
158
|
+
for (let i = 0; i < b.length; i++) {
|
|
161
159
|
ret.push({start: b.start(i), end: b.end(i)});
|
|
162
160
|
}
|
|
163
161
|
return ret;
|
|
@@ -141,7 +141,7 @@ shaka.media.VideoWrapper = class {
|
|
|
141
141
|
// TODO: Need further investigation why it happens. Before and after
|
|
142
142
|
// setting the current time, video.readyState is 1, video.paused is true,
|
|
143
143
|
// and video.buffered's TimeRanges length is 0.
|
|
144
|
-
// See: https://github.com/
|
|
144
|
+
// See: https://github.com/shaka-project/shaka-player/issues/1298
|
|
145
145
|
this.mover_.moveTo(
|
|
146
146
|
this.video_.currentTime == 0 ?
|
|
147
147
|
startTime :
|
|
@@ -232,6 +232,10 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
|
|
|
232
232
|
this.destroyed_ = true;
|
|
233
233
|
this.requestFilters_.clear();
|
|
234
234
|
this.responseFilters_.clear();
|
|
235
|
+
|
|
236
|
+
// FakeEventTarget implements IReleasable
|
|
237
|
+
super.release();
|
|
238
|
+
|
|
235
239
|
return this.operationManager_.destroy();
|
|
236
240
|
}
|
|
237
241
|
|
|
@@ -427,7 +431,7 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
|
|
|
427
431
|
}
|
|
428
432
|
|
|
429
433
|
// Schemes are meant to be case-insensitive.
|
|
430
|
-
// See https://github.com/
|
|
434
|
+
// See https://github.com/shaka-project/shaka-player/issues/2173
|
|
431
435
|
// and https://tools.ietf.org/html/rfc3986#section-3.1
|
|
432
436
|
scheme = scheme.toLowerCase();
|
|
433
437
|
|
package/lib/offline/storage.js
CHANGED
|
@@ -681,16 +681,15 @@ shaka.offline.Storage = class {
|
|
|
681
681
|
* @private
|
|
682
682
|
*/
|
|
683
683
|
async filterManifest_(manifest, drmEngine, config) {
|
|
684
|
-
const StreamUtils = shaka.util.StreamUtils;
|
|
685
|
-
|
|
686
684
|
// Filter the manifest based on the restrictions given in the player
|
|
687
685
|
// configuration.
|
|
688
686
|
const maxHwRes = {width: Infinity, height: Infinity};
|
|
689
|
-
StreamUtils.filterByRestrictions(
|
|
687
|
+
shaka.util.StreamUtils.filterByRestrictions(
|
|
688
|
+
manifest, config.restrictions, maxHwRes);
|
|
690
689
|
|
|
691
690
|
// Filter the manifest based on what we know MediaCapabilities will be able
|
|
692
691
|
// to play later (no point storing something we can't play).
|
|
693
|
-
StreamUtils.filterManifestByMediaCapabilities(
|
|
692
|
+
await shaka.util.StreamUtils.filterManifestByMediaCapabilities(
|
|
694
693
|
manifest, config.offline.usePersistentLicense);
|
|
695
694
|
|
|
696
695
|
// Gather all tracks.
|
|
@@ -702,24 +701,24 @@ shaka.offline.Storage = class {
|
|
|
702
701
|
const preferredVideoCodecs = config.preferredVideoCodecs;
|
|
703
702
|
const preferredAudioCodecs = config.preferredAudioCodecs;
|
|
704
703
|
|
|
705
|
-
StreamUtils.chooseCodecsAndFilterManifest(
|
|
704
|
+
shaka.util.StreamUtils.chooseCodecsAndFilterManifest(
|
|
706
705
|
manifest, preferredVideoCodecs, preferredAudioCodecs,
|
|
707
706
|
preferredAudioChannelCount, preferredDecodingAttributes);
|
|
708
707
|
|
|
709
708
|
for (const variant of manifest.variants) {
|
|
710
709
|
goog.asserts.assert(
|
|
711
|
-
StreamUtils.isPlayable(variant),
|
|
710
|
+
shaka.util.StreamUtils.isPlayable(variant),
|
|
712
711
|
'We should have already filtered by "is playable"');
|
|
713
712
|
|
|
714
|
-
allTracks.push(StreamUtils.variantToTrack(variant));
|
|
713
|
+
allTracks.push(shaka.util.StreamUtils.variantToTrack(variant));
|
|
715
714
|
}
|
|
716
715
|
|
|
717
716
|
for (const text of manifest.textStreams) {
|
|
718
|
-
allTracks.push(StreamUtils.textStreamToTrack(text));
|
|
717
|
+
allTracks.push(shaka.util.StreamUtils.textStreamToTrack(text));
|
|
719
718
|
}
|
|
720
719
|
|
|
721
720
|
for (const image of manifest.imageStreams) {
|
|
722
|
-
allTracks.push(StreamUtils.imageStreamToTrack(image));
|
|
721
|
+
allTracks.push(shaka.util.StreamUtils.imageStreamToTrack(image));
|
|
723
722
|
}
|
|
724
723
|
|
|
725
724
|
// Let the application choose which tracks to store.
|
|
@@ -805,10 +804,10 @@ shaka.offline.Storage = class {
|
|
|
805
804
|
makeManifestDB_(drmEngine, manifest, uri, metadata, config, downloader) {
|
|
806
805
|
const pendingContent = shaka.offline.StoredContentUtils.fromManifest(
|
|
807
806
|
uri, manifest, /* size= */ 0, metadata);
|
|
808
|
-
// In https://github.com/
|
|
809
|
-
// callback would be removed by the compiler if we reference the
|
|
810
|
-
// the onProgress closure below. Reading it into a local
|
|
811
|
-
// seems to work around this apparent compiler bug.
|
|
807
|
+
// In https://github.com/shaka-project/shaka-player/issues/2652, we found
|
|
808
|
+
// that this callback would be removed by the compiler if we reference the
|
|
809
|
+
// config in the onProgress closure below. Reading it into a local
|
|
810
|
+
// variable first seems to work around this apparent compiler bug.
|
|
812
811
|
const progressCallback = config.offline.progressCallback;
|
|
813
812
|
|
|
814
813
|
const onProgress = (progress, size) => {
|
package/lib/player.js
CHANGED
|
@@ -787,6 +787,9 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
787
787
|
await this.networkingEngine_.destroy();
|
|
788
788
|
this.networkingEngine_ = null;
|
|
789
789
|
}
|
|
790
|
+
|
|
791
|
+
// FakeEventTarget implements IReleasable
|
|
792
|
+
super.release();
|
|
790
793
|
}
|
|
791
794
|
|
|
792
795
|
/**
|
|
@@ -1691,17 +1694,26 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
1691
1694
|
// initialize it now even through it appears a little out-of-place.
|
|
1692
1695
|
this.regionTimeline_ =
|
|
1693
1696
|
new shaka.media.RegionTimeline(() => this.seekRange());
|
|
1694
|
-
this.regionTimeline_.
|
|
1697
|
+
this.regionTimeline_.addEventListener('regionadd', (event) => {
|
|
1698
|
+
/** @type {shaka.extern.TimelineRegionInfo} */
|
|
1699
|
+
const region = event['region'];
|
|
1695
1700
|
this.onRegionEvent_(shaka.Player.EventName.TimelineRegionAdded, region);
|
|
1701
|
+
|
|
1696
1702
|
if (this.adManager_) {
|
|
1697
1703
|
this.adManager_.onDashTimedMetadata(region);
|
|
1698
1704
|
}
|
|
1699
1705
|
});
|
|
1706
|
+
|
|
1700
1707
|
this.qualityObserver_ = null;
|
|
1701
1708
|
if (this.config_.streaming.observeQualityChanges) {
|
|
1702
1709
|
this.qualityObserver_ = new shaka.media.QualityObserver(
|
|
1703
1710
|
() => this.getBufferedInfo());
|
|
1704
|
-
|
|
1711
|
+
|
|
1712
|
+
this.qualityObserver_.addEventListener('qualitychange', (event) => {
|
|
1713
|
+
/** @type {shaka.extern.MediaQualityInfo} */
|
|
1714
|
+
const mediaQualityInfo = event['quality'];
|
|
1715
|
+
/** @type {number} */
|
|
1716
|
+
const position = event['position'];
|
|
1705
1717
|
this.onMediaQualityChange_(mediaQualityInfo, position);
|
|
1706
1718
|
});
|
|
1707
1719
|
}
|
|
@@ -2205,6 +2217,14 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
2205
2217
|
|
|
2206
2218
|
this.playhead_ = new shaka.media.SrcEqualsPlayhead(has.mediaElement);
|
|
2207
2219
|
|
|
2220
|
+
// This flag is used below in the language preference setup and
|
|
2221
|
+
// track-management to check if this load was canceled before the necessary
|
|
2222
|
+
// events fired.
|
|
2223
|
+
let unloaded = false;
|
|
2224
|
+
this.cleanupOnUnload_.push(() => {
|
|
2225
|
+
unloaded = true;
|
|
2226
|
+
});
|
|
2227
|
+
|
|
2208
2228
|
if (has.startTime != null) {
|
|
2209
2229
|
this.playhead_.setStartTime(has.startTime);
|
|
2210
2230
|
}
|
|
@@ -2232,7 +2252,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
2232
2252
|
|
|
2233
2253
|
// Wait for the 'loadedmetadata' event to measure load() latency, but only
|
|
2234
2254
|
// if preload is set in a way that would result in this event firing
|
|
2235
|
-
// automatically.
|
|
2255
|
+
// automatically.
|
|
2256
|
+
// See https://github.com/shaka-project/shaka-player/issues/2483
|
|
2236
2257
|
if (this.video_.preload != 'none') {
|
|
2237
2258
|
this.eventManager_.listenOnce(this.video_, 'loadedmetadata', () => {
|
|
2238
2259
|
const now = Date.now() / 1000;
|
|
@@ -2255,6 +2276,12 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
2255
2276
|
}
|
|
2256
2277
|
if (this.video_.textTracks) {
|
|
2257
2278
|
this.eventManager_.listen(this.video_.textTracks, 'addtrack', (e) => {
|
|
2279
|
+
// If we have moved on to another piece of content while waiting for
|
|
2280
|
+
// the above event, we should not process tracks here.
|
|
2281
|
+
if (unloaded) {
|
|
2282
|
+
return;
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2258
2285
|
const trackEvent = /** @type {!TrackEvent} */(e);
|
|
2259
2286
|
if (trackEvent.track) {
|
|
2260
2287
|
const track = trackEvent.track;
|
|
@@ -2314,13 +2341,6 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
2314
2341
|
fullyLoaded.resolve();
|
|
2315
2342
|
});
|
|
2316
2343
|
|
|
2317
|
-
// This flag is used below in the language preference setup to check if this
|
|
2318
|
-
// load was canceled before the necessary events fire.
|
|
2319
|
-
let unloaded = false;
|
|
2320
|
-
this.cleanupOnUnload_.push(() => {
|
|
2321
|
-
unloaded = true;
|
|
2322
|
-
});
|
|
2323
|
-
|
|
2324
2344
|
// We can't switch to preferred languages, though, until the data is loaded.
|
|
2325
2345
|
shaka.util.MediaReadyState.waitForReadyState(this.video_,
|
|
2326
2346
|
HTMLMediaElement.HAVE_CURRENT_DATA,
|
|
@@ -2475,12 +2495,16 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
2475
2495
|
// In Safari the initial assignment does not always work, so we schedule
|
|
2476
2496
|
// this process to be repeated several times to ensure that it has been put
|
|
2477
2497
|
// in the correct mode.
|
|
2478
|
-
new shaka.util.Timer(() => {
|
|
2498
|
+
const timer = new shaka.util.Timer(() => {
|
|
2479
2499
|
const textTracks = this.getMetadataTracks_();
|
|
2480
2500
|
for (const textTrack of textTracks) {
|
|
2481
2501
|
textTrack.mode = 'hidden';
|
|
2482
2502
|
}
|
|
2483
|
-
}).tickNow().tickAfter(
|
|
2503
|
+
}).tickNow().tickAfter(0.5);
|
|
2504
|
+
|
|
2505
|
+
this.cleanupOnUnload_.push(() => {
|
|
2506
|
+
timer.stop();
|
|
2507
|
+
});
|
|
2484
2508
|
}
|
|
2485
2509
|
|
|
2486
2510
|
|
|
@@ -2548,12 +2572,16 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
2548
2572
|
// In Safari the initial assignment does not always work, so we schedule
|
|
2549
2573
|
// this process to be repeated several times to ensure that it has been put
|
|
2550
2574
|
// in the correct mode.
|
|
2551
|
-
new shaka.util.Timer(() => {
|
|
2575
|
+
const timer = new shaka.util.Timer(() => {
|
|
2552
2576
|
const chaptersTracks = this.getChaptersTracks_();
|
|
2553
2577
|
for (const chaptersTrack of chaptersTracks) {
|
|
2554
2578
|
chaptersTrack.mode = 'hidden';
|
|
2555
2579
|
}
|
|
2556
|
-
}).tickNow().tickAfter(
|
|
2580
|
+
}).tickNow().tickAfter(0.5);
|
|
2581
|
+
|
|
2582
|
+
this.cleanupOnUnload_.push(() => {
|
|
2583
|
+
timer.stop();
|
|
2584
|
+
});
|
|
2557
2585
|
}
|
|
2558
2586
|
|
|
2559
2587
|
/**
|
|
@@ -2674,21 +2702,31 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
2674
2702
|
// Create the region observer. This will allow us to notify the app when we
|
|
2675
2703
|
// move in and out of timeline regions.
|
|
2676
2704
|
const regionObserver = new shaka.media.RegionObserver(this.regionTimeline_);
|
|
2677
|
-
|
|
2705
|
+
|
|
2706
|
+
regionObserver.addEventListener('enter', (event) => {
|
|
2707
|
+
/** @type {shaka.extern.TimelineRegionInfo} */
|
|
2708
|
+
const region = event['region'];
|
|
2678
2709
|
this.onRegionEvent_(shaka.Player.EventName.TimelineRegionEnter, region);
|
|
2679
|
-
};
|
|
2680
|
-
|
|
2710
|
+
});
|
|
2711
|
+
|
|
2712
|
+
regionObserver.addEventListener('exit', (event) => {
|
|
2713
|
+
/** @type {shaka.extern.TimelineRegionInfo} */
|
|
2714
|
+
const region = event['region'];
|
|
2681
2715
|
this.onRegionEvent_(shaka.Player.EventName.TimelineRegionExit, region);
|
|
2682
|
-
};
|
|
2683
|
-
|
|
2716
|
+
});
|
|
2717
|
+
|
|
2718
|
+
regionObserver.addEventListener('skip', (event) => {
|
|
2719
|
+
/** @type {shaka.extern.TimelineRegionInfo} */
|
|
2720
|
+
const region = event['region'];
|
|
2721
|
+
/** @type {boolean} */
|
|
2722
|
+
const seeking = event['seeking'];
|
|
2684
2723
|
// If we are seeking, we don't want to surface the enter/exit events since
|
|
2685
2724
|
// they didn't play through them.
|
|
2686
2725
|
if (!seeking) {
|
|
2687
2726
|
this.onRegionEvent_(shaka.Player.EventName.TimelineRegionEnter, region);
|
|
2688
2727
|
this.onRegionEvent_(shaka.Player.EventName.TimelineRegionExit, region);
|
|
2689
2728
|
}
|
|
2690
|
-
};
|
|
2691
|
-
regionObserver.setListeners(onEnterRegion, onExitRegion, onSkipRegion);
|
|
2729
|
+
});
|
|
2692
2730
|
|
|
2693
2731
|
// Now that we have all our observers, create a manager for them.
|
|
2694
2732
|
const manager = new shaka.media.PlayheadObserverManager(this.video_);
|
|
@@ -3682,7 +3720,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
3682
3720
|
this.streamingEngine_.switchTextStream(stream);
|
|
3683
3721
|
this.onTextChanged_();
|
|
3684
3722
|
|
|
3685
|
-
// Workaround for
|
|
3723
|
+
// Workaround for
|
|
3724
|
+
// https://github.com/shaka-project/shaka-player/issues/1299
|
|
3686
3725
|
// When track is selected, back-propagate the language to
|
|
3687
3726
|
// currentTextLanguage_.
|
|
3688
3727
|
this.currentTextLanguage_ = stream.language;
|
|
@@ -3758,7 +3797,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
3758
3797
|
this.switchVariant_(variant, /* fromAdaptation= */ false, clearBuffer,
|
|
3759
3798
|
safeMargin);
|
|
3760
3799
|
|
|
3761
|
-
// Workaround for
|
|
3800
|
+
// Workaround for
|
|
3801
|
+
// https://github.com/shaka-project/shaka-player/issues/1299
|
|
3762
3802
|
// When track is selected, back-propagate the language to
|
|
3763
3803
|
// currentAudioLanguage_.
|
|
3764
3804
|
this.currentAdaptationSetCriteria_ = new shaka.media.ExampleBasedCriteria(
|
|
@@ -5230,7 +5270,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
5230
5270
|
// If the playback rate changes while seeking, Edge will cache the playback
|
|
5231
5271
|
// rate and use it after seeking.
|
|
5232
5272
|
//
|
|
5233
|
-
// https://github.com/
|
|
5273
|
+
// https://github.com/shaka-project/shaka-player/issues/951
|
|
5234
5274
|
if (newRate == 0) {
|
|
5235
5275
|
return;
|
|
5236
5276
|
}
|
|
@@ -6536,7 +6576,7 @@ shaka.Player.TYPICAL_BUFFERING_THRESHOLD_ = 0.5;
|
|
|
6536
6576
|
* @define {string} A version number taken from git at compile time.
|
|
6537
6577
|
* @export
|
|
6538
6578
|
*/
|
|
6539
|
-
shaka.Player.version = 'v3.3.
|
|
6579
|
+
shaka.Player.version = 'v3.3.4-uncompiled';
|
|
6540
6580
|
|
|
6541
6581
|
// Initialize the deprecation system using the version string we just set
|
|
6542
6582
|
// on the player.
|
package/lib/polyfill/all.js
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
goog.provide('shaka.polyfill');
|
|
8
8
|
|
|
9
9
|
goog.require('shaka.log');
|
|
10
|
-
goog.require('shaka.util.Iterables');
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
/**
|
|
@@ -40,8 +39,8 @@ shaka.polyfill = class {
|
|
|
40
39
|
*/
|
|
41
40
|
static register(polyfill, priority) {
|
|
42
41
|
const newItem = {priority: priority || 0, callback: polyfill};
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
for (let i = 0; i < shaka.polyfill.polyfills_.length; i++) {
|
|
43
|
+
const item = shaka.polyfill.polyfills_[i];
|
|
45
44
|
if (item.priority < newItem.priority) {
|
|
46
45
|
shaka.polyfill.polyfills_.splice(i, 0, newItem);
|
|
47
46
|
return;
|
|
@@ -12,7 +12,7 @@ goog.require('shaka.polyfill');
|
|
|
12
12
|
* @summary A polyfill to add support for EncryptionScheme queries in EME.
|
|
13
13
|
* @see https://wicg.github.io/encrypted-media-encryption-scheme/
|
|
14
14
|
* @see https://github.com/w3c/encrypted-media/pull/457
|
|
15
|
-
* @see https://github.com/
|
|
15
|
+
* @see https://github.com/shaka-project/eme-encryption-scheme-polyfill
|
|
16
16
|
* @export
|
|
17
17
|
*/
|
|
18
18
|
shaka.polyfill.EncryptionScheme = class {
|
|
@@ -29,12 +29,12 @@ shaka.polyfill.MediaCapabilities = class {
|
|
|
29
29
|
// TODO: re-evaluate MediaCapabilities in the future versions of Chromecast.
|
|
30
30
|
// Since MediaCapabilities implementation is buggy in Apple browsers, we
|
|
31
31
|
// should always install polyfill for Apple browsers.
|
|
32
|
-
// See: https://github.com/
|
|
32
|
+
// See: https://github.com/shaka-project/shaka-player/issues/3530
|
|
33
33
|
// TODO: re-evaluate MediaCapabilities in the future versions of Apple
|
|
34
34
|
// Browsers.
|
|
35
35
|
// Since MediaCapabilities implementation is buggy in PS5 browsers, we
|
|
36
36
|
// should always install polyfill for PS5 browsers.
|
|
37
|
-
// See: https://github.com/
|
|
37
|
+
// See: https://github.com/shaka-project/shaka-player/issues/3582
|
|
38
38
|
// TODO: re-evaluate MediaCapabilities in the future versions of PS5
|
|
39
39
|
// Browsers.
|
|
40
40
|
if (!shaka.util.Platform.isChromecast() &&
|
|
@@ -54,7 +54,7 @@ shaka.polyfill.MediaCapabilities = class {
|
|
|
54
54
|
|
|
55
55
|
// Keep the patched MediaCapabilities object from being garbage-collected in
|
|
56
56
|
// Safari.
|
|
57
|
-
// See https://github.com/
|
|
57
|
+
// See https://github.com/shaka-project/shaka-player/issues/3696#issuecomment-1009472718
|
|
58
58
|
shaka.polyfill.MediaCapabilities.originalMcap =
|
|
59
59
|
navigator.mediaCapabilities;
|
|
60
60
|
|
|
@@ -39,7 +39,7 @@ shaka.polyfill.MediaSource = class {
|
|
|
39
39
|
shaka.polyfill.MediaSource.patchCastIsTypeSupported_();
|
|
40
40
|
} else if (safariVersion) {
|
|
41
41
|
// TS content is broken on Safari in general.
|
|
42
|
-
// See https://github.com/
|
|
42
|
+
// See https://github.com/shaka-project/shaka-player/issues/743
|
|
43
43
|
// and https://bugs.webkit.org/show_bug.cgi?id=165342
|
|
44
44
|
shaka.polyfill.MediaSource.rejectTsContent_();
|
|
45
45
|
|