rx-player 4.2.0-dev.2024082600 → 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 +12 -3
- package/VERSION +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.js +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/browser_detection.d.ts +3 -1
- package/dist/commonjs/compat/browser_detection.d.ts.map +1 -1
- package/dist/commonjs/compat/browser_detection.js +8 -1
- package/dist/commonjs/compat/can_reuse_media_keys.d.ts +2 -0
- package/dist/commonjs/compat/can_reuse_media_keys.d.ts.map +1 -1
- package/dist/commonjs/compat/can_reuse_media_keys.js +3 -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/cmcd/cmcd_data_builder.js +1 -1
- 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/commonjs/core/{stream/representation/utils/downloading_queue.d.ts → 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/{es2017/core/fetchers/segment/segment_fetcher_creator.d.ts → commonjs/core/fetchers/segment/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 +3 -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/adaptation.d.ts +13 -13
- package/dist/commonjs/manifest/classes/manifest.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/manifest.js +0 -6
- package/dist/commonjs/manifest/classes/representation.d.ts +20 -12
- package/dist/commonjs/manifest/classes/representation.d.ts.map +1 -1
- 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_dash_wasm.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.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/browser_detection.d.ts +3 -1
- package/dist/es2017/compat/browser_detection.d.ts.map +1 -1
- package/dist/es2017/compat/browser_detection.js +7 -1
- package/dist/es2017/compat/can_reuse_media_keys.d.ts +2 -0
- package/dist/es2017/compat/can_reuse_media_keys.d.ts.map +1 -1
- package/dist/es2017/compat/can_reuse_media_keys.js +4 -2
- 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/cmcd/cmcd_data_builder.js +1 -1
- 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/es2017/core/{stream/representation/utils/downloading_queue.d.ts → 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/{commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts → es2017/core/fetchers/segment/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 +3 -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/adaptation.d.ts +13 -13
- package/dist/es2017/manifest/classes/manifest.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/manifest.js +0 -6
- package/dist/es2017/manifest/classes/representation.d.ts +20 -12
- package/dist/es2017/manifest/classes/representation.d.ts.map +1 -1
- 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/mpd-parser.wasm +0 -0
- 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_dash_wasm.ts +1 -1
- 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 +38 -15
- 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/browser_detection.ts +9 -0
- package/src/compat/can_reuse_media_keys.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/cmcd/cmcd_data_builder.ts +1 -1
- 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 +3 -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/adaptation.ts +13 -13
- package/src/manifest/classes/manifest.ts +0 -6
- package/src/manifest/classes/representation.ts +20 -12
- 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/.vscode/settings.json +0 -7
- 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
|
@@ -13,56 +13,27 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import log from "
|
|
17
|
-
import assert from "
|
|
18
|
-
import EventEmitter from "
|
|
19
|
-
import noop from "
|
|
20
|
-
import objectAssign from "
|
|
21
|
-
import SharedReference from "
|
|
22
|
-
import TaskCanceller from "
|
|
16
|
+
import log from "../../../log";
|
|
17
|
+
import assert from "../../../utils/assert";
|
|
18
|
+
import EventEmitter from "../../../utils/event_emitter";
|
|
19
|
+
import noop from "../../../utils/noop";
|
|
20
|
+
import objectAssign from "../../../utils/object_assign";
|
|
21
|
+
import SharedReference from "../../../utils/reference";
|
|
22
|
+
import TaskCanceller from "../../../utils/task_canceller";
|
|
23
23
|
/**
|
|
24
|
-
* Class scheduling segment downloads
|
|
25
|
-
*
|
|
26
|
-
* TODO The request scheduling abstractions might be simplified by integrating
|
|
27
|
-
* the `DownloadingQueue` in the segment fetchers code, instead of having it as
|
|
28
|
-
* an utilis of the `RepresentationStream` like here.
|
|
29
|
-
* @class DownloadingQueue
|
|
24
|
+
* Class scheduling segment downloads as a FIFO queue.
|
|
30
25
|
*/
|
|
31
|
-
export default class
|
|
26
|
+
export default class SegmentQueue extends EventEmitter {
|
|
32
27
|
/**
|
|
33
|
-
* Create a new `
|
|
28
|
+
* Create a new `SegmentQueue`.
|
|
34
29
|
*
|
|
35
|
-
* @param {Object} content - The context of the Representation you want to
|
|
36
|
-
* load segments for.
|
|
37
|
-
* @param {Object} downloadQueue - Queue of segments you want to load.
|
|
38
30
|
* @param {Object} segmentFetcher - Interface to facilitate the download of
|
|
39
31
|
* segments.
|
|
40
|
-
* @param {boolean} hasInitSegment - Declare that an initialization segment
|
|
41
|
-
* will need to be downloaded.
|
|
42
|
-
*
|
|
43
|
-
* A `DownloadingQueue` ALWAYS wait for the initialization segment to be
|
|
44
|
-
* loaded and parsed before parsing a media segment.
|
|
45
|
-
*
|
|
46
|
-
* In cases where no initialization segment exist, this would lead to the
|
|
47
|
-
* `DownloadingQueue` waiting indefinitely for it.
|
|
48
|
-
*
|
|
49
|
-
* By setting that value to `false`, you anounce to the `DownloadingQueue`
|
|
50
|
-
* that it should not wait for an initialization segment before parsing a
|
|
51
|
-
* media segment.
|
|
52
32
|
*/
|
|
53
|
-
constructor(
|
|
33
|
+
constructor(segmentFetcher) {
|
|
54
34
|
super();
|
|
55
|
-
this._content = content;
|
|
56
|
-
this._currentCanceller = null;
|
|
57
|
-
this._downloadQueue = downloadQueue;
|
|
58
|
-
this._initSegmentRequest = null;
|
|
59
|
-
this._mediaSegmentRequest = null;
|
|
60
35
|
this._segmentFetcher = segmentFetcher;
|
|
61
|
-
this.
|
|
62
|
-
this._mediaSegmentAwaitingInitMetadata = null;
|
|
63
|
-
if (!hasInitSegment) {
|
|
64
|
-
this._initSegmentInfoRef.setValue(null);
|
|
65
|
-
}
|
|
36
|
+
this._currentContentInfo = null;
|
|
66
37
|
}
|
|
67
38
|
/**
|
|
68
39
|
* Returns the initialization segment currently being requested.
|
|
@@ -70,7 +41,8 @@ export default class DownloadingQueue extends EventEmitter {
|
|
|
70
41
|
* @returns {Object | null}
|
|
71
42
|
*/
|
|
72
43
|
getRequestedInitSegment() {
|
|
73
|
-
|
|
44
|
+
var _a, _b, _c;
|
|
45
|
+
return (_c = (_b = (_a = this._currentContentInfo) === null || _a === void 0 ? void 0 : _a.initSegmentRequest) === null || _b === void 0 ? void 0 : _b.segment) !== null && _c !== void 0 ? _c : null;
|
|
74
46
|
}
|
|
75
47
|
/**
|
|
76
48
|
* Returns the media segment currently being requested.
|
|
@@ -78,62 +50,105 @@ export default class DownloadingQueue extends EventEmitter {
|
|
|
78
50
|
* @returns {Object | null}
|
|
79
51
|
*/
|
|
80
52
|
getRequestedMediaSegment() {
|
|
81
|
-
|
|
53
|
+
var _a, _b, _c;
|
|
54
|
+
return (_c = (_b = (_a = this._currentContentInfo) === null || _a === void 0 ? void 0 : _a.mediaSegmentRequest) === null || _b === void 0 ? void 0 : _b.segment) !== null && _c !== void 0 ? _c : null;
|
|
82
55
|
}
|
|
83
56
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
57
|
+
* Return an object allowing to schedule segment requests linked to the given
|
|
58
|
+
* content.
|
|
59
|
+
* The `SegmentQueue` will emit events as it loads and parses initialization
|
|
60
|
+
* and media segments.
|
|
61
|
+
*
|
|
62
|
+
* Calling this method resets all previous queues that were previously started
|
|
63
|
+
* on the same instance.
|
|
64
|
+
*
|
|
65
|
+
* @param {Object} content - The context of the Representation you want to
|
|
66
|
+
* load segments for.
|
|
67
|
+
* @param {boolean} hasInitSegment - Declare that an initialization segment
|
|
68
|
+
* will need to be downloaded.
|
|
69
|
+
*
|
|
70
|
+
* A `SegmentQueue` ALWAYS wait for the initialization segment to be
|
|
71
|
+
* loaded and parsed before parsing a media segment.
|
|
72
|
+
*
|
|
73
|
+
* In cases where no initialization segment exist, this would lead to the
|
|
74
|
+
* `SegmentQueue` waiting indefinitely for it.
|
|
75
|
+
*
|
|
76
|
+
* By setting that value to `false`, you anounce to the `SegmentQueue`
|
|
77
|
+
* that it should not wait for an initialization segment before parsing a
|
|
78
|
+
* media segment.
|
|
79
|
+
* @returns {Object} - `SharedReference` on which the queue of segment for
|
|
80
|
+
* that content can be communicated and updated. See type for more
|
|
81
|
+
* information.
|
|
86
82
|
*/
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
resetForContent(content, hasInitSegment) {
|
|
84
|
+
var _a;
|
|
85
|
+
(_a = this._currentContentInfo) === null || _a === void 0 ? void 0 : _a.currentCanceller.cancel();
|
|
86
|
+
const downloadQueue = new SharedReference({
|
|
87
|
+
initSegment: null,
|
|
88
|
+
segmentQueue: [],
|
|
89
|
+
});
|
|
90
|
+
const currentCanceller = new TaskCanceller();
|
|
91
|
+
currentCanceller.signal.register(() => {
|
|
92
|
+
downloadQueue.finish();
|
|
93
|
+
});
|
|
94
|
+
const currentContentInfo = {
|
|
95
|
+
content,
|
|
96
|
+
downloadQueue,
|
|
97
|
+
initSegmentInfoRef: hasInitSegment
|
|
98
|
+
? new SharedReference(undefined)
|
|
99
|
+
: new SharedReference(null),
|
|
100
|
+
currentCanceller,
|
|
101
|
+
initSegmentRequest: null,
|
|
102
|
+
mediaSegmentRequest: null,
|
|
103
|
+
mediaSegmentAwaitingInitMetadata: null,
|
|
104
|
+
};
|
|
105
|
+
this._currentContentInfo = currentContentInfo;
|
|
92
106
|
// Listen for asked media segments
|
|
93
|
-
|
|
107
|
+
downloadQueue.onUpdate((queue) => {
|
|
94
108
|
const { segmentQueue } = queue;
|
|
95
109
|
if (segmentQueue.length > 0 &&
|
|
96
|
-
segmentQueue[0].segment.id ===
|
|
110
|
+
segmentQueue[0].segment.id ===
|
|
111
|
+
currentContentInfo.mediaSegmentAwaitingInitMetadata) {
|
|
97
112
|
// The most needed segment is still the same one, and there's no need to
|
|
98
113
|
// update its priority as the request already ended, just quit.
|
|
99
114
|
return;
|
|
100
115
|
}
|
|
101
|
-
const currentSegmentRequest =
|
|
116
|
+
const currentSegmentRequest = currentContentInfo.mediaSegmentRequest;
|
|
102
117
|
if (segmentQueue.length === 0) {
|
|
103
118
|
if (currentSegmentRequest === null) {
|
|
104
119
|
// There's nothing to load but there's already no request pending.
|
|
105
120
|
return;
|
|
106
121
|
}
|
|
107
|
-
log.debug("
|
|
108
|
-
this._restartMediaSegmentDownloadingQueue();
|
|
122
|
+
log.debug("SQ: no more media segment to request. Cancelling queue.", content.adaptation.type);
|
|
123
|
+
this._restartMediaSegmentDownloadingQueue(currentContentInfo);
|
|
109
124
|
return;
|
|
110
125
|
}
|
|
111
126
|
else if (currentSegmentRequest === null) {
|
|
112
127
|
// There's no request although there are needed segments: start requests
|
|
113
|
-
log.debug("
|
|
114
|
-
this._restartMediaSegmentDownloadingQueue();
|
|
128
|
+
log.debug("SQ: Media segments now need to be requested. Starting queue.", content.adaptation.type, segmentQueue.length);
|
|
129
|
+
this._restartMediaSegmentDownloadingQueue(currentContentInfo);
|
|
115
130
|
return;
|
|
116
131
|
}
|
|
117
132
|
else {
|
|
118
133
|
const nextItem = segmentQueue[0];
|
|
119
134
|
if (currentSegmentRequest.segment.id !== nextItem.segment.id) {
|
|
120
135
|
// The most important request if for another segment, request it
|
|
121
|
-
log.debug("
|
|
122
|
-
this._restartMediaSegmentDownloadingQueue();
|
|
136
|
+
log.debug("SQ: Next media segment changed, cancelling previous", content.adaptation.type);
|
|
137
|
+
this._restartMediaSegmentDownloadingQueue(currentContentInfo);
|
|
123
138
|
return;
|
|
124
139
|
}
|
|
125
140
|
if (currentSegmentRequest.priority !== nextItem.priority) {
|
|
126
141
|
// The priority of the most important request has changed, update it
|
|
127
|
-
log.debug("
|
|
142
|
+
log.debug("SQ: Priority of next media segment changed, updating", content.adaptation.type, currentSegmentRequest.priority, nextItem.priority);
|
|
128
143
|
this._segmentFetcher.updatePriority(currentSegmentRequest.request, nextItem.priority);
|
|
129
144
|
}
|
|
130
145
|
return;
|
|
131
146
|
}
|
|
132
|
-
}, { emitCurrentValue: true, clearSignal:
|
|
147
|
+
}, { emitCurrentValue: true, clearSignal: currentCanceller.signal });
|
|
133
148
|
// Listen for asked init segment
|
|
134
|
-
|
|
149
|
+
downloadQueue.onUpdate((next) => {
|
|
135
150
|
var _a;
|
|
136
|
-
const initSegmentRequest =
|
|
151
|
+
const initSegmentRequest = currentContentInfo.initSegmentRequest;
|
|
137
152
|
if (next.initSegment !== null && initSegmentRequest !== null) {
|
|
138
153
|
if (next.initSegment.priority !== initSegmentRequest.priority) {
|
|
139
154
|
this._segmentFetcher.updatePriority(initSegmentRequest.request, next.initSegment.priority);
|
|
@@ -144,41 +159,48 @@ export default class DownloadingQueue extends EventEmitter {
|
|
|
144
159
|
return;
|
|
145
160
|
}
|
|
146
161
|
if (next.initSegment === null) {
|
|
147
|
-
log.debug("
|
|
162
|
+
log.debug("SQ: no more init segment to request. Cancelling queue.", content.adaptation.type);
|
|
148
163
|
}
|
|
149
|
-
this._restartInitSegmentDownloadingQueue(next.initSegment);
|
|
150
|
-
}, { emitCurrentValue: true, clearSignal:
|
|
164
|
+
this._restartInitSegmentDownloadingQueue(currentContentInfo, next.initSegment);
|
|
165
|
+
}, { emitCurrentValue: true, clearSignal: currentCanceller.signal });
|
|
166
|
+
return downloadQueue;
|
|
151
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Stop the currently-active `SegmentQueue`.
|
|
170
|
+
*
|
|
171
|
+
* Do nothing if no queue is active.
|
|
172
|
+
*/
|
|
152
173
|
stop() {
|
|
153
174
|
var _a;
|
|
154
|
-
(_a = this.
|
|
155
|
-
this.
|
|
175
|
+
(_a = this._currentContentInfo) === null || _a === void 0 ? void 0 : _a.currentCanceller.cancel();
|
|
176
|
+
this._currentContentInfo = null;
|
|
156
177
|
}
|
|
157
178
|
/**
|
|
158
179
|
* Internal logic performing media segment requests.
|
|
159
180
|
*/
|
|
160
|
-
_restartMediaSegmentDownloadingQueue() {
|
|
161
|
-
if (
|
|
162
|
-
|
|
181
|
+
_restartMediaSegmentDownloadingQueue(contentInfo) {
|
|
182
|
+
if (contentInfo.mediaSegmentRequest !== null) {
|
|
183
|
+
contentInfo.mediaSegmentRequest.canceller.cancel();
|
|
163
184
|
}
|
|
164
|
-
const {
|
|
185
|
+
const { downloadQueue, content, initSegmentInfoRef, currentCanceller } = contentInfo;
|
|
186
|
+
const { segmentQueue } = downloadQueue.getValue();
|
|
165
187
|
const currentNeededSegment = segmentQueue[0];
|
|
166
188
|
const recursivelyRequestSegments = (startingSegment) => {
|
|
167
|
-
if (
|
|
168
|
-
|
|
189
|
+
if (currentCanceller !== null && currentCanceller.isUsed()) {
|
|
190
|
+
contentInfo.mediaSegmentRequest = null;
|
|
169
191
|
return;
|
|
170
192
|
}
|
|
171
193
|
if (startingSegment === undefined) {
|
|
172
|
-
|
|
194
|
+
contentInfo.mediaSegmentRequest = null;
|
|
173
195
|
this.trigger("emptyQueue", null);
|
|
174
196
|
return;
|
|
175
197
|
}
|
|
176
198
|
const canceller = new TaskCanceller();
|
|
177
|
-
const unlinkCanceller =
|
|
199
|
+
const unlinkCanceller = currentCanceller === null
|
|
178
200
|
? noop
|
|
179
|
-
: canceller.linkToSignal(
|
|
201
|
+
: canceller.linkToSignal(currentCanceller.signal);
|
|
180
202
|
const { segment, priority } = startingSegment;
|
|
181
|
-
const context = objectAssign({ segment },
|
|
203
|
+
const context = objectAssign({ segment }, content);
|
|
182
204
|
/**
|
|
183
205
|
* If `true` , the current task has either errored, finished, or was
|
|
184
206
|
* cancelled.
|
|
@@ -190,12 +212,12 @@ export default class DownloadingQueue extends EventEmitter {
|
|
|
190
212
|
*/
|
|
191
213
|
let isWaitingOnInitSegment = false;
|
|
192
214
|
canceller.signal.register(() => {
|
|
193
|
-
|
|
215
|
+
contentInfo.mediaSegmentRequest = null;
|
|
194
216
|
if (isComplete) {
|
|
195
217
|
return;
|
|
196
218
|
}
|
|
197
|
-
if (
|
|
198
|
-
|
|
219
|
+
if (contentInfo.mediaSegmentAwaitingInitMetadata === segment.id) {
|
|
220
|
+
contentInfo.mediaSegmentAwaitingInitMetadata = null;
|
|
199
221
|
}
|
|
200
222
|
isComplete = true;
|
|
201
223
|
isWaitingOnInitSegment = false;
|
|
@@ -205,7 +227,7 @@ export default class DownloadingQueue extends EventEmitter {
|
|
|
205
227
|
this.trigger("parsedMediaSegment", objectAssign({}, parsed, { segment }));
|
|
206
228
|
};
|
|
207
229
|
const continueToNextSegment = () => {
|
|
208
|
-
const lastQueue =
|
|
230
|
+
const lastQueue = downloadQueue.getValue().segmentQueue;
|
|
209
231
|
if (lastQueue.length === 0) {
|
|
210
232
|
isComplete = true;
|
|
211
233
|
this.trigger("emptyQueue", null);
|
|
@@ -231,14 +253,14 @@ export default class DownloadingQueue extends EventEmitter {
|
|
|
231
253
|
* restarted later.
|
|
232
254
|
*/
|
|
233
255
|
beforeInterrupted() {
|
|
234
|
-
log.info("
|
|
256
|
+
log.info("SQ: segment request interrupted temporarly.", segment.id, segment.time);
|
|
235
257
|
},
|
|
236
258
|
/**
|
|
237
259
|
* Callback called when a decodable chunk of the segment is available.
|
|
238
260
|
* @param {Function} parse - Function allowing to parse the segment.
|
|
239
261
|
*/
|
|
240
262
|
onChunk: (parse) => {
|
|
241
|
-
const initTimescale =
|
|
263
|
+
const initTimescale = initSegmentInfoRef.getValue();
|
|
242
264
|
if (initTimescale !== undefined) {
|
|
243
265
|
emitChunk(parse(initTimescale !== null && initTimescale !== void 0 ? initTimescale : undefined));
|
|
244
266
|
}
|
|
@@ -248,7 +270,7 @@ export default class DownloadingQueue extends EventEmitter {
|
|
|
248
270
|
// but I found it globally clearer to segregate the two cases,
|
|
249
271
|
// especially to always have a meaningful `isWaitingOnInitSegment`
|
|
250
272
|
// boolean which is a very important variable.
|
|
251
|
-
|
|
273
|
+
initSegmentInfoRef.waitUntilDefined((actualTimescale) => {
|
|
252
274
|
emitChunk(parse(actualTimescale !== null && actualTimescale !== void 0 ? actualTimescale : undefined));
|
|
253
275
|
}, { clearSignal: canceller.signal });
|
|
254
276
|
}
|
|
@@ -259,9 +281,9 @@ export default class DownloadingQueue extends EventEmitter {
|
|
|
259
281
|
this.trigger("fullyLoadedSegment", segment);
|
|
260
282
|
}
|
|
261
283
|
else {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
284
|
+
contentInfo.mediaSegmentAwaitingInitMetadata = segment.id;
|
|
285
|
+
initSegmentInfoRef.waitUntilDefined(() => {
|
|
286
|
+
contentInfo.mediaSegmentAwaitingInitMetadata = null;
|
|
265
287
|
isWaitingOnInitSegment = false;
|
|
266
288
|
this.trigger("fullyLoadedSegment", segment);
|
|
267
289
|
}, { clearSignal: canceller.signal });
|
|
@@ -273,9 +295,9 @@ export default class DownloadingQueue extends EventEmitter {
|
|
|
273
295
|
*/
|
|
274
296
|
beforeEnded: () => {
|
|
275
297
|
unlinkCanceller();
|
|
276
|
-
|
|
298
|
+
contentInfo.mediaSegmentRequest = null;
|
|
277
299
|
if (isWaitingOnInitSegment) {
|
|
278
|
-
|
|
300
|
+
initSegmentInfoRef.waitUntilDefined(continueToNextSegment, {
|
|
279
301
|
clearSignal: canceller.signal,
|
|
280
302
|
});
|
|
281
303
|
}
|
|
@@ -292,30 +314,29 @@ export default class DownloadingQueue extends EventEmitter {
|
|
|
292
314
|
this.trigger("error", error);
|
|
293
315
|
}
|
|
294
316
|
});
|
|
295
|
-
|
|
317
|
+
contentInfo.mediaSegmentRequest = { segment, priority, request, canceller };
|
|
296
318
|
};
|
|
297
319
|
recursivelyRequestSegments(currentNeededSegment);
|
|
298
320
|
}
|
|
299
321
|
/**
|
|
300
322
|
* Internal logic performing initialization segment requests.
|
|
323
|
+
* @param {Object} contentInfo
|
|
301
324
|
* @param {Object} queuedInitSegment
|
|
302
325
|
*/
|
|
303
|
-
_restartInitSegmentDownloadingQueue(queuedInitSegment) {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
if (this._initSegmentRequest !== null) {
|
|
308
|
-
this._initSegmentRequest.canceller.cancel();
|
|
326
|
+
_restartInitSegmentDownloadingQueue(contentInfo, queuedInitSegment) {
|
|
327
|
+
const { content, initSegmentInfoRef } = contentInfo;
|
|
328
|
+
if (contentInfo.initSegmentRequest !== null) {
|
|
329
|
+
contentInfo.initSegmentRequest.canceller.cancel();
|
|
309
330
|
}
|
|
310
331
|
if (queuedInitSegment === null) {
|
|
311
332
|
return;
|
|
312
333
|
}
|
|
313
334
|
const canceller = new TaskCanceller();
|
|
314
|
-
const unlinkCanceller =
|
|
335
|
+
const unlinkCanceller = contentInfo.currentCanceller === null
|
|
315
336
|
? noop
|
|
316
|
-
: canceller.linkToSignal(
|
|
337
|
+
: canceller.linkToSignal(contentInfo.currentCanceller.signal);
|
|
317
338
|
const { segment, priority } = queuedInitSegment;
|
|
318
|
-
const context = objectAssign({ segment },
|
|
339
|
+
const context = objectAssign({ segment }, content);
|
|
319
340
|
/**
|
|
320
341
|
* If `true` , the current task has either errored, finished, or was
|
|
321
342
|
* cancelled.
|
|
@@ -326,11 +347,11 @@ export default class DownloadingQueue extends EventEmitter {
|
|
|
326
347
|
this.trigger("requestRetry", { segment, error: err });
|
|
327
348
|
},
|
|
328
349
|
beforeInterrupted: () => {
|
|
329
|
-
log.info("
|
|
350
|
+
log.info("SQ: init segment request interrupted temporarly.", segment.id);
|
|
330
351
|
},
|
|
331
352
|
beforeEnded: () => {
|
|
332
353
|
unlinkCanceller();
|
|
333
|
-
|
|
354
|
+
contentInfo.initSegmentRequest = null;
|
|
334
355
|
isComplete = true;
|
|
335
356
|
},
|
|
336
357
|
onChunk: (parse) => {
|
|
@@ -339,7 +360,7 @@ export default class DownloadingQueue extends EventEmitter {
|
|
|
339
360
|
assert(parsed.segmentType === "init", "Should have loaded an init segment.");
|
|
340
361
|
this.trigger("parsedInitSegment", objectAssign({}, parsed, { segment }));
|
|
341
362
|
if (parsed.segmentType === "init") {
|
|
342
|
-
|
|
363
|
+
initSegmentInfoRef.setValue((_a = parsed.initTimescale) !== null && _a !== void 0 ? _a : null);
|
|
343
364
|
}
|
|
344
365
|
},
|
|
345
366
|
onAllChunksReceived: () => {
|
|
@@ -355,12 +376,12 @@ export default class DownloadingQueue extends EventEmitter {
|
|
|
355
376
|
}
|
|
356
377
|
});
|
|
357
378
|
canceller.signal.register(() => {
|
|
358
|
-
|
|
379
|
+
contentInfo.initSegmentRequest = null;
|
|
359
380
|
if (isComplete) {
|
|
360
381
|
return;
|
|
361
382
|
}
|
|
362
383
|
isComplete = true;
|
|
363
384
|
});
|
|
364
|
-
|
|
385
|
+
contentInfo.initSegmentRequest = { segment, priority, request, canceller };
|
|
365
386
|
}
|
|
366
387
|
}
|
|
@@ -17,22 +17,22 @@ import type { ITransportPipelines } from "../../../transports";
|
|
|
17
17
|
import type { CancellationSignal } from "../../../utils/task_canceller";
|
|
18
18
|
import type CmcdDataBuilder from "../../cmcd";
|
|
19
19
|
import type { IBufferType } from "../../segment_sinks";
|
|
20
|
-
import type { IPrioritizedSegmentFetcher } from "./prioritized_segment_fetcher";
|
|
21
20
|
import type { ISegmentFetcherLifecycleCallbacks } from "./segment_fetcher";
|
|
21
|
+
import SegmentQueue from "./segment_queue";
|
|
22
22
|
/**
|
|
23
23
|
* Interact with the transport pipelines to download segments with the right
|
|
24
24
|
* priority.
|
|
25
25
|
*
|
|
26
|
-
* @class
|
|
26
|
+
* @class SegmentQueueCreator
|
|
27
27
|
*/
|
|
28
|
-
export default class
|
|
28
|
+
export default class SegmentQueueCreator {
|
|
29
29
|
/**
|
|
30
30
|
* Transport pipelines of the currently choosen streaming protocol (e.g. DASH,
|
|
31
31
|
* Smooth etc.).
|
|
32
32
|
*/
|
|
33
33
|
private readonly _transport;
|
|
34
34
|
/**
|
|
35
|
-
* `TaskPrioritizer` linked to this
|
|
35
|
+
* `TaskPrioritizer` linked to this SegmentQueueCreator.
|
|
36
36
|
*
|
|
37
37
|
* Note: this is typed as `any` because segment loaders / parsers can use
|
|
38
38
|
* different types depending on the type of buffer. We could maybe be smarter
|
|
@@ -41,27 +41,32 @@ export default class SegmentFetcherCreator {
|
|
|
41
41
|
*/
|
|
42
42
|
private readonly _prioritizer;
|
|
43
43
|
/**
|
|
44
|
-
* Options used by the
|
|
44
|
+
* Options used by the SegmentQueueCreator, e.g. to allow configuration on
|
|
45
45
|
* segment retries (number of retries maximum, default delay and so on).
|
|
46
46
|
*/
|
|
47
47
|
private readonly _backoffOptions;
|
|
48
|
+
/** Class allowing to select a CDN when multiple are available for a given resource. */
|
|
48
49
|
private readonly _cdnPrioritizer;
|
|
49
50
|
private _cmcdDataBuilder;
|
|
50
51
|
/**
|
|
51
52
|
* @param {Object} transport
|
|
53
|
+
* @param {Object} options
|
|
54
|
+
* @param {Object} cancelSignal
|
|
52
55
|
*/
|
|
53
|
-
constructor(transport: ITransportPipelines, cmcdDataBuilder: CmcdDataBuilder | null, options:
|
|
56
|
+
constructor(transport: ITransportPipelines, cmcdDataBuilder: CmcdDataBuilder | null, options: ISegmentQueueCreatorBackoffOptions, cancelSignal: CancellationSignal);
|
|
54
57
|
/**
|
|
55
|
-
* Create a
|
|
58
|
+
* Create a `SegmentQueue`, allowing to easily perform segment requests.
|
|
56
59
|
* @param {string} bufferType - The type of buffer concerned (e.g. "audio",
|
|
57
60
|
* "video", etc.)
|
|
58
61
|
* @param {Object} eventListeners
|
|
59
|
-
* @returns {Object}
|
|
62
|
+
* @returns {Object} - `SegmentQueue`, which is an abstraction allowing to
|
|
63
|
+
* perform a queue of segment requests for a given media type (here defined by
|
|
64
|
+
* `bufferType`) with associated priorities.
|
|
60
65
|
*/
|
|
61
|
-
|
|
66
|
+
createSegmentQueue(bufferType: IBufferType, eventListeners: ISegmentFetcherLifecycleCallbacks): SegmentQueue<unknown>;
|
|
62
67
|
}
|
|
63
|
-
/** Options used by the `
|
|
64
|
-
export interface
|
|
68
|
+
/** Options used by the `SegmentQueueCreator`. */
|
|
69
|
+
export interface ISegmentQueueCreatorBackoffOptions {
|
|
65
70
|
/**
|
|
66
71
|
* Whether the content is played in a low-latency mode.
|
|
67
72
|
* This has an impact on default backoff delays.
|
|
@@ -76,6 +81,14 @@ export interface ISegmentFetcherCreatorBackoffOptions {
|
|
|
76
81
|
* `undefined` will lead to a default, large, timeout being used.
|
|
77
82
|
*/
|
|
78
83
|
requestTimeout: number | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Timeout for just the "connection" part of the request, before data is
|
|
86
|
+
* actually being transferred.
|
|
87
|
+
*
|
|
88
|
+
* Setting a lower `connectionTimeout` than a `requestTimeout` allows to
|
|
89
|
+
* fail faster without having to take into account a potentially low
|
|
90
|
+
* bandwidth.
|
|
91
|
+
*/
|
|
79
92
|
connectionTimeout: number | undefined;
|
|
80
93
|
}
|
|
81
|
-
//# sourceMappingURL=
|
|
94
|
+
//# sourceMappingURL=segment_queue_creator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment_queue_creator.d.ts","sourceRoot":"","sources":["../../../../../src/core/fetchers/segment/segment_queue_creator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAoB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,eAAe,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAG3C;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAmB;IACtC;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;IACjD;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAwB;IACrD;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqC;IAErE,uFAAuF;IACvF,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;IAEjD,OAAO,CAAC,gBAAgB,CAAyB;IAEjD;;;;OAIG;gBAED,SAAS,EAAE,mBAAmB,EAC9B,eAAe,EAAE,eAAe,GAAG,IAAI,EACvC,OAAO,EAAE,kCAAkC,EAC3C,YAAY,EAAE,kBAAkB;IAiBlC;;;;;;;;OAQG;IACI,kBAAkB,CACvB,UAAU,EAAE,WAAW,EACvB,cAAc,EAAE,iCAAiC,GAChD,YAAY,CAAC,OAAO,CAAC;CAmBzB;AAED,iDAAiD;AACjD,MAAM,WAAW,kCAAkC;IACjD;;;OAGG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB,iEAAiE;IACjE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B;;;;;OAKG;IACH,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC;;;;;;;OAOG;IACH,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC"}
|
package/dist/es2017/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js}
RENAMED
|
@@ -17,16 +17,19 @@ import config from "../../../config";
|
|
|
17
17
|
import CdnPrioritizer from "../cdn_prioritizer";
|
|
18
18
|
import applyPrioritizerToSegmentFetcher from "./prioritized_segment_fetcher";
|
|
19
19
|
import createSegmentFetcher, { getSegmentFetcherRequestOptions } from "./segment_fetcher";
|
|
20
|
+
import SegmentQueue from "./segment_queue";
|
|
20
21
|
import TaskPrioritizer from "./task_prioritizer";
|
|
21
22
|
/**
|
|
22
23
|
* Interact with the transport pipelines to download segments with the right
|
|
23
24
|
* priority.
|
|
24
25
|
*
|
|
25
|
-
* @class
|
|
26
|
+
* @class SegmentQueueCreator
|
|
26
27
|
*/
|
|
27
|
-
export default class
|
|
28
|
+
export default class SegmentQueueCreator {
|
|
28
29
|
/**
|
|
29
30
|
* @param {Object} transport
|
|
31
|
+
* @param {Object} options
|
|
32
|
+
* @param {Object} cancelSignal
|
|
30
33
|
*/
|
|
31
34
|
constructor(transport, cmcdDataBuilder, options, cancelSignal) {
|
|
32
35
|
const cdnPrioritizer = new CdnPrioritizer(cancelSignal);
|
|
@@ -43,13 +46,15 @@ export default class SegmentFetcherCreator {
|
|
|
43
46
|
this._cmcdDataBuilder = cmcdDataBuilder;
|
|
44
47
|
}
|
|
45
48
|
/**
|
|
46
|
-
* Create a
|
|
49
|
+
* Create a `SegmentQueue`, allowing to easily perform segment requests.
|
|
47
50
|
* @param {string} bufferType - The type of buffer concerned (e.g. "audio",
|
|
48
51
|
* "video", etc.)
|
|
49
52
|
* @param {Object} eventListeners
|
|
50
|
-
* @returns {Object}
|
|
53
|
+
* @returns {Object} - `SegmentQueue`, which is an abstraction allowing to
|
|
54
|
+
* perform a queue of segment requests for a given media type (here defined by
|
|
55
|
+
* `bufferType`) with associated priorities.
|
|
51
56
|
*/
|
|
52
|
-
|
|
57
|
+
createSegmentQueue(bufferType, eventListeners) {
|
|
53
58
|
const requestOptions = getSegmentFetcherRequestOptions(this._backoffOptions);
|
|
54
59
|
const pipelines = this._transport[bufferType];
|
|
55
60
|
// Types are very complicated here as they are per-type of buffer.
|
|
@@ -61,6 +66,7 @@ export default class SegmentFetcherCreator {
|
|
|
61
66
|
eventListeners,
|
|
62
67
|
requestOptions,
|
|
63
68
|
});
|
|
64
|
-
|
|
69
|
+
const prioritizedSegmentFetcher = applyPrioritizerToSegmentFetcher(this._prioritizer, segmentFetcher);
|
|
70
|
+
return new SegmentQueue(prioritizedSegmentFetcher);
|
|
65
71
|
}
|
|
66
72
|
}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import type { CancellationSignal } from "../../../utils/task_canceller";
|
|
2
|
+
/**
|
|
3
|
+
* Utilitary class which allows to perform multiple tasks at once each with an
|
|
4
|
+
* associated priority.
|
|
5
|
+
*
|
|
6
|
+
* This class will then schedule the given tasks in the right order based on the
|
|
7
|
+
* priorities.
|
|
8
|
+
*
|
|
9
|
+
* @class TaskPrioritizer
|
|
10
|
+
*/
|
|
2
11
|
export default class TaskPrioritizer<T> {
|
|
3
12
|
/**
|
|
4
13
|
* Priority of the most prioritary task currently running.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task_prioritizer.d.ts","sourceRoot":"","sources":["../../../../../src/core/fetchers/segment/task_prioritizer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGxE,MAAM,CAAC,OAAO,OAAO,eAAe,CAAC,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,mBAAmB,CAAgB;IAC3C,2EAA2E;IAC3E,OAAO,CAAC,aAAa,CAA6B;IAClD,gCAAgC;IAChC,OAAO,CAAC,aAAa,CAA6B;IAClD,qCAAqC;IACrC,OAAO,CAAC,cAAc,CAA4B;IAElD;;OAEG;gBACS,EAAE,aAAa,EAAE,EAAE,mBAAmB;IAclD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACI,MAAM,CACX,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,yBAAyB,EACpC,YAAY,EAAE,kBAAkB,GAC/B,OAAO,CAAC,CAAC,CAAC;IAoFb,OAAO,CAAC,QAAQ;IA2BhB;;;;OAIG;IACI,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAwElE;;;;;;;OAOG;IACH,OAAO,CAAC,wBAAwB;IAwBhC;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;
|
|
1
|
+
{"version":3,"file":"task_prioritizer.d.ts","sourceRoot":"","sources":["../../../../../src/core/fetchers/segment/task_prioritizer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGxE;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe,CAAC,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,mBAAmB,CAAgB;IAC3C,2EAA2E;IAC3E,OAAO,CAAC,aAAa,CAA6B;IAClD,gCAAgC;IAChC,OAAO,CAAC,aAAa,CAA6B;IAClD,qCAAqC;IACrC,OAAO,CAAC,cAAc,CAA4B;IAElD;;OAEG;gBACS,EAAE,aAAa,EAAE,EAAE,mBAAmB;IAclD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACI,MAAM,CACX,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,yBAAyB,EACpC,YAAY,EAAE,kBAAkB,GAC/B,OAAO,CAAC,CAAC,CAAC;IAoFb,OAAO,CAAC,QAAQ;IA2BhB;;;;OAIG;IACI,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAwElE;;;;;;;OAOG;IACH,OAAO,CAAC,wBAAwB;IAwBhC;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;IAalC;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;IAUnC;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAkB7B;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;CAMpC;AAkBD;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,kBAAkB,EAAE,kBAAkB,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAwBhF,gDAAgD;AAChD,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,aAAa,EAAE,yBAAyB,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,yBAAyB;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;OAKG;IACH,iBAAiB,IAAI,IAAI,CAAC;IAC1B;;;;;;OAMG;IACH,WAAW,IAAI,IAAI,CAAC;CACrB"}
|
|
@@ -2,6 +2,15 @@ import log from "../../../log";
|
|
|
2
2
|
import arrayFindIndex from "../../../utils/array_find_index";
|
|
3
3
|
import createCancellablePromise from "../../../utils/create_cancellable_promise";
|
|
4
4
|
import TaskCanceller, { CancellationError } from "../../../utils/task_canceller";
|
|
5
|
+
/**
|
|
6
|
+
* Utilitary class which allows to perform multiple tasks at once each with an
|
|
7
|
+
* associated priority.
|
|
8
|
+
*
|
|
9
|
+
* This class will then schedule the given tasks in the right order based on the
|
|
10
|
+
* priorities.
|
|
11
|
+
*
|
|
12
|
+
* @class TaskPrioritizer
|
|
13
|
+
*/
|
|
5
14
|
export default class TaskPrioritizer {
|
|
6
15
|
/**
|
|
7
16
|
* @param {Options} prioritizerOptions
|
|
@@ -240,8 +249,7 @@ export default class TaskPrioritizer {
|
|
|
240
249
|
* `this._prioritySteps.low`).
|
|
241
250
|
*/
|
|
242
251
|
_interruptCancellableTasks() {
|
|
243
|
-
for (
|
|
244
|
-
const pendingObj = this._pendingTasks[i];
|
|
252
|
+
for (const pendingObj of this._pendingTasks) {
|
|
245
253
|
if (pendingObj.priority >= this._prioritySteps.low) {
|
|
246
254
|
this._interruptPendingTask(pendingObj);
|
|
247
255
|
// The previous call could have a lot of potential side-effects.
|
|
@@ -253,7 +253,7 @@ export async function scheduleRequestWithCdns(cdns, cdnPrioritizer, performReque
|
|
|
253
253
|
const canceller = new TaskCanceller();
|
|
254
254
|
const unlinkCanceller = canceller.linkToSignal(cancellationSignal);
|
|
255
255
|
return new Promise((res, rej) => {
|
|
256
|
-
|
|
256
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
257
257
|
cdnPrioritizer === null || cdnPrioritizer === void 0 ? void 0 : cdnPrioritizer.addEventListener("priorityChange", () => {
|
|
258
258
|
const updatedPrioritaryCdn = getCdnToRequest();
|
|
259
259
|
if (cancellationSignal.isCancelled()) {
|
|
@@ -450,10 +450,10 @@ function getEndingPositionFromAdaptation(adaptation) {
|
|
|
450
450
|
* This variable allows to optimize the logic here when this is the case.
|
|
451
451
|
*/
|
|
452
452
|
let lastIndex;
|
|
453
|
-
for (
|
|
454
|
-
if (
|
|
455
|
-
lastIndex =
|
|
456
|
-
const lastPosition =
|
|
453
|
+
for (const representation of representations) {
|
|
454
|
+
if (representation.index !== lastIndex) {
|
|
455
|
+
lastIndex = representation.index;
|
|
456
|
+
const lastPosition = representation.index.getEnd();
|
|
457
457
|
if (lastPosition === undefined) {
|
|
458
458
|
// we cannot tell
|
|
459
459
|
return undefined;
|