rx-player 4.0.0-dev.2023111400 → 4.0.0-dev.2023121900
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/CHANGELOG.md +20 -60
- package/FILES.md +1 -1
- package/README.md +2 -33
- package/VERSION +1 -1
- package/dist/_esm5.processed/core/api/debug/buffer_graph.js +2 -6
- package/dist/_esm5.processed/core/api/debug/modules/general_info.js +20 -10
- package/dist/_esm5.processed/core/api/option_utils.d.ts +0 -2
- package/dist/_esm5.processed/core/api/option_utils.js +0 -6
- package/dist/_esm5.processed/core/api/public_api.d.ts +1 -2
- package/dist/_esm5.processed/core/api/public_api.js +9 -17
- package/dist/_esm5.processed/core/init/directfile_content_initializer.js +1 -1
- package/dist/_esm5.processed/core/init/media_source_content_initializer.js +3 -14
- package/dist/_esm5.processed/core/init/utils/rebuffering_controller.d.ts +2 -36
- package/dist/_esm5.processed/core/init/utils/rebuffering_controller.js +2 -82
- package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +9 -2
- package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.js +1 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +1 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +1 -1
- package/dist/_esm5.processed/core/segment_buffers/index.d.ts +2 -2
- package/dist/_esm5.processed/core/segment_buffers/inventory/index.d.ts +2 -2
- package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.d.ts +25 -8
- package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.js +19 -10
- package/dist/_esm5.processed/core/stream/representation/utils/get_buffer_status.js +1 -1
- package/dist/_esm5.processed/core/stream/representation/utils/get_needed_segments.js +1 -1
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_extent.js +1 -8
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_line_height.js +2 -1
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_origin.js +1 -9
- package/dist/_esm5.processed/public_types.d.ts +2 -0
- package/dist/commonjs/compat/is_codec_supported.js +22 -1
- package/dist/commonjs/config.d.ts +2 -1
- package/dist/commonjs/core/adaptive/adaptive_representation_selector.d.ts +2 -19
- package/dist/commonjs/core/adaptive/adaptive_representation_selector.js +2 -2
- package/dist/commonjs/core/adaptive/network_analyzer.js +3 -3
- package/dist/commonjs/core/api/debug/buffer_graph.js +2 -6
- package/dist/commonjs/core/api/debug/modules/general_info.js +17 -10
- package/dist/commonjs/core/api/index.d.ts +1 -1
- package/dist/commonjs/core/api/option_utils.d.ts +2 -0
- package/dist/commonjs/core/api/option_utils.js +2 -3
- package/dist/commonjs/core/api/playback_observer.d.ts +128 -8
- package/dist/commonjs/core/api/playback_observer.js +217 -64
- package/dist/commonjs/core/api/public_api.d.ts +9 -0
- package/dist/commonjs/core/api/public_api.js +41 -16
- package/dist/commonjs/core/api/utils.js +1 -1
- package/dist/commonjs/core/decrypt/get_media_keys.js +2 -6
- package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.d.ts +6 -0
- package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.js +11 -3
- package/dist/commonjs/core/fetchers/segment/segment_fetcher.d.ts +8 -1
- package/dist/commonjs/core/fetchers/segment/segment_fetcher.js +8 -4
- package/dist/commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts +1 -0
- package/dist/commonjs/core/fetchers/utils/schedule_request.js +1 -1
- package/dist/commonjs/core/init/directfile_content_initializer.js +29 -8
- package/dist/commonjs/core/init/media_source_content_initializer.d.ts +6 -0
- package/dist/commonjs/core/init/media_source_content_initializer.js +32 -20
- package/dist/commonjs/core/init/utils/content_time_boundaries_observer.d.ts +13 -12
- package/dist/commonjs/core/init/utils/content_time_boundaries_observer.js +17 -19
- package/dist/commonjs/core/init/utils/create_stream_playback_observer.d.ts +1 -5
- package/dist/commonjs/core/init/utils/create_stream_playback_observer.js +16 -14
- package/dist/commonjs/core/init/utils/get_initial_time.d.ts +17 -3
- package/dist/commonjs/core/init/utils/get_initial_time.js +9 -7
- package/dist/commonjs/core/init/utils/initial_seek_and_play.d.ts +9 -11
- package/dist/commonjs/core/init/utils/initial_seek_and_play.js +121 -91
- package/dist/commonjs/core/init/utils/rebuffering_controller.js +27 -70
- package/dist/commonjs/core/init/utils/stream_events_emitter/stream_events_emitter.js +4 -2
- package/dist/commonjs/core/segment_buffers/garbage_collector.js +1 -2
- package/dist/commonjs/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +9 -2
- package/dist/commonjs/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +1 -1
- package/dist/commonjs/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +1 -1
- package/dist/commonjs/core/segment_buffers/index.d.ts +2 -2
- package/dist/commonjs/core/segment_buffers/inventory/index.d.ts +2 -2
- package/dist/commonjs/core/segment_buffers/inventory/segment_inventory.d.ts +25 -8
- package/dist/commonjs/core/segment_buffers/inventory/segment_inventory.js +19 -10
- package/dist/commonjs/core/stream/adaptation/get_representations_switch_strategy.d.ts +2 -2
- package/dist/commonjs/core/stream/adaptation/get_representations_switch_strategy.js +16 -9
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +14 -18
- package/dist/commonjs/core/stream/period/period_stream.js +5 -8
- package/dist/commonjs/core/stream/period/types.d.ts +2 -3
- package/dist/commonjs/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +4 -5
- package/dist/commonjs/core/stream/period/utils/get_adaptation_switch_strategy.js +17 -13
- package/dist/commonjs/core/stream/representation/representation_stream.js +3 -4
- package/dist/commonjs/core/stream/representation/types.d.ts +2 -2
- package/dist/commonjs/core/stream/representation/utils/append_segment_to_buffer.js +11 -12
- package/dist/commonjs/core/stream/representation/utils/get_buffer_status.js +4 -4
- package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +1 -1
- package/dist/commonjs/default_config.d.ts +12 -16
- package/dist/commonjs/default_config.js +21 -16
- package/dist/commonjs/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -1
- package/dist/commonjs/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +2 -0
- package/dist/commonjs/manifest/adaptation.js +2 -1
- package/dist/commonjs/manifest/representation_index/static.d.ts +1 -1
- package/dist/commonjs/manifest/representation_index/static.js +2 -2
- package/dist/commonjs/manifest/representation_index/types.d.ts +4 -4
- package/dist/commonjs/parsers/manifest/dash/common/indexes/base.d.ts +6 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/base.js +4 -3
- package/dist/commonjs/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +5 -2
- package/dist/commonjs/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -4
- package/dist/commonjs/parsers/manifest/dash/common/indexes/index.d.ts +5 -5
- package/dist/commonjs/parsers/manifest/dash/common/indexes/list.d.ts +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/list.js +2 -2
- package/dist/commonjs/parsers/manifest/dash/common/indexes/template.d.ts +12 -5
- package/dist/commonjs/parsers/manifest/dash/common/indexes/template.js +42 -29
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/index.d.ts +2 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +99 -6
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +250 -51
- package/dist/commonjs/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +40 -17
- package/dist/commonjs/parsers/manifest/dash/common/manifest_bounds_calculator.js +38 -18
- package/dist/commonjs/parsers/manifest/dash/common/parse_adaptation_sets.js +13 -10
- package/dist/commonjs/parsers/manifest/dash/common/parse_mpd.js +27 -14
- package/dist/commonjs/parsers/manifest/dash/common/parse_periods.d.ts +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/parse_periods.js +17 -18
- package/dist/commonjs/parsers/manifest/dash/common/parse_representation_index.d.ts +19 -6
- package/dist/commonjs/parsers/manifest/dash/common/parse_representation_index.js +21 -8
- package/dist/commonjs/parsers/manifest/dash/common/parse_representations.js +7 -3
- package/dist/commonjs/parsers/manifest/local/representation_index.d.ts +1 -1
- package/dist/commonjs/parsers/manifest/local/representation_index.js +3 -3
- package/dist/commonjs/parsers/manifest/metaplaylist/representation_index.d.ts +1 -1
- package/dist/commonjs/parsers/manifest/metaplaylist/representation_index.js +2 -2
- package/dist/commonjs/parsers/manifest/smooth/representation_index.d.ts +5 -5
- package/dist/commonjs/parsers/manifest/smooth/representation_index.js +25 -9
- package/dist/commonjs/parsers/manifest/utils/index_helpers.js +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/html/apply_line_height.js +2 -1
- package/dist/commonjs/public_types.d.ts +107 -36
- package/dist/commonjs/transports/dash/init_segment_loader.js +10 -5
- package/dist/commonjs/transports/dash/manifest_parser.js +5 -2
- package/dist/commonjs/transports/dash/segment_loader.js +2 -1
- package/dist/commonjs/transports/dash/text_loader.js +2 -0
- package/dist/commonjs/transports/metaplaylist/manifest_loader.js +2 -1
- package/dist/commonjs/transports/metaplaylist/pipelines.js +4 -1
- package/dist/commonjs/transports/smooth/pipelines.js +4 -2
- package/dist/commonjs/transports/smooth/segment_loader.js +2 -1
- package/dist/commonjs/transports/types.d.ts +12 -0
- package/dist/commonjs/transports/utils/generate_manifest_loader.js +6 -3
- package/dist/commonjs/utils/request/fetch.d.ts +6 -0
- package/dist/commonjs/utils/request/fetch.js +29 -8
- package/dist/commonjs/utils/request/xhr.d.ts +11 -5
- package/dist/commonjs/utils/request/xhr.js +29 -8
- package/dist/es2017/compat/is_codec_supported.js +22 -1
- package/dist/es2017/config.d.ts +2 -1
- package/dist/es2017/core/adaptive/adaptive_representation_selector.d.ts +2 -19
- package/dist/es2017/core/adaptive/adaptive_representation_selector.js +2 -2
- package/dist/es2017/core/adaptive/network_analyzer.js +3 -3
- package/dist/es2017/core/api/debug/buffer_graph.js +2 -6
- package/dist/es2017/core/api/debug/modules/general_info.js +17 -10
- package/dist/es2017/core/api/index.d.ts +1 -1
- package/dist/es2017/core/api/option_utils.d.ts +2 -0
- package/dist/es2017/core/api/option_utils.js +2 -3
- package/dist/es2017/core/api/playback_observer.d.ts +128 -8
- package/dist/es2017/core/api/playback_observer.js +217 -66
- package/dist/es2017/core/api/public_api.d.ts +9 -0
- package/dist/es2017/core/api/public_api.js +40 -15
- package/dist/es2017/core/api/utils.js +1 -1
- package/dist/es2017/core/decrypt/get_media_keys.js +2 -6
- package/dist/es2017/core/fetchers/manifest/manifest_fetcher.d.ts +6 -0
- package/dist/es2017/core/fetchers/manifest/manifest_fetcher.js +11 -3
- package/dist/es2017/core/fetchers/segment/segment_fetcher.d.ts +8 -1
- package/dist/es2017/core/fetchers/segment/segment_fetcher.js +8 -4
- package/dist/es2017/core/fetchers/segment/segment_fetcher_creator.d.ts +1 -0
- package/dist/es2017/core/fetchers/utils/schedule_request.js +1 -1
- package/dist/es2017/core/init/directfile_content_initializer.js +31 -8
- package/dist/es2017/core/init/media_source_content_initializer.d.ts +6 -0
- package/dist/es2017/core/init/media_source_content_initializer.js +34 -22
- package/dist/es2017/core/init/utils/content_time_boundaries_observer.d.ts +13 -12
- package/dist/es2017/core/init/utils/content_time_boundaries_observer.js +17 -17
- package/dist/es2017/core/init/utils/create_stream_playback_observer.d.ts +1 -5
- package/dist/es2017/core/init/utils/create_stream_playback_observer.js +16 -14
- package/dist/es2017/core/init/utils/get_initial_time.d.ts +17 -3
- package/dist/es2017/core/init/utils/get_initial_time.js +9 -7
- package/dist/es2017/core/init/utils/initial_seek_and_play.d.ts +9 -11
- package/dist/es2017/core/init/utils/initial_seek_and_play.js +120 -91
- package/dist/es2017/core/init/utils/rebuffering_controller.js +27 -70
- package/dist/es2017/core/init/utils/stream_events_emitter/stream_events_emitter.js +4 -2
- package/dist/es2017/core/segment_buffers/garbage_collector.js +1 -2
- package/dist/es2017/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +9 -2
- package/dist/es2017/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +1 -1
- package/dist/es2017/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +1 -1
- package/dist/es2017/core/segment_buffers/index.d.ts +2 -2
- package/dist/es2017/core/segment_buffers/inventory/index.d.ts +2 -2
- package/dist/es2017/core/segment_buffers/inventory/segment_inventory.d.ts +25 -8
- package/dist/es2017/core/segment_buffers/inventory/segment_inventory.js +19 -10
- package/dist/es2017/core/stream/adaptation/get_representations_switch_strategy.d.ts +2 -2
- package/dist/es2017/core/stream/adaptation/get_representations_switch_strategy.js +16 -9
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +16 -18
- package/dist/es2017/core/stream/period/period_stream.js +4 -7
- package/dist/es2017/core/stream/period/types.d.ts +2 -3
- package/dist/es2017/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +4 -5
- package/dist/es2017/core/stream/period/utils/get_adaptation_switch_strategy.js +17 -13
- package/dist/es2017/core/stream/representation/representation_stream.js +3 -4
- package/dist/es2017/core/stream/representation/types.d.ts +2 -2
- package/dist/es2017/core/stream/representation/utils/append_segment_to_buffer.js +1 -2
- package/dist/es2017/core/stream/representation/utils/get_buffer_status.js +4 -4
- package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +1 -1
- package/dist/es2017/default_config.d.ts +12 -16
- package/dist/es2017/default_config.js +21 -16
- package/dist/es2017/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -1
- package/dist/es2017/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +2 -0
- package/dist/es2017/manifest/adaptation.js +2 -1
- package/dist/es2017/manifest/representation_index/static.d.ts +1 -1
- package/dist/es2017/manifest/representation_index/static.js +2 -2
- package/dist/es2017/manifest/representation_index/types.d.ts +4 -4
- package/dist/es2017/parsers/manifest/dash/common/indexes/base.d.ts +6 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/base.js +4 -3
- package/dist/es2017/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +5 -2
- package/dist/es2017/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -4
- package/dist/es2017/parsers/manifest/dash/common/indexes/index.d.ts +5 -5
- package/dist/es2017/parsers/manifest/dash/common/indexes/list.d.ts +1 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/list.js +2 -2
- package/dist/es2017/parsers/manifest/dash/common/indexes/template.d.ts +12 -5
- package/dist/es2017/parsers/manifest/dash/common/indexes/template.js +40 -27
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/index.d.ts +2 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +99 -6
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +246 -51
- package/dist/es2017/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +40 -17
- package/dist/es2017/parsers/manifest/dash/common/manifest_bounds_calculator.js +38 -18
- package/dist/es2017/parsers/manifest/dash/common/parse_adaptation_sets.js +11 -8
- package/dist/es2017/parsers/manifest/dash/common/parse_mpd.js +27 -13
- package/dist/es2017/parsers/manifest/dash/common/parse_periods.d.ts +1 -1
- package/dist/es2017/parsers/manifest/dash/common/parse_periods.js +13 -16
- package/dist/es2017/parsers/manifest/dash/common/parse_representation_index.d.ts +19 -6
- package/dist/es2017/parsers/manifest/dash/common/parse_representation_index.js +10 -8
- package/dist/es2017/parsers/manifest/dash/common/parse_representations.js +7 -3
- package/dist/es2017/parsers/manifest/local/representation_index.d.ts +1 -1
- package/dist/es2017/parsers/manifest/local/representation_index.js +3 -3
- package/dist/es2017/parsers/manifest/metaplaylist/representation_index.d.ts +1 -1
- package/dist/es2017/parsers/manifest/metaplaylist/representation_index.js +2 -2
- package/dist/es2017/parsers/manifest/smooth/representation_index.d.ts +5 -5
- package/dist/es2017/parsers/manifest/smooth/representation_index.js +25 -9
- package/dist/es2017/parsers/manifest/utils/index_helpers.js +1 -1
- package/dist/es2017/parsers/texttracks/ttml/html/apply_line_height.js +2 -1
- package/dist/es2017/public_types.d.ts +107 -36
- package/dist/es2017/transports/dash/init_segment_loader.js +5 -0
- package/dist/es2017/transports/dash/manifest_parser.js +3 -0
- package/dist/es2017/transports/dash/segment_loader.js +1 -0
- package/dist/es2017/transports/dash/text_loader.js +2 -0
- package/dist/es2017/transports/metaplaylist/manifest_loader.js +1 -0
- package/dist/es2017/transports/metaplaylist/pipelines.js +4 -1
- package/dist/es2017/transports/smooth/pipelines.js +2 -0
- package/dist/es2017/transports/smooth/segment_loader.js +1 -0
- package/dist/es2017/transports/types.d.ts +12 -0
- package/dist/es2017/transports/utils/generate_manifest_loader.js +3 -0
- package/dist/es2017/utils/request/fetch.d.ts +6 -0
- package/dist/es2017/utils/request/fetch.js +29 -8
- package/dist/es2017/utils/request/xhr.d.ts +11 -5
- package/dist/es2017/utils/request/xhr.js +30 -9
- package/dist/mpd-parser.wasm +0 -0
- package/dist/rx-player.js +1335 -812
- package/dist/rx-player.min.js +1 -1
- package/package.json +7 -4
- package/scripts/canal-release.patch +78 -0
- package/scripts/make-dev-releases +65 -0
- package/scripts/update-version +7 -0
- package/sonar-project.properties +1 -1
- package/src/compat/is_codec_supported.ts +23 -1
- package/src/core/adaptive/adaptive_representation_selector.ts +4 -21
- package/src/core/adaptive/network_analyzer.ts +3 -3
- package/src/core/api/debug/buffer_graph.ts +2 -5
- package/src/core/api/debug/modules/general_info.ts +15 -10
- package/src/core/api/index.ts +1 -0
- package/src/core/api/option_utils.ts +3 -3
- package/src/core/api/playback_observer.ts +327 -107
- package/src/core/api/public_api.ts +42 -14
- package/src/core/api/utils.ts +3 -1
- package/src/core/decrypt/get_media_keys.ts +2 -8
- package/src/core/fetchers/manifest/manifest_fetcher.ts +21 -3
- package/src/core/fetchers/segment/segment_fetcher.ts +19 -5
- package/src/core/fetchers/segment/segment_fetcher_creator.ts +1 -0
- package/src/core/fetchers/utils/schedule_request.ts +1 -1
- package/src/core/init/directfile_content_initializer.ts +31 -15
- package/src/core/init/media_source_content_initializer.ts +40 -27
- package/src/core/init/utils/content_time_boundaries_observer.ts +24 -23
- package/src/core/init/utils/create_stream_playback_observer.ts +19 -20
- package/src/core/init/utils/get_initial_time.ts +25 -12
- package/src/core/init/utils/initial_seek_and_play.ts +140 -108
- package/src/core/init/utils/rebuffering_controller.ts +32 -77
- package/src/core/init/utils/stream_events_emitter/stream_events_emitter.ts +5 -2
- package/src/core/segment_buffers/garbage_collector.ts +1 -1
- package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +10 -2
- package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +1 -1
- package/src/core/segment_buffers/implementations/text/native/native_text_segment_buffer.ts +1 -1
- package/src/core/segment_buffers/index.ts +2 -0
- package/src/core/segment_buffers/inventory/index.ts +2 -0
- package/src/core/segment_buffers/inventory/segment_inventory.ts +49 -17
- package/src/core/stream/adaptation/get_representations_switch_strategy.ts +21 -12
- package/src/core/stream/orchestrator/stream_orchestrator.ts +14 -19
- package/src/core/stream/period/period_stream.ts +7 -8
- package/src/core/stream/period/types.ts +2 -3
- package/src/core/stream/period/utils/get_adaptation_switch_strategy.ts +21 -15
- package/src/core/stream/representation/representation_stream.ts +3 -5
- package/src/core/stream/representation/types.ts +2 -2
- package/src/core/stream/representation/utils/append_segment_to_buffer.ts +1 -1
- package/src/core/stream/representation/utils/get_buffer_status.ts +5 -4
- package/src/core/stream/representation/utils/get_needed_segments.ts +2 -2
- package/src/default_config.ts +22 -17
- package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +3 -1
- package/src/experimental/tools/createMetaplaylist/get_duration_from_manifest.ts +2 -0
- package/src/manifest/adaptation.ts +2 -1
- package/src/manifest/representation_index/static.ts +2 -2
- package/src/manifest/representation_index/types.ts +4 -4
- package/src/parsers/manifest/dash/common/__tests__/manifest_bounds_calculator.test.ts +182 -36
- package/src/parsers/manifest/dash/common/indexes/base.ts +12 -4
- package/src/parsers/manifest/dash/common/indexes/get_segments_from_timeline.ts +19 -5
- package/src/parsers/manifest/dash/common/indexes/index.ts +16 -4
- package/src/parsers/manifest/dash/common/indexes/list.ts +2 -2
- package/src/parsers/manifest/dash/common/indexes/template.ts +52 -31
- package/src/parsers/manifest/dash/common/indexes/timeline/index.ts +4 -1
- package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +366 -60
- package/src/parsers/manifest/dash/common/manifest_bounds_calculator.ts +63 -25
- package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +10 -4
- package/src/parsers/manifest/dash/common/parse_mpd.ts +28 -15
- package/src/parsers/manifest/dash/common/parse_periods.ts +12 -17
- package/src/parsers/manifest/dash/common/parse_representation_index.ts +50 -26
- package/src/parsers/manifest/dash/common/parse_representations.ts +9 -3
- package/src/parsers/manifest/local/representation_index.ts +3 -3
- package/src/parsers/manifest/metaplaylist/representation_index.ts +2 -2
- package/src/parsers/manifest/smooth/representation_index.ts +23 -9
- package/src/parsers/manifest/utils/__tests__/get_first_time_from_adaptations.test.ts +1 -1
- package/src/parsers/manifest/utils/__tests__/get_last_time_from_adaptation.test.ts +1 -1
- package/src/parsers/manifest/utils/index_helpers.ts +1 -1
- package/src/parsers/texttracks/ttml/html/apply_line_height.ts +3 -1
- package/src/public_types.ts +108 -36
- package/src/transports/dash/init_segment_loader.ts +5 -0
- package/src/transports/dash/manifest_parser.ts +6 -0
- package/src/transports/dash/segment_loader.ts +1 -0
- package/src/transports/dash/text_loader.ts +2 -0
- package/src/transports/metaplaylist/manifest_loader.ts +1 -0
- package/src/transports/metaplaylist/pipelines.ts +4 -1
- package/src/transports/smooth/pipelines.ts +2 -0
- package/src/transports/smooth/segment_loader.ts +1 -0
- package/src/transports/types.ts +12 -0
- package/src/transports/utils/generate_manifest_loader.ts +3 -0
- package/src/utils/request/fetch.ts +35 -8
- package/src/utils/request/xhr.ts +45 -14
- package/dist/commonjs/parsers/manifest/utils/is_segment_still_available.d.ts +0 -29
- package/dist/commonjs/parsers/manifest/utils/is_segment_still_available.js +0 -54
- package/dist/es2017/parsers/manifest/utils/is_segment_still_available.d.ts +0 -29
- package/dist/es2017/parsers/manifest/utils/is_segment_still_available.js +0 -51
- package/src/parsers/manifest/utils/is_segment_still_available.ts +0 -58
- package/src/typings/object-assign.d.ts +0 -48
|
@@ -231,7 +231,7 @@ var HTMLTextSegmentBuffer = /** @class */ (function (_super) {
|
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
233
|
if (infos.inventoryInfos !== null) {
|
|
234
|
-
this._segmentInventory.insertChunk(infos.inventoryInfos);
|
|
234
|
+
this._segmentInventory.insertChunk(infos.inventoryInfos, true);
|
|
235
235
|
}
|
|
236
236
|
this._buffer.insert(cues, start, end);
|
|
237
237
|
this._buffered.insert(start, end);
|
|
@@ -157,7 +157,7 @@ var NativeTextSegmentBuffer = /** @class */ (function (_super) {
|
|
|
157
157
|
}
|
|
158
158
|
this._buffered.insert(start, end);
|
|
159
159
|
if (infos.inventoryInfos !== null) {
|
|
160
|
-
this._segmentInventory.insertChunk(infos.inventoryInfos);
|
|
160
|
+
this._segmentInventory.insertChunk(infos.inventoryInfos, true);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
catch (err) {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import BufferGarbageCollector from "./garbage_collector";
|
|
17
17
|
import { IBufferType, IEndOfSegmentInfos, IEndOfSegmentOperation, IPushChunkInfos, IPushedChunkData, IPushOperation, IRemoveOperation, ISBOperation, SegmentBuffer, SegmentBufferOperation } from "./implementations";
|
|
18
|
-
import { IBufferedChunk, IChunkContext, IInsertedChunkInfos } from "./inventory";
|
|
18
|
+
import { ChunkStatus, IBufferedChunk, IChunkContext, IInsertedChunkInfos } from "./inventory";
|
|
19
19
|
import SegmentBuffersStore, { ISegmentBufferOptions, ITextTrackSegmentBufferOptions } from "./segment_buffers_store";
|
|
20
20
|
export default SegmentBuffersStore;
|
|
21
|
-
export { BufferGarbageCollector, ISegmentBufferOptions, ITextTrackSegmentBufferOptions, SegmentBuffer, IBufferType, IBufferedChunk, IChunkContext, IInsertedChunkInfos, IPushChunkInfos, IPushedChunkData, IEndOfSegmentInfos, SegmentBufferOperation, ISBOperation, IEndOfSegmentOperation, IPushOperation, IRemoveOperation, };
|
|
21
|
+
export { BufferGarbageCollector, ChunkStatus, ISegmentBufferOptions, ITextTrackSegmentBufferOptions, SegmentBuffer, IBufferType, IBufferedChunk, IChunkContext, IInsertedChunkInfos, IPushChunkInfos, IPushedChunkData, IEndOfSegmentInfos, SegmentBufferOperation, ISBOperation, IEndOfSegmentOperation, IPushOperation, IRemoveOperation, };
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import SegmentInventory, { IBufferedChunk, IInsertedChunkInfos } from "./segment_inventory";
|
|
16
|
+
import SegmentInventory, { ChunkStatus, IBufferedChunk, IInsertedChunkInfos } from "./segment_inventory";
|
|
17
17
|
export default SegmentInventory;
|
|
18
|
-
export { IBufferedChunk, IInsertedChunkInfos, };
|
|
18
|
+
export { ChunkStatus, IBufferedChunk, IInsertedChunkInfos, };
|
|
19
19
|
export { IBufferedHistoryEntry } from "./buffered_history";
|
|
20
20
|
export { IChunkContext } from "./types";
|
|
@@ -16,6 +16,27 @@
|
|
|
16
16
|
import { Adaptation, ISegment, Period, Representation } from "../../../manifest";
|
|
17
17
|
import { IBufferedHistoryEntry } from "./buffered_history";
|
|
18
18
|
import { IChunkContext } from "./types";
|
|
19
|
+
/** Categorization of a given chunk in the `SegmentInventory`. */
|
|
20
|
+
export declare const enum ChunkStatus {
|
|
21
|
+
/**
|
|
22
|
+
* This chunk is only a part of a partially-pushed segment for now, meaning
|
|
23
|
+
* that it is only a sub-part of a requested segment that was not yet
|
|
24
|
+
* fully-loaded and pushed.
|
|
25
|
+
*
|
|
26
|
+
* Once and if the corresponding segment is fully-pushed, its `ChunkStatus`
|
|
27
|
+
* switches to `Complete`.
|
|
28
|
+
*/
|
|
29
|
+
PartiallyPushed = 0,
|
|
30
|
+
/** This chunk corresponds to a fully-loaded segment. */
|
|
31
|
+
Complete = 1,
|
|
32
|
+
/**
|
|
33
|
+
* This chunk's push operation failed, in this scenario there is no certitude
|
|
34
|
+
* about the presence of that chunk in the buffer: it may not be present,
|
|
35
|
+
* partially-present, or fully-present depending on why that push operation
|
|
36
|
+
* failed, which is generally only known by the lower-level code.
|
|
37
|
+
*/
|
|
38
|
+
Failed = 2
|
|
39
|
+
}
|
|
19
40
|
/** Information stored on a single chunk by the SegmentInventory. */
|
|
20
41
|
export interface IBufferedChunk {
|
|
21
42
|
/**
|
|
@@ -69,14 +90,10 @@ export interface IBufferedChunk {
|
|
|
69
90
|
/** Information on what that chunk actually contains. */
|
|
70
91
|
infos: IChunkContext;
|
|
71
92
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* Inversely, if `false`, this chunk is a whole segment whose inner chunks
|
|
75
|
-
* have all been fully pushed.
|
|
76
|
-
* In that condition, the `start` and `end` properties refer to that fully
|
|
77
|
-
* pushed segment.
|
|
93
|
+
* Status of this chunk.
|
|
94
|
+
* @see ChunkStatus
|
|
78
95
|
*/
|
|
79
|
-
|
|
96
|
+
status: ChunkStatus;
|
|
80
97
|
/**
|
|
81
98
|
* If `true`, the segment as a whole is divided into multiple parts in the
|
|
82
99
|
* buffer, with other segment(s) between them.
|
|
@@ -169,7 +186,7 @@ export default class SegmentInventory {
|
|
|
169
186
|
* segment have been inserted, you should call the `completeSegment` method.
|
|
170
187
|
* @param {Object} chunkInformation
|
|
171
188
|
*/
|
|
172
|
-
insertChunk({ period, adaptation, representation, segment, chunkSize, start, end }: IInsertedChunkInfos): void;
|
|
189
|
+
insertChunk({ period, adaptation, representation, segment, chunkSize, start, end }: IInsertedChunkInfos, succeed: boolean): void;
|
|
173
190
|
/**
|
|
174
191
|
* Indicate that inserted chunks can now be considered as a complete segment.
|
|
175
192
|
* Take in argument the same content than what was given to `insertChunk` for
|
|
@@ -97,7 +97,9 @@ var SegmentInventory = /** @class */ (function () {
|
|
|
97
97
|
var removed = inventory.splice(indexBefore, numberOfSegmentToDelete);
|
|
98
98
|
for (var _i = 0, removed_1 = removed; _i < removed_1.length; _i++) {
|
|
99
99
|
var seg = removed_1[_i];
|
|
100
|
-
if (seg.bufferedStart === undefined &&
|
|
100
|
+
if (seg.bufferedStart === undefined &&
|
|
101
|
+
seg.bufferedEnd === undefined &&
|
|
102
|
+
seg.status !== 2 /* ChunkStatus.Failed */) {
|
|
101
103
|
this._bufferedHistory.addBufferedSegment(seg.infos, null);
|
|
102
104
|
}
|
|
103
105
|
}
|
|
@@ -156,7 +158,9 @@ var SegmentInventory = /** @class */ (function () {
|
|
|
156
158
|
var removed = inventory.splice(inventoryIndex, inventory.length - inventoryIndex);
|
|
157
159
|
for (var _h = 0, removed_2 = removed; _h < removed_2.length; _h++) {
|
|
158
160
|
var seg = removed_2[_h];
|
|
159
|
-
if (seg.bufferedStart === undefined &&
|
|
161
|
+
if (seg.bufferedStart === undefined &&
|
|
162
|
+
seg.bufferedEnd === undefined &&
|
|
163
|
+
seg.status !== 2 /* ChunkStatus.Failed */) {
|
|
160
164
|
this._bufferedHistory.addBufferedSegment(seg.infos, null);
|
|
161
165
|
}
|
|
162
166
|
}
|
|
@@ -173,7 +177,7 @@ var SegmentInventory = /** @class */ (function () {
|
|
|
173
177
|
* segment have been inserted, you should call the `completeSegment` method.
|
|
174
178
|
* @param {Object} chunkInformation
|
|
175
179
|
*/
|
|
176
|
-
SegmentInventory.prototype.insertChunk = function (_a) {
|
|
180
|
+
SegmentInventory.prototype.insertChunk = function (_a, succeed) {
|
|
177
181
|
var period = _a.period, adaptation = _a.adaptation, representation = _a.representation, segment = _a.segment, chunkSize = _a.chunkSize, start = _a.start, end = _a.end;
|
|
178
182
|
if (segment.isInit) {
|
|
179
183
|
return;
|
|
@@ -184,7 +188,8 @@ var SegmentInventory = /** @class */ (function () {
|
|
|
184
188
|
return;
|
|
185
189
|
}
|
|
186
190
|
var inventory = this._inventory;
|
|
187
|
-
var newSegment = {
|
|
191
|
+
var newSegment = { status: succeed ? 0 /* ChunkStatus.PartiallyPushed */ :
|
|
192
|
+
2 /* ChunkStatus.Failed */, chunkSize: chunkSize, splitted: false, start: start, end: end, precizeStart: false,
|
|
188
193
|
precizeEnd: false,
|
|
189
194
|
bufferedStart: undefined,
|
|
190
195
|
bufferedEnd: undefined,
|
|
@@ -377,7 +382,7 @@ var SegmentInventory = /** @class */ (function () {
|
|
|
377
382
|
// newSegment : |====|
|
|
378
383
|
// ===> : |--|====|-|
|
|
379
384
|
log.warn("SI: Segment pushed is contained in a previous one", bufferType, start, end, segmentI.start, segmentI.end);
|
|
380
|
-
var nextSegment = {
|
|
385
|
+
var nextSegment = { status: segmentI.status,
|
|
381
386
|
/**
|
|
382
387
|
* Note: this sadly means we're doing as if
|
|
383
388
|
* that chunk is present two times.
|
|
@@ -535,7 +540,9 @@ var SegmentInventory = /** @class */ (function () {
|
|
|
535
540
|
this._inventory.splice(firstI + 1, length_1);
|
|
536
541
|
i -= length_1;
|
|
537
542
|
}
|
|
538
|
-
this._inventory[firstI].
|
|
543
|
+
if (this._inventory[firstI].status === 0 /* ChunkStatus.PartiallyPushed */) {
|
|
544
|
+
this._inventory[firstI].status = 1 /* ChunkStatus.Complete */;
|
|
545
|
+
}
|
|
539
546
|
this._inventory[firstI].chunkSize = segmentSize;
|
|
540
547
|
this._inventory[firstI].end = lastEnd;
|
|
541
548
|
this._inventory[firstI].bufferedEnd = lastBufferedEnd;
|
|
@@ -551,8 +558,10 @@ var SegmentInventory = /** @class */ (function () {
|
|
|
551
558
|
for (var _i = 0, resSegments_1 = resSegments; _i < resSegments_1.length; _i++) {
|
|
552
559
|
var seg = resSegments_1[_i];
|
|
553
560
|
if (seg.bufferedStart !== undefined && seg.bufferedEnd !== undefined) {
|
|
554
|
-
|
|
555
|
-
|
|
561
|
+
if (seg.status !== 2 /* ChunkStatus.Failed */) {
|
|
562
|
+
this._bufferedHistory.addBufferedSegment(seg.infos, { start: seg.bufferedStart,
|
|
563
|
+
end: seg.bufferedEnd });
|
|
564
|
+
}
|
|
556
565
|
}
|
|
557
566
|
else {
|
|
558
567
|
log.debug("SI: buffered range not known after sync. Skipping history.", seg.start, seg.end);
|
|
@@ -597,7 +606,7 @@ export default SegmentInventory;
|
|
|
597
606
|
*/
|
|
598
607
|
function bufferedStartLooksCoherent(thisSegment) {
|
|
599
608
|
if (thisSegment.bufferedStart === undefined ||
|
|
600
|
-
thisSegment.
|
|
609
|
+
thisSegment.status !== 1 /* ChunkStatus.Complete */) {
|
|
601
610
|
return false;
|
|
602
611
|
}
|
|
603
612
|
var start = thisSegment.start, end = thisSegment.end;
|
|
@@ -618,7 +627,7 @@ function bufferedStartLooksCoherent(thisSegment) {
|
|
|
618
627
|
*/
|
|
619
628
|
function bufferedEndLooksCoherent(thisSegment) {
|
|
620
629
|
if (thisSegment.bufferedEnd === undefined ||
|
|
621
|
-
thisSegment.
|
|
630
|
+
thisSegment.status !== 1 /* ChunkStatus.Complete */) {
|
|
622
631
|
return false;
|
|
623
632
|
}
|
|
624
633
|
var start = thisSegment.start, end = thisSegment.end;
|
|
@@ -184,7 +184,7 @@ function getPlayableBufferedSegments(neededRange, segmentInventory) {
|
|
|
184
184
|
for (var i = segmentInventory.length - 1; i >= 0; i--) {
|
|
185
185
|
var eltInventory = segmentInventory[i];
|
|
186
186
|
var representation = eltInventory.infos.representation;
|
|
187
|
-
if (
|
|
187
|
+
if (eltInventory.status === 1 /* ChunkStatus.Complete */ &&
|
|
188
188
|
representation.decipherable !== false &&
|
|
189
189
|
representation.isSupported) {
|
|
190
190
|
var inventorySegment = eltInventory.infos.segment;
|
|
@@ -321,7 +321,7 @@ function doesEndSeemGarbageCollected(currentSeg, nextSeg, minimumEndTime) {
|
|
|
321
321
|
}
|
|
322
322
|
if (minimumEndTime > currentSeg.bufferedEnd &&
|
|
323
323
|
currentSeg.end - currentSeg.bufferedEnd > MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT) {
|
|
324
|
-
log.info("Stream: The end of the wanted segment has been garbage collected", currentSeg.
|
|
324
|
+
log.info("Stream: The end of the wanted segment has been garbage collected", currentSeg.end, currentSeg.bufferedEnd);
|
|
325
325
|
return true;
|
|
326
326
|
}
|
|
327
327
|
return false;
|
|
@@ -48,14 +48,7 @@ export default function applyExtent(element, extent) {
|
|
|
48
48
|
if (secondExtent[2] === "px" ||
|
|
49
49
|
secondExtent[2] === "%" ||
|
|
50
50
|
secondExtent[2] === "em") {
|
|
51
|
-
|
|
52
|
-
if (secondExtent[2] === "%" && !isNaN(toNum) &&
|
|
53
|
-
(toNum < 0 || toNum > 100)) {
|
|
54
|
-
element.style.width = "80%";
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
element.style.height = secondExtent[1] + secondExtent[2];
|
|
58
|
-
}
|
|
51
|
+
element.style.height = secondExtent[1] + secondExtent[2];
|
|
59
52
|
}
|
|
60
53
|
else if (secondExtent[2] === "c") {
|
|
61
54
|
addClassName(element, "proportional-style");
|
|
@@ -22,10 +22,11 @@ import { REGXP_LENGTH } from "../regexps";
|
|
|
22
22
|
*/
|
|
23
23
|
export default function applyLineHeight(element, lineHeight) {
|
|
24
24
|
var trimmedLineHeight = lineHeight.trim();
|
|
25
|
+
var splittedLineHeight = trimmedLineHeight.split(" ");
|
|
25
26
|
if (trimmedLineHeight === "auto") {
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
|
-
var firstLineHeight = REGXP_LENGTH.exec(
|
|
29
|
+
var firstLineHeight = REGXP_LENGTH.exec(splittedLineHeight[0]);
|
|
29
30
|
if (firstLineHeight === null) {
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
@@ -47,15 +47,7 @@ export default function applyOrigin(element, origin) {
|
|
|
47
47
|
if (secondOrigin[2] === "px" ||
|
|
48
48
|
secondOrigin[2] === "%" ||
|
|
49
49
|
secondOrigin[2] === "em") {
|
|
50
|
-
|
|
51
|
-
if (secondOrigin[2] === "%" && !isNaN(toNum) &&
|
|
52
|
-
(toNum < 0 || toNum > 100)) {
|
|
53
|
-
element.style.bottom = "5%";
|
|
54
|
-
element.style.left = "10%";
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
element.style.top = secondOrigin[1] + secondOrigin[2];
|
|
58
|
-
}
|
|
50
|
+
element.style.top = secondOrigin[1] + secondOrigin[2];
|
|
59
51
|
}
|
|
60
52
|
else if (secondOrigin[2] === "c") {
|
|
61
53
|
addClassName(element, "proportional-style");
|
|
@@ -264,6 +264,8 @@ export interface IRepresentation {
|
|
|
264
264
|
/** If the track is HDR, gives the HDR characteristics of the content */
|
|
265
265
|
hdrInfo?: IHDRInformation;
|
|
266
266
|
index: IRepresentationIndex;
|
|
267
|
+
/** NOTE: not part of the API. */
|
|
268
|
+
isSupported: boolean;
|
|
267
269
|
}
|
|
268
270
|
export interface IHDRInformation {
|
|
269
271
|
/**
|
|
@@ -16,6 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
var browser_compatibility_types_1 = require("./browser_compatibility_types");
|
|
19
|
+
/**
|
|
20
|
+
* Setting this value limit the number of entries in the support map
|
|
21
|
+
* preventing important memory usage, value is arbitrary
|
|
22
|
+
*/
|
|
23
|
+
var MAX_SUPPORT_MAP_ENTRIES = 200;
|
|
24
|
+
/**
|
|
25
|
+
* caching the codec support reduce the amount of call to `isTypeSupported`
|
|
26
|
+
* and help for performance especially on low-end devices.
|
|
27
|
+
*/
|
|
28
|
+
var supportMap = new Map();
|
|
19
29
|
/**
|
|
20
30
|
* Returns true if the given codec is supported by the browser's MediaSource
|
|
21
31
|
* implementation.
|
|
@@ -32,7 +42,18 @@ function isCodecSupported(mimeType) {
|
|
|
32
42
|
/* eslint-disable @typescript-eslint/unbound-method */
|
|
33
43
|
if (typeof browser_compatibility_types_1.MediaSource_.isTypeSupported === "function") {
|
|
34
44
|
/* eslint-enable @typescript-eslint/unbound-method */
|
|
35
|
-
|
|
45
|
+
var cachedSupport = supportMap.get(mimeType);
|
|
46
|
+
if (cachedSupport !== undefined) {
|
|
47
|
+
return cachedSupport;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
var isSupported = browser_compatibility_types_1.MediaSource_.isTypeSupported(mimeType);
|
|
51
|
+
if (supportMap.size >= MAX_SUPPORT_MAP_ENTRIES) {
|
|
52
|
+
supportMap.clear();
|
|
53
|
+
}
|
|
54
|
+
supportMap.set(mimeType, isSupported);
|
|
55
|
+
return isSupported;
|
|
56
|
+
}
|
|
36
57
|
}
|
|
37
58
|
return true;
|
|
38
59
|
}
|
|
@@ -18,6 +18,7 @@ declare class ConfigHandler {
|
|
|
18
18
|
_config: {
|
|
19
19
|
DEFAULT_UNMUTED_VOLUME: number;
|
|
20
20
|
DEFAULT_REQUEST_TIMEOUT: number;
|
|
21
|
+
DEFAULT_CONNECTION_TIMEOUT: number;
|
|
21
22
|
DEFAULT_TEXT_TRACK_MODE: "native" | "html";
|
|
22
23
|
DEFAULT_ENABLE_FAST_SWITCHING: boolean;
|
|
23
24
|
DELTA_POSITION_AFTER_RELOAD: {
|
|
@@ -35,6 +36,7 @@ declare class ConfigHandler {
|
|
|
35
36
|
DEFAULT_MAX_BUFFER_BEHIND: number;
|
|
36
37
|
DEFAULT_MAX_VIDEO_BUFFER_SIZE: number;
|
|
37
38
|
MAXIMUM_MAX_BUFFER_AHEAD: Partial<Record<"audio" | "video" | "text", number>>;
|
|
39
|
+
MINIMUM_MAX_BUFFER_AHEAD: Partial<Record<"audio" | "video" | "image" | "text", number>>;
|
|
38
40
|
MAXIMUM_MAX_BUFFER_BEHIND: Partial<Record<"audio" | "video" | "text", number>>;
|
|
39
41
|
DEFAULT_BASE_BANDWIDTH: number;
|
|
40
42
|
INACTIVITY_DELAY: number;
|
|
@@ -45,7 +47,6 @@ declare class ConfigHandler {
|
|
|
45
47
|
LOW_LATENCY: number;
|
|
46
48
|
};
|
|
47
49
|
BUFFER_DISCONTINUITY_THRESHOLD: number;
|
|
48
|
-
FORCE_DISCONTINUITY_SEEK_DELAY: number;
|
|
49
50
|
BITRATE_REBUFFERING_RATIO: number;
|
|
50
51
|
BUFFER_GC_GAPS: {
|
|
51
52
|
CALM: number;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import Manifest, { Adaptation, ISegment, Period, Representation } from "../../manifest";
|
|
17
17
|
import { IReadOnlySharedReference } from "../../utils/reference";
|
|
18
18
|
import { CancellationSignal } from "../../utils/task_canceller";
|
|
19
|
-
import { IReadOnlyPlaybackObserver } from "../api";
|
|
19
|
+
import { IObservationPosition, IReadOnlyPlaybackObserver } from "../api";
|
|
20
20
|
import { IBufferType } from "../segment_buffers";
|
|
21
21
|
import BandwidthEstimator from "./utils/bandwidth_estimator";
|
|
22
22
|
import { IResolutionInfo } from "./utils/filter_by_resolution";
|
|
@@ -99,24 +99,7 @@ export interface IRepresentationEstimatorPlaybackObservation {
|
|
|
99
99
|
* Information on the current media position in seconds at the time of a
|
|
100
100
|
* Playback Observation.
|
|
101
101
|
*/
|
|
102
|
-
position:
|
|
103
|
-
/**
|
|
104
|
-
* Known position at the time the Observation was emitted, in seconds.
|
|
105
|
-
*
|
|
106
|
-
* Note that it might have changed since. If you want truly precize
|
|
107
|
-
* information, you should recuperate it from the HTMLMediaElement directly
|
|
108
|
-
* through another mean.
|
|
109
|
-
*/
|
|
110
|
-
last: number;
|
|
111
|
-
/**
|
|
112
|
-
* Actually wanted position in seconds that is not yet reached.
|
|
113
|
-
*
|
|
114
|
-
* This might for example be set to the initial position when the content is
|
|
115
|
-
* loading (and thus potentially at a `0` position) but which will be seeked
|
|
116
|
-
* to a given position once possible.
|
|
117
|
-
*/
|
|
118
|
-
pending: number | undefined;
|
|
119
|
-
};
|
|
102
|
+
position: IObservationPosition;
|
|
120
103
|
/**
|
|
121
104
|
* Last "playback rate" set by the user. This is the ideal "playback rate" at
|
|
122
105
|
* which the media should play.
|
|
@@ -194,7 +194,7 @@ function getEstimateReference(_a, stopAllEstimates) {
|
|
|
194
194
|
}
|
|
195
195
|
var position = lastPlaybackObservation.position, speed = lastPlaybackObservation.speed;
|
|
196
196
|
var timeRanges = val.buffered;
|
|
197
|
-
var bufferGap = (0, ranges_1.getLeftSizeOfBufferedTimeRange)(timeRanges, position.
|
|
197
|
+
var bufferGap = (0, ranges_1.getLeftSizeOfBufferedTimeRange)(timeRanges, position.getWanted());
|
|
198
198
|
var representation = val.content.representation;
|
|
199
199
|
var currentScore = scoreCalculator.getEstimate(representation);
|
|
200
200
|
var currentBitrate = representation.bitrate;
|
|
@@ -285,7 +285,7 @@ function getEstimateReference(_a, stopAllEstimates) {
|
|
|
285
285
|
if (lowLatencyMode &&
|
|
286
286
|
currentRepresentationVal !== null &&
|
|
287
287
|
context.manifest.isDynamic &&
|
|
288
|
-
maximumPosition - position.
|
|
288
|
+
maximumPosition - position.getWanted() < 40) {
|
|
289
289
|
chosenRepFromGuessMode = guessBasedChooser
|
|
290
290
|
.getGuess(sortedRepresentations, lastPlaybackObservation, currentRepresentationVal, currentBestBitrate, requests);
|
|
291
291
|
}
|
|
@@ -124,7 +124,7 @@ function estimateStarvationModeBitrate(pendingRequests, playbackInfo, currentRep
|
|
|
124
124
|
var bufferGap = playbackInfo.bufferGap, speed = playbackInfo.speed, position = playbackInfo.position;
|
|
125
125
|
var realBufferGap = isFinite(bufferGap) ? bufferGap :
|
|
126
126
|
0;
|
|
127
|
-
var nextNeededPosition = position.
|
|
127
|
+
var nextNeededPosition = position.getWanted() + realBufferGap;
|
|
128
128
|
var concernedRequests = getConcernedRequests(pendingRequests, nextNeededPosition);
|
|
129
129
|
if (concernedRequests.length !== 1) { // 0 == no request
|
|
130
130
|
// 2+ == too complicated to calculate
|
|
@@ -192,7 +192,7 @@ function shouldDirectlySwitchToLowBitrate(playbackInfo, requests, lowLatencyMode
|
|
|
192
192
|
}
|
|
193
193
|
var realBufferGap = isFinite(playbackInfo.bufferGap) ? playbackInfo.bufferGap :
|
|
194
194
|
0;
|
|
195
|
-
var nextNeededPosition = playbackInfo.position.
|
|
195
|
+
var nextNeededPosition = playbackInfo.position.getWanted() + realBufferGap;
|
|
196
196
|
var nextRequest = (0, array_find_1.default)(requests, function (_a) {
|
|
197
197
|
var content = _a.content;
|
|
198
198
|
return content.segment.duration > 0 &&
|
|
@@ -268,7 +268,7 @@ var NetworkAnalyzer = /** @class */ (function () {
|
|
|
268
268
|
var ABR_STARVATION_DURATION_DELTA = config_1.default.getCurrent().ABR_STARVATION_DURATION_DELTA;
|
|
269
269
|
// check if should get in/out of starvation mode
|
|
270
270
|
if (isNaN(duration) ||
|
|
271
|
-
realBufferGap + position.
|
|
271
|
+
realBufferGap + position.getWanted() < duration - ABR_STARVATION_DURATION_DELTA) {
|
|
272
272
|
if (!this._inStarvationMode && realBufferGap <= localConf.starvationGap) {
|
|
273
273
|
log_1.default.info("ABR: enter starvation mode.");
|
|
274
274
|
this._inStarvationMode = true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var BUFFER_WIDTH_IN_SECONDS =
|
|
3
|
+
var BUFFER_WIDTH_IN_SECONDS = 30 * 60;
|
|
4
4
|
var COLORS = [
|
|
5
5
|
"#2ab7ca",
|
|
6
6
|
"#fed766",
|
|
@@ -67,11 +67,7 @@ var SegmentBufferGraph = /** @class */ (function () {
|
|
|
67
67
|
var minimumPosition;
|
|
68
68
|
var maximumPosition;
|
|
69
69
|
if (maximumPoint - minimumPoint > BUFFER_WIDTH_IN_SECONDS) {
|
|
70
|
-
if (currentTime
|
|
71
|
-
minimumPosition = minimumPoint;
|
|
72
|
-
maximumPosition = maximumPoint;
|
|
73
|
-
}
|
|
74
|
-
else if (maximumPoint - currentTime < BUFFER_WIDTH_IN_SECONDS / 2) {
|
|
70
|
+
if (maximumPoint - currentTime < BUFFER_WIDTH_IN_SECONDS / 2) {
|
|
75
71
|
maximumPosition = maximumPoint;
|
|
76
72
|
minimumPosition = maximumPoint - BUFFER_WIDTH_IN_SECONDS;
|
|
77
73
|
}
|
|
@@ -184,23 +184,30 @@ function constructDebugGeneralInfo(instance, parentElt, cancelSignal) {
|
|
|
184
184
|
]);
|
|
185
185
|
adaptationsElt.appendChild(textAdaps);
|
|
186
186
|
}
|
|
187
|
-
var
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
187
|
+
var adaptations = instance.__priv_getCurrentAdaptation();
|
|
188
|
+
var videoBitratesStr = (_e = (_d = adaptations === null || adaptations === void 0 ? void 0 : adaptations.video) === null || _d === void 0 ? void 0 : _d.representations.map(function (r) {
|
|
189
|
+
var _a;
|
|
190
|
+
return String((_a = r.bitrate) !== null && _a !== void 0 ? _a : "N/A") +
|
|
191
|
+
(r.isSupported ? "" : " U!") +
|
|
192
|
+
(r.decipherable !== false ? "" : " E!");
|
|
193
|
+
})) !== null && _e !== void 0 ? _e : [];
|
|
194
|
+
var audioBitratesStr = (_g = (_f = adaptations === null || adaptations === void 0 ? void 0 : adaptations.video) === null || _f === void 0 ? void 0 : _f.representations.map(function (r) {
|
|
195
|
+
var _a;
|
|
196
|
+
return String((_a = r.bitrate) !== null && _a !== void 0 ? _a : "N/A") +
|
|
197
|
+
(r.isSupported ? "" : " U!") +
|
|
198
|
+
(r.decipherable !== false ? "" : " E!");
|
|
199
|
+
})) !== null && _g !== void 0 ? _g : [];
|
|
193
200
|
representationsElt.innerHTML = "";
|
|
194
|
-
if (
|
|
201
|
+
if (videoBitratesStr.length > 0) {
|
|
195
202
|
representationsElt.appendChild((0, utils_1.createMetricTitle)("vb"));
|
|
196
203
|
representationsElt.appendChild((0, utils_1.createElement)("span", {
|
|
197
|
-
textContent:
|
|
204
|
+
textContent: videoBitratesStr.join(" ") + " ",
|
|
198
205
|
}));
|
|
199
206
|
}
|
|
200
|
-
if (
|
|
207
|
+
if (audioBitratesStr.length > 0) {
|
|
201
208
|
representationsElt.appendChild((0, utils_1.createMetricTitle)("ab"));
|
|
202
209
|
representationsElt.appendChild((0, utils_1.createElement)("span", {
|
|
203
|
-
textContent:
|
|
210
|
+
textContent: audioBitratesStr.join(" ") + " ",
|
|
204
211
|
}));
|
|
205
212
|
}
|
|
206
213
|
}
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
import PlaybackObserver from "./playback_observer";
|
|
17
17
|
import Player from "./public_api";
|
|
18
18
|
export { PlaybackObserver };
|
|
19
|
-
export { IPlaybackObservation, IPlaybackObserverEventType, IReadOnlyPlaybackObserver, IFreezingStatus, IRebufferingStatus, } from "./playback_observer";
|
|
19
|
+
export { IObservationPosition, IPlaybackObservation, IPlaybackObserverEventType, IReadOnlyPlaybackObserver, IFreezingStatus, IRebufferingStatus, } from "./playback_observer";
|
|
20
20
|
export default Player;
|
|
@@ -279,9 +279,8 @@ function parseLoadVideoOptions(options) {
|
|
|
279
279
|
"an \"html\" textTrackMode. It will be ignored.");
|
|
280
280
|
}
|
|
281
281
|
if (!(0, is_null_or_undefined_1.default)(options.startAt)) {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
instanceof Date) {
|
|
282
|
+
if ("wallClockTime" in options.startAt
|
|
283
|
+
&& options.startAt.wallClockTime instanceof Date) {
|
|
285
284
|
var wallClockTime = options.startAt
|
|
286
285
|
.wallClockTime.getTime() / 1000;
|
|
287
286
|
startAt = (0, object_assign_1.default)({}, options.startAt, { wallClockTime: wallClockTime });
|