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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rx-player",
|
|
3
3
|
"author": "Canal+",
|
|
4
|
-
"version": "4.0.0-dev.
|
|
4
|
+
"version": "4.0.0-dev.2023121900",
|
|
5
5
|
"description": "Canal+ HTML5 Video Player",
|
|
6
6
|
"main": "./dist/commonjs/index.js",
|
|
7
7
|
"module": "./dist/es2017/index.js",
|
|
@@ -138,12 +138,13 @@
|
|
|
138
138
|
"demo": "node ./scripts/build_demo.mjs --production-mode",
|
|
139
139
|
"demo:min": "node ./scripts/build_demo.mjs --production-mode --minify",
|
|
140
140
|
"demo:watch": "node ./scripts/build_demo.mjs --watch --production-mode",
|
|
141
|
-
"doc": "
|
|
141
|
+
"doc": "readme.doc doc/ doc/generated \"$(cat VERSION)\"",
|
|
142
142
|
"lint": "eslint src -c .eslintrc.js",
|
|
143
143
|
"lint:demo": "eslint -c demo/full/.eslintrc.js demo/full/scripts",
|
|
144
144
|
"lint:tests": "eslint tests/**/*.js --ignore-pattern '/tests/performance/bundle*'",
|
|
145
145
|
"list": "node scripts/list-npm-scripts.mjs",
|
|
146
146
|
"prepublishOnly": "npm run build:all",
|
|
147
|
+
"releases:dev": "./scripts/make-dev-releases",
|
|
147
148
|
"standalone": "node ./scripts/run_standalone_demo.mjs",
|
|
148
149
|
"start": "node ./scripts/start_demo_web_server.mjs",
|
|
149
150
|
"sart:wasm": "node ./scripts/start_demo_web_server.mjs --include-wasm",
|
|
@@ -172,6 +173,7 @@
|
|
|
172
173
|
"@babel/plugin-transform-runtime": "7.22.15",
|
|
173
174
|
"@babel/preset-env": "7.22.20",
|
|
174
175
|
"@babel/preset-react": "7.22.15",
|
|
176
|
+
"@canalplus/readme.doc": "^0.3.0",
|
|
175
177
|
"@types/chai": "4.3.6",
|
|
176
178
|
"@types/jest": "29.5.5",
|
|
177
179
|
"@types/mocha": "10.0.1",
|
|
@@ -185,7 +187,6 @@
|
|
|
185
187
|
"babel-loader": "9.1.3",
|
|
186
188
|
"chai": "4.3.8",
|
|
187
189
|
"core-js": "3.32.2",
|
|
188
|
-
"docgen.ico": "^0.2.3",
|
|
189
190
|
"esbuild": "0.19.3",
|
|
190
191
|
"eslint": "8.50.0",
|
|
191
192
|
"eslint-plugin-ban": "1.6.0",
|
|
@@ -215,7 +216,6 @@
|
|
|
215
216
|
"terser-webpack-plugin": "5.3.9",
|
|
216
217
|
"ts-jest": "29.1.1",
|
|
217
218
|
"ts-loader": "9.4.4",
|
|
218
|
-
"tslint": "6.1.3",
|
|
219
219
|
"typescript": "5.2.2",
|
|
220
220
|
"webpack": "5.88.2",
|
|
221
221
|
"webpack-cli": "5.1.4"
|
|
@@ -283,6 +283,9 @@
|
|
|
283
283
|
"doc": "Generate the HTML documentation in doc/generated/pages"
|
|
284
284
|
},
|
|
285
285
|
"Update the RxPlayer's version": {
|
|
286
|
+
},
|
|
287
|
+
"Make a release": {
|
|
288
|
+
"releases:dev": "Produce dev npm releases (which are tagged pre-releases on npm) with the code in the current branch",
|
|
286
289
|
"update-version": "Update the version to the string given in argument (example: `npm run update-version 3.8.0`). Will update the codebase and perform every builds."
|
|
287
290
|
}
|
|
288
291
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
diff --git a/src/parsers/texttracks/ttml/html/apply_extent.ts b/src/parsers/texttracks/ttml/html/apply_extent.ts
|
|
2
|
+
index 5772fa8fb..eb3a051e4 100644
|
|
3
|
+
--- a/src/parsers/texttracks/ttml/html/apply_extent.ts
|
|
4
|
+
+++ b/src/parsers/texttracks/ttml/html/apply_extent.ts
|
|
5
|
+
@@ -54,7 +54,14 @@ export default function applyExtent(
|
|
6
|
+
secondExtent[2] === "%" ||
|
|
7
|
+
secondExtent[2] === "em")
|
|
8
|
+
{
|
|
9
|
+
- element.style.height = secondExtent[1] + secondExtent[2];
|
|
10
|
+
+ const toNum = Number(secondExtent[1]);
|
|
11
|
+
+ if (secondExtent[2] === "%" && !isNaN(toNum) &&
|
|
12
|
+
+ (toNum < 0 || toNum > 100))
|
|
13
|
+
+ {
|
|
14
|
+
+ element.style.width = "80%";
|
|
15
|
+
+ } else {
|
|
16
|
+
+ element.style.height = secondExtent[1] + secondExtent[2];
|
|
17
|
+
+ }
|
|
18
|
+
} else if (secondExtent[2] === "c") {
|
|
19
|
+
addClassName(element, "proportional-style");
|
|
20
|
+
element.setAttribute("data-proportional-height", secondExtent[1]);
|
|
21
|
+
diff --git a/src/parsers/texttracks/ttml/html/apply_line_height.ts b/src/parsers/texttracks/ttml/html/apply_line_height.ts
|
|
22
|
+
index 4f727229a..253aa1a72 100644
|
|
23
|
+
--- a/src/parsers/texttracks/ttml/html/apply_line_height.ts
|
|
24
|
+
+++ b/src/parsers/texttracks/ttml/html/apply_line_height.ts
|
|
25
|
+
@@ -14,16 +14,15 @@
|
|
26
|
+
* limitations under the License.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
-import { addClassName } from "../../../../compat";
|
|
30
|
+
import log from "../../../../log";
|
|
31
|
+
import { REGXP_LENGTH } from "../regexps";
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
- * @param {HTMLElement} element
|
|
35
|
+
+ * @param {HTMLElement} _element
|
|
36
|
+
* @param {string} lineHeight
|
|
37
|
+
*/
|
|
38
|
+
export default function applyLineHeight(
|
|
39
|
+
- element : HTMLElement,
|
|
40
|
+
+ _element : HTMLElement,
|
|
41
|
+
lineHeight : string
|
|
42
|
+
) : void {
|
|
43
|
+
const trimmedLineHeight = lineHeight.trim();
|
|
44
|
+
@@ -40,10 +39,10 @@ export default function applyLineHeight(
|
|
45
|
+
firstLineHeight[2] === "%" ||
|
|
46
|
+
firstLineHeight[2] === "em")
|
|
47
|
+
{
|
|
48
|
+
- element.style.lineHeight = firstLineHeight[1] + firstLineHeight[2];
|
|
49
|
+
+ // element.style.lineHeight = firstLineHeight[1] + firstLineHeight[2];
|
|
50
|
+
} else if (firstLineHeight[2] === "c") {
|
|
51
|
+
- addClassName(element, "proportional-style");
|
|
52
|
+
- element.setAttribute("data-proportional-line-height", firstLineHeight[1]);
|
|
53
|
+
+ // addClassName(element, "proportional-style");
|
|
54
|
+
+ // element.setAttribute("data-proportional-line-height", firstLineHeight[1]);
|
|
55
|
+
} else {
|
|
56
|
+
log.warn("TTML Parser: unhandled lineHeight unit:", firstLineHeight[2]);
|
|
57
|
+
}
|
|
58
|
+
diff --git a/src/parsers/texttracks/ttml/html/apply_origin.ts b/src/parsers/texttracks/ttml/html/apply_origin.ts
|
|
59
|
+
index 01a205aad..91d69fa3c 100644
|
|
60
|
+
--- a/src/parsers/texttracks/ttml/html/apply_origin.ts
|
|
61
|
+
+++ b/src/parsers/texttracks/ttml/html/apply_origin.ts
|
|
62
|
+
@@ -53,7 +53,15 @@ export default function applyOrigin(
|
|
63
|
+
secondOrigin[2] === "%" ||
|
|
64
|
+
secondOrigin[2] === "em")
|
|
65
|
+
{
|
|
66
|
+
- element.style.top = secondOrigin[1] + secondOrigin[2];
|
|
67
|
+
+ const toNum = Number(secondOrigin[1]);
|
|
68
|
+
+ if (secondOrigin[2] === "%" && !isNaN(toNum) &&
|
|
69
|
+
+ (toNum < 0 || toNum > 100))
|
|
70
|
+
+ {
|
|
71
|
+
+ element.style.bottom = "5%";
|
|
72
|
+
+ element.style.left = "10%";
|
|
73
|
+
+ } else {
|
|
74
|
+
+ element.style.top = secondOrigin[1] + secondOrigin[2];
|
|
75
|
+
+ }
|
|
76
|
+
} else if (secondOrigin[2] === "c") {
|
|
77
|
+
addClassName(element, "proportional-style");
|
|
78
|
+
element.setAttribute("data-proportional-top", secondOrigin[1]);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# make-dev-releases
|
|
4
|
+
# =================
|
|
5
|
+
#
|
|
6
|
+
# This script produces pre-releases on top of the current branch for the
|
|
7
|
+
# `dev-v4` and `canal-v4` versions (as per their npm tags).
|
|
8
|
+
#
|
|
9
|
+
# To use it:
|
|
10
|
+
#
|
|
11
|
+
# 1. Be sure that you're on the branch corresponding to the pre-release you
|
|
12
|
+
# want to publish, at the repository's root directory.
|
|
13
|
+
#
|
|
14
|
+
# 2. Call this script followed with the corresponding version number it would
|
|
15
|
+
# have as an official release in the `MAJOR.MINOR.PATCH` format (e.g.
|
|
16
|
+
# `./update-version 4.1.3`). Special suffix corresponding to the date and
|
|
17
|
+
# tag will be added automatically by this script.
|
|
18
|
+
#
|
|
19
|
+
# 3. When the script ask you to confirm, check that the preceding commands did
|
|
20
|
+
# not output any issue and if it didn't you can confirm.
|
|
21
|
+
#
|
|
22
|
+
# 4. That's it!
|
|
23
|
+
|
|
24
|
+
set -e
|
|
25
|
+
|
|
26
|
+
current_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
|
|
27
|
+
version=$1
|
|
28
|
+
date=$(date "+%Y%m%d")
|
|
29
|
+
dev_branch="release/v${version}-dev.${date}00"
|
|
30
|
+
canal_branch="release/v${version}-canal.${date}00"
|
|
31
|
+
|
|
32
|
+
git checkout -b ${dev_branch}
|
|
33
|
+
./scripts/update-version $1-dev.${date}00
|
|
34
|
+
git add --all
|
|
35
|
+
git commit -m "update version"
|
|
36
|
+
while true; do
|
|
37
|
+
read -n1 -p "Do you wish to push and publish the dev build? [y/n] " yn
|
|
38
|
+
echo ""
|
|
39
|
+
case $yn in
|
|
40
|
+
[Yy]* ) break;;
|
|
41
|
+
[Nn]* ) exit;;
|
|
42
|
+
* ) echo "Please answer y or n.";;
|
|
43
|
+
esac
|
|
44
|
+
done
|
|
45
|
+
git push origin ${dev_branch}
|
|
46
|
+
npm publish --tag dev-v4
|
|
47
|
+
|
|
48
|
+
git checkout $current_branch
|
|
49
|
+
|
|
50
|
+
git checkout -b ${canal_branch}
|
|
51
|
+
git apply ./scripts/canal-release.patch
|
|
52
|
+
./scripts/update-version $1-canal.${date}00
|
|
53
|
+
git add --all
|
|
54
|
+
git commit -m "update version"
|
|
55
|
+
git push origin ${canal_branch}
|
|
56
|
+
while true; do
|
|
57
|
+
read -n1 -p "Do you wish to push and publish the canal build? [y/n] " yn
|
|
58
|
+
echo ""
|
|
59
|
+
case $yn in
|
|
60
|
+
[Yy]* ) break;;
|
|
61
|
+
[Nn]* ) exit;;
|
|
62
|
+
* ) echo "Please answer y or n.";;
|
|
63
|
+
esac
|
|
64
|
+
done
|
|
65
|
+
npm publish --tag canal-v4
|
package/scripts/update-version
CHANGED
|
@@ -21,8 +21,15 @@
|
|
|
21
21
|
|
|
22
22
|
set -e
|
|
23
23
|
|
|
24
|
+
if [ $# -eq 0 ]; then
|
|
25
|
+
echo "no version in argument"
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
28
|
+
|
|
24
29
|
version=$1
|
|
30
|
+
date_iso=$(date "+%Y-%m-%d")
|
|
25
31
|
|
|
32
|
+
sed -i.bak -e "s/^\#\# Unreleased/\#\# v${version} \(${date_iso}\)/gi" CHANGELOG.md && rm CHANGELOG.md.bak
|
|
26
33
|
sed -i.bak -e "s/\/\\* PLAYER_VERSION \\*\/\"\(.*\)\";/\/* PLAYER_VERSION *\/\"${version}\";/g" src/core/api/public_api.ts && rm src/core/api/public_api.ts.bak
|
|
27
34
|
sed -i.bak -e "s/\"version\":\s*\"[0-9]\+\.[0-9]\+\.[0-9]\+[^\"]*\"/\"version\": \"${version}\"/g" package.json && rm package.json.bak
|
|
28
35
|
sed -i.bak -e "s/sonar\.projectVersion= *.*/sonar.projectVersion=${version}/g" sonar-project.properties && rm sonar-project.properties.bak
|
package/sonar-project.properties
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
sonar.projectKey=rx-player
|
|
2
2
|
sonar.organization=rx-player
|
|
3
3
|
sonar.projectName=rx-player
|
|
4
|
-
sonar.projectVersion=4.0.0-dev.
|
|
4
|
+
sonar.projectVersion=4.0.0-dev.2023121900
|
|
5
5
|
sonar.sources=./src,./demo,./tests
|
|
6
6
|
sonar.exclusions=demo/full/bundle.js,demo/standalone/lib.js,demo/bundle.js
|
|
7
7
|
sonar.host.url=https://sonarcloud.io
|
|
@@ -16,6 +16,17 @@
|
|
|
16
16
|
|
|
17
17
|
import { MediaSource_ } from "./browser_compatibility_types";
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Setting this value limit the number of entries in the support map
|
|
21
|
+
* preventing important memory usage, value is arbitrary
|
|
22
|
+
*/
|
|
23
|
+
const MAX_SUPPORT_MAP_ENTRIES = 200;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* caching the codec support reduce the amount of call to `isTypeSupported`
|
|
27
|
+
* and help for performance especially on low-end devices.
|
|
28
|
+
*/
|
|
29
|
+
const supportMap: Map<string, boolean> = new Map();
|
|
19
30
|
/**
|
|
20
31
|
* Returns true if the given codec is supported by the browser's MediaSource
|
|
21
32
|
* implementation.
|
|
@@ -33,7 +44,18 @@ export default function isCodecSupported(mimeType : string) : boolean {
|
|
|
33
44
|
/* eslint-disable @typescript-eslint/unbound-method */
|
|
34
45
|
if (typeof MediaSource_.isTypeSupported === "function") {
|
|
35
46
|
/* eslint-enable @typescript-eslint/unbound-method */
|
|
36
|
-
|
|
47
|
+
const cachedSupport = supportMap.get(mimeType);
|
|
48
|
+
if (cachedSupport !== undefined) {
|
|
49
|
+
return cachedSupport;
|
|
50
|
+
} else {
|
|
51
|
+
const isSupported = MediaSource_.isTypeSupported(mimeType);
|
|
52
|
+
if (supportMap.size >= MAX_SUPPORT_MAP_ENTRIES) {
|
|
53
|
+
supportMap.clear();
|
|
54
|
+
}
|
|
55
|
+
supportMap.set(mimeType, isSupported);
|
|
56
|
+
return isSupported;
|
|
57
|
+
}
|
|
58
|
+
|
|
37
59
|
}
|
|
38
60
|
|
|
39
61
|
return true;
|
|
@@ -30,7 +30,7 @@ import SharedReference, {
|
|
|
30
30
|
import TaskCanceller, {
|
|
31
31
|
CancellationSignal,
|
|
32
32
|
} from "../../utils/task_canceller";
|
|
33
|
-
import { IReadOnlyPlaybackObserver } from "../api";
|
|
33
|
+
import { IObservationPosition, IReadOnlyPlaybackObserver } from "../api";
|
|
34
34
|
import { IBufferType } from "../segment_buffers";
|
|
35
35
|
import BufferBasedChooser from "./buffer_based_chooser";
|
|
36
36
|
import GuessBasedChooser from "./guess_based_chooser";
|
|
@@ -272,7 +272,7 @@ function getEstimateReference(
|
|
|
272
272
|
}
|
|
273
273
|
const { position, speed } = lastPlaybackObservation;
|
|
274
274
|
const timeRanges = val.buffered;
|
|
275
|
-
const bufferGap = getLeftSizeOfBufferedTimeRange(timeRanges, position.
|
|
275
|
+
const bufferGap = getLeftSizeOfBufferedTimeRange(timeRanges, position.getWanted());
|
|
276
276
|
const { representation } = val.content;
|
|
277
277
|
const currentScore = scoreCalculator.getEstimate(representation);
|
|
278
278
|
const currentBitrate = representation.bitrate;
|
|
@@ -389,7 +389,7 @@ function getEstimateReference(
|
|
|
389
389
|
if (lowLatencyMode &&
|
|
390
390
|
currentRepresentationVal !== null &&
|
|
391
391
|
context.manifest.isDynamic &&
|
|
392
|
-
maximumPosition - position.
|
|
392
|
+
maximumPosition - position.getWanted() < 40)
|
|
393
393
|
{
|
|
394
394
|
chosenRepFromGuessMode = guessBasedChooser
|
|
395
395
|
.getGuess(sortedRepresentations,
|
|
@@ -595,24 +595,7 @@ export interface IRepresentationEstimatorPlaybackObservation {
|
|
|
595
595
|
* Information on the current media position in seconds at the time of a
|
|
596
596
|
* Playback Observation.
|
|
597
597
|
*/
|
|
598
|
-
position :
|
|
599
|
-
/**
|
|
600
|
-
* Known position at the time the Observation was emitted, in seconds.
|
|
601
|
-
*
|
|
602
|
-
* Note that it might have changed since. If you want truly precize
|
|
603
|
-
* information, you should recuperate it from the HTMLMediaElement directly
|
|
604
|
-
* through another mean.
|
|
605
|
-
*/
|
|
606
|
-
last : number;
|
|
607
|
-
/**
|
|
608
|
-
* Actually wanted position in seconds that is not yet reached.
|
|
609
|
-
*
|
|
610
|
-
* This might for example be set to the initial position when the content is
|
|
611
|
-
* loading (and thus potentially at a `0` position) but which will be seeked
|
|
612
|
-
* to a given position once possible.
|
|
613
|
-
*/
|
|
614
|
-
pending : number | undefined;
|
|
615
|
-
};
|
|
598
|
+
position : IObservationPosition;
|
|
616
599
|
/**
|
|
617
600
|
* Last "playback rate" set by the user. This is the ideal "playback rate" at
|
|
618
601
|
* which the media should play.
|
|
@@ -154,7 +154,7 @@ function estimateStarvationModeBitrate(
|
|
|
154
154
|
const { bufferGap, speed, position } = playbackInfo;
|
|
155
155
|
const realBufferGap = isFinite(bufferGap) ? bufferGap :
|
|
156
156
|
0;
|
|
157
|
-
const nextNeededPosition = position.
|
|
157
|
+
const nextNeededPosition = position.getWanted() + realBufferGap;
|
|
158
158
|
const concernedRequests = getConcernedRequests(pendingRequests, nextNeededPosition);
|
|
159
159
|
|
|
160
160
|
if (concernedRequests.length !== 1) { // 0 == no request
|
|
@@ -238,7 +238,7 @@ function shouldDirectlySwitchToLowBitrate(
|
|
|
238
238
|
}
|
|
239
239
|
const realBufferGap = isFinite(playbackInfo.bufferGap) ? playbackInfo.bufferGap :
|
|
240
240
|
0;
|
|
241
|
-
const nextNeededPosition = playbackInfo.position.
|
|
241
|
+
const nextNeededPosition = playbackInfo.position.getWanted() + realBufferGap;
|
|
242
242
|
const nextRequest = arrayFind(requests, ({ content }) =>
|
|
243
243
|
content.segment.duration > 0 &&
|
|
244
244
|
(content.segment.time + content.segment.duration) > nextNeededPosition);
|
|
@@ -334,7 +334,7 @@ export default class NetworkAnalyzer {
|
|
|
334
334
|
const { ABR_STARVATION_DURATION_DELTA } = config.getCurrent();
|
|
335
335
|
// check if should get in/out of starvation mode
|
|
336
336
|
if (isNaN(duration) ||
|
|
337
|
-
realBufferGap + position.
|
|
337
|
+
realBufferGap + position.getWanted() < duration - ABR_STARVATION_DURATION_DELTA)
|
|
338
338
|
{
|
|
339
339
|
if (!this._inStarvationMode && realBufferGap <= localConf.starvationGap) {
|
|
340
340
|
log.info("ABR: enter starvation mode.");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Representation } from "../../../manifest";
|
|
2
2
|
import { IBufferedChunk } from "../../segment_buffers";
|
|
3
3
|
|
|
4
|
-
const BUFFER_WIDTH_IN_SECONDS =
|
|
4
|
+
const BUFFER_WIDTH_IN_SECONDS = 30 * 60;
|
|
5
5
|
|
|
6
6
|
const COLORS = [
|
|
7
7
|
"#2ab7ca",
|
|
@@ -95,10 +95,7 @@ export default class SegmentBufferGraph {
|
|
|
95
95
|
let minimumPosition;
|
|
96
96
|
let maximumPosition;
|
|
97
97
|
if (maximumPoint - minimumPoint > BUFFER_WIDTH_IN_SECONDS) {
|
|
98
|
-
if (currentTime
|
|
99
|
-
minimumPosition = minimumPoint;
|
|
100
|
-
maximumPosition = maximumPoint;
|
|
101
|
-
} else if (maximumPoint - currentTime < BUFFER_WIDTH_IN_SECONDS / 2) {
|
|
98
|
+
if (maximumPoint - currentTime < BUFFER_WIDTH_IN_SECONDS / 2) {
|
|
102
99
|
maximumPosition = maximumPoint;
|
|
103
100
|
minimumPosition = maximumPoint - BUFFER_WIDTH_IN_SECONDS;
|
|
104
101
|
} else if (currentTime - minimumPoint < BUFFER_WIDTH_IN_SECONDS / 2) {
|
|
@@ -157,23 +157,28 @@ export default function constructDebugGeneralInfo(
|
|
|
157
157
|
]);
|
|
158
158
|
adaptationsElt.appendChild(textAdaps);
|
|
159
159
|
}
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
})
|
|
160
|
+
const adaptations = instance.__priv_getCurrentAdaptation();
|
|
161
|
+
const videoBitratesStr = adaptations?.video?.representations.map((r) => {
|
|
162
|
+
return String(r.bitrate ?? "N/A") +
|
|
163
|
+
(r.isSupported ? "" : " U!") +
|
|
164
|
+
(r.decipherable !== false ? "" : " E!");
|
|
165
|
+
}) ?? [];
|
|
166
|
+
const audioBitratesStr = adaptations?.video?.representations.map((r) => {
|
|
167
|
+
return String(r.bitrate ?? "N/A") +
|
|
168
|
+
(r.isSupported ? "" : " U!") +
|
|
169
|
+
(r.decipherable !== false ? "" : " E!");
|
|
170
|
+
}) ?? [];
|
|
166
171
|
representationsElt.innerHTML = "";
|
|
167
|
-
if (
|
|
172
|
+
if (videoBitratesStr.length > 0) {
|
|
168
173
|
representationsElt.appendChild(createMetricTitle("vb"));
|
|
169
174
|
representationsElt.appendChild(createElement("span", {
|
|
170
|
-
textContent:
|
|
175
|
+
textContent: videoBitratesStr.join(" ") + " ",
|
|
171
176
|
}));
|
|
172
177
|
}
|
|
173
|
-
if (
|
|
178
|
+
if (audioBitratesStr.length > 0) {
|
|
174
179
|
representationsElt.appendChild(createMetricTitle("ab"));
|
|
175
180
|
representationsElt.appendChild(createElement("span", {
|
|
176
|
-
textContent:
|
|
181
|
+
textContent: audioBitratesStr.join(" ") + " ",
|
|
177
182
|
}));
|
|
178
183
|
}
|
|
179
184
|
} else {
|
package/src/core/api/index.ts
CHANGED
|
@@ -42,6 +42,7 @@ export type IParsedStartAtOption = { position : number } |
|
|
|
42
42
|
{ wallClockTime : number } |
|
|
43
43
|
{ percentage : number } |
|
|
44
44
|
{ fromLastPosition : number } |
|
|
45
|
+
{ fromLivePosition : number } |
|
|
45
46
|
{ fromFirstPosition : number };
|
|
46
47
|
|
|
47
48
|
/** Options of the RxPlayer's constructor once parsed. */
|
|
@@ -383,9 +384,8 @@ function parseLoadVideoOptions(
|
|
|
383
384
|
}
|
|
384
385
|
|
|
385
386
|
if (!isNullOrUndefined(options.startAt)) {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
instanceof Date
|
|
387
|
+
if ("wallClockTime" in options.startAt
|
|
388
|
+
&& options.startAt.wallClockTime instanceof Date
|
|
389
389
|
) {
|
|
390
390
|
const wallClockTime = (options.startAt as { wallClockTime : Date })
|
|
391
391
|
.wallClockTime.getTime() / 1000;
|