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,13 +1,6 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
2
|
import type { IMediaElement } from "../../compat/browser_compatibility_types";
|
|
3
|
-
|
|
4
|
-
// Needed for calling require (which itself is needed to mock properly) because
|
|
5
|
-
// it is not type-checked:
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
8
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
9
|
-
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
10
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
import type IAddTextTrack from "../add_text_track";
|
|
11
4
|
|
|
12
5
|
describe("compat - addTextTrack", () => {
|
|
13
6
|
beforeEach(() => {
|
|
@@ -29,7 +22,8 @@ describe("compat - addTextTrack", () => {
|
|
|
29
22
|
vi.doMock("../browser_detection", () => ({
|
|
30
23
|
isIEOrEdge: true,
|
|
31
24
|
}));
|
|
32
|
-
const
|
|
25
|
+
const addTextTrack = (await vi.importActual("../add_text_track"))
|
|
26
|
+
.default as typeof IAddTextTrack;
|
|
33
27
|
const { track, trackElement } = addTextTrack(fakeMediaElement);
|
|
34
28
|
expect(trackElement).toBe(undefined);
|
|
35
29
|
expect(track).toBe(fakeTextTrack);
|
|
@@ -58,7 +52,8 @@ describe("compat - addTextTrack", () => {
|
|
|
58
52
|
isIEOrEdge: true,
|
|
59
53
|
}));
|
|
60
54
|
|
|
61
|
-
const
|
|
55
|
+
const addTextTrack = (await vi.importActual("../add_text_track"))
|
|
56
|
+
.default as typeof IAddTextTrack;
|
|
62
57
|
const { track, trackElement } = addTextTrack(fakeMediaElement);
|
|
63
58
|
expect(trackElement).toBe(undefined);
|
|
64
59
|
expect(track).toBe(fakeTextTrack);
|
|
@@ -72,7 +67,8 @@ describe("compat - addTextTrack", () => {
|
|
|
72
67
|
vi.doMock("../browser_detection", () => ({
|
|
73
68
|
isIEOrEdge: false,
|
|
74
69
|
}));
|
|
75
|
-
const
|
|
70
|
+
const addTextTrack = (await vi.importActual("../add_text_track"))
|
|
71
|
+
.default as typeof IAddTextTrack;
|
|
76
72
|
|
|
77
73
|
const fakeTextTrack = {
|
|
78
74
|
id: "textTrack1",
|
|
@@ -87,7 +83,7 @@ describe("compat - addTextTrack", () => {
|
|
|
87
83
|
const fakeTextTracks: TextTrack[] = [];
|
|
88
84
|
const fakeChildNodes: ChildNode[] = [];
|
|
89
85
|
|
|
90
|
-
const mockAppendChild = vi.fn((_trackElement) => {
|
|
86
|
+
const mockAppendChild = vi.fn((_trackElement: HTMLTrackElement) => {
|
|
91
87
|
fakeChildNodes.push(_trackElement);
|
|
92
88
|
fakeTextTracks.push(_trackElement.track);
|
|
93
89
|
});
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
2
|
import globalScope from "../../utils/global_scope";
|
|
3
3
|
|
|
4
|
-
// Needed for calling require (which itself is needed to mock properly) because
|
|
5
|
-
// it is not type-checked:
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
8
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
9
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
10
|
-
|
|
11
4
|
describe("compat - browser compatibility types", () => {
|
|
12
5
|
interface IFakeWindow {
|
|
13
6
|
MediaSource?: unknown;
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
import { describe, afterEach, it, expect, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import type { getFirefoxVersion as IGetFirefoxVersion } from "../browser_version";
|
|
7
3
|
|
|
8
4
|
describe("Compat - Browser version", () => {
|
|
9
5
|
const origUserAgent = navigator.userAgent;
|
|
10
6
|
Object.defineProperty(
|
|
11
7
|
navigator,
|
|
12
8
|
"userAgent",
|
|
13
|
-
((
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
((initVal: string) => {
|
|
10
|
+
let value = initVal;
|
|
11
|
+
return {
|
|
12
|
+
get() {
|
|
13
|
+
return value;
|
|
14
|
+
},
|
|
15
|
+
set(v: string) {
|
|
16
|
+
value = v;
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
})(navigator.userAgent),
|
|
23
20
|
);
|
|
24
21
|
|
|
25
22
|
const nav = navigator as {
|
|
@@ -35,7 +32,8 @@ describe("Compat - Browser version", () => {
|
|
|
35
32
|
vi.doMock("../browser_detection", () => {
|
|
36
33
|
return { isFirefox: true };
|
|
37
34
|
});
|
|
38
|
-
const
|
|
35
|
+
const getFirefoxVersion = (await vi.importActual("../browser_version"))
|
|
36
|
+
.getFirefoxVersion as typeof IGetFirefoxVersion;
|
|
39
37
|
nav.userAgent = "Firefox/60.0";
|
|
40
38
|
const version = getFirefoxVersion();
|
|
41
39
|
expect(version).toBe(60);
|
|
@@ -45,7 +43,8 @@ describe("Compat - Browser version", () => {
|
|
|
45
43
|
vi.doMock("../browser_detection", () => {
|
|
46
44
|
return { isFirefox: true };
|
|
47
45
|
});
|
|
48
|
-
const
|
|
46
|
+
const getFirefoxVersion = (await vi.importActual("../browser_version"))
|
|
47
|
+
.getFirefoxVersion as typeof IGetFirefoxVersion;
|
|
49
48
|
nav.userAgent = "Firefox/80.0";
|
|
50
49
|
const version = getFirefoxVersion();
|
|
51
50
|
expect(version).toBe(80);
|
|
@@ -55,7 +54,8 @@ describe("Compat - Browser version", () => {
|
|
|
55
54
|
vi.doMock("../browser_detection", () => {
|
|
56
55
|
return { isFirefox: false };
|
|
57
56
|
});
|
|
58
|
-
const
|
|
57
|
+
const getFirefoxVersion = (await vi.importActual("../browser_version"))
|
|
58
|
+
.getFirefoxVersion as typeof IGetFirefoxVersion;
|
|
59
59
|
const version = getFirefoxVersion();
|
|
60
60
|
expect(version).toBe(null);
|
|
61
61
|
});
|
|
@@ -64,7 +64,8 @@ describe("Compat - Browser version", () => {
|
|
|
64
64
|
vi.doMock("../browser_detection", () => {
|
|
65
65
|
return { isFirefox: true };
|
|
66
66
|
});
|
|
67
|
-
const
|
|
67
|
+
const getFirefoxVersion = (await vi.importActual("../browser_version"))
|
|
68
|
+
.getFirefoxVersion as typeof IGetFirefoxVersion;
|
|
68
69
|
nav.userAgent = "FireFennec/80.0";
|
|
69
70
|
const version = getFirefoxVersion();
|
|
70
71
|
expect(version).toBe(-1);
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import type ICanPatchISOBMFFSegment from "../can_patch_isobmff";
|
|
8
3
|
|
|
9
4
|
describe("compat - canPatchISOBMFFSegment", () => {
|
|
10
5
|
beforeEach(() => {
|
|
@@ -17,8 +12,9 @@ describe("compat - canPatchISOBMFFSegment", () => {
|
|
|
17
12
|
isIEOrEdge: false,
|
|
18
13
|
};
|
|
19
14
|
});
|
|
20
|
-
const canPatchISOBMFFSegment = (await vi.importActual("../can_patch_isobmff"))
|
|
21
|
-
|
|
15
|
+
const canPatchISOBMFFSegment = (await vi.importActual("../can_patch_isobmff"))
|
|
16
|
+
.default as typeof ICanPatchISOBMFFSegment;
|
|
17
|
+
expect(canPatchISOBMFFSegment()).toBe(true);
|
|
22
18
|
});
|
|
23
19
|
|
|
24
20
|
it("should return false if we are on IE11 or Edge", async () => {
|
|
@@ -27,7 +23,8 @@ describe("compat - canPatchISOBMFFSegment", () => {
|
|
|
27
23
|
isIEOrEdge: true,
|
|
28
24
|
};
|
|
29
25
|
});
|
|
30
|
-
const canPatchISOBMFFSegment = (await vi.importActual("../can_patch_isobmff"))
|
|
31
|
-
|
|
26
|
+
const canPatchISOBMFFSegment = (await vi.importActual("../can_patch_isobmff"))
|
|
27
|
+
.default as typeof ICanPatchISOBMFFSegment;
|
|
28
|
+
expect(canPatchISOBMFFSegment()).toBe(false);
|
|
32
29
|
});
|
|
33
30
|
});
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { describe, afterEach, it, expect, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import type ICanRelyOnVideoVisibilityAndSize from "../can_rely_on_video_visibility_and_size";
|
|
7
3
|
|
|
8
4
|
describe("Compat - canRelyOnVideoVisibilityAndSize", () => {
|
|
9
5
|
afterEach(() => {
|
|
@@ -14,10 +10,10 @@ describe("Compat - canRelyOnVideoVisibilityAndSize", () => {
|
|
|
14
10
|
vi.doMock("../browser_detection", () => {
|
|
15
11
|
return { isFirefox: false };
|
|
16
12
|
});
|
|
17
|
-
const canRelyOnVideoVisibilityAndSize = (
|
|
18
|
-
"../can_rely_on_video_visibility_and_size.ts"
|
|
19
|
-
)
|
|
20
|
-
expect(canRelyOnVideoVisibilityAndSize
|
|
13
|
+
const canRelyOnVideoVisibilityAndSize = (
|
|
14
|
+
await vi.importActual("../can_rely_on_video_visibility_and_size.ts")
|
|
15
|
+
).default as typeof ICanRelyOnVideoVisibilityAndSize;
|
|
16
|
+
expect(canRelyOnVideoVisibilityAndSize()).toBe(true);
|
|
21
17
|
});
|
|
22
18
|
|
|
23
19
|
it("should return true on Firefox but the version is unknown", async () => {
|
|
@@ -27,10 +23,10 @@ describe("Compat - canRelyOnVideoVisibilityAndSize", () => {
|
|
|
27
23
|
vi.doMock("../browser_version", () => {
|
|
28
24
|
return { getFirefoxVersion: () => -1 };
|
|
29
25
|
});
|
|
30
|
-
const canRelyOnVideoVisibilityAndSize = (
|
|
31
|
-
"../can_rely_on_video_visibility_and_size.ts"
|
|
32
|
-
)
|
|
33
|
-
expect(canRelyOnVideoVisibilityAndSize
|
|
26
|
+
const canRelyOnVideoVisibilityAndSize = (
|
|
27
|
+
await vi.importActual("../can_rely_on_video_visibility_and_size.ts")
|
|
28
|
+
).default as typeof ICanRelyOnVideoVisibilityAndSize;
|
|
29
|
+
expect(canRelyOnVideoVisibilityAndSize()).toBe(true);
|
|
34
30
|
});
|
|
35
31
|
|
|
36
32
|
it("should return true on Firefox < 67>", async () => {
|
|
@@ -40,10 +36,10 @@ describe("Compat - canRelyOnVideoVisibilityAndSize", () => {
|
|
|
40
36
|
vi.doMock("../browser_version", () => {
|
|
41
37
|
return { getFirefoxVersion: () => 60 };
|
|
42
38
|
});
|
|
43
|
-
const canRelyOnVideoVisibilityAndSize = (
|
|
44
|
-
"../can_rely_on_video_visibility_and_size.ts"
|
|
45
|
-
)
|
|
46
|
-
expect(canRelyOnVideoVisibilityAndSize
|
|
39
|
+
const canRelyOnVideoVisibilityAndSize = (
|
|
40
|
+
await vi.importActual("../can_rely_on_video_visibility_and_size.ts")
|
|
41
|
+
).default as typeof ICanRelyOnVideoVisibilityAndSize;
|
|
42
|
+
expect(canRelyOnVideoVisibilityAndSize()).toBe(true);
|
|
47
43
|
});
|
|
48
44
|
|
|
49
45
|
it("should return false on Firefox >= 67", async () => {
|
|
@@ -53,9 +49,9 @@ describe("Compat - canRelyOnVideoVisibilityAndSize", () => {
|
|
|
53
49
|
vi.doMock("../browser_version", () => {
|
|
54
50
|
return { getFirefoxVersion: () => 83 };
|
|
55
51
|
});
|
|
56
|
-
const canRelyOnVideoVisibilityAndSize = (
|
|
57
|
-
"../can_rely_on_video_visibility_and_size.ts"
|
|
58
|
-
)
|
|
59
|
-
expect(canRelyOnVideoVisibilityAndSize
|
|
52
|
+
const canRelyOnVideoVisibilityAndSize = (
|
|
53
|
+
await vi.importActual("../can_rely_on_video_visibility_and_size.ts")
|
|
54
|
+
).default as typeof ICanRelyOnVideoVisibilityAndSize;
|
|
55
|
+
expect(canRelyOnVideoVisibilityAndSize()).toBe(false);
|
|
60
56
|
});
|
|
61
57
|
});
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { describe, afterEach, it, expect, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import type ICanReuseMediaKeys from "../can_reuse_media_keys";
|
|
7
3
|
|
|
8
4
|
describe("Compat - canReuseMediaKeys", () => {
|
|
9
5
|
afterEach(() => {
|
|
@@ -14,10 +10,9 @@ describe("Compat - canReuseMediaKeys", () => {
|
|
|
14
10
|
vi.doMock("../browser_detection", () => {
|
|
15
11
|
return { isWebOs: false, isPhilipsNetTv: false, isPanasonic: false };
|
|
16
12
|
});
|
|
17
|
-
const canReuseMediaKeys = (await vi.importActual(
|
|
18
|
-
|
|
19
|
-
))
|
|
20
|
-
expect(canReuseMediaKeys.default()).toBe(true);
|
|
13
|
+
const canReuseMediaKeys = (await vi.importActual("../can_reuse_media_keys.ts"))
|
|
14
|
+
.default as typeof ICanReuseMediaKeys;
|
|
15
|
+
expect(canReuseMediaKeys()).toBe(true);
|
|
21
16
|
});
|
|
22
17
|
|
|
23
18
|
it("should return false on WebOs", async () => {
|
|
@@ -29,10 +24,9 @@ describe("Compat - canReuseMediaKeys", () => {
|
|
|
29
24
|
isPhilipsNetTv: false,
|
|
30
25
|
};
|
|
31
26
|
});
|
|
32
|
-
const canReuseMediaKeys = (await vi.importActual(
|
|
33
|
-
|
|
34
|
-
))
|
|
35
|
-
expect(canReuseMediaKeys.default()).toBe(false);
|
|
27
|
+
const canReuseMediaKeys = (await vi.importActual("../can_reuse_media_keys.ts"))
|
|
28
|
+
.default as typeof ICanReuseMediaKeys;
|
|
29
|
+
expect(canReuseMediaKeys()).toBe(false);
|
|
36
30
|
});
|
|
37
31
|
|
|
38
32
|
it("should return false on Panasonic", async () => {
|
|
@@ -44,10 +38,9 @@ describe("Compat - canReuseMediaKeys", () => {
|
|
|
44
38
|
isPhilipsNetTv: false,
|
|
45
39
|
};
|
|
46
40
|
});
|
|
47
|
-
const canReuseMediaKeys = (await vi.importActual(
|
|
48
|
-
|
|
49
|
-
))
|
|
50
|
-
expect(canReuseMediaKeys.default()).toBe(false);
|
|
41
|
+
const canReuseMediaKeys = (await vi.importActual("../can_reuse_media_keys.ts"))
|
|
42
|
+
.default as typeof ICanReuseMediaKeys;
|
|
43
|
+
expect(canReuseMediaKeys()).toBe(false);
|
|
51
44
|
});
|
|
52
45
|
|
|
53
46
|
it("should return false on Philips' NETTV", async () => {
|
|
@@ -59,9 +52,8 @@ describe("Compat - canReuseMediaKeys", () => {
|
|
|
59
52
|
isPhilipsNetTv: true,
|
|
60
53
|
};
|
|
61
54
|
});
|
|
62
|
-
const canReuseMediaKeys = (await vi.importActual(
|
|
63
|
-
|
|
64
|
-
))
|
|
65
|
-
expect(canReuseMediaKeys.default()).toBe(false);
|
|
55
|
+
const canReuseMediaKeys = (await vi.importActual("../can_reuse_media_keys.ts"))
|
|
56
|
+
.default as typeof ICanReuseMediaKeys;
|
|
57
|
+
expect(canReuseMediaKeys()).toBe(false);
|
|
66
58
|
});
|
|
67
59
|
});
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
|
-
|
|
9
2
|
import arrayFindIndex from "../../utils/array_find_index";
|
|
3
|
+
import type { IMediaElement } from "../browser_compatibility_types";
|
|
4
|
+
import type IClearElementSrc from "../clear_element_src";
|
|
10
5
|
|
|
11
6
|
describe("Compat - clearElementSrc", () => {
|
|
12
7
|
beforeEach(() => {
|
|
@@ -19,11 +14,12 @@ describe("Compat - clearElementSrc", () => {
|
|
|
19
14
|
removeAttribute() {
|
|
20
15
|
return null;
|
|
21
16
|
},
|
|
22
|
-
};
|
|
23
|
-
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
17
|
+
} as unknown as IMediaElement;
|
|
18
|
+
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
19
|
+
.default as typeof IClearElementSrc;
|
|
24
20
|
|
|
25
21
|
const spyRemoveAttribute = vi.spyOn(fakeElement, "removeAttribute");
|
|
26
|
-
clearElementSrc
|
|
22
|
+
clearElementSrc(fakeElement);
|
|
27
23
|
expect(fakeElement.src).toBe("");
|
|
28
24
|
expect(spyRemoveAttribute).toHaveBeenCalledTimes(1);
|
|
29
25
|
expect(spyRemoveAttribute).toHaveBeenCalledWith("src");
|
|
@@ -35,11 +31,12 @@ describe("Compat - clearElementSrc", () => {
|
|
|
35
31
|
removeAttribute() {
|
|
36
32
|
throw new Error("Oups, can't remove attribute.");
|
|
37
33
|
},
|
|
38
|
-
};
|
|
39
|
-
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
34
|
+
} as unknown as IMediaElement;
|
|
35
|
+
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
36
|
+
.default as typeof IClearElementSrc;
|
|
40
37
|
const spyRemoveAttribute = vi.spyOn(fakeElement, "removeAttribute");
|
|
41
38
|
|
|
42
|
-
expect(() => clearElementSrc
|
|
39
|
+
expect(() => clearElementSrc(fakeElement)).toThrowError(
|
|
43
40
|
"Oups, can't remove attribute.",
|
|
44
41
|
);
|
|
45
42
|
expect(fakeElement.src).toBe("");
|
|
@@ -55,20 +52,21 @@ describe("Compat - clearElementSrc", () => {
|
|
|
55
52
|
textTracks: [{ mode: "showing" }, { mode: "showing" }],
|
|
56
53
|
childNodes: [{ nodeName: "audio" }, { nodeName: "track" }, { nodeName: "track" }],
|
|
57
54
|
hasChildNodes: () => true,
|
|
58
|
-
removeChild: (node:
|
|
59
|
-
const
|
|
55
|
+
removeChild: (node: Node) => {
|
|
56
|
+
const childNodes = fakeElement.childNodes as Node[];
|
|
60
57
|
const idx = arrayFindIndex(childNodes, (n) => n.nodeName === node.nodeName);
|
|
61
58
|
childNodes.splice(idx, 1);
|
|
62
59
|
},
|
|
63
|
-
};
|
|
60
|
+
} as unknown as IMediaElement;
|
|
64
61
|
|
|
65
|
-
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
62
|
+
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
63
|
+
.default as typeof IClearElementSrc;
|
|
66
64
|
|
|
67
65
|
const spyRemoveAttribute = vi.spyOn(fakeElement, "removeAttribute");
|
|
68
66
|
const spyHasChildNodes = vi.spyOn(fakeElement, "hasChildNodes");
|
|
69
67
|
const spyRemoveChild = vi.spyOn(fakeElement, "removeChild");
|
|
70
68
|
|
|
71
|
-
clearElementSrc
|
|
69
|
+
clearElementSrc(fakeElement);
|
|
72
70
|
|
|
73
71
|
expect(fakeElement.src).toBe("");
|
|
74
72
|
expect(fakeElement.textTracks[0].mode).toBe("disabled");
|
|
@@ -93,19 +91,20 @@ describe("Compat - clearElementSrc", () => {
|
|
|
93
91
|
removeChild: () => {
|
|
94
92
|
throw new Error();
|
|
95
93
|
},
|
|
96
|
-
};
|
|
94
|
+
} as unknown as IMediaElement;
|
|
97
95
|
|
|
98
|
-
const mockLogWarn = vi.fn((message) => message);
|
|
96
|
+
const mockLogWarn = vi.fn((message: unknown) => message);
|
|
99
97
|
vi.doMock("../../log", () => ({
|
|
100
98
|
default: { warn: mockLogWarn },
|
|
101
99
|
}));
|
|
102
|
-
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
100
|
+
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
101
|
+
.default as typeof IClearElementSrc;
|
|
103
102
|
|
|
104
103
|
const spyRemoveAttribute = vi.spyOn(fakeElement, "removeAttribute");
|
|
105
104
|
const spyHasChildNodes = vi.spyOn(fakeElement, "hasChildNodes");
|
|
106
105
|
const spyRemoveChild = vi.spyOn(fakeElement, "removeChild");
|
|
107
106
|
|
|
108
|
-
clearElementSrc
|
|
107
|
+
clearElementSrc(fakeElement);
|
|
109
108
|
|
|
110
109
|
expect(fakeElement.src).toBe("");
|
|
111
110
|
expect(fakeElement.textTracks[0].mode).toBe("disabled");
|
|
@@ -135,15 +134,16 @@ describe("Compat - clearElementSrc", () => {
|
|
|
135
134
|
childNodes: [{ nodeName: "audio" }],
|
|
136
135
|
hasChildNodes: () => true,
|
|
137
136
|
removeChild: () => null,
|
|
138
|
-
};
|
|
137
|
+
} as unknown as IMediaElement;
|
|
139
138
|
|
|
140
|
-
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
139
|
+
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
140
|
+
.default as typeof IClearElementSrc;
|
|
141
141
|
|
|
142
142
|
const spyRemoveAttribute = vi.spyOn(fakeElement, "removeAttribute");
|
|
143
143
|
const spyHasChildNodes = vi.spyOn(fakeElement, "hasChildNodes");
|
|
144
144
|
const spyRemoveChild = vi.spyOn(fakeElement, "removeChild");
|
|
145
145
|
|
|
146
|
-
clearElementSrc
|
|
146
|
+
clearElementSrc(fakeElement);
|
|
147
147
|
|
|
148
148
|
expect(fakeElement.src).toBe("");
|
|
149
149
|
expect(fakeElement.childNodes).toEqual([{ nodeName: "audio" }]);
|
|
@@ -163,15 +163,16 @@ describe("Compat - clearElementSrc", () => {
|
|
|
163
163
|
childNodes: [],
|
|
164
164
|
hasChildNodes: () => false,
|
|
165
165
|
removeChild: () => null,
|
|
166
|
-
};
|
|
166
|
+
} as unknown as IMediaElement;
|
|
167
167
|
|
|
168
|
-
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
168
|
+
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
169
|
+
.default as typeof IClearElementSrc;
|
|
169
170
|
|
|
170
171
|
const spyRemoveAttribute = vi.spyOn(fakeElement, "removeAttribute");
|
|
171
172
|
const spyHasChildNodes = vi.spyOn(fakeElement, "hasChildNodes");
|
|
172
173
|
const spyRemoveChild = vi.spyOn(fakeElement, "removeChild");
|
|
173
174
|
|
|
174
|
-
clearElementSrc
|
|
175
|
+
clearElementSrc(fakeElement);
|
|
175
176
|
|
|
176
177
|
expect(fakeElement.src).toBe("");
|
|
177
178
|
expect(fakeElement.childNodes).toEqual([]);
|
|
@@ -191,15 +192,16 @@ describe("Compat - clearElementSrc", () => {
|
|
|
191
192
|
childNodes: [],
|
|
192
193
|
hasChildNodes: () => false,
|
|
193
194
|
removeChild: () => null,
|
|
194
|
-
};
|
|
195
|
+
} as unknown as IMediaElement;
|
|
195
196
|
|
|
196
|
-
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
197
|
+
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
198
|
+
.default as typeof IClearElementSrc;
|
|
197
199
|
|
|
198
200
|
const spyRemoveAttribute = vi.spyOn(fakeElement, "removeAttribute");
|
|
199
201
|
const spyHasChildNodes = vi.spyOn(fakeElement, "hasChildNodes");
|
|
200
202
|
const spyRemoveChild = vi.spyOn(fakeElement, "removeChild");
|
|
201
203
|
|
|
202
|
-
clearElementSrc
|
|
204
|
+
clearElementSrc(fakeElement);
|
|
203
205
|
|
|
204
206
|
expect(fakeElement.src).toBe("");
|
|
205
207
|
expect(fakeElement.childNodes).toEqual([]);
|
|
@@ -219,15 +221,16 @@ describe("Compat - clearElementSrc", () => {
|
|
|
219
221
|
childNodes: [],
|
|
220
222
|
hasChildNodes: () => false,
|
|
221
223
|
removeChild: () => null,
|
|
222
|
-
};
|
|
224
|
+
} as unknown as IMediaElement;
|
|
223
225
|
|
|
224
|
-
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
226
|
+
const clearElementSrc = (await vi.importActual("../clear_element_src"))
|
|
227
|
+
.default as typeof IClearElementSrc;
|
|
225
228
|
|
|
226
229
|
const spyRemoveAttribute = vi.spyOn(fakeElement, "removeAttribute");
|
|
227
230
|
const spyHasChildNodes = vi.spyOn(fakeElement, "hasChildNodes");
|
|
228
231
|
const spyRemoveChild = vi.spyOn(fakeElement, "removeChild");
|
|
229
232
|
|
|
230
|
-
clearElementSrc
|
|
233
|
+
clearElementSrc(fakeElement);
|
|
231
234
|
|
|
232
235
|
expect(fakeElement.src).toBe("");
|
|
233
236
|
expect(fakeElement.childNodes).toEqual([]);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
|
+
import type IEnableAudioTrack from "../enable_audio_track";
|
|
2
3
|
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
4
|
describe("compat - enableAudioTrack", () => {
|
|
9
5
|
beforeEach(() => {
|
|
10
6
|
vi.resetModules();
|
|
@@ -39,16 +35,17 @@ describe("compat - enableAudioTrack", () => {
|
|
|
39
35
|
enabled: false,
|
|
40
36
|
},
|
|
41
37
|
];
|
|
42
|
-
const enableAudioTrack = (await vi.importActual("../enable_audio_track"))
|
|
43
|
-
|
|
38
|
+
const enableAudioTrack = (await vi.importActual("../enable_audio_track"))
|
|
39
|
+
.default as typeof IEnableAudioTrack;
|
|
40
|
+
expect(enableAudioTrack(fakeAudioTracks, 2)).toEqual(true);
|
|
44
41
|
expect(fakeAudioTracks[0].enabled).toBe(false);
|
|
45
42
|
expect(fakeAudioTracks[1].enabled).toBe(false);
|
|
46
43
|
expect(fakeAudioTracks[2].enabled).toBe(true);
|
|
47
|
-
expect(enableAudioTrack
|
|
44
|
+
expect(enableAudioTrack(fakeAudioTracks, 1)).toEqual(true);
|
|
48
45
|
expect(fakeAudioTracks[0].enabled).toBe(false);
|
|
49
46
|
expect(fakeAudioTracks[1].enabled).toBe(true);
|
|
50
47
|
expect(fakeAudioTracks[2].enabled).toBe(false);
|
|
51
|
-
expect(enableAudioTrack
|
|
48
|
+
expect(enableAudioTrack(fakeAudioTracks, 0)).toEqual(true);
|
|
52
49
|
expect(fakeAudioTracks[0].enabled).toBe(true);
|
|
53
50
|
expect(fakeAudioTracks[1].enabled).toBe(false);
|
|
54
51
|
expect(fakeAudioTracks[2].enabled).toBe(false);
|
|
@@ -83,16 +80,17 @@ describe("compat - enableAudioTrack", () => {
|
|
|
83
80
|
enabled: false,
|
|
84
81
|
},
|
|
85
82
|
];
|
|
86
|
-
const enableAudioTrack = (await vi.importActual("../enable_audio_track"))
|
|
87
|
-
|
|
83
|
+
const enableAudioTrack = (await vi.importActual("../enable_audio_track"))
|
|
84
|
+
.default as typeof IEnableAudioTrack;
|
|
85
|
+
expect(enableAudioTrack(fakeAudioTracks, 2)).toEqual(true);
|
|
88
86
|
expect(fakeAudioTracks[0].enabled).toBe(false);
|
|
89
87
|
expect(fakeAudioTracks[1].enabled).toBe(false);
|
|
90
88
|
expect(fakeAudioTracks[2].enabled).toBe(true);
|
|
91
|
-
expect(enableAudioTrack
|
|
89
|
+
expect(enableAudioTrack(fakeAudioTracks, 1)).toEqual(true);
|
|
92
90
|
expect(fakeAudioTracks[0].enabled).toBe(false);
|
|
93
91
|
expect(fakeAudioTracks[1].enabled).toBe(true);
|
|
94
92
|
expect(fakeAudioTracks[2].enabled).toBe(false);
|
|
95
|
-
expect(enableAudioTrack
|
|
93
|
+
expect(enableAudioTrack(fakeAudioTracks, 0)).toEqual(true);
|
|
96
94
|
expect(fakeAudioTracks[0].enabled).toBe(true);
|
|
97
95
|
expect(fakeAudioTracks[1].enabled).toBe(false);
|
|
98
96
|
expect(fakeAudioTracks[2].enabled).toBe(false);
|
|
@@ -127,16 +125,17 @@ describe("compat - enableAudioTrack", () => {
|
|
|
127
125
|
enabled: false,
|
|
128
126
|
},
|
|
129
127
|
];
|
|
130
|
-
const enableAudioTrack = (await vi.importActual("../enable_audio_track"))
|
|
131
|
-
|
|
128
|
+
const enableAudioTrack = (await vi.importActual("../enable_audio_track"))
|
|
129
|
+
.default as typeof IEnableAudioTrack;
|
|
130
|
+
expect(enableAudioTrack(fakeAudioTracks, -1)).toEqual(false);
|
|
132
131
|
expect(fakeAudioTracks[0].enabled).toBe(false);
|
|
133
132
|
expect(fakeAudioTracks[1].enabled).toBe(false);
|
|
134
133
|
expect(fakeAudioTracks[2].enabled).toBe(false);
|
|
135
|
-
expect(enableAudioTrack
|
|
134
|
+
expect(enableAudioTrack(fakeAudioTracks, 0)).toEqual(true);
|
|
136
135
|
expect(fakeAudioTracks[0].enabled).toBe(true);
|
|
137
136
|
expect(fakeAudioTracks[1].enabled).toBe(false);
|
|
138
137
|
expect(fakeAudioTracks[2].enabled).toBe(false);
|
|
139
|
-
expect(enableAudioTrack
|
|
138
|
+
expect(enableAudioTrack(fakeAudioTracks, 4)).toEqual(false);
|
|
140
139
|
expect(fakeAudioTracks[0].enabled).toBe(false);
|
|
141
140
|
expect(fakeAudioTracks[1].enabled).toBe(false);
|
|
142
141
|
expect(fakeAudioTracks[2].enabled).toBe(false);
|
|
@@ -222,8 +221,9 @@ describe("compat - enableAudioTrack", () => {
|
|
|
222
221
|
track3IsEnabled = enabled;
|
|
223
222
|
},
|
|
224
223
|
});
|
|
225
|
-
const enableAudioTrack = (await vi.importActual("../enable_audio_track"))
|
|
226
|
-
|
|
224
|
+
const enableAudioTrack = (await vi.importActual("../enable_audio_track"))
|
|
225
|
+
.default as typeof IEnableAudioTrack;
|
|
226
|
+
expect(enableAudioTrack(fakeAudioTracks, 1)).toBe(true);
|
|
227
227
|
expect(fakeAudioTracks[0].enabled).toBe(false);
|
|
228
228
|
expect(fakeAudioTracks[1].enabled).toBe(true);
|
|
229
229
|
expect(fakeAudioTracks[2].enabled).toBe(false);
|
|
@@ -318,8 +318,9 @@ describe("compat - enableAudioTrack", () => {
|
|
|
318
318
|
track3IsEnabled = enabled;
|
|
319
319
|
},
|
|
320
320
|
});
|
|
321
|
-
const enableAudioTrack = (await vi.importActual("../enable_audio_track"))
|
|
322
|
-
|
|
321
|
+
const enableAudioTrack = (await vi.importActual("../enable_audio_track"))
|
|
322
|
+
.default as typeof IEnableAudioTrack;
|
|
323
|
+
expect(enableAudioTrack(fakeAudioTracks, 1)).toBe(true);
|
|
323
324
|
expect(fakeAudioTracks[0].enabled).toBe(false);
|
|
324
325
|
expect(fakeAudioTracks[1].enabled).toBe(true);
|
|
325
326
|
expect(fakeAudioTracks[2].enabled).toBe(false);
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import type IIsCodecSupported from "../is_codec_supported";
|
|
8
3
|
|
|
9
4
|
describe("Compat - isCodecSupported", () => {
|
|
10
5
|
beforeEach(() => {
|
|
@@ -17,9 +12,10 @@ describe("Compat - isCodecSupported", () => {
|
|
|
17
12
|
MediaSource_: undefined,
|
|
18
13
|
};
|
|
19
14
|
});
|
|
20
|
-
const isCodecSupported = (await vi.importActual("../is_codec_supported"))
|
|
21
|
-
|
|
22
|
-
expect(isCodecSupported
|
|
15
|
+
const isCodecSupported = (await vi.importActual("../is_codec_supported"))
|
|
16
|
+
.default as typeof IIsCodecSupported;
|
|
17
|
+
expect(isCodecSupported("foo")).toEqual(false);
|
|
18
|
+
expect(isCodecSupported("")).toEqual(false);
|
|
23
19
|
});
|
|
24
20
|
|
|
25
21
|
it("should return true in any case if the MediaSource does not have the right function", async () => {
|
|
@@ -28,9 +24,10 @@ describe("Compat - isCodecSupported", () => {
|
|
|
28
24
|
MediaSource_: { isTypeSupported: undefined },
|
|
29
25
|
};
|
|
30
26
|
});
|
|
31
|
-
const isCodecSupported = (await vi.importActual("../is_codec_supported"))
|
|
32
|
-
|
|
33
|
-
expect(isCodecSupported
|
|
27
|
+
const isCodecSupported = (await vi.importActual("../is_codec_supported"))
|
|
28
|
+
.default as typeof IIsCodecSupported;
|
|
29
|
+
expect(isCodecSupported("foo")).toEqual(true);
|
|
30
|
+
expect(isCodecSupported("")).toEqual(true);
|
|
34
31
|
});
|
|
35
32
|
|
|
36
33
|
it("should return true if MediaSource.isTypeSupported returns true", async () => {
|
|
@@ -43,9 +40,10 @@ describe("Compat - isCodecSupported", () => {
|
|
|
43
40
|
},
|
|
44
41
|
};
|
|
45
42
|
});
|
|
46
|
-
const isCodecSupported = (await vi.importActual("../is_codec_supported"))
|
|
47
|
-
|
|
48
|
-
expect(isCodecSupported
|
|
43
|
+
const isCodecSupported = (await vi.importActual("../is_codec_supported"))
|
|
44
|
+
.default as typeof IIsCodecSupported;
|
|
45
|
+
expect(isCodecSupported("foo")).toEqual(true);
|
|
46
|
+
expect(isCodecSupported("")).toEqual(true);
|
|
49
47
|
});
|
|
50
48
|
|
|
51
49
|
it("should return false if MediaSource.isTypeSupported returns false", async () => {
|
|
@@ -58,8 +56,9 @@ describe("Compat - isCodecSupported", () => {
|
|
|
58
56
|
},
|
|
59
57
|
};
|
|
60
58
|
});
|
|
61
|
-
const isCodecSupported = (await vi.importActual("../is_codec_supported"))
|
|
62
|
-
|
|
63
|
-
expect(isCodecSupported
|
|
59
|
+
const isCodecSupported = (await vi.importActual("../is_codec_supported"))
|
|
60
|
+
.default as typeof IIsCodecSupported;
|
|
61
|
+
expect(isCodecSupported("foo")).toEqual(false);
|
|
62
|
+
expect(isCodecSupported("")).toEqual(false);
|
|
64
63
|
});
|
|
65
64
|
});
|