rx-player 4.2.0-dev.2024090300 → 4.2.0-dev.2024090500
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 +1 -1
- package/VERSION +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/commonjs/compat/add_class_name.d.ts.map +1 -1
- package/dist/commonjs/compat/add_class_name.js +1 -2
- package/dist/commonjs/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/commonjs/compat/browser_compatibility_types.js +4 -1
- package/dist/commonjs/compat/clear_element_src.js +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
- package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
- package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
- package/dist/commonjs/compat/eme/eme-api-implementation.js +0 -2
- package/dist/commonjs/compat/event_listeners.d.ts.map +1 -1
- package/dist/commonjs/compat/event_listeners.js +2 -6
- package/dist/commonjs/compat/has_mse_in_worker.js +1 -1
- package/dist/commonjs/compat/is_codec_supported.d.ts.map +1 -1
- package/dist/commonjs/compat/is_codec_supported.js +0 -2
- package/dist/commonjs/compat/is_vtt_cue.d.ts.map +1 -1
- package/dist/commonjs/compat/is_vtt_cue.js +1 -2
- package/dist/commonjs/compat/on_height_width_change.d.ts.map +1 -1
- package/dist/commonjs/compat/patch_webkit_source_buffer.d.ts.map +1 -1
- package/dist/commonjs/compat/patch_webkit_source_buffer.js +8 -18
- package/dist/commonjs/compat/remove_cue.js +2 -2
- package/dist/commonjs/core/fetchers/index.d.ts +4 -4
- package/dist/commonjs/core/fetchers/index.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/index.js +2 -2
- package/dist/commonjs/core/fetchers/segment/index.d.ts +6 -5
- package/dist/commonjs/core/fetchers/segment/index.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/segment/index.js +2 -2
- package/dist/{es2017/core/stream/representation/utils/downloading_queue.d.ts → commonjs/core/fetchers/segment/segment_queue.d.ts} +63 -80
- package/dist/commonjs/core/fetchers/segment/segment_queue.d.ts.map +1 -0
- package/dist/commonjs/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +132 -111
- package/dist/commonjs/core/fetchers/segment/{segment_fetcher_creator.d.ts → segment_queue_creator.d.ts} +25 -12
- package/dist/commonjs/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
- package/dist/commonjs/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +15 -9
- package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts +9 -0
- package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/segment/task_prioritizer.js +38 -8
- package/dist/commonjs/core/fetchers/utils/schedule_request.js +1 -1
- package/dist/commonjs/core/main/common/content_time_boundaries_observer.js +21 -10
- package/dist/commonjs/core/main/worker/content_preparer.d.ts +3 -3
- package/dist/commonjs/core/main/worker/content_preparer.d.ts.map +1 -1
- package/dist/commonjs/core/main/worker/content_preparer.js +2 -2
- package/dist/commonjs/core/main/worker/send_message.js +1 -1
- package/dist/commonjs/core/main/worker/worker_main.js +2 -2
- package/dist/commonjs/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
- package/dist/commonjs/core/segment_sinks/inventory/segment_inventory.js +39 -30
- package/dist/commonjs/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
- package/dist/commonjs/core/segment_sinks/segment_buffers_store.js +3 -2
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +3 -3
- package/dist/commonjs/core/stream/adaptation/types.d.ts +2 -2
- package/dist/commonjs/core/stream/adaptation/types.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.js +27 -6
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +3 -3
- package/dist/commonjs/core/stream/period/period_stream.d.ts +1 -1
- package/dist/commonjs/core/stream/period/period_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/period/period_stream.js +2 -2
- package/dist/commonjs/core/stream/period/types.d.ts +2 -2
- package/dist/commonjs/core/stream/period/types.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.d.ts +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.js +19 -28
- package/dist/commonjs/core/stream/representation/types.d.ts +2 -2
- package/dist/commonjs/core/stream/representation/types.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +39 -18
- package/dist/commonjs/core/types.d.ts +2 -2
- package/dist/commonjs/core/types.d.ts.map +1 -1
- package/dist/commonjs/default_config.d.ts.map +1 -1
- package/dist/commonjs/default_config.js +0 -8
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
- package/dist/commonjs/features/add_features.d.ts.map +1 -1
- package/dist/commonjs/features/add_features.js +31 -10
- package/dist/commonjs/main_thread/api/option_utils.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/option_utils.js +2 -6
- package/dist/commonjs/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/public_api.js +33 -27
- package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.js +4 -3
- package/dist/commonjs/main_thread/init/media_source_content_initializer.js +6 -6
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +32 -37
- package/dist/commonjs/main_thread/text_displayer/html/html_text_displayer.js +1 -5
- package/dist/commonjs/main_thread/text_displayer/native/native_text_displayer.js +3 -7
- package/dist/commonjs/main_thread/tracks_store/track_dispatcher.js +1 -1
- package/dist/commonjs/main_thread/types.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/manifest.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/manifest.js +0 -6
- package/dist/commonjs/manifest/utils.d.ts.map +1 -1
- package/dist/commonjs/manifest/utils.js +72 -62
- package/dist/commonjs/mse/main_media_source_interface.js +1 -1
- package/dist/commonjs/multithread_types.d.ts +2 -2
- package/dist/commonjs/multithread_types.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
- package/dist/commonjs/parsers/manifest/local/representation_index.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/local/representation_index.js +29 -8
- package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.js +31 -10
- package/dist/commonjs/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/smooth/create_parser.js +2 -1
- package/dist/commonjs/parsers/manifest/smooth/shared_smooth_segment_timeline.js +26 -4
- package/dist/commonjs/parsers/manifest/utils/get_first_time_from_adaptation.js +29 -7
- package/dist/commonjs/parsers/manifest/utils/get_last_time_from_adaptation.js +29 -7
- package/dist/commonjs/parsers/texttracks/srt/html.js +28 -6
- package/dist/commonjs/parsers/texttracks/ttml/html/create_element.js +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/html/parse_ttml_to_div.js +29 -7
- package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +26 -5
- package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.js +25 -4
- package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
- package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.js +9 -3
- package/dist/commonjs/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +30 -8
- package/dist/commonjs/public_types.d.ts +5 -7
- package/dist/commonjs/public_types.d.ts.map +1 -1
- package/dist/commonjs/transports/smooth/extract_timings_infos.js +30 -8
- package/dist/commonjs/utils/array_find.d.ts +1 -1
- package/dist/commonjs/utils/array_find.d.ts.map +1 -1
- package/dist/commonjs/utils/array_find.js +3 -1
- package/dist/commonjs/utils/array_find_index.d.ts +1 -1
- package/dist/commonjs/utils/array_find_index.d.ts.map +1 -1
- package/dist/commonjs/utils/array_find_index.js +3 -1
- package/dist/commonjs/utils/array_includes.d.ts.map +1 -1
- package/dist/commonjs/utils/array_includes.js +1 -3
- package/dist/commonjs/utils/assert.d.ts.map +1 -1
- package/dist/commonjs/utils/assert.js +0 -2
- package/dist/commonjs/utils/base64.d.ts +1 -1
- package/dist/commonjs/utils/base64.d.ts.map +1 -1
- package/dist/commonjs/utils/base64.js +3 -2
- package/dist/commonjs/utils/event_emitter.js +1 -1
- package/dist/commonjs/utils/flat_map.d.ts.map +1 -1
- package/dist/commonjs/utils/flat_map.js +1 -2
- package/dist/commonjs/utils/id_generator.d.ts.map +1 -1
- package/dist/commonjs/utils/id_generator.js +0 -1
- package/dist/commonjs/utils/logger.js +1 -1
- package/dist/commonjs/utils/monotonic_timestamp.js +2 -2
- package/dist/commonjs/utils/noop.js +1 -2
- package/dist/commonjs/utils/object_assign.d.ts.map +1 -1
- package/dist/commonjs/utils/object_assign.js +27 -6
- package/dist/commonjs/utils/object_values.d.ts.map +1 -1
- package/dist/commonjs/utils/object_values.js +1 -1
- package/dist/commonjs/utils/reference.js +1 -1
- package/dist/commonjs/utils/request/xhr.js +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/es2017/compat/add_class_name.d.ts.map +1 -1
- package/dist/es2017/compat/add_class_name.js +1 -2
- package/dist/es2017/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/es2017/compat/browser_compatibility_types.js +4 -1
- package/dist/es2017/compat/clear_element_src.js +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
- package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
- package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
- package/dist/es2017/compat/eme/eme-api-implementation.js +0 -2
- package/dist/es2017/compat/event_listeners.d.ts.map +1 -1
- package/dist/es2017/compat/event_listeners.js +2 -6
- package/dist/es2017/compat/has_mse_in_worker.js +1 -1
- package/dist/es2017/compat/is_codec_supported.d.ts.map +1 -1
- package/dist/es2017/compat/is_codec_supported.js +0 -2
- package/dist/es2017/compat/is_vtt_cue.d.ts.map +1 -1
- package/dist/es2017/compat/is_vtt_cue.js +1 -2
- package/dist/es2017/compat/on_height_width_change.d.ts.map +1 -1
- package/dist/es2017/compat/patch_webkit_source_buffer.d.ts.map +1 -1
- package/dist/es2017/compat/patch_webkit_source_buffer.js +8 -18
- package/dist/es2017/compat/remove_cue.js +2 -2
- package/dist/es2017/core/fetchers/index.d.ts +4 -4
- package/dist/es2017/core/fetchers/index.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/index.js +2 -2
- package/dist/es2017/core/fetchers/segment/index.d.ts +6 -5
- package/dist/es2017/core/fetchers/segment/index.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/segment/index.js +2 -2
- package/dist/{commonjs/core/stream/representation/utils/downloading_queue.d.ts → es2017/core/fetchers/segment/segment_queue.d.ts} +63 -80
- package/dist/es2017/core/fetchers/segment/segment_queue.d.ts.map +1 -0
- package/dist/es2017/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +126 -105
- package/dist/es2017/core/fetchers/segment/{segment_fetcher_creator.d.ts → segment_queue_creator.d.ts} +25 -12
- package/dist/es2017/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
- package/dist/es2017/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +12 -6
- package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts +9 -0
- package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/segment/task_prioritizer.js +10 -2
- package/dist/es2017/core/fetchers/utils/schedule_request.js +1 -1
- package/dist/es2017/core/main/common/content_time_boundaries_observer.js +4 -4
- package/dist/es2017/core/main/worker/content_preparer.d.ts +3 -3
- package/dist/es2017/core/main/worker/content_preparer.d.ts.map +1 -1
- package/dist/es2017/core/main/worker/content_preparer.js +3 -3
- package/dist/es2017/core/main/worker/send_message.js +1 -1
- package/dist/es2017/core/main/worker/worker_main.js +2 -2
- package/dist/es2017/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
- package/dist/es2017/core/segment_sinks/inventory/segment_inventory.js +1 -2
- package/dist/es2017/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
- package/dist/es2017/core/segment_sinks/segment_buffers_store.js +3 -2
- package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.js +3 -3
- package/dist/es2017/core/stream/adaptation/types.d.ts +2 -2
- package/dist/es2017/core/stream/adaptation/types.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.js +1 -2
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +3 -3
- package/dist/es2017/core/stream/period/period_stream.d.ts +1 -1
- package/dist/es2017/core/stream/period/period_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/period/period_stream.js +2 -2
- package/dist/es2017/core/stream/period/types.d.ts +2 -2
- package/dist/es2017/core/stream/period/types.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.d.ts +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.js +19 -28
- package/dist/es2017/core/stream/representation/types.d.ts +2 -2
- package/dist/es2017/core/stream/representation/types.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +1 -2
- package/dist/es2017/core/types.d.ts +2 -2
- package/dist/es2017/core/types.d.ts.map +1 -1
- package/dist/es2017/default_config.d.ts.map +1 -1
- package/dist/es2017/default_config.js +0 -8
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
- package/dist/es2017/features/add_features.d.ts.map +1 -1
- package/dist/es2017/features/add_features.js +1 -2
- package/dist/es2017/main_thread/api/option_utils.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/option_utils.js +2 -6
- package/dist/es2017/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/public_api.js +29 -23
- package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.js +2 -1
- package/dist/es2017/main_thread/init/media_source_content_initializer.js +6 -6
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.js +7 -12
- package/dist/es2017/main_thread/text_displayer/html/html_text_displayer.js +1 -5
- package/dist/es2017/main_thread/text_displayer/native/native_text_displayer.js +3 -7
- package/dist/es2017/main_thread/tracks_store/track_dispatcher.js +1 -1
- package/dist/es2017/main_thread/types.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/manifest.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/manifest.js +0 -6
- package/dist/es2017/manifest/utils.d.ts.map +1 -1
- package/dist/es2017/manifest/utils.js +1 -2
- package/dist/es2017/mse/main_media_source_interface.js +1 -1
- package/dist/es2017/multithread_types.d.ts +2 -2
- package/dist/es2017/multithread_types.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +1 -2
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
- package/dist/es2017/parsers/manifest/local/representation_index.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/local/representation_index.js +1 -2
- package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.js +2 -3
- package/dist/es2017/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/smooth/create_parser.js +2 -1
- package/dist/es2017/parsers/manifest/smooth/shared_smooth_segment_timeline.js +2 -2
- package/dist/es2017/parsers/manifest/utils/get_first_time_from_adaptation.js +2 -2
- package/dist/es2017/parsers/manifest/utils/get_last_time_from_adaptation.js +2 -2
- package/dist/es2017/parsers/texttracks/srt/html.js +2 -2
- package/dist/es2017/parsers/texttracks/ttml/html/create_element.js +1 -1
- package/dist/es2017/parsers/texttracks/ttml/html/parse_ttml_to_div.js +3 -3
- package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +1 -2
- package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.js +1 -2
- package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
- package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/webvtt/html/to_html.js +9 -3
- package/dist/es2017/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +2 -2
- package/dist/es2017/public_types.d.ts +5 -7
- package/dist/es2017/public_types.d.ts.map +1 -1
- package/dist/es2017/transports/smooth/extract_timings_infos.js +3 -3
- package/dist/es2017/utils/array_find.d.ts +1 -1
- package/dist/es2017/utils/array_find.d.ts.map +1 -1
- package/dist/es2017/utils/array_find.js +3 -1
- package/dist/es2017/utils/array_find_index.d.ts +1 -1
- package/dist/es2017/utils/array_find_index.d.ts.map +1 -1
- package/dist/es2017/utils/array_find_index.js +3 -1
- package/dist/es2017/utils/array_includes.d.ts.map +1 -1
- package/dist/es2017/utils/array_includes.js +1 -3
- package/dist/es2017/utils/assert.d.ts.map +1 -1
- package/dist/es2017/utils/assert.js +0 -2
- package/dist/es2017/utils/base64.d.ts +1 -1
- package/dist/es2017/utils/base64.d.ts.map +1 -1
- package/dist/es2017/utils/base64.js +3 -2
- package/dist/es2017/utils/event_emitter.js +1 -1
- package/dist/es2017/utils/flat_map.d.ts.map +1 -1
- package/dist/es2017/utils/flat_map.js +1 -2
- package/dist/es2017/utils/id_generator.d.ts.map +1 -1
- package/dist/es2017/utils/id_generator.js +0 -1
- package/dist/es2017/utils/logger.js +1 -1
- package/dist/es2017/utils/monotonic_timestamp.js +2 -2
- package/dist/es2017/utils/noop.js +1 -2
- package/dist/es2017/utils/object_assign.d.ts.map +1 -1
- package/dist/es2017/utils/object_assign.js +1 -2
- package/dist/es2017/utils/object_values.d.ts.map +1 -1
- package/dist/es2017/utils/object_values.js +1 -2
- package/dist/es2017/utils/reference.js +1 -1
- package/dist/es2017/utils/request/xhr.js +1 -1
- package/dist/rx-player.js +39336 -18
- package/dist/rx-player.min.js +18 -0
- package/dist/worker.js +5 -5
- package/package.json +16 -9
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/compat/__tests__/add_text_track.test.ts +8 -12
- package/src/compat/__tests__/browser_compatibility_types.test.ts +0 -7
- package/src/compat/__tests__/browser_version.test.ts +20 -19
- package/src/compat/__tests__/can_patch_isobmff.test.ts +7 -10
- package/src/compat/__tests__/can_rely_on_video_visibility_and_size.test.ts +17 -21
- package/src/compat/__tests__/can_reuse_media_keys.test.ts +13 -21
- package/src/compat/__tests__/clear_element_src.test.ts +37 -34
- package/src/compat/__tests__/enable_audio_track.test.ts +22 -21
- package/src/compat/__tests__/is_codec_supported.test.ts +17 -18
- package/src/compat/__tests__/is_seeking_approximate.test.ts +8 -14
- package/src/compat/__tests__/is_vtt_cue.test.ts +8 -13
- package/src/compat/__tests__/make_vtt_cue.test.ts +7 -12
- package/src/compat/__tests__/patch_webkit_source_buffer.test.ts +44 -32
- package/src/compat/__tests__/remove_cue.test.ts +30 -31
- package/src/compat/__tests__/should_favour_custom_safari_EME.test.ts +21 -26
- package/src/compat/__tests__/should_renew_media_key_system_access.test.ts +9 -17
- package/src/compat/__tests__/should_unset_media_keys.test.ts +7 -14
- package/src/compat/__tests__/should_validate_metadata.test.ts +7 -17
- package/src/compat/__tests__/should_wait_for_data_before_loaded.test.ts +17 -26
- package/src/compat/__tests__/should_wait_for_have_enough_data.test.ts +10 -15
- package/src/compat/add_class_name.ts +1 -2
- package/src/compat/browser_compatibility_types.ts +4 -2
- package/src/compat/clear_element_src.ts +1 -1
- package/src/compat/eme/custom_media_keys/moz_media_keys_constructor.ts +1 -2
- package/src/compat/eme/custom_media_keys/ms_media_keys_constructor.ts +1 -2
- package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +3 -6
- package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +2 -17
- package/src/compat/eme/custom_media_keys/webkit_media_keys_constructor.ts +1 -4
- package/src/compat/eme/eme-api-implementation.ts +0 -2
- package/src/compat/event_listeners.ts +2 -6
- package/src/compat/has_mse_in_worker.ts +1 -1
- package/src/compat/is_codec_supported.ts +0 -2
- package/src/compat/is_debug_mode_enabled.ts +1 -1
- package/src/compat/is_vtt_cue.ts +1 -2
- package/src/compat/on_height_width_change.ts +1 -2
- package/src/compat/patch_webkit_source_buffer.ts +48 -29
- package/src/compat/remove_cue.ts +2 -2
- package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +21 -26
- package/src/core/fetchers/README.md +13 -12
- package/src/core/fetchers/index.ts +5 -8
- package/src/core/fetchers/segment/__tests__/task_prioritizer.test.ts +17 -23
- package/src/core/fetchers/segment/index.ts +6 -5
- package/src/core/{stream/representation/utils/downloading_queue.ts → fetchers/segment/segment_queue.ts} +204 -166
- package/src/core/fetchers/segment/{segment_fetcher_creator.ts → segment_queue_creator.ts} +31 -14
- package/src/core/fetchers/segment/task_prioritizer.ts +10 -2
- package/src/core/fetchers/utils/schedule_request.ts +1 -1
- package/src/core/main/common/content_time_boundaries_observer.ts +4 -4
- package/src/core/main/worker/content_preparer.ts +5 -5
- package/src/core/main/worker/send_message.ts +1 -1
- package/src/core/main/worker/worker_main.ts +2 -2
- package/src/core/segment_sinks/implementations/text/text_segment_buffer.ts +1 -5
- package/src/core/segment_sinks/inventory/segment_inventory.ts +1 -2
- package/src/core/segment_sinks/segment_buffers_store.ts +3 -2
- package/src/core/stream/adaptation/adaptation_stream.ts +3 -3
- package/src/core/stream/adaptation/types.ts +2 -2
- package/src/core/stream/orchestrator/get_time_ranges_for_content.ts +1 -2
- package/src/core/stream/orchestrator/stream_orchestrator.ts +4 -4
- package/src/core/stream/period/period_stream.ts +2 -2
- package/src/core/stream/period/types.ts +2 -2
- package/src/core/stream/representation/representation_stream.ts +59 -56
- package/src/core/stream/representation/types.ts +3 -4
- package/src/core/stream/representation/utils/get_needed_segments.ts +1 -2
- package/src/core/types.ts +2 -4
- package/src/default_config.ts +0 -8
- package/src/errors/__tests__/format_error.test.ts +18 -18
- package/src/experimental/features/__tests__/multi_thread.test.ts +5 -5
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/capabilities.test.ts +11 -11
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +18 -26
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +13 -21
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/decodingInfos.test.ts +24 -20
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/defaultCodecFinder.test.ts +28 -30
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaContentType.test.ts +32 -38
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +64 -51
- package/src/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.ts +4 -17
- package/src/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.ts +0 -4
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.ts +1 -2
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts +16 -14
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +1 -2
- package/src/features/__tests__/add_features.test.ts +12 -11
- package/src/features/add_features.ts +1 -2
- package/src/features/list/__tests__/dash_wasm.test.ts +4 -4
- package/src/main_thread/api/__tests__/option_utils.test.ts +114 -70
- package/src/main_thread/api/__tests__/public_api.test.ts +85 -48
- package/src/main_thread/api/option_utils.ts +2 -6
- package/src/main_thread/api/public_api.ts +24 -18
- package/src/main_thread/decrypt/__tests__/__global__/get_license.test.ts +12 -18
- package/src/main_thread/decrypt/__tests__/__global__/init_data.test.ts +128 -101
- package/src/main_thread/decrypt/__tests__/__global__/media_key_system_access.test.ts +26 -33
- package/src/main_thread/decrypt/__tests__/__global__/media_keys.test.ts +46 -48
- package/src/main_thread/decrypt/__tests__/__global__/server_certificate.test.ts +33 -34
- package/src/main_thread/decrypt/__tests__/__global__/utils.ts +13 -17
- package/src/main_thread/decrypt/session_events_listener.ts +1 -1
- package/src/main_thread/decrypt/utils/__tests__/clean_old_loaded_sessions.test.ts +0 -5
- package/src/main_thread/decrypt/utils/__tests__/clean_old_stored_persistent_info.test.ts +14 -17
- package/src/main_thread/decrypt/utils/persistent_sessions_store.ts +2 -1
- package/src/main_thread/init/media_source_content_initializer.ts +7 -7
- package/src/main_thread/init/multi_thread_content_initializer.ts +7 -12
- package/src/main_thread/init/utils/__tests__/are_same_stream_events.test.ts +11 -16
- package/src/main_thread/init/utils/__tests__/refresh_scheduled_events_list.test.ts +48 -18
- package/src/main_thread/text_displayer/html/__tests__/text_track_cues_store.test.ts +32 -17
- package/src/main_thread/text_displayer/html/html_text_displayer.ts +1 -5
- package/src/main_thread/text_displayer/native/native_text_displayer.ts +3 -7
- package/src/main_thread/tracks_store/__tests__/media_element_tracks_store.test.ts +33 -28
- package/src/main_thread/tracks_store/track_dispatcher.ts +1 -1
- package/src/main_thread/types.ts +0 -1
- package/src/manifest/classes/__tests__/adaptation.test.ts +167 -62
- package/src/manifest/classes/__tests__/manifest.test.ts +130 -74
- package/src/manifest/classes/__tests__/period.test.ts +293 -211
- package/src/manifest/classes/__tests__/update_period_in_place.test.ts +0 -2
- package/src/manifest/classes/__tests__/update_periods.test.ts +57 -57
- package/src/manifest/classes/manifest.ts +0 -6
- package/src/manifest/utils.ts +1 -2
- package/src/mse/main_media_source_interface.ts +1 -1
- package/src/mse/types.ts +1 -1
- package/src/multithread_types.ts +2 -2
- package/src/parsers/manifest/dash/common/__tests__/get_clock_offset.test.ts +5 -10
- package/src/parsers/manifest/dash/common/__tests__/get_http_utc-timing_url.test.ts +38 -30
- package/src/parsers/manifest/dash/common/__tests__/get_periods_time_infos.test.ts +0 -3
- package/src/parsers/manifest/dash/common/indexes/timeline/parse_s_element.ts +12 -6
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.ts +14 -7
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.ts +8 -4
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Period.ts +10 -5
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.ts +10 -5
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
- package/src/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.ts +14 -7
- package/src/parsers/manifest/dash/native-parser/node_parsers/EventStream.ts +2 -1
- package/src/parsers/manifest/dash/native-parser/node_parsers/MPD.ts +8 -4
- package/src/parsers/manifest/dash/native-parser/node_parsers/Period.ts +10 -5
- package/src/parsers/manifest/dash/native-parser/node_parsers/Representation.ts +10 -5
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentTimeline.test.ts +9 -14
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
- package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +1 -2
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.ts +2 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.ts +2 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.ts +4 -2
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/MPD.ts +10 -5
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/Period.ts +2 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/root.ts +2 -1
- package/src/parsers/manifest/local/representation_index.ts +1 -2
- package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +2 -3
- package/src/parsers/manifest/smooth/create_parser.ts +2 -1
- package/src/parsers/manifest/smooth/shared_smooth_segment_timeline.ts +2 -2
- package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +3 -8
- package/src/parsers/manifest/utils/get_first_time_from_adaptation.ts +2 -2
- package/src/parsers/manifest/utils/get_last_time_from_adaptation.ts +2 -2
- package/src/parsers/texttracks/srt/html.ts +2 -2
- package/src/parsers/texttracks/ttml/__tests__/resolve_styles_inheritance.test.ts +3 -7
- package/src/parsers/texttracks/ttml/html/__tests__/__global__/html_ttml_parser.test.ts +4 -4
- package/src/parsers/texttracks/ttml/html/create_element.ts +1 -1
- package/src/parsers/texttracks/ttml/html/parse_ttml_to_div.ts +3 -3
- package/src/parsers/texttracks/ttml/native/parse_ttml_to_vtt.ts +1 -2
- package/src/parsers/texttracks/ttml/resolve_styles_inheritance.ts +1 -2
- package/src/parsers/texttracks/webvtt/__tests__/parse_cue_block.test.ts +11 -11
- package/src/parsers/texttracks/webvtt/html/__tests__/convert_payload_to_html.test.ts +5 -18
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_style_block.test.ts +23 -28
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_webvtt_to_div.test.ts +9 -14
- package/src/parsers/texttracks/webvtt/html/__tests__/to_html.test.ts +11 -11
- package/src/parsers/texttracks/webvtt/html/to_html.ts +9 -3
- package/src/parsers/texttracks/webvtt/native/parse_vtt_to_cues.ts +2 -2
- package/src/public_types.ts +7 -8
- package/src/tools/TextTrackRenderer/text_track_renderer.ts +1 -1
- package/src/transports/smooth/extract_timings_infos.ts +3 -3
- package/src/transports/smooth/isobmff/__tests__/create_boxes.test.ts +30 -28
- package/src/transports/utils/__tests__/check_isobmff_integrity.test.ts +38 -44
- package/src/utils/__tests__/array_find.test.ts +12 -12
- package/src/utils/__tests__/array_find_index.test.ts +13 -12
- package/src/utils/__tests__/array_includes.test.ts +7 -7
- package/src/utils/__tests__/assert.test.ts +19 -25
- package/src/utils/__tests__/base64.test.ts +18 -13
- package/src/utils/__tests__/event_emitter.test.ts +225 -50
- package/src/utils/__tests__/flat_map.test.ts +2 -6
- package/src/utils/__tests__/starts_with.test.ts +7 -8
- package/src/utils/array_find.ts +3 -7
- package/src/utils/array_find_index.ts +3 -7
- package/src/utils/array_includes.ts +1 -3
- package/src/utils/assert.ts +0 -2
- package/src/utils/base64.ts +3 -2
- package/src/utils/event_emitter.ts +1 -1
- package/src/utils/flat_map.ts +1 -2
- package/src/utils/id_generator.ts +0 -2
- package/src/utils/is_worker.ts +1 -1
- package/src/utils/logger.ts +1 -1
- package/src/utils/monotonic_timestamp.ts +2 -2
- package/src/utils/noop.ts +1 -2
- package/src/utils/object_assign.ts +1 -2
- package/src/utils/object_values.ts +1 -2
- package/src/utils/reference.ts +1 -1
- package/src/utils/request/xhr.ts +1 -1
- package/dist/commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
- package/dist/commonjs/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
- package/dist/es2017/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
- package/dist/es2017/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
|
@@ -20,26 +20,26 @@ import type { CancellationSignal } from "../../../utils/task_canceller";
|
|
|
20
20
|
import type CmcdDataBuilder from "../../cmcd";
|
|
21
21
|
import type { IBufferType } from "../../segment_sinks";
|
|
22
22
|
import CdnPrioritizer from "../cdn_prioritizer";
|
|
23
|
-
import type { IPrioritizedSegmentFetcher } from "./prioritized_segment_fetcher";
|
|
24
23
|
import applyPrioritizerToSegmentFetcher from "./prioritized_segment_fetcher";
|
|
25
24
|
import type { ISegmentFetcherLifecycleCallbacks } from "./segment_fetcher";
|
|
26
25
|
import createSegmentFetcher, { getSegmentFetcherRequestOptions } from "./segment_fetcher";
|
|
26
|
+
import SegmentQueue from "./segment_queue";
|
|
27
27
|
import TaskPrioritizer from "./task_prioritizer";
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Interact with the transport pipelines to download segments with the right
|
|
31
31
|
* priority.
|
|
32
32
|
*
|
|
33
|
-
* @class
|
|
33
|
+
* @class SegmentQueueCreator
|
|
34
34
|
*/
|
|
35
|
-
export default class
|
|
35
|
+
export default class SegmentQueueCreator {
|
|
36
36
|
/**
|
|
37
37
|
* Transport pipelines of the currently choosen streaming protocol (e.g. DASH,
|
|
38
38
|
* Smooth etc.).
|
|
39
39
|
*/
|
|
40
40
|
private readonly _transport: ITransportPipelines;
|
|
41
41
|
/**
|
|
42
|
-
* `TaskPrioritizer` linked to this
|
|
42
|
+
* `TaskPrioritizer` linked to this SegmentQueueCreator.
|
|
43
43
|
*
|
|
44
44
|
* Note: this is typed as `any` because segment loaders / parsers can use
|
|
45
45
|
* different types depending on the type of buffer. We could maybe be smarter
|
|
@@ -48,22 +48,25 @@ export default class SegmentFetcherCreator {
|
|
|
48
48
|
*/
|
|
49
49
|
private readonly _prioritizer: TaskPrioritizer<void>;
|
|
50
50
|
/**
|
|
51
|
-
* Options used by the
|
|
51
|
+
* Options used by the SegmentQueueCreator, e.g. to allow configuration on
|
|
52
52
|
* segment retries (number of retries maximum, default delay and so on).
|
|
53
53
|
*/
|
|
54
|
-
private readonly _backoffOptions:
|
|
54
|
+
private readonly _backoffOptions: ISegmentQueueCreatorBackoffOptions;
|
|
55
55
|
|
|
56
|
+
/** Class allowing to select a CDN when multiple are available for a given resource. */
|
|
56
57
|
private readonly _cdnPrioritizer: CdnPrioritizer;
|
|
57
58
|
|
|
58
59
|
private _cmcdDataBuilder: CmcdDataBuilder | null;
|
|
59
60
|
|
|
60
61
|
/**
|
|
61
62
|
* @param {Object} transport
|
|
63
|
+
* @param {Object} options
|
|
64
|
+
* @param {Object} cancelSignal
|
|
62
65
|
*/
|
|
63
66
|
constructor(
|
|
64
67
|
transport: ITransportPipelines,
|
|
65
68
|
cmcdDataBuilder: CmcdDataBuilder | null,
|
|
66
|
-
options:
|
|
69
|
+
options: ISegmentQueueCreatorBackoffOptions,
|
|
67
70
|
cancelSignal: CancellationSignal,
|
|
68
71
|
) {
|
|
69
72
|
const cdnPrioritizer = new CdnPrioritizer(cancelSignal);
|
|
@@ -82,16 +85,18 @@ export default class SegmentFetcherCreator {
|
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
/**
|
|
85
|
-
* Create a
|
|
88
|
+
* Create a `SegmentQueue`, allowing to easily perform segment requests.
|
|
86
89
|
* @param {string} bufferType - The type of buffer concerned (e.g. "audio",
|
|
87
90
|
* "video", etc.)
|
|
88
91
|
* @param {Object} eventListeners
|
|
89
|
-
* @returns {Object}
|
|
92
|
+
* @returns {Object} - `SegmentQueue`, which is an abstraction allowing to
|
|
93
|
+
* perform a queue of segment requests for a given media type (here defined by
|
|
94
|
+
* `bufferType`) with associated priorities.
|
|
90
95
|
*/
|
|
91
|
-
|
|
96
|
+
public createSegmentQueue(
|
|
92
97
|
bufferType: IBufferType,
|
|
93
98
|
eventListeners: ISegmentFetcherLifecycleCallbacks,
|
|
94
|
-
):
|
|
99
|
+
): SegmentQueue<unknown> {
|
|
95
100
|
const requestOptions = getSegmentFetcherRequestOptions(this._backoffOptions);
|
|
96
101
|
const pipelines = this._transport[bufferType];
|
|
97
102
|
|
|
@@ -104,12 +109,16 @@ export default class SegmentFetcherCreator {
|
|
|
104
109
|
eventListeners,
|
|
105
110
|
requestOptions,
|
|
106
111
|
});
|
|
107
|
-
|
|
112
|
+
const prioritizedSegmentFetcher = applyPrioritizerToSegmentFetcher(
|
|
113
|
+
this._prioritizer,
|
|
114
|
+
segmentFetcher,
|
|
115
|
+
);
|
|
116
|
+
return new SegmentQueue(prioritizedSegmentFetcher);
|
|
108
117
|
}
|
|
109
118
|
}
|
|
110
119
|
|
|
111
|
-
/** Options used by the `
|
|
112
|
-
export interface
|
|
120
|
+
/** Options used by the `SegmentQueueCreator`. */
|
|
121
|
+
export interface ISegmentQueueCreatorBackoffOptions {
|
|
113
122
|
/**
|
|
114
123
|
* Whether the content is played in a low-latency mode.
|
|
115
124
|
* This has an impact on default backoff delays.
|
|
@@ -124,5 +133,13 @@ export interface ISegmentFetcherCreatorBackoffOptions {
|
|
|
124
133
|
* `undefined` will lead to a default, large, timeout being used.
|
|
125
134
|
*/
|
|
126
135
|
requestTimeout: number | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Timeout for just the "connection" part of the request, before data is
|
|
138
|
+
* actually being transferred.
|
|
139
|
+
*
|
|
140
|
+
* Setting a lower `connectionTimeout` than a `requestTimeout` allows to
|
|
141
|
+
* fail faster without having to take into account a potentially low
|
|
142
|
+
* bandwidth.
|
|
143
|
+
*/
|
|
127
144
|
connectionTimeout: number | undefined;
|
|
128
145
|
}
|
|
@@ -4,6 +4,15 @@ import createCancellablePromise from "../../../utils/create_cancellable_promise"
|
|
|
4
4
|
import type { CancellationSignal } from "../../../utils/task_canceller";
|
|
5
5
|
import TaskCanceller, { CancellationError } from "../../../utils/task_canceller";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Utilitary class which allows to perform multiple tasks at once each with an
|
|
9
|
+
* associated priority.
|
|
10
|
+
*
|
|
11
|
+
* This class will then schedule the given tasks in the right order based on the
|
|
12
|
+
* priorities.
|
|
13
|
+
*
|
|
14
|
+
* @class TaskPrioritizer
|
|
15
|
+
*/
|
|
7
16
|
export default class TaskPrioritizer<T> {
|
|
8
17
|
/**
|
|
9
18
|
* Priority of the most prioritary task currently running.
|
|
@@ -287,8 +296,7 @@ export default class TaskPrioritizer<T> {
|
|
|
287
296
|
* `this._prioritySteps.low`).
|
|
288
297
|
*/
|
|
289
298
|
private _interruptCancellableTasks(): void {
|
|
290
|
-
for (
|
|
291
|
-
const pendingObj = this._pendingTasks[i];
|
|
299
|
+
for (const pendingObj of this._pendingTasks) {
|
|
292
300
|
if (pendingObj.priority >= this._prioritySteps.low) {
|
|
293
301
|
this._interruptPendingTask(pendingObj);
|
|
294
302
|
|
|
@@ -310,7 +310,7 @@ export async function scheduleRequestWithCdns<T>(
|
|
|
310
310
|
const canceller = new TaskCanceller();
|
|
311
311
|
const unlinkCanceller = canceller.linkToSignal(cancellationSignal);
|
|
312
312
|
return new Promise<T>((res, rej) => {
|
|
313
|
-
|
|
313
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
314
314
|
cdnPrioritizer?.addEventListener(
|
|
315
315
|
"priorityChange",
|
|
316
316
|
() => {
|
|
@@ -616,10 +616,10 @@ function getEndingPositionFromAdaptation(
|
|
|
616
616
|
* This variable allows to optimize the logic here when this is the case.
|
|
617
617
|
*/
|
|
618
618
|
let lastIndex: IRepresentationIndex | undefined;
|
|
619
|
-
for (
|
|
620
|
-
if (
|
|
621
|
-
lastIndex =
|
|
622
|
-
const lastPosition =
|
|
619
|
+
for (const representation of representations) {
|
|
620
|
+
if (representation.index !== lastIndex) {
|
|
621
|
+
lastIndex = representation.index;
|
|
622
|
+
const lastPosition = representation.index.getEnd();
|
|
623
623
|
if (lastPosition === undefined) {
|
|
624
624
|
// we cannot tell
|
|
625
625
|
return undefined;
|
|
@@ -23,7 +23,7 @@ import type { IRepresentationEstimator } from "../../adaptive";
|
|
|
23
23
|
import createAdaptiveRepresentationSelector from "../../adaptive";
|
|
24
24
|
import CmcdDataBuilder from "../../cmcd";
|
|
25
25
|
import type { IManifestRefreshSettings } from "../../fetchers";
|
|
26
|
-
import { ManifestFetcher,
|
|
26
|
+
import { ManifestFetcher, SegmentQueueCreator } from "../../fetchers";
|
|
27
27
|
import SegmentSinksStore from "../../segment_sinks";
|
|
28
28
|
import type { INeedsMediaSourceReloadPayload } from "../../stream";
|
|
29
29
|
import DecipherabilityFreezeDetector from "../common/DecipherabilityFreezeDetector";
|
|
@@ -129,7 +129,7 @@ export default class ContentPreparer {
|
|
|
129
129
|
},
|
|
130
130
|
);
|
|
131
131
|
|
|
132
|
-
const
|
|
132
|
+
const segmentQueueCreator = new SegmentQueueCreator(
|
|
133
133
|
dashPipelines,
|
|
134
134
|
cmcdDataBuilder,
|
|
135
135
|
context.segmentRetryOptions,
|
|
@@ -160,7 +160,7 @@ export default class ContentPreparer {
|
|
|
160
160
|
manifestFetcher,
|
|
161
161
|
representationEstimator,
|
|
162
162
|
segmentSinksStore,
|
|
163
|
-
|
|
163
|
+
segmentQueueCreator,
|
|
164
164
|
workerTextSender,
|
|
165
165
|
trackChoiceSetter,
|
|
166
166
|
};
|
|
@@ -359,10 +359,10 @@ export interface IPreparedContentData {
|
|
|
359
359
|
/** Allows to send timed text media data so it can be rendered. */
|
|
360
360
|
workerTextSender: WorkerTextDisplayerInterface | null;
|
|
361
361
|
/**
|
|
362
|
-
* Allows to create `
|
|
362
|
+
* Allows to create `SegmentQueue` which simplifies complex media segment
|
|
363
363
|
* fetching.
|
|
364
364
|
*/
|
|
365
|
-
|
|
365
|
+
segmentQueueCreator: SegmentQueueCreator;
|
|
366
366
|
/**
|
|
367
367
|
* Allows to store and update the wanted tracks and Representation inside that
|
|
368
368
|
* track.
|
|
@@ -511,7 +511,7 @@ function loadOrReloadPreparedContent(
|
|
|
511
511
|
mediaSource,
|
|
512
512
|
representationEstimator,
|
|
513
513
|
segmentSinksStore,
|
|
514
|
-
|
|
514
|
+
segmentQueueCreator,
|
|
515
515
|
} = preparedContent;
|
|
516
516
|
const { drmSystemId, enableFastSwitching, initialTime, onCodecSwitch } = val;
|
|
517
517
|
playbackObservationRef.onUpdate((observation) => {
|
|
@@ -586,7 +586,7 @@ function loadOrReloadPreparedContent(
|
|
|
586
586
|
playbackObserver,
|
|
587
587
|
representationEstimator,
|
|
588
588
|
segmentSinksStore,
|
|
589
|
-
|
|
589
|
+
segmentQueueCreator,
|
|
590
590
|
{
|
|
591
591
|
wantedBufferAhead,
|
|
592
592
|
maxVideoBufferSize,
|
|
@@ -228,15 +228,11 @@ export interface ITextDisplayerInterface {
|
|
|
228
228
|
* a hack to tell TypeScript to perform that check.
|
|
229
229
|
*/
|
|
230
230
|
if ((__ENVIRONMENT__.CURRENT_ENV as number) === (__ENVIRONMENT__.DEV as number)) {
|
|
231
|
-
|
|
232
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
233
|
-
// @ts-ignore
|
|
231
|
+
// @ts-expect-error: unused function for type checking
|
|
234
232
|
function _checkType(input: ITextTrackSegmentData): void {
|
|
235
233
|
function checkEqual(_arg: ITextTracksBufferSegmentData): void {
|
|
236
234
|
/* nothing */
|
|
237
235
|
}
|
|
238
236
|
checkEqual(input);
|
|
239
237
|
}
|
|
240
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
241
|
-
/* eslint-enable @typescript-eslint/ban-ts-comment */
|
|
242
238
|
}
|
|
@@ -1338,8 +1338,7 @@ function prettyPrintInventory(inventory: IBufferedChunk[]): string {
|
|
|
1338
1338
|
}
|
|
1339
1339
|
|
|
1340
1340
|
let str = "";
|
|
1341
|
-
for (
|
|
1342
|
-
const chunk = inventory[i];
|
|
1341
|
+
for (const chunk of inventory) {
|
|
1343
1342
|
if (chunk.bufferedStart !== undefined && chunk.bufferedEnd !== undefined) {
|
|
1344
1343
|
const periodId = chunk.infos.period.id;
|
|
1345
1344
|
const representationId = chunk.infos.representation.id;
|
|
@@ -21,6 +21,7 @@ import { SourceBufferType } from "../../mse";
|
|
|
21
21
|
import assert from "../../utils/assert";
|
|
22
22
|
import createCancellablePromise from "../../utils/create_cancellable_promise";
|
|
23
23
|
import isNullOrUndefined from "../../utils/is_null_or_undefined";
|
|
24
|
+
import noop from "../../utils/noop";
|
|
24
25
|
import type { CancellationSignal } from "../../utils/task_canceller";
|
|
25
26
|
import type { IBufferType, SegmentSink } from "./implementations";
|
|
26
27
|
import { AudioVideoSegmentSink } from "./implementations";
|
|
@@ -212,8 +213,8 @@ export default class SegmentSinksStore {
|
|
|
212
213
|
return Promise.resolve();
|
|
213
214
|
}
|
|
214
215
|
return createCancellablePromise(cancelWaitSignal, (res) => {
|
|
215
|
-
|
|
216
|
-
let onAddedOrDisabled: () => void;
|
|
216
|
+
// eslint-disable-next-line prefer-const
|
|
217
|
+
let onAddedOrDisabled: () => void = noop;
|
|
217
218
|
|
|
218
219
|
const removeCallback = () => {
|
|
219
220
|
const indexOf = this._onNativeBufferAddedOrDisabled.indexOf(onAddedOrDisabled);
|
|
@@ -58,7 +58,7 @@ export default function AdaptationStream(
|
|
|
58
58
|
options,
|
|
59
59
|
representationEstimator,
|
|
60
60
|
segmentSink,
|
|
61
|
-
|
|
61
|
+
segmentQueueCreator,
|
|
62
62
|
wantedBufferAhead,
|
|
63
63
|
maxVideoBufferSize,
|
|
64
64
|
}: IAdaptationStreamArguments,
|
|
@@ -117,7 +117,7 @@ export default function AdaptationStream(
|
|
|
117
117
|
);
|
|
118
118
|
|
|
119
119
|
/** Allows a `RepresentationStream` to easily fetch media segments. */
|
|
120
|
-
const
|
|
120
|
+
const segmentQueue = segmentQueueCreator.createSegmentQueue(
|
|
121
121
|
adaptation.type,
|
|
122
122
|
/* eslint-disable @typescript-eslint/unbound-method */
|
|
123
123
|
{
|
|
@@ -435,7 +435,7 @@ export default function AdaptationStream(
|
|
|
435
435
|
playbackObserver,
|
|
436
436
|
content: { representation, adaptation, period, manifest },
|
|
437
437
|
segmentSink,
|
|
438
|
-
|
|
438
|
+
segmentQueue,
|
|
439
439
|
terminate: terminateCurrentStream,
|
|
440
440
|
options: {
|
|
441
441
|
bufferGoal,
|
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
} from "../../../public_types";
|
|
7
7
|
import type { IReadOnlySharedReference } from "../../../utils/reference";
|
|
8
8
|
import type { IRepresentationEstimator } from "../../adaptive";
|
|
9
|
-
import type {
|
|
9
|
+
import type { SegmentQueueCreator } from "../../fetchers";
|
|
10
10
|
import type { IBufferType, SegmentSink } from "../../segment_sinks";
|
|
11
11
|
import type {
|
|
12
12
|
IRepresentationsChoice,
|
|
@@ -141,7 +141,7 @@ export interface IAdaptationStreamArguments {
|
|
|
141
141
|
/** SourceBuffer wrapper - needed to push media segments. */
|
|
142
142
|
segmentSink: SegmentSink;
|
|
143
143
|
/** Module used to fetch the wanted media segments. */
|
|
144
|
-
|
|
144
|
+
segmentQueueCreator: SegmentQueueCreator;
|
|
145
145
|
/**
|
|
146
146
|
* "Buffer goal" wanted, or the ideal amount of time ahead of the current
|
|
147
147
|
* position in the current SegmentSink. When this amount has been reached
|
|
@@ -44,8 +44,7 @@ export default function getTimeRangesForContent(
|
|
|
44
44
|
const accumulator: IRange[] = [];
|
|
45
45
|
const inventory = segmentSink.getLastKnownInventory();
|
|
46
46
|
|
|
47
|
-
for (
|
|
48
|
-
const chunk = inventory[i];
|
|
47
|
+
for (const chunk of inventory) {
|
|
49
48
|
const hasContent = contents.some((content) => {
|
|
50
49
|
return (
|
|
51
50
|
chunk.infos.period.id === content.period.id &&
|
|
@@ -32,7 +32,7 @@ import type { CancellationSignal } from "../../../utils/task_canceller";
|
|
|
32
32
|
import TaskCanceller from "../../../utils/task_canceller";
|
|
33
33
|
import WeakMapMemory from "../../../utils/weak_map_memory";
|
|
34
34
|
import type { IRepresentationEstimator } from "../../adaptive";
|
|
35
|
-
import type {
|
|
35
|
+
import type { SegmentQueueCreator } from "../../fetchers";
|
|
36
36
|
import type { IBufferType, SegmentSink } from "../../segment_sinks";
|
|
37
37
|
import type SegmentSinksStore from "../../segment_sinks";
|
|
38
38
|
import { BufferGarbageCollector } from "../../segment_sinks";
|
|
@@ -68,7 +68,7 @@ import getTimeRangesForContent from "./get_time_ranges_for_content";
|
|
|
68
68
|
* Representation to play.
|
|
69
69
|
* @param {Object} segmentSinksStore - Will be used to lazily create
|
|
70
70
|
* SegmentSink instances associated with the current content.
|
|
71
|
-
* @param {Object}
|
|
71
|
+
* @param {Object} segmentQueueCreator - Allow to download segments.
|
|
72
72
|
* @param {Object} options
|
|
73
73
|
* @param {Object} callbacks - The `StreamOrchestrator` relies on a system of
|
|
74
74
|
* callbacks that it will call on various events.
|
|
@@ -94,7 +94,7 @@ export default function StreamOrchestrator(
|
|
|
94
94
|
playbackObserver: IReadOnlyPlaybackObserver<IStreamOrchestratorPlaybackObservation>,
|
|
95
95
|
representationEstimator: IRepresentationEstimator,
|
|
96
96
|
segmentSinksStore: SegmentSinksStore,
|
|
97
|
-
|
|
97
|
+
segmentQueueCreator: SegmentQueueCreator,
|
|
98
98
|
options: IStreamOrchestratorOptions,
|
|
99
99
|
callbacks: IStreamOrchestratorCallbacks,
|
|
100
100
|
orchestratorCancelSignal: CancellationSignal,
|
|
@@ -499,7 +499,7 @@ export default function StreamOrchestrator(
|
|
|
499
499
|
content: { manifest, period: basePeriod },
|
|
500
500
|
garbageCollectors,
|
|
501
501
|
maxVideoBufferSize,
|
|
502
|
-
|
|
502
|
+
segmentQueueCreator,
|
|
503
503
|
segmentSinksStore,
|
|
504
504
|
options,
|
|
505
505
|
playbackObserver,
|
|
@@ -83,7 +83,7 @@ export default function PeriodStream(
|
|
|
83
83
|
garbageCollectors,
|
|
84
84
|
playbackObserver,
|
|
85
85
|
representationEstimator,
|
|
86
|
-
|
|
86
|
+
segmentQueueCreator,
|
|
87
87
|
segmentSinksStore,
|
|
88
88
|
options,
|
|
89
89
|
wantedBufferAhead,
|
|
@@ -351,7 +351,7 @@ export default function PeriodStream(
|
|
|
351
351
|
playbackObserver: adaptationPlaybackObserver,
|
|
352
352
|
representationEstimator,
|
|
353
353
|
segmentSink,
|
|
354
|
-
|
|
354
|
+
segmentQueueCreator,
|
|
355
355
|
wantedBufferAhead,
|
|
356
356
|
maxVideoBufferSize,
|
|
357
357
|
},
|
|
@@ -10,7 +10,7 @@ import type SharedReference from "../../../utils/reference";
|
|
|
10
10
|
import type { CancellationSignal } from "../../../utils/task_canceller";
|
|
11
11
|
import type WeakMapMemory from "../../../utils/weak_map_memory";
|
|
12
12
|
import type { IRepresentationEstimator } from "../../adaptive";
|
|
13
|
-
import type {
|
|
13
|
+
import type { SegmentQueueCreator } from "../../fetchers";
|
|
14
14
|
import type { IBufferType, SegmentSink } from "../../segment_sinks";
|
|
15
15
|
import type SegmentSinksStore from "../../segment_sinks";
|
|
16
16
|
import type {
|
|
@@ -106,7 +106,7 @@ export interface IPeriodStreamArguments {
|
|
|
106
106
|
SegmentSink,
|
|
107
107
|
(cancelSignal: CancellationSignal) => void
|
|
108
108
|
>;
|
|
109
|
-
|
|
109
|
+
segmentQueueCreator: SegmentQueueCreator;
|
|
110
110
|
segmentSinksStore: SegmentSinksStore;
|
|
111
111
|
playbackObserver: IReadOnlyPlaybackObserver<IPeriodStreamPlaybackObservation>;
|
|
112
112
|
options: IPeriodStreamOptions;
|
|
@@ -27,20 +27,17 @@ import config from "../../../config";
|
|
|
27
27
|
import log from "../../../log";
|
|
28
28
|
import type { ISegment } from "../../../manifest";
|
|
29
29
|
import objectAssign from "../../../utils/object_assign";
|
|
30
|
-
import SharedReference from "../../../utils/reference";
|
|
31
30
|
import type { CancellationSignal } from "../../../utils/task_canceller";
|
|
32
31
|
import TaskCanceller, { CancellationError } from "../../../utils/task_canceller";
|
|
32
|
+
import type {
|
|
33
|
+
IParsedInitSegmentPayload,
|
|
34
|
+
IParsedSegmentPayload,
|
|
35
|
+
} from "../../fetchers/segment/segment_queue";
|
|
33
36
|
import type {
|
|
34
37
|
IQueuedSegment,
|
|
35
38
|
IRepresentationStreamArguments,
|
|
36
39
|
IRepresentationStreamCallbacks,
|
|
37
40
|
} from "./types";
|
|
38
|
-
import type {
|
|
39
|
-
IDownloadQueueItem,
|
|
40
|
-
IParsedInitSegmentPayload,
|
|
41
|
-
IParsedSegmentPayload,
|
|
42
|
-
} from "./utils/downloading_queue";
|
|
43
|
-
import DownloadingQueue from "./utils/downloading_queue";
|
|
44
41
|
import getBufferStatus from "./utils/get_buffer_status";
|
|
45
42
|
import getSegmentPriority from "./utils/get_segment_priority";
|
|
46
43
|
import pushInitSegment from "./utils/push_init_segment";
|
|
@@ -87,7 +84,7 @@ export default function RepresentationStream<TSegmentDataType>(
|
|
|
87
84
|
options,
|
|
88
85
|
playbackObserver,
|
|
89
86
|
segmentSink,
|
|
90
|
-
|
|
87
|
+
segmentQueue,
|
|
91
88
|
terminate,
|
|
92
89
|
}: IRepresentationStreamArguments<TSegmentDataType>,
|
|
93
90
|
callbacks: IRepresentationStreamCallbacks,
|
|
@@ -122,15 +119,6 @@ export default function RepresentationStream<TSegmentDataType>(
|
|
|
122
119
|
}
|
|
123
120
|
});
|
|
124
121
|
|
|
125
|
-
/** Emit the last scheduled downloading queue for segments. */
|
|
126
|
-
const lastSegmentQueue = new SharedReference<IDownloadQueueItem>(
|
|
127
|
-
{
|
|
128
|
-
initSegment: null,
|
|
129
|
-
segmentQueue: [],
|
|
130
|
-
},
|
|
131
|
-
segmentsLoadingCanceller.signal,
|
|
132
|
-
);
|
|
133
|
-
|
|
134
122
|
/** If `true`, the current Representation has a linked initialization segment. */
|
|
135
123
|
const hasInitSegment = initSegmentState.segment !== null;
|
|
136
124
|
|
|
@@ -167,45 +155,60 @@ export default function RepresentationStream<TSegmentDataType>(
|
|
|
167
155
|
}
|
|
168
156
|
}
|
|
169
157
|
|
|
170
|
-
|
|
171
|
-
const downloadingQueue = new DownloadingQueue(
|
|
172
|
-
content,
|
|
173
|
-
lastSegmentQueue,
|
|
174
|
-
segmentFetcher,
|
|
175
|
-
hasInitSegment,
|
|
176
|
-
);
|
|
177
|
-
downloadingQueue.addEventListener("error", (err) => {
|
|
158
|
+
segmentQueue.addEventListener("error", (err) => {
|
|
178
159
|
if (segmentsLoadingCanceller.signal.isCancelled()) {
|
|
179
160
|
return; // ignore post requests-cancellation loading-related errors,
|
|
180
161
|
}
|
|
181
162
|
globalCanceller.cancel(); // Stop every operations
|
|
182
163
|
callbacks.error(err);
|
|
183
164
|
});
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
.
|
|
203
|
-
.
|
|
204
|
-
|
|
205
|
-
|
|
165
|
+
segmentQueue.addEventListener(
|
|
166
|
+
"parsedInitSegment",
|
|
167
|
+
onParsedChunk,
|
|
168
|
+
segmentsLoadingCanceller.signal,
|
|
169
|
+
);
|
|
170
|
+
segmentQueue.addEventListener(
|
|
171
|
+
"parsedMediaSegment",
|
|
172
|
+
onParsedChunk,
|
|
173
|
+
segmentsLoadingCanceller.signal,
|
|
174
|
+
);
|
|
175
|
+
segmentQueue.addEventListener(
|
|
176
|
+
"emptyQueue",
|
|
177
|
+
checkStatus,
|
|
178
|
+
segmentsLoadingCanceller.signal,
|
|
179
|
+
);
|
|
180
|
+
segmentQueue.addEventListener(
|
|
181
|
+
"requestRetry",
|
|
182
|
+
(payload) => {
|
|
183
|
+
callbacks.warning(payload.error);
|
|
184
|
+
if (segmentsLoadingCanceller.signal.isCancelled()) {
|
|
185
|
+
return; // If the previous callback led to loading operations being stopped, skip
|
|
186
|
+
}
|
|
187
|
+
const retriedSegment = payload.segment;
|
|
188
|
+
const { index } = representation;
|
|
189
|
+
if (index.isSegmentStillAvailable(retriedSegment) === false) {
|
|
190
|
+
checkStatus();
|
|
191
|
+
} else if (index.canBeOutOfSyncError(payload.error, retriedSegment)) {
|
|
192
|
+
callbacks.manifestMightBeOufOfSync();
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
segmentsLoadingCanceller.signal,
|
|
196
|
+
);
|
|
197
|
+
segmentQueue.addEventListener(
|
|
198
|
+
"fullyLoadedSegment",
|
|
199
|
+
(segment) => {
|
|
200
|
+
segmentSink
|
|
201
|
+
.signalSegmentComplete(objectAssign({ segment }, content))
|
|
202
|
+
.catch(onFatalBufferError);
|
|
203
|
+
},
|
|
204
|
+
segmentsLoadingCanceller.signal,
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
/** Emit the last scheduled downloading queue for segments. */
|
|
208
|
+
const segmentsToLoadRef = segmentQueue.resetForContent(content, hasInitSegment);
|
|
209
|
+
|
|
206
210
|
segmentsLoadingCanceller.signal.register(() => {
|
|
207
|
-
|
|
208
|
-
downloadingQueue.stop();
|
|
211
|
+
segmentQueue.stop();
|
|
209
212
|
});
|
|
210
213
|
|
|
211
214
|
playbackObserver.listen(checkStatus, {
|
|
@@ -286,14 +289,14 @@ export default function RepresentationStream<TSegmentDataType>(
|
|
|
286
289
|
|
|
287
290
|
const terminateVal = terminate.getValue();
|
|
288
291
|
if (terminateVal === null) {
|
|
289
|
-
|
|
292
|
+
segmentsToLoadRef.setValue({
|
|
290
293
|
initSegment: neededInitSegment,
|
|
291
294
|
segmentQueue: neededSegments,
|
|
292
295
|
});
|
|
293
296
|
} else if (terminateVal.urgent) {
|
|
294
297
|
log.debug("Stream: Urgent switch, terminate now.", bufferType);
|
|
295
|
-
|
|
296
|
-
|
|
298
|
+
segmentsToLoadRef.setValue({ initSegment: null, segmentQueue: [] });
|
|
299
|
+
segmentsToLoadRef.finish();
|
|
297
300
|
segmentsLoadingCanceller.cancel();
|
|
298
301
|
callbacks.terminating();
|
|
299
302
|
return;
|
|
@@ -304,8 +307,8 @@ export default function RepresentationStream<TSegmentDataType>(
|
|
|
304
307
|
// is wanted instead, whichever comes first.
|
|
305
308
|
|
|
306
309
|
const mostNeededSegment = neededSegments[0];
|
|
307
|
-
const initSegmentRequest =
|
|
308
|
-
const currentSegmentRequest =
|
|
310
|
+
const initSegmentRequest = segmentQueue.getRequestedInitSegment();
|
|
311
|
+
const currentSegmentRequest = segmentQueue.getRequestedMediaSegment();
|
|
309
312
|
|
|
310
313
|
const nextQueue =
|
|
311
314
|
currentSegmentRequest === null ||
|
|
@@ -315,13 +318,13 @@ export default function RepresentationStream<TSegmentDataType>(
|
|
|
315
318
|
: [mostNeededSegment];
|
|
316
319
|
|
|
317
320
|
const nextInit = initSegmentRequest === null ? null : neededInitSegment;
|
|
318
|
-
|
|
321
|
+
segmentsToLoadRef.setValue({
|
|
319
322
|
initSegment: nextInit,
|
|
320
323
|
segmentQueue: nextQueue,
|
|
321
324
|
});
|
|
322
325
|
if (nextQueue.length === 0 && nextInit === null) {
|
|
323
326
|
log.debug("Stream: No request left, terminate", bufferType);
|
|
324
|
-
|
|
327
|
+
segmentsToLoadRef.finish();
|
|
325
328
|
segmentsLoadingCanceller.cancel();
|
|
326
329
|
callbacks.terminating();
|
|
327
330
|
return;
|
|
@@ -18,7 +18,7 @@ import type {
|
|
|
18
18
|
} from "../../../public_types";
|
|
19
19
|
import type { IRange } from "../../../utils/ranges";
|
|
20
20
|
import type { IReadOnlySharedReference } from "../../../utils/reference";
|
|
21
|
-
import type {
|
|
21
|
+
import type { SegmentQueue } from "../../fetchers";
|
|
22
22
|
import type { IBufferType, SegmentSink } from "../../segment_sinks";
|
|
23
23
|
|
|
24
24
|
/** Callbacks called by the `RepresentationStream` on various events. */
|
|
@@ -257,7 +257,7 @@ export interface IRepresentationStreamArguments<TSegmentDataType> {
|
|
|
257
257
|
/** The `SegmentSink` on which segments will be pushed. */
|
|
258
258
|
segmentSink: SegmentSink;
|
|
259
259
|
/** Interface used to load new segments. */
|
|
260
|
-
|
|
260
|
+
segmentQueue: SegmentQueue<TSegmentDataType>;
|
|
261
261
|
/**
|
|
262
262
|
* Reference emitting when the RepresentationStream should "terminate".
|
|
263
263
|
*
|
|
@@ -333,7 +333,6 @@ export interface IRepresentationsChoice {
|
|
|
333
333
|
* How the Streams should react if another, not currently authorized,
|
|
334
334
|
* Representation was previously playing.
|
|
335
335
|
*/
|
|
336
|
-
|
|
336
|
+
// eslint-disable-next-line @typescript-eslint/no-duplicate-type-constituents
|
|
337
337
|
switchingMode: IVideoRepresentationsSwitchingMode | IAudioRepresentationsSwitchingMode;
|
|
338
|
-
/* eslint-enable @typescript-eslint/no-duplicate-type-constituents */
|
|
339
338
|
}
|
|
@@ -215,8 +215,7 @@ export default function getNeededSegments({
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
// check if the segment is already downloaded
|
|
218
|
-
for (
|
|
219
|
-
const completeSeg = reusableSegments[i];
|
|
218
|
+
for (const completeSeg of reusableSegments) {
|
|
220
219
|
const areFromSamePeriod = completeSeg.infos.period.id === content.period.id;
|
|
221
220
|
// Check if content are from same period, as there can't be overlapping
|
|
222
221
|
// periods, we should consider a segment as already downloaded if
|