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
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest";
|
|
2
2
|
import EventEmitter from "../event_emitter";
|
|
3
3
|
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
|
-
|
|
9
4
|
describe("utils - EventEmitter", () => {
|
|
10
5
|
it("should be able to call synchronously a callback on a given event", () => {
|
|
11
6
|
const eventEmitter = new EventEmitter<{
|
|
@@ -18,9 +13,17 @@ describe("utils - EventEmitter", () => {
|
|
|
18
13
|
});
|
|
19
14
|
|
|
20
15
|
expect(wasCalled).toEqual(0);
|
|
21
|
-
(
|
|
16
|
+
(
|
|
17
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
18
|
+
trigger(evtName: string, payload: unknown): void;
|
|
19
|
+
}
|
|
20
|
+
).trigger("something", undefined);
|
|
22
21
|
expect(wasCalled).toEqual(1);
|
|
23
|
-
(
|
|
22
|
+
(
|
|
23
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
24
|
+
trigger(evtName: string, payload: unknown): void;
|
|
25
|
+
}
|
|
26
|
+
).trigger("nope", undefined);
|
|
24
27
|
expect(wasCalled).toEqual(1);
|
|
25
28
|
eventEmitter.removeEventListener();
|
|
26
29
|
});
|
|
@@ -46,33 +49,69 @@ describe("utils - EventEmitter", () => {
|
|
|
46
49
|
expect(wasCalledWithString).toEqual(0);
|
|
47
50
|
expect(wasCalledWithObject).toEqual(0);
|
|
48
51
|
|
|
49
|
-
(
|
|
52
|
+
(
|
|
53
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
54
|
+
trigger(evtName: string, payload: unknown): void;
|
|
55
|
+
}
|
|
56
|
+
).trigger("something", undefined);
|
|
50
57
|
expect(wasCalledWithString).toEqual(0);
|
|
51
58
|
expect(wasCalledWithObject).toEqual(0);
|
|
52
59
|
|
|
53
|
-
(
|
|
60
|
+
(
|
|
61
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
62
|
+
trigger(evtName: string, payload: unknown): void;
|
|
63
|
+
}
|
|
64
|
+
).trigger("something", "a");
|
|
54
65
|
expect(wasCalledWithString).toEqual(1);
|
|
55
66
|
expect(wasCalledWithObject).toEqual(0);
|
|
56
67
|
|
|
57
|
-
(
|
|
68
|
+
(
|
|
69
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
70
|
+
trigger(evtName: string, payload: unknown): void;
|
|
71
|
+
}
|
|
72
|
+
).trigger("nope", undefined);
|
|
58
73
|
expect(wasCalledWithString).toEqual(1);
|
|
59
74
|
expect(wasCalledWithObject).toEqual(0);
|
|
60
75
|
|
|
61
|
-
(
|
|
76
|
+
(
|
|
77
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
78
|
+
trigger(evtName: string, payload: unknown): void;
|
|
79
|
+
}
|
|
80
|
+
).trigger("nope", undefined);
|
|
62
81
|
expect(wasCalledWithString).toEqual(1);
|
|
63
82
|
expect(wasCalledWithObject).toEqual(0);
|
|
64
83
|
|
|
65
|
-
(
|
|
84
|
+
(
|
|
85
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
86
|
+
trigger(evtName: string, payload: unknown): void;
|
|
87
|
+
}
|
|
88
|
+
).trigger("something", { a: "b" });
|
|
66
89
|
expect(wasCalledWithString).toEqual(1);
|
|
67
90
|
expect(wasCalledWithObject).toEqual(1);
|
|
68
91
|
|
|
69
|
-
(
|
|
70
|
-
|
|
71
|
-
|
|
92
|
+
(
|
|
93
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
94
|
+
trigger(evtName: string, payload: unknown): void;
|
|
95
|
+
}
|
|
96
|
+
).trigger("something", "a");
|
|
97
|
+
(
|
|
98
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
99
|
+
trigger(evtName: string, payload: unknown): void;
|
|
100
|
+
}
|
|
101
|
+
).trigger("something", "a");
|
|
102
|
+
(
|
|
103
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
104
|
+
trigger(evtName: string, payload: unknown): void;
|
|
105
|
+
}
|
|
106
|
+
).trigger("something", "a");
|
|
72
107
|
expect(wasCalledWithString).toEqual(4);
|
|
73
108
|
expect(wasCalledWithObject).toEqual(1);
|
|
74
109
|
|
|
75
|
-
(
|
|
110
|
+
(
|
|
111
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
112
|
+
trigger(evtName: string, payload: unknown): void;
|
|
113
|
+
}
|
|
114
|
+
).trigger("nope", undefined);
|
|
76
115
|
expect(wasCalledWithString).toEqual(4);
|
|
77
116
|
expect(wasCalledWithObject).toEqual(1);
|
|
78
117
|
eventEmitter.removeEventListener();
|
|
@@ -98,38 +137,78 @@ describe("utils - EventEmitter", () => {
|
|
|
98
137
|
expect(wasCalledWithString).toEqual(0);
|
|
99
138
|
expect(wasCalledWithObject).toEqual(0);
|
|
100
139
|
|
|
101
|
-
(
|
|
140
|
+
(
|
|
141
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
142
|
+
trigger(evtName: string, payload: unknown): void;
|
|
143
|
+
}
|
|
144
|
+
).trigger("something", undefined);
|
|
102
145
|
expect(wasCalledWithString).toEqual(0);
|
|
103
146
|
expect(wasCalledWithObject).toEqual(0);
|
|
104
147
|
|
|
105
|
-
(
|
|
148
|
+
(
|
|
149
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
150
|
+
trigger(evtName: string, payload: unknown): void;
|
|
151
|
+
}
|
|
152
|
+
).trigger("something", "a");
|
|
106
153
|
expect(wasCalledWithString).toEqual(1);
|
|
107
154
|
expect(wasCalledWithObject).toEqual(0);
|
|
108
155
|
|
|
109
|
-
(
|
|
156
|
+
(
|
|
157
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
158
|
+
trigger(evtName: string, payload: unknown): void;
|
|
159
|
+
}
|
|
160
|
+
).trigger("nope", undefined);
|
|
110
161
|
expect(wasCalledWithString).toEqual(1);
|
|
111
162
|
expect(wasCalledWithObject).toEqual(0);
|
|
112
163
|
|
|
113
|
-
(
|
|
164
|
+
(
|
|
165
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
166
|
+
trigger(evtName: string, payload: unknown): void;
|
|
167
|
+
}
|
|
168
|
+
).trigger("nope", "a");
|
|
114
169
|
expect(wasCalledWithString).toEqual(2);
|
|
115
170
|
expect(wasCalledWithObject).toEqual(0);
|
|
116
171
|
|
|
117
|
-
(
|
|
172
|
+
(
|
|
173
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
174
|
+
trigger(evtName: string, payload: unknown): void;
|
|
175
|
+
}
|
|
176
|
+
).trigger("something", { a: "b" });
|
|
118
177
|
expect(wasCalledWithString).toEqual(2);
|
|
119
178
|
expect(wasCalledWithObject).toEqual(1);
|
|
120
179
|
|
|
121
180
|
eventEmitter.removeEventListener("something", callback);
|
|
122
|
-
(
|
|
123
|
-
|
|
124
|
-
|
|
181
|
+
(
|
|
182
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
183
|
+
trigger(evtName: string, payload: unknown): void;
|
|
184
|
+
}
|
|
185
|
+
).trigger("something", "a");
|
|
186
|
+
(
|
|
187
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
188
|
+
trigger(evtName: string, payload: unknown): void;
|
|
189
|
+
}
|
|
190
|
+
).trigger("something", "a");
|
|
191
|
+
(
|
|
192
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
193
|
+
trigger(evtName: string, payload: unknown): void;
|
|
194
|
+
}
|
|
195
|
+
).trigger("something", "a");
|
|
125
196
|
expect(wasCalledWithString).toEqual(2);
|
|
126
197
|
expect(wasCalledWithObject).toEqual(1);
|
|
127
198
|
|
|
128
|
-
(
|
|
199
|
+
(
|
|
200
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
201
|
+
trigger(evtName: string, payload: unknown): void;
|
|
202
|
+
}
|
|
203
|
+
).trigger("nope", undefined);
|
|
129
204
|
expect(wasCalledWithString).toEqual(2);
|
|
130
205
|
expect(wasCalledWithObject).toEqual(1);
|
|
131
206
|
|
|
132
|
-
(
|
|
207
|
+
(
|
|
208
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
209
|
+
trigger(evtName: string, payload: unknown): void;
|
|
210
|
+
}
|
|
211
|
+
).trigger("nope", "a");
|
|
133
212
|
expect(wasCalledWithString).toEqual(3);
|
|
134
213
|
expect(wasCalledWithObject).toEqual(1);
|
|
135
214
|
eventEmitter.removeEventListener();
|
|
@@ -179,7 +258,11 @@ describe("utils - EventEmitter", () => {
|
|
|
179
258
|
expect(wasCalledWithString3).toEqual(0);
|
|
180
259
|
expect(wasCalledWithObject3).toEqual(0);
|
|
181
260
|
|
|
182
|
-
(
|
|
261
|
+
(
|
|
262
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
263
|
+
trigger(evtName: string, payload: unknown): void;
|
|
264
|
+
}
|
|
265
|
+
).trigger("something", undefined);
|
|
183
266
|
expect(wasCalledWithString1).toEqual(0);
|
|
184
267
|
expect(wasCalledWithObject1).toEqual(0);
|
|
185
268
|
expect(wasCalledWithString2).toEqual(0);
|
|
@@ -187,7 +270,11 @@ describe("utils - EventEmitter", () => {
|
|
|
187
270
|
expect(wasCalledWithString3).toEqual(0);
|
|
188
271
|
expect(wasCalledWithObject3).toEqual(0);
|
|
189
272
|
|
|
190
|
-
(
|
|
273
|
+
(
|
|
274
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
275
|
+
trigger(evtName: string, payload: unknown): void;
|
|
276
|
+
}
|
|
277
|
+
).trigger("something", "a");
|
|
191
278
|
expect(wasCalledWithString1).toEqual(1);
|
|
192
279
|
expect(wasCalledWithObject1).toEqual(0);
|
|
193
280
|
expect(wasCalledWithString2).toEqual(1);
|
|
@@ -203,7 +290,11 @@ describe("utils - EventEmitter", () => {
|
|
|
203
290
|
expect(wasCalledWithString3).toEqual(0);
|
|
204
291
|
expect(wasCalledWithObject3).toEqual(0);
|
|
205
292
|
|
|
206
|
-
(
|
|
293
|
+
(
|
|
294
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
295
|
+
trigger(evtName: string, payload: unknown): void;
|
|
296
|
+
}
|
|
297
|
+
).trigger("something", "a");
|
|
207
298
|
expect(wasCalledWithString1).toEqual(2);
|
|
208
299
|
expect(wasCalledWithObject1).toEqual(0);
|
|
209
300
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -211,7 +302,11 @@ describe("utils - EventEmitter", () => {
|
|
|
211
302
|
expect(wasCalledWithString3).toEqual(1);
|
|
212
303
|
expect(wasCalledWithObject3).toEqual(0);
|
|
213
304
|
|
|
214
|
-
(
|
|
305
|
+
(
|
|
306
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
307
|
+
trigger(evtName: string, payload: unknown): void;
|
|
308
|
+
}
|
|
309
|
+
).trigger("nope", undefined);
|
|
215
310
|
expect(wasCalledWithString1).toEqual(2);
|
|
216
311
|
expect(wasCalledWithObject1).toEqual(0);
|
|
217
312
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -219,7 +314,11 @@ describe("utils - EventEmitter", () => {
|
|
|
219
314
|
expect(wasCalledWithString3).toEqual(1);
|
|
220
315
|
expect(wasCalledWithObject3).toEqual(0);
|
|
221
316
|
|
|
222
|
-
(
|
|
317
|
+
(
|
|
318
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
319
|
+
trigger(evtName: string, payload: unknown): void;
|
|
320
|
+
}
|
|
321
|
+
).trigger("nope", "a");
|
|
223
322
|
expect(wasCalledWithString1).toEqual(3);
|
|
224
323
|
expect(wasCalledWithObject1).toEqual(0);
|
|
225
324
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -227,7 +326,11 @@ describe("utils - EventEmitter", () => {
|
|
|
227
326
|
expect(wasCalledWithString3).toEqual(2);
|
|
228
327
|
expect(wasCalledWithObject3).toEqual(0);
|
|
229
328
|
|
|
230
|
-
(
|
|
329
|
+
(
|
|
330
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
331
|
+
trigger(evtName: string, payload: unknown): void;
|
|
332
|
+
}
|
|
333
|
+
).trigger("something", { a: "b" });
|
|
231
334
|
expect(wasCalledWithString1).toEqual(3);
|
|
232
335
|
expect(wasCalledWithObject1).toEqual(1);
|
|
233
336
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -243,7 +346,11 @@ describe("utils - EventEmitter", () => {
|
|
|
243
346
|
expect(wasCalledWithString3).toEqual(2);
|
|
244
347
|
expect(wasCalledWithObject3).toEqual(1);
|
|
245
348
|
|
|
246
|
-
(
|
|
349
|
+
(
|
|
350
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
351
|
+
trigger(evtName: string, payload: unknown): void;
|
|
352
|
+
}
|
|
353
|
+
).trigger("something", { a: "b" });
|
|
247
354
|
expect(wasCalledWithString1).toEqual(3);
|
|
248
355
|
expect(wasCalledWithObject1).toEqual(2);
|
|
249
356
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -251,7 +358,11 @@ describe("utils - EventEmitter", () => {
|
|
|
251
358
|
expect(wasCalledWithString3).toEqual(2);
|
|
252
359
|
expect(wasCalledWithObject3).toEqual(2);
|
|
253
360
|
|
|
254
|
-
(
|
|
361
|
+
(
|
|
362
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
363
|
+
trigger(evtName: string, payload: unknown): void;
|
|
364
|
+
}
|
|
365
|
+
).trigger("nope", { a: "b" });
|
|
255
366
|
expect(wasCalledWithString1).toEqual(3);
|
|
256
367
|
expect(wasCalledWithObject1).toEqual(3);
|
|
257
368
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -305,7 +416,11 @@ describe("utils - EventEmitter", () => {
|
|
|
305
416
|
expect(wasCalledWithString3).toEqual(0);
|
|
306
417
|
expect(wasCalledWithObject3).toEqual(0);
|
|
307
418
|
|
|
308
|
-
(
|
|
419
|
+
(
|
|
420
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
421
|
+
trigger(evtName: string, payload: unknown): void;
|
|
422
|
+
}
|
|
423
|
+
).trigger("something", undefined);
|
|
309
424
|
expect(wasCalledWithString1).toEqual(0);
|
|
310
425
|
expect(wasCalledWithObject1).toEqual(0);
|
|
311
426
|
expect(wasCalledWithString2).toEqual(0);
|
|
@@ -313,7 +428,11 @@ describe("utils - EventEmitter", () => {
|
|
|
313
428
|
expect(wasCalledWithString3).toEqual(0);
|
|
314
429
|
expect(wasCalledWithObject3).toEqual(0);
|
|
315
430
|
|
|
316
|
-
(
|
|
431
|
+
(
|
|
432
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
433
|
+
trigger(evtName: string, payload: unknown): void;
|
|
434
|
+
}
|
|
435
|
+
).trigger("something", "a");
|
|
317
436
|
expect(wasCalledWithString1).toEqual(1);
|
|
318
437
|
expect(wasCalledWithObject1).toEqual(0);
|
|
319
438
|
expect(wasCalledWithString2).toEqual(1);
|
|
@@ -329,7 +448,11 @@ describe("utils - EventEmitter", () => {
|
|
|
329
448
|
expect(wasCalledWithString3).toEqual(0);
|
|
330
449
|
expect(wasCalledWithObject3).toEqual(0);
|
|
331
450
|
|
|
332
|
-
(
|
|
451
|
+
(
|
|
452
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
453
|
+
trigger(evtName: string, payload: unknown): void;
|
|
454
|
+
}
|
|
455
|
+
).trigger("something", "a");
|
|
333
456
|
expect(wasCalledWithString1).toEqual(2);
|
|
334
457
|
expect(wasCalledWithObject1).toEqual(0);
|
|
335
458
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -337,7 +460,11 @@ describe("utils - EventEmitter", () => {
|
|
|
337
460
|
expect(wasCalledWithString3).toEqual(1);
|
|
338
461
|
expect(wasCalledWithObject3).toEqual(0);
|
|
339
462
|
|
|
340
|
-
(
|
|
463
|
+
(
|
|
464
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
465
|
+
trigger(evtName: string, payload: unknown): void;
|
|
466
|
+
}
|
|
467
|
+
).trigger("nope", undefined);
|
|
341
468
|
expect(wasCalledWithString1).toEqual(2);
|
|
342
469
|
expect(wasCalledWithObject1).toEqual(0);
|
|
343
470
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -345,7 +472,11 @@ describe("utils - EventEmitter", () => {
|
|
|
345
472
|
expect(wasCalledWithString3).toEqual(1);
|
|
346
473
|
expect(wasCalledWithObject3).toEqual(0);
|
|
347
474
|
|
|
348
|
-
(
|
|
475
|
+
(
|
|
476
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
477
|
+
trigger(evtName: string, payload: unknown): void;
|
|
478
|
+
}
|
|
479
|
+
).trigger("nope", "a");
|
|
349
480
|
expect(wasCalledWithString1).toEqual(3);
|
|
350
481
|
expect(wasCalledWithObject1).toEqual(0);
|
|
351
482
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -353,7 +484,11 @@ describe("utils - EventEmitter", () => {
|
|
|
353
484
|
expect(wasCalledWithString3).toEqual(2);
|
|
354
485
|
expect(wasCalledWithObject3).toEqual(0);
|
|
355
486
|
|
|
356
|
-
(
|
|
487
|
+
(
|
|
488
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
489
|
+
trigger(evtName: string, payload: unknown): void;
|
|
490
|
+
}
|
|
491
|
+
).trigger("something", { a: "b" });
|
|
357
492
|
expect(wasCalledWithString1).toEqual(3);
|
|
358
493
|
expect(wasCalledWithObject1).toEqual(1);
|
|
359
494
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -369,7 +504,11 @@ describe("utils - EventEmitter", () => {
|
|
|
369
504
|
expect(wasCalledWithString3).toEqual(2);
|
|
370
505
|
expect(wasCalledWithObject3).toEqual(1);
|
|
371
506
|
|
|
372
|
-
(
|
|
507
|
+
(
|
|
508
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
509
|
+
trigger(evtName: string, payload: unknown): void;
|
|
510
|
+
}
|
|
511
|
+
).trigger("something", { a: "b" });
|
|
373
512
|
expect(wasCalledWithString1).toEqual(3);
|
|
374
513
|
expect(wasCalledWithObject1).toEqual(1);
|
|
375
514
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -377,7 +516,11 @@ describe("utils - EventEmitter", () => {
|
|
|
377
516
|
expect(wasCalledWithString3).toEqual(2);
|
|
378
517
|
expect(wasCalledWithObject3).toEqual(1);
|
|
379
518
|
|
|
380
|
-
(
|
|
519
|
+
(
|
|
520
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
521
|
+
trigger(evtName: string, payload: unknown): void;
|
|
522
|
+
}
|
|
523
|
+
).trigger("nope", { a: "b" });
|
|
381
524
|
expect(wasCalledWithString1).toEqual(3);
|
|
382
525
|
expect(wasCalledWithObject1).toEqual(2);
|
|
383
526
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -431,7 +574,11 @@ describe("utils - EventEmitter", () => {
|
|
|
431
574
|
expect(wasCalledWithString3).toEqual(0);
|
|
432
575
|
expect(wasCalledWithObject3).toEqual(0);
|
|
433
576
|
|
|
434
|
-
(
|
|
577
|
+
(
|
|
578
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
579
|
+
trigger(evtName: string, payload: unknown): void;
|
|
580
|
+
}
|
|
581
|
+
).trigger("something", undefined);
|
|
435
582
|
expect(wasCalledWithString1).toEqual(0);
|
|
436
583
|
expect(wasCalledWithObject1).toEqual(0);
|
|
437
584
|
expect(wasCalledWithString2).toEqual(0);
|
|
@@ -439,7 +586,11 @@ describe("utils - EventEmitter", () => {
|
|
|
439
586
|
expect(wasCalledWithString3).toEqual(0);
|
|
440
587
|
expect(wasCalledWithObject3).toEqual(0);
|
|
441
588
|
|
|
442
|
-
(
|
|
589
|
+
(
|
|
590
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
591
|
+
trigger(evtName: string, payload: unknown): void;
|
|
592
|
+
}
|
|
593
|
+
).trigger("something", "a");
|
|
443
594
|
expect(wasCalledWithString1).toEqual(1);
|
|
444
595
|
expect(wasCalledWithObject1).toEqual(0);
|
|
445
596
|
expect(wasCalledWithString2).toEqual(1);
|
|
@@ -455,7 +606,11 @@ describe("utils - EventEmitter", () => {
|
|
|
455
606
|
expect(wasCalledWithString3).toEqual(0);
|
|
456
607
|
expect(wasCalledWithObject3).toEqual(0);
|
|
457
608
|
|
|
458
|
-
(
|
|
609
|
+
(
|
|
610
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
611
|
+
trigger(evtName: string, payload: unknown): void;
|
|
612
|
+
}
|
|
613
|
+
).trigger("something", "a");
|
|
459
614
|
expect(wasCalledWithString1).toEqual(2);
|
|
460
615
|
expect(wasCalledWithObject1).toEqual(0);
|
|
461
616
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -463,7 +618,11 @@ describe("utils - EventEmitter", () => {
|
|
|
463
618
|
expect(wasCalledWithString3).toEqual(1);
|
|
464
619
|
expect(wasCalledWithObject3).toEqual(0);
|
|
465
620
|
|
|
466
|
-
(
|
|
621
|
+
(
|
|
622
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
623
|
+
trigger(evtName: string, payload: unknown): void;
|
|
624
|
+
}
|
|
625
|
+
).trigger("nope", undefined);
|
|
467
626
|
expect(wasCalledWithString1).toEqual(2);
|
|
468
627
|
expect(wasCalledWithObject1).toEqual(0);
|
|
469
628
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -471,7 +630,11 @@ describe("utils - EventEmitter", () => {
|
|
|
471
630
|
expect(wasCalledWithString3).toEqual(1);
|
|
472
631
|
expect(wasCalledWithObject3).toEqual(0);
|
|
473
632
|
|
|
474
|
-
(
|
|
633
|
+
(
|
|
634
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
635
|
+
trigger(evtName: string, payload: unknown): void;
|
|
636
|
+
}
|
|
637
|
+
).trigger("nope", "a");
|
|
475
638
|
expect(wasCalledWithString1).toEqual(3);
|
|
476
639
|
expect(wasCalledWithObject1).toEqual(0);
|
|
477
640
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -479,7 +642,11 @@ describe("utils - EventEmitter", () => {
|
|
|
479
642
|
expect(wasCalledWithString3).toEqual(2);
|
|
480
643
|
expect(wasCalledWithObject3).toEqual(0);
|
|
481
644
|
|
|
482
|
-
(
|
|
645
|
+
(
|
|
646
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
647
|
+
trigger(evtName: string, payload: unknown): void;
|
|
648
|
+
}
|
|
649
|
+
).trigger("something", { a: "b" });
|
|
483
650
|
expect(wasCalledWithString1).toEqual(3);
|
|
484
651
|
expect(wasCalledWithObject1).toEqual(1);
|
|
485
652
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -495,7 +662,11 @@ describe("utils - EventEmitter", () => {
|
|
|
495
662
|
expect(wasCalledWithString3).toEqual(2);
|
|
496
663
|
expect(wasCalledWithObject3).toEqual(1);
|
|
497
664
|
|
|
498
|
-
(
|
|
665
|
+
(
|
|
666
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
667
|
+
trigger(evtName: string, payload: unknown): void;
|
|
668
|
+
}
|
|
669
|
+
).trigger("something", { a: "b" });
|
|
499
670
|
expect(wasCalledWithString1).toEqual(3);
|
|
500
671
|
expect(wasCalledWithObject1).toEqual(1);
|
|
501
672
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -503,7 +674,11 @@ describe("utils - EventEmitter", () => {
|
|
|
503
674
|
expect(wasCalledWithString3).toEqual(2);
|
|
504
675
|
expect(wasCalledWithObject3).toEqual(1);
|
|
505
676
|
|
|
506
|
-
(
|
|
677
|
+
(
|
|
678
|
+
eventEmitter as EventEmitter<unknown> & {
|
|
679
|
+
trigger(evtName: string, payload: unknown): void;
|
|
680
|
+
}
|
|
681
|
+
).trigger("nope", { a: "b" });
|
|
507
682
|
expect(wasCalledWithString1).toEqual(3);
|
|
508
683
|
expect(wasCalledWithObject1).toEqual(1);
|
|
509
684
|
expect(wasCalledWithString2).toEqual(2);
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { describe, beforeEach, afterEach, it, expect, vi } from "vitest";
|
|
2
2
|
import flatMap from "../flat_map";
|
|
3
3
|
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
6
|
-
|
|
7
4
|
interface IProtoWithFlatMap {
|
|
8
5
|
flatMap?:
|
|
9
6
|
| (<U, This = undefined>(
|
|
@@ -20,9 +17,8 @@ interface IProtoWithFlatMap {
|
|
|
20
17
|
|
|
21
18
|
const proto = Array.prototype as unknown as IProtoWithFlatMap;
|
|
22
19
|
|
|
23
|
-
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
24
21
|
const initialFlatMap = proto.flatMap;
|
|
25
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
26
22
|
|
|
27
23
|
describe("utils - starts-with", () => {
|
|
28
24
|
beforeEach(() => {
|
|
@@ -44,7 +40,7 @@ describe("utils - starts-with", () => {
|
|
|
44
40
|
it("should call the original flatMap function if available", () => {
|
|
45
41
|
proto.flatMap = initialFlatMap;
|
|
46
42
|
// TODO find what bother typescript here instead of adding "as any"
|
|
47
|
-
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
44
|
const mockFlatMap = vi.spyOn(proto as any, "flatMap");
|
|
49
45
|
const func1 = (x: number): number[] => [x, x + 1, x - 1];
|
|
50
46
|
const func2 = (x: number): string => String(x) + "a";
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { describe, beforeEach, afterEach, it, expect, vi } from "vitest";
|
|
2
2
|
import startsWith from "../starts_with";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/* eslint-disable @typescript-eslint/unbound-method */
|
|
4
|
+
// eslint-disable-next-line no-restricted-properties, @typescript-eslint/unbound-method
|
|
7
5
|
const initialStartsWith = String.prototype.startsWith;
|
|
8
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
9
6
|
|
|
10
7
|
describe("utils - starts-with", () => {
|
|
11
8
|
beforeEach(() => {
|
|
12
|
-
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
// @ts-expect-error: We're setting `startsWith` to `undefined` to
|
|
10
|
+
// specifically test our own implementation
|
|
11
|
+
// eslint-disable-next-line no-restricted-properties
|
|
12
|
+
String.prototype.startsWith = undefined;
|
|
16
13
|
});
|
|
17
14
|
|
|
18
15
|
afterEach(() => {
|
|
16
|
+
// eslint-disable-next-line no-restricted-properties
|
|
19
17
|
String.prototype.startsWith = initialStartsWith;
|
|
20
18
|
});
|
|
21
19
|
|
|
@@ -34,6 +32,7 @@ describe("utils - starts-with", () => {
|
|
|
34
32
|
|
|
35
33
|
if (typeof initialStartsWith === "function") {
|
|
36
34
|
it("should call the original startsWith function if available", () => {
|
|
35
|
+
// eslint-disable-next-line no-restricted-properties
|
|
37
36
|
String.prototype.startsWith = initialStartsWith;
|
|
38
37
|
const mockStartsWith = vi.spyOn(String.prototype, "startsWith");
|
|
39
38
|
const str = "Street Halo";
|
package/src/utils/array_find.ts
CHANGED
|
@@ -14,12 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
18
|
-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
19
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
20
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
21
|
-
/* eslint-disable no-restricted-properties */
|
|
22
|
-
|
|
23
17
|
// Ugly transitory type to make duck typing work
|
|
24
18
|
type ArrayWithFind<T> = T[] & {
|
|
25
19
|
find(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: unknown): T;
|
|
@@ -29,7 +23,7 @@ type ArrayWithFind<T> = T[] & {
|
|
|
29
23
|
* Array.prototype.find ponyfill.
|
|
30
24
|
* @param {Array} arr
|
|
31
25
|
* @param {Function} predicate
|
|
32
|
-
* @param {*}
|
|
26
|
+
* @param {*} thisArg
|
|
33
27
|
* @returns {boolean}
|
|
34
28
|
*/
|
|
35
29
|
export default function arrayFind<T>(
|
|
@@ -37,7 +31,9 @@ export default function arrayFind<T>(
|
|
|
37
31
|
predicate: (arg: T, index: number, fullArray: T[]) => boolean,
|
|
38
32
|
thisArg?: unknown,
|
|
39
33
|
): T | undefined {
|
|
34
|
+
// eslint-disable-next-line no-restricted-properties, @typescript-eslint/unbound-method
|
|
40
35
|
if (typeof (Array.prototype as ArrayWithFind<T>).find === "function") {
|
|
36
|
+
// eslint-disable-next-line no-restricted-properties
|
|
41
37
|
return (arr as ArrayWithFind<T>).find(predicate, thisArg);
|
|
42
38
|
}
|
|
43
39
|
|
|
@@ -14,12 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
18
|
-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
19
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
20
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
21
|
-
/* eslint-disable no-restricted-properties */
|
|
22
|
-
|
|
23
17
|
// Ugly transitory type to make duck typing work
|
|
24
18
|
type ArrayWithFindIndex<T> = T[] & {
|
|
25
19
|
findIndex(
|
|
@@ -32,7 +26,7 @@ type ArrayWithFindIndex<T> = T[] & {
|
|
|
32
26
|
* Array.prototype.find ponyfill.
|
|
33
27
|
* @param {Array} arr
|
|
34
28
|
* @param {Function} predicate
|
|
35
|
-
* @param {*}
|
|
29
|
+
* @param {*} thisArg
|
|
36
30
|
* @returns {boolean}
|
|
37
31
|
*/
|
|
38
32
|
export default function arrayFindIndex<T>(
|
|
@@ -40,7 +34,9 @@ export default function arrayFindIndex<T>(
|
|
|
40
34
|
predicate: (arg: T, index: number, fullArray: T[]) => boolean,
|
|
41
35
|
thisArg?: unknown,
|
|
42
36
|
): number {
|
|
37
|
+
// eslint-disable-next-line no-restricted-properties, @typescript-eslint/unbound-method
|
|
43
38
|
if (typeof (Array.prototype as ArrayWithFindIndex<T>).findIndex === "function") {
|
|
39
|
+
// eslint-disable-next-line no-restricted-properties
|
|
44
40
|
return (arr as ArrayWithFindIndex<T>).findIndex(predicate, thisArg);
|
|
45
41
|
}
|
|
46
42
|
|
|
@@ -56,10 +56,8 @@ export default function arrayIncludes<T>(
|
|
|
56
56
|
searchElement: T,
|
|
57
57
|
fromIndex?: number,
|
|
58
58
|
): boolean {
|
|
59
|
-
|
|
60
|
-
// eslint-disable-next-line no-restricted-properties
|
|
59
|
+
// eslint-disable-next-line no-restricted-properties, @typescript-eslint/unbound-method
|
|
61
60
|
if (typeof Array.prototype.includes === "function") {
|
|
62
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
63
61
|
// eslint-disable-next-line no-restricted-properties
|
|
64
62
|
return arr.includes(searchElement, fromIndex);
|
|
65
63
|
}
|
package/src/utils/assert.ts
CHANGED
|
@@ -73,12 +73,10 @@ export function assertInterface<T>(
|
|
|
73
73
|
assert(!isNullOrUndefined(o), `${name} should be an object`);
|
|
74
74
|
for (const k in iface) {
|
|
75
75
|
if (iface.hasOwnProperty(k)) {
|
|
76
|
-
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
77
76
|
assert(
|
|
78
77
|
typeof o[k] === iface[k],
|
|
79
78
|
`${name} should have property ${k} as a ${iface[k]}`,
|
|
80
79
|
);
|
|
81
|
-
/* eslint-enable @typescript-eslint/restrict-template-expressions */
|
|
82
80
|
}
|
|
83
81
|
}
|
|
84
82
|
}
|