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
package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaContentType.test.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
|
+
import type IProbeMediaContentType from "../../probers/mediaContentType";
|
|
2
3
|
import { ProberStatus } from "../../types";
|
|
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 */
|
|
4
|
+
import type { IMediaConfiguration } from "../../types";
|
|
9
5
|
|
|
10
6
|
describe("MediaCapabilitiesProber - probers probeMediaContentType", () => {
|
|
11
7
|
beforeEach(() => {
|
|
@@ -17,13 +13,12 @@ describe("MediaCapabilitiesProber - probers probeMediaContentType", () => {
|
|
|
17
13
|
MediaSource_: null,
|
|
18
14
|
}));
|
|
19
15
|
const probeMediaContentType = (
|
|
20
|
-
|
|
21
|
-
).default;
|
|
22
|
-
|
|
16
|
+
await vi.importActual("../../probers/mediaContentType")
|
|
17
|
+
).default as typeof IProbeMediaContentType;
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
23
19
|
expect(probeMediaContentType({})).rejects.toThrowError(
|
|
24
20
|
"MediaCapabilitiesProber >>> API_CALL: " + "MediaSource API not available",
|
|
25
21
|
);
|
|
26
|
-
/* eslint-enable @typescript-eslint/no-floating-promises */
|
|
27
22
|
});
|
|
28
23
|
|
|
29
24
|
it("should throw if no compatible isTypeSupported API", async () => {
|
|
@@ -33,13 +28,12 @@ describe("MediaCapabilitiesProber - probers probeMediaContentType", () => {
|
|
|
33
28
|
},
|
|
34
29
|
}));
|
|
35
30
|
const probeMediaContentType = (
|
|
36
|
-
|
|
37
|
-
).default;
|
|
38
|
-
|
|
31
|
+
await vi.importActual("../../probers/mediaContentType")
|
|
32
|
+
).default as typeof IProbeMediaContentType;
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
39
34
|
expect(probeMediaContentType({})).rejects.toThrowError(
|
|
40
35
|
"MediaCapabilitiesProber >>> API_CALL: " + "isTypeSupported not available",
|
|
41
36
|
);
|
|
42
|
-
/* eslint-enable @typescript-eslint/no-floating-promises */
|
|
43
37
|
});
|
|
44
38
|
|
|
45
39
|
it("should throw if no specified contentType in config", async () => {
|
|
@@ -49,12 +43,12 @@ describe("MediaCapabilitiesProber - probers probeMediaContentType", () => {
|
|
|
49
43
|
isTypeSupported: mockIsTypeSupported,
|
|
50
44
|
},
|
|
51
45
|
}));
|
|
52
|
-
const config = {
|
|
46
|
+
const config: IMediaConfiguration = {
|
|
53
47
|
type: "media-source",
|
|
54
48
|
};
|
|
55
49
|
const probeMediaContentType = (
|
|
56
|
-
|
|
57
|
-
).default;
|
|
50
|
+
await vi.importActual("../../probers/mediaContentType")
|
|
51
|
+
).default as typeof IProbeMediaContentType;
|
|
58
52
|
|
|
59
53
|
expect.assertions(1);
|
|
60
54
|
await probeMediaContentType(config).catch(({ message }: { message: string }) => {
|
|
@@ -72,15 +66,15 @@ describe("MediaCapabilitiesProber - probers probeMediaContentType", () => {
|
|
|
72
66
|
isTypeSupported: mockIsTypeSupported,
|
|
73
67
|
},
|
|
74
68
|
}));
|
|
75
|
-
const config = {
|
|
69
|
+
const config: IMediaConfiguration = {
|
|
76
70
|
type: "media-source",
|
|
77
71
|
video: {
|
|
78
72
|
contentType: "video/mp5",
|
|
79
73
|
},
|
|
80
74
|
};
|
|
81
75
|
const probeMediaContentType = (
|
|
82
|
-
|
|
83
|
-
).default;
|
|
76
|
+
await vi.importActual("../../probers/mediaContentType")
|
|
77
|
+
).default as typeof IProbeMediaContentType;
|
|
84
78
|
|
|
85
79
|
expect.assertions(2);
|
|
86
80
|
await probeMediaContentType(config)
|
|
@@ -100,15 +94,15 @@ describe("MediaCapabilitiesProber - probers probeMediaContentType", () => {
|
|
|
100
94
|
isTypeSupported: mockIsTypeSupported,
|
|
101
95
|
},
|
|
102
96
|
}));
|
|
103
|
-
const config = {
|
|
97
|
+
const config: IMediaConfiguration = {
|
|
104
98
|
type: "media-source",
|
|
105
99
|
audio: {
|
|
106
100
|
contentType: "audio/wma",
|
|
107
101
|
},
|
|
108
102
|
};
|
|
109
103
|
const probeMediaContentType = (
|
|
110
|
-
|
|
111
|
-
).default;
|
|
104
|
+
await vi.importActual("../../probers/mediaContentType")
|
|
105
|
+
).default as typeof IProbeMediaContentType;
|
|
112
106
|
|
|
113
107
|
expect.assertions(2);
|
|
114
108
|
await probeMediaContentType(config)
|
|
@@ -128,7 +122,7 @@ describe("MediaCapabilitiesProber - probers probeMediaContentType", () => {
|
|
|
128
122
|
isTypeSupported: mockIsTypeSupported,
|
|
129
123
|
},
|
|
130
124
|
}));
|
|
131
|
-
const config = {
|
|
125
|
+
const config: IMediaConfiguration = {
|
|
132
126
|
type: "media-source",
|
|
133
127
|
audio: {
|
|
134
128
|
contentType: "audio/wma",
|
|
@@ -138,8 +132,8 @@ describe("MediaCapabilitiesProber - probers probeMediaContentType", () => {
|
|
|
138
132
|
},
|
|
139
133
|
};
|
|
140
134
|
const probeMediaContentType = (
|
|
141
|
-
|
|
142
|
-
).default;
|
|
135
|
+
await vi.importActual("../../probers/mediaContentType")
|
|
136
|
+
).default as typeof IProbeMediaContentType;
|
|
143
137
|
|
|
144
138
|
expect.assertions(2);
|
|
145
139
|
await probeMediaContentType(config)
|
|
@@ -159,15 +153,15 @@ describe("MediaCapabilitiesProber - probers probeMediaContentType", () => {
|
|
|
159
153
|
isTypeSupported: mockIsTypeSupported,
|
|
160
154
|
},
|
|
161
155
|
}));
|
|
162
|
-
const config = {
|
|
156
|
+
const config: IMediaConfiguration = {
|
|
163
157
|
type: "media-source",
|
|
164
158
|
audio: {
|
|
165
159
|
contentType: "audio/wma",
|
|
166
160
|
},
|
|
167
161
|
};
|
|
168
162
|
const probeMediaContentType = (
|
|
169
|
-
|
|
170
|
-
).default;
|
|
163
|
+
await vi.importActual("../../probers/mediaContentType")
|
|
164
|
+
).default as typeof IProbeMediaContentType;
|
|
171
165
|
|
|
172
166
|
expect.assertions(2);
|
|
173
167
|
await probeMediaContentType(config)
|
|
@@ -187,15 +181,15 @@ describe("MediaCapabilitiesProber - probers probeMediaContentType", () => {
|
|
|
187
181
|
isTypeSupported: mockIsTypeSupported,
|
|
188
182
|
},
|
|
189
183
|
}));
|
|
190
|
-
const config = {
|
|
184
|
+
const config: IMediaConfiguration = {
|
|
191
185
|
type: "media-source",
|
|
192
186
|
video: {
|
|
193
187
|
contentType: "video/mp5",
|
|
194
188
|
},
|
|
195
189
|
};
|
|
196
190
|
const probeMediaContentType = (
|
|
197
|
-
|
|
198
|
-
).default;
|
|
191
|
+
await vi.importActual("../../probers/mediaContentType")
|
|
192
|
+
).default as typeof IProbeMediaContentType;
|
|
199
193
|
|
|
200
194
|
expect.assertions(2);
|
|
201
195
|
await probeMediaContentType(config)
|
|
@@ -215,7 +209,7 @@ describe("MediaCapabilitiesProber - probers probeMediaContentType", () => {
|
|
|
215
209
|
isTypeSupported: mockIsTypeSupported,
|
|
216
210
|
},
|
|
217
211
|
}));
|
|
218
|
-
const config = {
|
|
212
|
+
const config: IMediaConfiguration = {
|
|
219
213
|
type: "media-source",
|
|
220
214
|
video: {
|
|
221
215
|
contentType: "video/mp5",
|
|
@@ -225,8 +219,8 @@ describe("MediaCapabilitiesProber - probers probeMediaContentType", () => {
|
|
|
225
219
|
},
|
|
226
220
|
};
|
|
227
221
|
const probeMediaContentType = (
|
|
228
|
-
|
|
229
|
-
).default;
|
|
222
|
+
await vi.importActual("../../probers/mediaContentType")
|
|
223
|
+
).default as typeof IProbeMediaContentType;
|
|
230
224
|
|
|
231
225
|
expect.assertions(2);
|
|
232
226
|
await probeMediaContentType(config)
|
|
@@ -248,7 +242,7 @@ describe("MediaCapabilitiesProber - probers probeMediaContentType", () => {
|
|
|
248
242
|
isTypeSupported: mockIsTypeSupported,
|
|
249
243
|
},
|
|
250
244
|
}));
|
|
251
|
-
const config = {
|
|
245
|
+
const config: IMediaConfiguration = {
|
|
252
246
|
type: "media-source",
|
|
253
247
|
video: {
|
|
254
248
|
contentType: "video/mp5",
|
|
@@ -258,8 +252,8 @@ describe("MediaCapabilitiesProber - probers probeMediaContentType", () => {
|
|
|
258
252
|
},
|
|
259
253
|
};
|
|
260
254
|
const probeMediaContentType = (
|
|
261
|
-
|
|
262
|
-
).default;
|
|
255
|
+
await vi.importActual("../../probers/mediaContentType")
|
|
256
|
+
).default as typeof IProbeMediaContentType;
|
|
263
257
|
|
|
264
258
|
expect.assertions(2);
|
|
265
259
|
await probeMediaContentType(config)
|
package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts
CHANGED
|
@@ -1,92 +1,95 @@
|
|
|
1
1
|
import { describe, it, expect, vi } from "vitest";
|
|
2
2
|
import globalScope from "../../../../../utils/global_scope";
|
|
3
|
+
import type IProbeMediaDisplayInfos from "../../probers/mediaDisplayInfos";
|
|
3
4
|
import { ProberStatus } from "../../types";
|
|
4
5
|
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
8
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
9
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10
|
-
|
|
11
6
|
describe("MediaCapabilitiesProber probers probeMediaDisplayInfos", () => {
|
|
12
7
|
it("should throw if matchMedia is undefined", async () => {
|
|
13
|
-
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
14
9
|
const origMatchMedia = globalScope.matchMedia;
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
(
|
|
11
|
+
globalScope as { matchMedia: typeof globalScope.matchMedia | undefined }
|
|
12
|
+
).matchMedia = undefined;
|
|
13
|
+
|
|
17
14
|
const probeMediaDisplayInfos = (
|
|
18
|
-
|
|
19
|
-
).default;
|
|
20
|
-
|
|
15
|
+
await vi.importActual("../../probers/mediaDisplayInfos")
|
|
16
|
+
).default as typeof IProbeMediaDisplayInfos;
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
21
18
|
expect(probeMediaDisplayInfos({})).rejects.toThrowError(
|
|
22
19
|
"MediaCapabilitiesProber >>> API_CALL: matchMedia not available",
|
|
23
20
|
);
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
(
|
|
22
|
+
globalScope as { matchMedia: typeof globalScope.matchMedia | undefined }
|
|
23
|
+
).matchMedia = origMatchMedia;
|
|
26
24
|
});
|
|
27
25
|
|
|
28
26
|
it("should throw if no colorSpace in display configuration", async () => {
|
|
29
|
-
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
30
28
|
const origMatchMedia = globalScope.matchMedia;
|
|
31
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
32
29
|
const mockMatchMedia = vi.fn(() => true);
|
|
33
|
-
|
|
30
|
+
globalScope.matchMedia = mockMatchMedia as unknown as typeof globalScope.matchMedia;
|
|
34
31
|
const config = {
|
|
35
32
|
display: {},
|
|
36
33
|
};
|
|
37
34
|
|
|
38
35
|
const probeMediaDisplayInfos = (
|
|
39
|
-
|
|
40
|
-
).default;
|
|
36
|
+
await vi.importActual("../../probers/mediaDisplayInfos")
|
|
37
|
+
).default as typeof IProbeMediaDisplayInfos;
|
|
41
38
|
|
|
42
39
|
expect.assertions(1);
|
|
43
40
|
return probeMediaDisplayInfos(config)
|
|
44
41
|
.then(() => {
|
|
45
|
-
(
|
|
42
|
+
(
|
|
43
|
+
globalScope as { matchMedia: typeof globalScope.matchMedia | undefined }
|
|
44
|
+
).matchMedia = origMatchMedia;
|
|
46
45
|
})
|
|
47
46
|
.catch(({ message }: { message: string }) => {
|
|
48
47
|
expect(message).toBe(
|
|
49
48
|
"MediaCapabilitiesProber >>> API_CALL: " +
|
|
50
49
|
"Not enough arguments for calling matchMedia.",
|
|
51
50
|
);
|
|
52
|
-
(
|
|
51
|
+
(
|
|
52
|
+
globalScope as { matchMedia: typeof globalScope.matchMedia | undefined }
|
|
53
|
+
).matchMedia = origMatchMedia;
|
|
53
54
|
});
|
|
54
55
|
});
|
|
55
56
|
|
|
56
57
|
it("should throw if no display in configuration", async () => {
|
|
57
|
-
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
58
59
|
const origMatchMedia = globalScope.matchMedia;
|
|
59
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
60
60
|
const mockMatchMedia = vi.fn(() => true);
|
|
61
|
-
|
|
61
|
+
globalScope.matchMedia = mockMatchMedia as unknown as typeof globalScope.matchMedia;
|
|
62
62
|
const config = {};
|
|
63
63
|
|
|
64
64
|
const probeMediaDisplayInfos = (
|
|
65
|
-
|
|
66
|
-
).default;
|
|
65
|
+
await vi.importActual("../../probers/mediaDisplayInfos")
|
|
66
|
+
).default as typeof IProbeMediaDisplayInfos;
|
|
67
67
|
|
|
68
68
|
expect.assertions(1);
|
|
69
69
|
return probeMediaDisplayInfos(config)
|
|
70
70
|
.then(() => {
|
|
71
|
-
(
|
|
71
|
+
(
|
|
72
|
+
globalScope as { matchMedia: typeof globalScope.matchMedia | undefined }
|
|
73
|
+
).matchMedia = origMatchMedia;
|
|
72
74
|
})
|
|
73
75
|
.catch(({ message }: { message: string }) => {
|
|
74
76
|
expect(message).toBe(
|
|
75
77
|
"MediaCapabilitiesProber >>> API_CALL: " +
|
|
76
78
|
"Not enough arguments for calling matchMedia.",
|
|
77
79
|
);
|
|
78
|
-
(
|
|
80
|
+
(
|
|
81
|
+
globalScope as { matchMedia: typeof globalScope.matchMedia | undefined }
|
|
82
|
+
).matchMedia = origMatchMedia;
|
|
79
83
|
});
|
|
80
84
|
});
|
|
81
85
|
|
|
82
86
|
it("should throw if mediaMatch called with bad arguments", async () => {
|
|
83
|
-
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
84
88
|
const origMatchMedia = globalScope.matchMedia;
|
|
85
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
86
89
|
const mockMatchMedia = vi.fn(() => ({
|
|
87
90
|
media: "not all",
|
|
88
91
|
}));
|
|
89
|
-
|
|
92
|
+
globalScope.matchMedia = mockMatchMedia as unknown as typeof globalScope.matchMedia;
|
|
90
93
|
const config = {
|
|
91
94
|
display: {
|
|
92
95
|
colorSpace: "srgb",
|
|
@@ -94,13 +97,15 @@ describe("MediaCapabilitiesProber probers probeMediaDisplayInfos", () => {
|
|
|
94
97
|
};
|
|
95
98
|
|
|
96
99
|
const probeMediaDisplayInfos = (
|
|
97
|
-
|
|
98
|
-
).default;
|
|
100
|
+
await vi.importActual("../../probers/mediaDisplayInfos")
|
|
101
|
+
).default as typeof IProbeMediaDisplayInfos;
|
|
99
102
|
|
|
100
103
|
expect.assertions(2);
|
|
101
104
|
return probeMediaDisplayInfos(config)
|
|
102
105
|
.then(() => {
|
|
103
|
-
(
|
|
106
|
+
(
|
|
107
|
+
globalScope as { matchMedia: typeof globalScope.matchMedia | undefined }
|
|
108
|
+
).matchMedia = origMatchMedia;
|
|
104
109
|
})
|
|
105
110
|
.catch(({ message }: { message: string }) => {
|
|
106
111
|
expect(message).toBe(
|
|
@@ -108,18 +113,19 @@ describe("MediaCapabilitiesProber probers probeMediaDisplayInfos", () => {
|
|
|
108
113
|
"Bad arguments for calling matchMedia.",
|
|
109
114
|
);
|
|
110
115
|
expect(mockMatchMedia).toHaveBeenCalledTimes(1);
|
|
111
|
-
(
|
|
116
|
+
(
|
|
117
|
+
globalScope as { matchMedia: typeof globalScope.matchMedia | undefined }
|
|
118
|
+
).matchMedia = origMatchMedia;
|
|
112
119
|
});
|
|
113
120
|
});
|
|
114
121
|
|
|
115
122
|
it("should resolves with `Supported` if color space is supported", async () => {
|
|
116
|
-
|
|
123
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
117
124
|
const origMatchMedia = globalScope.matchMedia;
|
|
118
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
119
125
|
const mockMatchMedia = vi.fn(() => ({
|
|
120
126
|
matches: true,
|
|
121
127
|
}));
|
|
122
|
-
|
|
128
|
+
globalScope.matchMedia = mockMatchMedia as unknown as typeof globalScope.matchMedia;
|
|
123
129
|
const config = {
|
|
124
130
|
display: {
|
|
125
131
|
colorSpace: "srgb",
|
|
@@ -127,29 +133,32 @@ describe("MediaCapabilitiesProber probers probeMediaDisplayInfos", () => {
|
|
|
127
133
|
};
|
|
128
134
|
|
|
129
135
|
const probeMediaDisplayInfos = (
|
|
130
|
-
|
|
131
|
-
).default;
|
|
136
|
+
await vi.importActual("../../probers/mediaDisplayInfos")
|
|
137
|
+
).default as typeof IProbeMediaDisplayInfos;
|
|
132
138
|
|
|
133
139
|
expect.assertions(2);
|
|
134
140
|
return probeMediaDisplayInfos(config)
|
|
135
|
-
.then(([res]
|
|
141
|
+
.then(([res]) => {
|
|
136
142
|
expect(res).toEqual(ProberStatus.Supported);
|
|
137
143
|
expect(mockMatchMedia).toHaveBeenCalledTimes(1);
|
|
138
|
-
(
|
|
144
|
+
(
|
|
145
|
+
globalScope as { matchMedia: typeof globalScope.matchMedia | undefined }
|
|
146
|
+
).matchMedia = origMatchMedia;
|
|
139
147
|
})
|
|
140
148
|
.catch(() => {
|
|
141
|
-
(
|
|
149
|
+
(
|
|
150
|
+
globalScope as { matchMedia: typeof globalScope.matchMedia | undefined }
|
|
151
|
+
).matchMedia = origMatchMedia;
|
|
142
152
|
});
|
|
143
153
|
});
|
|
144
154
|
|
|
145
155
|
it("should resolves with `NotSupported` if color space is not supported", async () => {
|
|
146
|
-
|
|
156
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
147
157
|
const origMatchMedia = globalScope.matchMedia;
|
|
148
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
149
158
|
const mockMatchMedia = vi.fn(() => ({
|
|
150
159
|
matches: false,
|
|
151
160
|
}));
|
|
152
|
-
|
|
161
|
+
globalScope.matchMedia = mockMatchMedia as unknown as typeof globalScope.matchMedia;
|
|
153
162
|
const config = {
|
|
154
163
|
display: {
|
|
155
164
|
colorSpace: "p5",
|
|
@@ -157,18 +166,22 @@ describe("MediaCapabilitiesProber probers probeMediaDisplayInfos", () => {
|
|
|
157
166
|
};
|
|
158
167
|
|
|
159
168
|
const probeMediaDisplayInfos = (
|
|
160
|
-
|
|
161
|
-
).default;
|
|
169
|
+
await vi.importActual("../../probers/mediaDisplayInfos")
|
|
170
|
+
).default as typeof IProbeMediaDisplayInfos;
|
|
162
171
|
|
|
163
172
|
expect.assertions(2);
|
|
164
173
|
return probeMediaDisplayInfos(config)
|
|
165
|
-
.then(([res]
|
|
174
|
+
.then(([res]) => {
|
|
166
175
|
expect(res).toEqual(ProberStatus.NotSupported);
|
|
167
176
|
expect(mockMatchMedia).toHaveBeenCalledTimes(1);
|
|
168
|
-
(
|
|
177
|
+
(
|
|
178
|
+
globalScope as { matchMedia: typeof globalScope.matchMedia | undefined }
|
|
179
|
+
).matchMedia = origMatchMedia;
|
|
169
180
|
})
|
|
170
181
|
.catch(() => {
|
|
171
|
-
(
|
|
182
|
+
(
|
|
183
|
+
globalScope as { matchMedia: typeof globalScope.matchMedia | undefined }
|
|
184
|
+
).matchMedia = origMatchMedia;
|
|
172
185
|
});
|
|
173
186
|
});
|
|
174
187
|
});
|
|
@@ -34,11 +34,7 @@ function isMediaCapabilitiesAPIAvailable(): Promise<void> {
|
|
|
34
34
|
"MediaCapabilitiesProber >>> API_CALL: " + "MediaCapabilities API not available",
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
39
|
-
if (!("decodingInfo" in (navigator as any).mediaCapabilities)) {
|
|
40
|
-
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
41
|
-
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
|
|
37
|
+
if (!("decodingInfo" in navigator.mediaCapabilities)) {
|
|
42
38
|
throw new Error(
|
|
43
39
|
"MediaCapabilitiesProber >>> API_CALL: " + "Decoding Info not available",
|
|
44
40
|
);
|
|
@@ -54,7 +50,6 @@ function isMediaCapabilitiesAPIAvailable(): Promise<void> {
|
|
|
54
50
|
export default function probeDecodingInfos(
|
|
55
51
|
config: IMediaConfiguration,
|
|
56
52
|
): Promise<[ProberStatus]> {
|
|
57
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
58
53
|
return isMediaCapabilitiesAPIAvailable().then(() => {
|
|
59
54
|
const hasVideoConfig =
|
|
60
55
|
config.type !== undefined &&
|
|
@@ -86,21 +81,13 @@ export default function probeDecodingInfos(
|
|
|
86
81
|
);
|
|
87
82
|
}
|
|
88
83
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
93
|
-
return (navigator as any).mediaCapabilities
|
|
94
|
-
.decodingInfo(config)
|
|
95
|
-
.then((result: IDecodingInfos) => {
|
|
84
|
+
return navigator.mediaCapabilities
|
|
85
|
+
.decodingInfo(config as unknown as MediaDecodingConfiguration)
|
|
86
|
+
.then((result: IDecodingInfos): [ProberStatus] => {
|
|
96
87
|
return [result.supported ? ProberStatus.Supported : ProberStatus.NotSupported];
|
|
97
88
|
})
|
|
98
89
|
.catch(() => {
|
|
99
90
|
return [ProberStatus.NotSupported];
|
|
100
91
|
});
|
|
101
|
-
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
102
|
-
/* eslint-enable @typescript-eslint/no-unsafe-call */
|
|
103
|
-
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
|
|
104
|
-
/* eslint-enable @typescript-eslint/no-unsafe-return */
|
|
105
92
|
});
|
|
106
93
|
}
|
|
@@ -30,12 +30,10 @@ export function findDefaultVideoCodec(): string {
|
|
|
30
30
|
'video/mp4;codecs="hvc1.1.6.L93.B0"',
|
|
31
31
|
'video/webm;codecs="vp8"',
|
|
32
32
|
];
|
|
33
|
-
/* eslint-disable @typescript-eslint/unbound-method */
|
|
34
33
|
if (
|
|
35
34
|
isNullOrUndefined(MediaSource_) ||
|
|
36
35
|
typeof MediaSource_.isTypeSupported !== "function"
|
|
37
36
|
) {
|
|
38
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
39
37
|
throw new Error("Cannot check video codec support: No API available.");
|
|
40
38
|
}
|
|
41
39
|
for (const codec of videoCodecs) {
|
|
@@ -54,12 +52,10 @@ export function findDefaultVideoCodec(): string {
|
|
|
54
52
|
*/
|
|
55
53
|
export function findDefaultAudioCodec(): string {
|
|
56
54
|
const audioCodecs = ['audio/mp4;codecs="mp4a.40.2"', "audio/webm;codecs=opus"];
|
|
57
|
-
/* eslint-disable @typescript-eslint/unbound-method */
|
|
58
55
|
if (
|
|
59
56
|
isNullOrUndefined(MediaSource_) ||
|
|
60
57
|
typeof MediaSource_.isTypeSupported !== "function"
|
|
61
58
|
) {
|
|
62
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
63
59
|
throw new Error("Cannot check audio codec support: No API available.");
|
|
64
60
|
}
|
|
65
61
|
for (const codec of audioCodecs) {
|
|
@@ -32,9 +32,8 @@ export default function probeContentType(
|
|
|
32
32
|
"MediaCapabilitiesProber >>> API_CALL: " + "MediaSource API not available",
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
36
36
|
if (typeof MediaSource_.isTypeSupported !== "function") {
|
|
37
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
38
37
|
throw new Error(
|
|
39
38
|
"MediaCapabilitiesProber >>> API_CALL: " + "isTypeSupported not available",
|
|
40
39
|
);
|
package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts
CHANGED
|
@@ -27,6 +27,15 @@ export interface ITypeWithFeatures {
|
|
|
27
27
|
|
|
28
28
|
export type ISupportWithFeatures = "" | "Maybe" | "Not Supported" | "Probably";
|
|
29
29
|
|
|
30
|
+
type IGlobalScopeWithMSMediaKeysFeatures = typeof globalScope & {
|
|
31
|
+
MSMediaKeys: {
|
|
32
|
+
isTypeSupportedWithFeatures: (
|
|
33
|
+
type: string,
|
|
34
|
+
features: string | null,
|
|
35
|
+
) => ISupportWithFeatures;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
30
39
|
/**
|
|
31
40
|
* @returns {Promise}
|
|
32
41
|
*/
|
|
@@ -37,11 +46,12 @@ function isTypeSupportedWithFeaturesAPIAvailable(): Promise<void> {
|
|
|
37
46
|
"MediaCapabilitiesProber >>> API_CALL: " + "MSMediaKeys API not available",
|
|
38
47
|
);
|
|
39
48
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
if (
|
|
50
|
+
!(
|
|
51
|
+
"isTypeSupportedWithFeatures" in
|
|
52
|
+
(globalScope as IGlobalScopeWithMSMediaKeysFeatures).MSMediaKeys
|
|
53
|
+
)
|
|
54
|
+
) {
|
|
45
55
|
throw new Error(
|
|
46
56
|
"MediaCapabilitiesProber >>> API_CALL: " +
|
|
47
57
|
"isTypeSupportedWithFeatures not available",
|
|
@@ -74,17 +84,9 @@ export default function probeTypeWithFeatures(
|
|
|
74
84
|
|
|
75
85
|
const features = formatConfig(config);
|
|
76
86
|
|
|
77
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
78
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
79
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
80
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
81
87
|
const result: ISupportWithFeatures = (
|
|
82
|
-
globalScope as
|
|
88
|
+
globalScope as IGlobalScopeWithMSMediaKeysFeatures
|
|
83
89
|
).MSMediaKeys.isTypeSupportedWithFeatures(type, features);
|
|
84
|
-
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
85
|
-
/* eslint-enable @typescript-eslint/no-unsafe-assignment */
|
|
86
|
-
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
|
|
87
|
-
/* eslint-enable @typescript-eslint/no-unsafe-call */
|
|
88
90
|
|
|
89
91
|
function formatSupport(support: ISupportWithFeatures): [ProberStatus] {
|
|
90
92
|
if (support === "") {
|
|
@@ -27,9 +27,8 @@ export default function probeMatchMedia(
|
|
|
27
27
|
config: IMediaConfiguration,
|
|
28
28
|
): Promise<[ProberStatus]> {
|
|
29
29
|
return new Promise((resolve) => {
|
|
30
|
-
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
31
31
|
if (typeof globalScope.matchMedia !== "function") {
|
|
32
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
33
32
|
throw new Error(
|
|
34
33
|
"MediaCapabilitiesProber >>> API_CALL: " + "matchMedia not available",
|
|
35
34
|
);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
|
|
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 IAddFeatures from "../add_features";
|
|
3
|
+
import type { IFeature } from "../types";
|
|
8
4
|
|
|
9
5
|
describe("Features - addFeatures", () => {
|
|
10
6
|
beforeEach(() => {
|
|
@@ -16,7 +12,8 @@ describe("Features - addFeatures", () => {
|
|
|
16
12
|
vi.doMock("../features_object", () => ({
|
|
17
13
|
default: feat,
|
|
18
14
|
}));
|
|
19
|
-
const addFeatures = (
|
|
15
|
+
const addFeatures = (await vi.importActual("../add_features"))
|
|
16
|
+
.default as typeof IAddFeatures;
|
|
20
17
|
|
|
21
18
|
expect(() => addFeatures([])).not.toThrow();
|
|
22
19
|
});
|
|
@@ -26,15 +23,18 @@ describe("Features - addFeatures", () => {
|
|
|
26
23
|
vi.doMock("../features_object", () => ({
|
|
27
24
|
default: feat,
|
|
28
25
|
}));
|
|
29
|
-
const addFeatures = (
|
|
26
|
+
const addFeatures = (await vi.importActual("../add_features"))
|
|
27
|
+
.default as typeof IAddFeatures;
|
|
30
28
|
|
|
31
|
-
expect(() => addFeatures([5])).toThrow(
|
|
29
|
+
expect(() => addFeatures([5 as unknown as IFeature])).toThrow(
|
|
30
|
+
new Error("Unrecognized feature"),
|
|
31
|
+
);
|
|
32
32
|
expect(() =>
|
|
33
33
|
addFeatures([
|
|
34
34
|
() => {
|
|
35
35
|
/* noop */
|
|
36
36
|
},
|
|
37
|
-
{},
|
|
37
|
+
{} as IFeature,
|
|
38
38
|
]),
|
|
39
39
|
).toThrow(new Error("Unrecognized feature"));
|
|
40
40
|
});
|
|
@@ -44,7 +44,8 @@ describe("Features - addFeatures", () => {
|
|
|
44
44
|
vi.doMock("../features_object", () => ({
|
|
45
45
|
default: feat,
|
|
46
46
|
}));
|
|
47
|
-
const addFeatures = (
|
|
47
|
+
const addFeatures = (await vi.importActual("../add_features"))
|
|
48
|
+
.default as typeof IAddFeatures;
|
|
48
49
|
|
|
49
50
|
const fakeFeat1 = vi.fn();
|
|
50
51
|
const fakeFeat2 = vi.fn();
|
|
@@ -22,8 +22,7 @@ import type { IFeature } from "./types";
|
|
|
22
22
|
* @param {Array.<Object>} featureFuncList
|
|
23
23
|
*/
|
|
24
24
|
export default function addFeatures(featureFuncList: IFeature[]): void {
|
|
25
|
-
for (
|
|
26
|
-
const addFeature = featureFuncList[i];
|
|
25
|
+
for (const addFeature of featureFuncList) {
|
|
27
26
|
if (typeof addFeature === "function") {
|
|
28
27
|
addFeature(features);
|
|
29
28
|
} else if (
|