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,5 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
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
3
|
describe("isSeekingApproximate", () => {
|
|
10
4
|
beforeEach(() => {
|
|
11
5
|
vi.resetModules();
|
|
@@ -15,19 +9,19 @@ describe("isSeekingApproximate", () => {
|
|
|
15
9
|
vi.doMock("../browser_detection", () => {
|
|
16
10
|
return { isTizen: true };
|
|
17
11
|
});
|
|
18
|
-
const shouldAppendBufferAfterPadding = (
|
|
19
|
-
"../is_seeking_approximate"
|
|
20
|
-
)
|
|
21
|
-
expect(shouldAppendBufferAfterPadding
|
|
12
|
+
const shouldAppendBufferAfterPadding = (
|
|
13
|
+
await vi.importActual("../is_seeking_approximate")
|
|
14
|
+
).default;
|
|
15
|
+
expect(shouldAppendBufferAfterPadding).toBe(true);
|
|
22
16
|
});
|
|
23
17
|
|
|
24
18
|
it("should be false if not on tizen", async () => {
|
|
25
19
|
vi.doMock("../browser_detection", () => {
|
|
26
20
|
return { isTizen: false };
|
|
27
21
|
});
|
|
28
|
-
const shouldAppendBufferAfterPadding = (
|
|
29
|
-
"../is_seeking_approximate"
|
|
30
|
-
)
|
|
31
|
-
expect(shouldAppendBufferAfterPadding
|
|
22
|
+
const shouldAppendBufferAfterPadding = (
|
|
23
|
+
await vi.importActual("../is_seeking_approximate")
|
|
24
|
+
).default;
|
|
25
|
+
expect(shouldAppendBufferAfterPadding).toBe(false);
|
|
32
26
|
});
|
|
33
27
|
});
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect, vi } from "vitest";
|
|
2
2
|
import globalScope from "../../utils/global_scope";
|
|
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-assignment */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
8
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
import type IIsVTTCue from "../is_vtt_cue";
|
|
9
4
|
|
|
10
5
|
describe("Compat - isVTTCue", () => {
|
|
11
6
|
interface IFakeWindow {
|
|
@@ -27,8 +22,8 @@ describe("Compat - isVTTCue", () => {
|
|
|
27
22
|
const originalVTTCue = globalScope.VTTCue;
|
|
28
23
|
gs.VTTCue = MockVTTCue;
|
|
29
24
|
const cue = new VTTCue(0, 10, "");
|
|
30
|
-
const isVTTCue = (await vi.importActual("../is_vtt_cue")) as
|
|
31
|
-
expect(isVTTCue
|
|
25
|
+
const isVTTCue = (await vi.importActual("../is_vtt_cue")).default as typeof IIsVTTCue;
|
|
26
|
+
expect(isVTTCue(cue)).toEqual(true);
|
|
32
27
|
globalScope.VTTCue = originalVTTCue;
|
|
33
28
|
});
|
|
34
29
|
|
|
@@ -39,9 +34,9 @@ describe("Compat - isVTTCue", () => {
|
|
|
39
34
|
startTime: 0,
|
|
40
35
|
endTime: 10,
|
|
41
36
|
text: "toto",
|
|
42
|
-
};
|
|
43
|
-
const isVTTCue = (await vi.importActual("../is_vtt_cue")) as
|
|
44
|
-
expect(isVTTCue
|
|
37
|
+
} as unknown as VTTCue;
|
|
38
|
+
const isVTTCue = (await vi.importActual("../is_vtt_cue")).default as typeof IIsVTTCue;
|
|
39
|
+
expect(isVTTCue(cue)).toEqual(false);
|
|
45
40
|
globalScope.VTTCue = originalVTTCue;
|
|
46
41
|
});
|
|
47
42
|
|
|
@@ -50,8 +45,8 @@ describe("Compat - isVTTCue", () => {
|
|
|
50
45
|
gs.VTTCue = MockVTTCue;
|
|
51
46
|
const cue = new VTTCue(0, 10, "");
|
|
52
47
|
delete gs.VTTCue;
|
|
53
|
-
const isVTTCue = (await vi.importActual("../is_vtt_cue")) as
|
|
54
|
-
expect(isVTTCue
|
|
48
|
+
const isVTTCue = (await vi.importActual("../is_vtt_cue")).default as typeof IIsVTTCue;
|
|
49
|
+
expect(isVTTCue(cue)).toEqual(false);
|
|
55
50
|
globalScope.VTTCue = originalVTTCue;
|
|
56
51
|
});
|
|
57
52
|
});
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
2
|
import globalScope from "../../utils/global_scope";
|
|
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-assignment */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
8
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
import type IMakeCue from "../make_vtt_cue";
|
|
9
4
|
|
|
10
5
|
describe("Compat - makeVTTCue", () => {
|
|
11
6
|
class MockVTTCue {
|
|
@@ -39,11 +34,11 @@ describe("Compat - makeVTTCue", () => {
|
|
|
39
34
|
vi.doMock("../../log", () => ({
|
|
40
35
|
default: mockLog,
|
|
41
36
|
}));
|
|
42
|
-
const makeCue = (await vi.importActual("../make_vtt_cue")) as
|
|
37
|
+
const makeCue = (await vi.importActual("../make_vtt_cue")).default as typeof IMakeCue;
|
|
43
38
|
let result: unknown;
|
|
44
39
|
let error: unknown;
|
|
45
40
|
try {
|
|
46
|
-
result = makeCue
|
|
41
|
+
result = makeCue(5, 10, "toto");
|
|
47
42
|
} catch (e: unknown) {
|
|
48
43
|
error = e;
|
|
49
44
|
}
|
|
@@ -59,8 +54,8 @@ describe("Compat - makeVTTCue", () => {
|
|
|
59
54
|
vi.doMock("../../log", () => ({
|
|
60
55
|
default: mockLog,
|
|
61
56
|
}));
|
|
62
|
-
const makeCue = (await vi.importActual("../make_vtt_cue")) as
|
|
63
|
-
const result = makeCue
|
|
57
|
+
const makeCue = (await vi.importActual("../make_vtt_cue")).default as typeof IMakeCue;
|
|
58
|
+
const result = makeCue(12, 10, "toto");
|
|
64
59
|
expect(result).toBeNull();
|
|
65
60
|
expect(mockLog.warn).toHaveBeenCalledTimes(1);
|
|
66
61
|
expect(mockLog.warn).toHaveBeenCalledWith("Compat: Invalid cue times: 12 - 10");
|
|
@@ -72,8 +67,8 @@ describe("Compat - makeVTTCue", () => {
|
|
|
72
67
|
vi.doMock("../../log", () => ({
|
|
73
68
|
default: mockLog,
|
|
74
69
|
}));
|
|
75
|
-
const makeCue = (await vi.importActual("../make_vtt_cue")) as
|
|
76
|
-
const result = makeCue
|
|
70
|
+
const makeCue = (await vi.importActual("../make_vtt_cue")).default as typeof IMakeCue;
|
|
71
|
+
const result = makeCue(10, 12, "toto");
|
|
77
72
|
expect(result).toEqual(new MockVTTCue(10, 12, "toto"));
|
|
78
73
|
expect(mockLog.warn).not.toHaveBeenCalled();
|
|
79
74
|
});
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { describe, it, expect, vi } from "vitest";
|
|
2
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
|
-
|
|
8
3
|
import globalScope from "../../utils/global_scope";
|
|
9
4
|
import patchWebkitSourceBuffer from "../patch_webkit_source_buffer";
|
|
10
5
|
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
const gs = globalScope as typeof globalScope & {
|
|
7
|
+
WebKitSourceBuffer?:
|
|
8
|
+
| {
|
|
9
|
+
new (): unknown;
|
|
10
|
+
prototype: {
|
|
11
|
+
appendBuffer(data: BufferSource): void;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
| undefined;
|
|
15
|
+
};
|
|
13
16
|
|
|
14
17
|
describe("compat - parseWebkitSourceBuffer", () => {
|
|
15
18
|
it("should do nothing if no WebkitSourceBuffer", () => {
|
|
@@ -22,14 +25,14 @@ describe("compat - parseWebkitSourceBuffer", () => {
|
|
|
22
25
|
|
|
23
26
|
it("should do nothing if has WebkitSourceBuffer with addEventListener", () => {
|
|
24
27
|
const origWebKitSourceBuffer = gs.WebKitSourceBuffer;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
gs.WebKitSourceBuffer =
|
|
28
|
+
class MockWebkitSourceBuffer {
|
|
29
|
+
addEventListener() {
|
|
30
|
+
/* noop */
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
gs.WebKitSourceBuffer = MockWebkitSourceBuffer as typeof gs.WebKitSourceBuffer;
|
|
31
34
|
patchWebkitSourceBuffer();
|
|
32
|
-
expect(gs.WebKitSourceBuffer).toEqual(
|
|
35
|
+
expect(gs.WebKitSourceBuffer).toEqual(MockWebkitSourceBuffer);
|
|
33
36
|
gs.WebKitSourceBuffer = origWebKitSourceBuffer;
|
|
34
37
|
});
|
|
35
38
|
|
|
@@ -41,20 +44,23 @@ describe("compat - parseWebkitSourceBuffer", () => {
|
|
|
41
44
|
const _mockEmitUpdate = vi.fn(() => ({}));
|
|
42
45
|
const mockAppend = vi.fn(() => ({}));
|
|
43
46
|
|
|
44
|
-
gs.WebKitSourceBuffer = mockWebKitSourceBuffer;
|
|
47
|
+
gs.WebKitSourceBuffer = mockWebKitSourceBuffer as typeof gs.WebKitSourceBuffer;
|
|
45
48
|
patchWebkitSourceBuffer();
|
|
46
49
|
|
|
47
|
-
gs.WebKitSourceBuffer
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
gs.WebKitSourceBuffer?.prototype.appendBuffer.call(
|
|
51
|
+
{
|
|
52
|
+
updating: false,
|
|
53
|
+
trigger: mockTrigger,
|
|
54
|
+
_emitUpdate: _mockEmitUpdate,
|
|
55
|
+
append: mockAppend,
|
|
56
|
+
},
|
|
57
|
+
new Uint8Array([]),
|
|
58
|
+
);
|
|
53
59
|
|
|
54
60
|
expect(mockTrigger).toHaveBeenCalledTimes(1);
|
|
55
|
-
expect(mockTrigger).toHaveBeenCalledWith("updatestart");
|
|
61
|
+
expect(mockTrigger).toHaveBeenCalledWith("updatestart", new Event("updatestart"));
|
|
56
62
|
expect(_mockEmitUpdate).toHaveBeenCalledTimes(1);
|
|
57
|
-
expect(_mockEmitUpdate).toHaveBeenCalledWith("update");
|
|
63
|
+
expect(_mockEmitUpdate).toHaveBeenCalledWith("update", new Event("update"));
|
|
58
64
|
gs.WebKitSourceBuffer = origWebKitSourceBuffer;
|
|
59
65
|
});
|
|
60
66
|
|
|
@@ -65,17 +71,20 @@ describe("compat - parseWebkitSourceBuffer", () => {
|
|
|
65
71
|
const mockTrigger = vi.fn(() => ({}));
|
|
66
72
|
const _mockEmitUpdate = vi.fn(() => ({}));
|
|
67
73
|
|
|
68
|
-
gs.WebKitSourceBuffer = mockWebKitSourceBuffer;
|
|
74
|
+
gs.WebKitSourceBuffer = mockWebKitSourceBuffer as typeof gs.WebKitSourceBuffer;
|
|
69
75
|
patchWebkitSourceBuffer();
|
|
70
76
|
|
|
71
|
-
gs.WebKitSourceBuffer
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
gs.WebKitSourceBuffer?.prototype.appendBuffer.call(
|
|
78
|
+
{
|
|
79
|
+
updating: false,
|
|
80
|
+
trigger: mockTrigger,
|
|
81
|
+
_emitUpdate: _mockEmitUpdate,
|
|
82
|
+
},
|
|
83
|
+
new Uint8Array([]),
|
|
84
|
+
);
|
|
76
85
|
|
|
77
86
|
expect(mockTrigger).toHaveBeenCalledTimes(1);
|
|
78
|
-
expect(mockTrigger).toHaveBeenCalledWith("updatestart");
|
|
87
|
+
expect(mockTrigger).toHaveBeenCalledWith("updatestart", new Event("updatestart"));
|
|
79
88
|
expect(_mockEmitUpdate).toHaveBeenCalledTimes(1);
|
|
80
89
|
|
|
81
90
|
const err = new TypeError("this.append is not a function");
|
|
@@ -86,11 +95,14 @@ describe("compat - parseWebkitSourceBuffer", () => {
|
|
|
86
95
|
it("(appendBuffer) should fail to update buffer if updating", () => {
|
|
87
96
|
const origWebKitSourceBuffer = gs.WebKitSourceBuffer;
|
|
88
97
|
const mockWebKitSourceBuffer = { prototype: {} };
|
|
89
|
-
gs.WebKitSourceBuffer = mockWebKitSourceBuffer;
|
|
98
|
+
gs.WebKitSourceBuffer = mockWebKitSourceBuffer as typeof gs.WebKitSourceBuffer;
|
|
90
99
|
patchWebkitSourceBuffer();
|
|
91
100
|
|
|
92
101
|
expect(() =>
|
|
93
|
-
gs.WebKitSourceBuffer
|
|
102
|
+
gs.WebKitSourceBuffer?.prototype.appendBuffer.call(
|
|
103
|
+
{ updating: true },
|
|
104
|
+
new Uint8Array([]),
|
|
105
|
+
),
|
|
94
106
|
).toThrowError("updating");
|
|
95
107
|
gs.WebKitSourceBuffer = origWebKitSourceBuffer;
|
|
96
108
|
});
|
|
@@ -1,12 +1,6 @@
|
|
|
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 IRemoveCue from "../remove_cue";
|
|
10
4
|
|
|
11
5
|
describe("compat - removeCue", () => {
|
|
12
6
|
beforeEach(() => {
|
|
@@ -14,7 +8,7 @@ describe("compat - removeCue", () => {
|
|
|
14
8
|
});
|
|
15
9
|
|
|
16
10
|
it("should remove cue from track if not on firefox", async () => {
|
|
17
|
-
const fakeTrackCues = [{ id: "1" }];
|
|
11
|
+
const fakeTrackCues = [{ id: "1" }] as unknown as TextTrackCue[];
|
|
18
12
|
|
|
19
13
|
const mockRemoveCue = vi.fn((cue: { id: string }) => {
|
|
20
14
|
const idx = arrayFindIndex(fakeTrackCues, (c) => {
|
|
@@ -37,16 +31,17 @@ describe("compat - removeCue", () => {
|
|
|
37
31
|
cues: fakeTrackCues,
|
|
38
32
|
activeCues: [],
|
|
39
33
|
removeCue: mockRemoveCue,
|
|
40
|
-
};
|
|
34
|
+
} as unknown as TextTrack;
|
|
41
35
|
|
|
42
36
|
vi.doMock("../browser_detection", () => ({
|
|
43
37
|
isFirefox: false,
|
|
44
38
|
}));
|
|
45
39
|
|
|
46
|
-
const removeCue = (
|
|
47
|
-
|
|
40
|
+
const removeCue = (await vi.importActual("../remove_cue"))
|
|
41
|
+
.default as typeof IRemoveCue;
|
|
42
|
+
removeCue(fakeTrack, { id: "1" } as unknown as TextTrackCue);
|
|
48
43
|
|
|
49
|
-
expect(fakeTrack.cues
|
|
44
|
+
expect(fakeTrack.cues?.length).toBe(0);
|
|
50
45
|
expect(mockRemoveCue).toHaveBeenCalledTimes(1);
|
|
51
46
|
expect(mockGetMode).not.toHaveBeenCalled();
|
|
52
47
|
expect(mockSetMode).not.toHaveBeenCalled();
|
|
@@ -55,7 +50,7 @@ describe("compat - removeCue", () => {
|
|
|
55
50
|
});
|
|
56
51
|
|
|
57
52
|
it("should remove cue from track if on firefox and is active cue", async () => {
|
|
58
|
-
const fakeCue = { id: "1" };
|
|
53
|
+
const fakeCue = { id: "1" } as unknown as TextTrackCue;
|
|
59
54
|
const fakeTrackCues = [fakeCue];
|
|
60
55
|
let fakeMode = "showing";
|
|
61
56
|
|
|
@@ -84,16 +79,17 @@ describe("compat - removeCue", () => {
|
|
|
84
79
|
cues: fakeTrackCues,
|
|
85
80
|
activeCues: fakeTrackCues,
|
|
86
81
|
removeCue: mockRemoveCue,
|
|
87
|
-
};
|
|
82
|
+
} as unknown as TextTrack;
|
|
88
83
|
|
|
89
84
|
vi.doMock("../browser_detection", () => ({
|
|
90
85
|
isFirefox: true,
|
|
91
86
|
}));
|
|
92
87
|
|
|
93
|
-
const removeCue = (
|
|
88
|
+
const removeCue = (await vi.importActual("../remove_cue"))
|
|
89
|
+
.default as typeof IRemoveCue;
|
|
94
90
|
removeCue(fakeTrack, fakeCue);
|
|
95
91
|
|
|
96
|
-
expect(fakeTrack.cues
|
|
92
|
+
expect(fakeTrack.cues?.length).toBe(0);
|
|
97
93
|
expect(mockRemoveCue).toHaveBeenCalledTimes(1);
|
|
98
94
|
expect(mockGetMode).toHaveBeenCalledTimes(1);
|
|
99
95
|
expect(mockSetMode).toHaveBeenCalledTimes(2);
|
|
@@ -102,7 +98,7 @@ describe("compat - removeCue", () => {
|
|
|
102
98
|
});
|
|
103
99
|
|
|
104
100
|
it("should remove cue from track if on firefox and is not active cue", async () => {
|
|
105
|
-
const fakeCue = { id: "1" };
|
|
101
|
+
const fakeCue = { id: "1" } as unknown as TextTrackCue;
|
|
106
102
|
const fakeTrackCue = [fakeCue];
|
|
107
103
|
let fakeMode = "showing";
|
|
108
104
|
|
|
@@ -131,16 +127,17 @@ describe("compat - removeCue", () => {
|
|
|
131
127
|
cues: fakeTrackCue,
|
|
132
128
|
activeCues: [],
|
|
133
129
|
removeCue: mockRemoveCue,
|
|
134
|
-
};
|
|
130
|
+
} as unknown as TextTrack;
|
|
135
131
|
|
|
136
132
|
vi.doMock("../browser_detection", () => ({
|
|
137
133
|
isFirefox: true,
|
|
138
134
|
}));
|
|
139
135
|
|
|
140
|
-
const removeCue = (
|
|
136
|
+
const removeCue = (await vi.importActual("../remove_cue"))
|
|
137
|
+
.default as typeof IRemoveCue;
|
|
141
138
|
removeCue(fakeTrack, fakeCue);
|
|
142
139
|
|
|
143
|
-
expect(fakeTrack.cues
|
|
140
|
+
expect(fakeTrack.cues?.length).toBe(0);
|
|
144
141
|
expect(mockRemoveCue).toHaveBeenCalledTimes(1);
|
|
145
142
|
expect(mockGetMode).not.toHaveBeenCalled();
|
|
146
143
|
expect(mockSetMode).not.toHaveBeenCalled();
|
|
@@ -149,12 +146,12 @@ describe("compat - removeCue", () => {
|
|
|
149
146
|
});
|
|
150
147
|
|
|
151
148
|
it("should log if removeCue throws if on firefox and is active cue", async () => {
|
|
152
|
-
const fakeCue = { id: "1" };
|
|
149
|
+
const fakeCue: TextTrackCue = { id: "1" } as unknown as TextTrackCue;
|
|
153
150
|
const fakeTrackCues = [fakeCue];
|
|
154
151
|
const mockRemoveCue = vi.fn(() => {
|
|
155
152
|
throw new Error();
|
|
156
153
|
});
|
|
157
|
-
const mockLog = vi.fn((message) => message);
|
|
154
|
+
const mockLog = vi.fn((message: unknown) => message);
|
|
158
155
|
|
|
159
156
|
vi.doMock("../browser_detection", () => ({
|
|
160
157
|
isFirefox: true,
|
|
@@ -165,17 +162,18 @@ describe("compat - removeCue", () => {
|
|
|
165
162
|
},
|
|
166
163
|
}));
|
|
167
164
|
|
|
168
|
-
const fakeTrack = {
|
|
165
|
+
const fakeTrack: TextTrack = {
|
|
169
166
|
mode: "showing",
|
|
170
167
|
cues: fakeTrackCues,
|
|
171
168
|
activeCues: fakeTrackCues,
|
|
172
169
|
removeCue: mockRemoveCue,
|
|
173
|
-
};
|
|
170
|
+
} as unknown as TextTrack;
|
|
174
171
|
|
|
175
|
-
const removeCue = (
|
|
172
|
+
const removeCue = (await vi.importActual("../remove_cue"))
|
|
173
|
+
.default as typeof IRemoveCue;
|
|
176
174
|
removeCue(fakeTrack, fakeCue);
|
|
177
175
|
|
|
178
|
-
expect(fakeTrack.cues
|
|
176
|
+
expect(fakeTrack.cues?.length).toBe(1);
|
|
179
177
|
expect(fakeTrack.mode).toBe("showing");
|
|
180
178
|
expect(mockLog).toHaveBeenCalledTimes(1);
|
|
181
179
|
expect(mockLog).toHaveBeenCalledWith("Compat: Could not remove cue from text track.");
|
|
@@ -184,7 +182,7 @@ describe("compat - removeCue", () => {
|
|
|
184
182
|
});
|
|
185
183
|
|
|
186
184
|
it("should log if removeCue throws if not on firefox", async () => {
|
|
187
|
-
const mockLog = vi.fn((message) => message);
|
|
185
|
+
const mockLog = vi.fn((message: unknown) => message);
|
|
188
186
|
const mockRemoveCue = vi.fn(() => {
|
|
189
187
|
throw new Error();
|
|
190
188
|
});
|
|
@@ -202,12 +200,13 @@ describe("compat - removeCue", () => {
|
|
|
202
200
|
mode: "showing",
|
|
203
201
|
cues: [{ id: "1" }],
|
|
204
202
|
removeCue: mockRemoveCue,
|
|
205
|
-
};
|
|
203
|
+
} as unknown as TextTrack;
|
|
206
204
|
|
|
207
|
-
const removeCue = (
|
|
208
|
-
|
|
205
|
+
const removeCue = (await vi.importActual("../remove_cue"))
|
|
206
|
+
.default as typeof IRemoveCue;
|
|
207
|
+
removeCue(fakeTrack, { id: "1" } as unknown as TextTrackCue);
|
|
209
208
|
|
|
210
|
-
expect(fakeTrack.cues
|
|
209
|
+
expect(fakeTrack.cues?.length).toBe(1);
|
|
211
210
|
expect(fakeTrack.mode).toBe("showing");
|
|
212
211
|
expect(mockLog).toHaveBeenCalledTimes(1);
|
|
213
212
|
expect(mockLog).toHaveBeenCalledWith("Compat: Could not remove cue from text track.");
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { describe, beforeEach, afterEach, it, expect, vi } from "vitest";
|
|
2
2
|
import globalScope from "../../utils/global_scope";
|
|
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-assignment */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
8
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
import type IShouldFavourCustomSafariEME from "../should_favour_custom_safari_EME";
|
|
9
4
|
|
|
10
5
|
describe("compat - shouldFavourSafariMediaKeys", () => {
|
|
11
6
|
const gs = globalScope as unknown as typeof globalThis & {
|
|
@@ -30,10 +25,10 @@ describe("compat - shouldFavourSafariMediaKeys", () => {
|
|
|
30
25
|
isSafariMobile: false,
|
|
31
26
|
};
|
|
32
27
|
});
|
|
33
|
-
const shouldFavourCustomSafariEME = (
|
|
34
|
-
"../should_favour_custom_safari_EME"
|
|
35
|
-
)
|
|
36
|
-
expect(shouldFavourCustomSafariEME
|
|
28
|
+
const shouldFavourCustomSafariEME = (
|
|
29
|
+
await vi.importActual("../should_favour_custom_safari_EME")
|
|
30
|
+
).default as typeof IShouldFavourCustomSafariEME;
|
|
31
|
+
expect(shouldFavourCustomSafariEME()).toBe(false);
|
|
37
32
|
});
|
|
38
33
|
|
|
39
34
|
it("should return false if we are on Safari Desktop but WekitMediaKeys is not available", async () => {
|
|
@@ -44,10 +39,10 @@ describe("compat - shouldFavourSafariMediaKeys", () => {
|
|
|
44
39
|
isSafariMobile: false,
|
|
45
40
|
};
|
|
46
41
|
});
|
|
47
|
-
const shouldFavourCustomSafariEME = (
|
|
48
|
-
"../should_favour_custom_safari_EME"
|
|
49
|
-
)
|
|
50
|
-
expect(shouldFavourCustomSafariEME
|
|
42
|
+
const shouldFavourCustomSafariEME = (
|
|
43
|
+
await vi.importActual("../should_favour_custom_safari_EME")
|
|
44
|
+
).default as typeof IShouldFavourCustomSafariEME;
|
|
45
|
+
expect(shouldFavourCustomSafariEME()).toBe(false);
|
|
51
46
|
});
|
|
52
47
|
|
|
53
48
|
it("should return false if we are on Safari Mobile but WekitMediaKeys is not available", async () => {
|
|
@@ -58,10 +53,10 @@ describe("compat - shouldFavourSafariMediaKeys", () => {
|
|
|
58
53
|
isSafariMobile: true,
|
|
59
54
|
};
|
|
60
55
|
});
|
|
61
|
-
const shouldFavourCustomSafariEME = (
|
|
62
|
-
"../should_favour_custom_safari_EME"
|
|
63
|
-
)
|
|
64
|
-
expect(shouldFavourCustomSafariEME
|
|
56
|
+
const shouldFavourCustomSafariEME = (
|
|
57
|
+
await vi.importActual("../should_favour_custom_safari_EME")
|
|
58
|
+
).default as typeof IShouldFavourCustomSafariEME;
|
|
59
|
+
expect(shouldFavourCustomSafariEME()).toBe(false);
|
|
65
60
|
});
|
|
66
61
|
|
|
67
62
|
it("should return true if we are on Safari Desktop and a WebKitMediaKeys implementation is available", async () => {
|
|
@@ -81,10 +76,10 @@ describe("compat - shouldFavourSafariMediaKeys", () => {
|
|
|
81
76
|
isSafariMobile: false,
|
|
82
77
|
};
|
|
83
78
|
});
|
|
84
|
-
const shouldFavourCustomSafariEME = (
|
|
85
|
-
"../should_favour_custom_safari_EME"
|
|
86
|
-
)
|
|
87
|
-
expect(shouldFavourCustomSafariEME
|
|
79
|
+
const shouldFavourCustomSafariEME = (
|
|
80
|
+
await vi.importActual("../should_favour_custom_safari_EME")
|
|
81
|
+
).default as typeof IShouldFavourCustomSafariEME;
|
|
82
|
+
expect(shouldFavourCustomSafariEME()).toBe(true);
|
|
88
83
|
});
|
|
89
84
|
|
|
90
85
|
it("should return true if we are on Safari Mobile and a WebKitMediaKeys implementation is available", async () => {
|
|
@@ -104,9 +99,9 @@ describe("compat - shouldFavourSafariMediaKeys", () => {
|
|
|
104
99
|
isSafariMobile: true,
|
|
105
100
|
};
|
|
106
101
|
});
|
|
107
|
-
const shouldFavourCustomSafariEME = (
|
|
108
|
-
"../should_favour_custom_safari_EME"
|
|
109
|
-
)
|
|
110
|
-
expect(shouldFavourCustomSafariEME
|
|
102
|
+
const shouldFavourCustomSafariEME = (
|
|
103
|
+
await vi.importActual("../should_favour_custom_safari_EME")
|
|
104
|
+
).default as typeof IShouldFavourCustomSafariEME;
|
|
105
|
+
expect(shouldFavourCustomSafariEME()).toBe(true);
|
|
111
106
|
});
|
|
112
107
|
});
|
|
@@ -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 IShouldRenewMediaKeySystemAccess from "../should_renew_media_key_system_access";
|
|
8
3
|
|
|
9
4
|
describe("compat - shouldRenewMediaKeySystemAccess", () => {
|
|
10
5
|
beforeEach(() => {
|
|
@@ -17,10 +12,10 @@ describe("compat - shouldRenewMediaKeySystemAccess", () => {
|
|
|
17
12
|
isIE11: false,
|
|
18
13
|
};
|
|
19
14
|
});
|
|
20
|
-
const shouldRenewMediaKeySystemAccess = (
|
|
21
|
-
"../should_renew_media_key_system_access"
|
|
22
|
-
)
|
|
23
|
-
expect(shouldRenewMediaKeySystemAccess
|
|
15
|
+
const shouldRenewMediaKeySystemAccess = (
|
|
16
|
+
await vi.importActual("../should_renew_media_key_system_access")
|
|
17
|
+
).default as typeof IShouldRenewMediaKeySystemAccess;
|
|
18
|
+
expect(shouldRenewMediaKeySystemAccess()).toBe(false);
|
|
24
19
|
});
|
|
25
20
|
|
|
26
21
|
it("should return true if we are on IE11", async () => {
|
|
@@ -29,12 +24,9 @@ describe("compat - shouldRenewMediaKeySystemAccess", () => {
|
|
|
29
24
|
isIE11: true,
|
|
30
25
|
};
|
|
31
26
|
});
|
|
32
|
-
const shouldRenewMediaKeySystemAccess = (
|
|
33
|
-
"../should_renew_media_key_system_access"
|
|
34
|
-
)
|
|
35
|
-
expect(shouldRenewMediaKeySystemAccess
|
|
36
|
-
});
|
|
37
|
-
beforeEach(() => {
|
|
38
|
-
vi.resetModules();
|
|
27
|
+
const shouldRenewMediaKeySystemAccess = (
|
|
28
|
+
await vi.importActual("../should_renew_media_key_system_access")
|
|
29
|
+
).default as typeof IShouldRenewMediaKeySystemAccess;
|
|
30
|
+
expect(shouldRenewMediaKeySystemAccess()).toBe(true);
|
|
39
31
|
});
|
|
40
32
|
});
|
|
@@ -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 IShouldUnsetMediaKeys from "../should_unset_media_keys";
|
|
8
3
|
|
|
9
4
|
describe("compat - shouldUnsetMediaKeys", () => {
|
|
10
5
|
beforeEach(() => {
|
|
@@ -17,10 +12,9 @@ describe("compat - shouldUnsetMediaKeys", () => {
|
|
|
17
12
|
isIE11: false,
|
|
18
13
|
};
|
|
19
14
|
});
|
|
20
|
-
const shouldUnsetMediaKeys = (await vi.importActual(
|
|
21
|
-
|
|
22
|
-
))
|
|
23
|
-
expect(shouldUnsetMediaKeys.default()).toBe(false);
|
|
15
|
+
const shouldUnsetMediaKeys = (await vi.importActual("../should_unset_media_keys"))
|
|
16
|
+
.default as typeof IShouldUnsetMediaKeys;
|
|
17
|
+
expect(shouldUnsetMediaKeys()).toBe(false);
|
|
24
18
|
});
|
|
25
19
|
|
|
26
20
|
it("should return true if we are on IE11", async () => {
|
|
@@ -29,9 +23,8 @@ describe("compat - shouldUnsetMediaKeys", () => {
|
|
|
29
23
|
isIE11: true,
|
|
30
24
|
};
|
|
31
25
|
});
|
|
32
|
-
const shouldUnsetMediaKeys = (await vi.importActual(
|
|
33
|
-
|
|
34
|
-
))
|
|
35
|
-
expect(shouldUnsetMediaKeys.default()).toBe(true);
|
|
26
|
+
const shouldUnsetMediaKeys = (await vi.importActual("../should_unset_media_keys"))
|
|
27
|
+
.default as typeof IShouldUnsetMediaKeys;
|
|
28
|
+
expect(shouldUnsetMediaKeys()).toBe(true);
|
|
36
29
|
});
|
|
37
30
|
});
|
|
@@ -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 IShouldValidateMetadata from "../should_validate_metadata";
|
|
8
3
|
|
|
9
4
|
describe("compat - shouldValidateMetadata", () => {
|
|
10
5
|
beforeEach(() => {
|
|
@@ -17,10 +12,9 @@ describe("compat - shouldValidateMetadata", () => {
|
|
|
17
12
|
isSamsungBrowser: false,
|
|
18
13
|
};
|
|
19
14
|
});
|
|
20
|
-
const shouldValidateMetadata = (await vi.importActual(
|
|
21
|
-
|
|
22
|
-
))
|
|
23
|
-
expect(shouldValidateMetadata.default()).toBe(false);
|
|
15
|
+
const shouldValidateMetadata = (await vi.importActual("../should_validate_metadata"))
|
|
16
|
+
.default as typeof IShouldValidateMetadata;
|
|
17
|
+
expect(shouldValidateMetadata()).toBe(false);
|
|
24
18
|
});
|
|
25
19
|
|
|
26
20
|
it("should return true if we are on the Samsung browser", async () => {
|
|
@@ -29,12 +23,8 @@ describe("compat - shouldValidateMetadata", () => {
|
|
|
29
23
|
isSamsungBrowser: true,
|
|
30
24
|
};
|
|
31
25
|
});
|
|
32
|
-
const shouldValidateMetadata = (await vi.importActual(
|
|
33
|
-
|
|
34
|
-
))
|
|
35
|
-
expect(shouldValidateMetadata.default()).toBe(true);
|
|
36
|
-
});
|
|
37
|
-
beforeEach(() => {
|
|
38
|
-
vi.resetModules();
|
|
26
|
+
const shouldValidateMetadata = (await vi.importActual("../should_validate_metadata"))
|
|
27
|
+
.default as typeof IShouldValidateMetadata;
|
|
28
|
+
expect(shouldValidateMetadata()).toBe(true);
|
|
39
29
|
});
|
|
40
30
|
});
|