rx-player 4.2.0-dev.2024082600 → 4.2.0-dev.2024090500
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -3
- package/VERSION +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/commonjs/compat/add_class_name.d.ts.map +1 -1
- package/dist/commonjs/compat/add_class_name.js +1 -2
- package/dist/commonjs/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/commonjs/compat/browser_compatibility_types.js +4 -1
- package/dist/commonjs/compat/browser_detection.d.ts +3 -1
- package/dist/commonjs/compat/browser_detection.d.ts.map +1 -1
- package/dist/commonjs/compat/browser_detection.js +8 -1
- package/dist/commonjs/compat/can_reuse_media_keys.d.ts +2 -0
- package/dist/commonjs/compat/can_reuse_media_keys.d.ts.map +1 -1
- package/dist/commonjs/compat/can_reuse_media_keys.js +3 -1
- package/dist/commonjs/compat/clear_element_src.js +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
- package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
- package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
- package/dist/commonjs/compat/eme/eme-api-implementation.js +0 -2
- package/dist/commonjs/compat/event_listeners.d.ts.map +1 -1
- package/dist/commonjs/compat/event_listeners.js +2 -6
- package/dist/commonjs/compat/has_mse_in_worker.js +1 -1
- package/dist/commonjs/compat/is_codec_supported.d.ts.map +1 -1
- package/dist/commonjs/compat/is_codec_supported.js +0 -2
- package/dist/commonjs/compat/is_vtt_cue.d.ts.map +1 -1
- package/dist/commonjs/compat/is_vtt_cue.js +1 -2
- package/dist/commonjs/compat/on_height_width_change.d.ts.map +1 -1
- package/dist/commonjs/compat/patch_webkit_source_buffer.d.ts.map +1 -1
- package/dist/commonjs/compat/patch_webkit_source_buffer.js +8 -18
- package/dist/commonjs/compat/remove_cue.js +2 -2
- package/dist/commonjs/core/cmcd/cmcd_data_builder.js +1 -1
- package/dist/commonjs/core/fetchers/index.d.ts +4 -4
- package/dist/commonjs/core/fetchers/index.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/index.js +2 -2
- package/dist/commonjs/core/fetchers/segment/index.d.ts +6 -5
- package/dist/commonjs/core/fetchers/segment/index.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/segment/index.js +2 -2
- package/dist/commonjs/core/{stream/representation/utils/downloading_queue.d.ts → fetchers/segment/segment_queue.d.ts} +63 -80
- package/dist/commonjs/core/fetchers/segment/segment_queue.d.ts.map +1 -0
- package/dist/commonjs/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +132 -111
- package/dist/{es2017/core/fetchers/segment/segment_fetcher_creator.d.ts → commonjs/core/fetchers/segment/segment_queue_creator.d.ts} +25 -12
- package/dist/commonjs/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
- package/dist/commonjs/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +15 -9
- package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts +9 -0
- package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/segment/task_prioritizer.js +38 -8
- package/dist/commonjs/core/fetchers/utils/schedule_request.js +1 -1
- package/dist/commonjs/core/main/common/content_time_boundaries_observer.js +21 -10
- package/dist/commonjs/core/main/worker/content_preparer.d.ts +3 -3
- package/dist/commonjs/core/main/worker/content_preparer.d.ts.map +1 -1
- package/dist/commonjs/core/main/worker/content_preparer.js +2 -2
- package/dist/commonjs/core/main/worker/send_message.js +1 -1
- package/dist/commonjs/core/main/worker/worker_main.js +3 -2
- package/dist/commonjs/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
- package/dist/commonjs/core/segment_sinks/inventory/segment_inventory.js +39 -30
- package/dist/commonjs/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
- package/dist/commonjs/core/segment_sinks/segment_buffers_store.js +3 -2
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +3 -3
- package/dist/commonjs/core/stream/adaptation/types.d.ts +2 -2
- package/dist/commonjs/core/stream/adaptation/types.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.js +27 -6
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +3 -3
- package/dist/commonjs/core/stream/period/period_stream.d.ts +1 -1
- package/dist/commonjs/core/stream/period/period_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/period/period_stream.js +2 -2
- package/dist/commonjs/core/stream/period/types.d.ts +2 -2
- package/dist/commonjs/core/stream/period/types.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.d.ts +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.js +19 -28
- package/dist/commonjs/core/stream/representation/types.d.ts +2 -2
- package/dist/commonjs/core/stream/representation/types.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +39 -18
- package/dist/commonjs/core/types.d.ts +2 -2
- package/dist/commonjs/core/types.d.ts.map +1 -1
- package/dist/commonjs/default_config.d.ts.map +1 -1
- package/dist/commonjs/default_config.js +0 -8
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
- package/dist/commonjs/features/add_features.d.ts.map +1 -1
- package/dist/commonjs/features/add_features.js +31 -10
- package/dist/commonjs/main_thread/api/option_utils.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/option_utils.js +2 -6
- package/dist/commonjs/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/public_api.js +33 -27
- package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.js +4 -3
- package/dist/commonjs/main_thread/init/media_source_content_initializer.js +6 -6
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +32 -37
- package/dist/commonjs/main_thread/text_displayer/html/html_text_displayer.js +1 -5
- package/dist/commonjs/main_thread/text_displayer/native/native_text_displayer.js +3 -7
- package/dist/commonjs/main_thread/tracks_store/track_dispatcher.js +1 -1
- package/dist/commonjs/main_thread/types.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/adaptation.d.ts +13 -13
- package/dist/commonjs/manifest/classes/manifest.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/manifest.js +0 -6
- package/dist/commonjs/manifest/classes/representation.d.ts +20 -12
- package/dist/commonjs/manifest/classes/representation.d.ts.map +1 -1
- package/dist/commonjs/manifest/utils.d.ts.map +1 -1
- package/dist/commonjs/manifest/utils.js +72 -62
- package/dist/commonjs/mse/main_media_source_interface.js +1 -1
- package/dist/commonjs/multithread_types.d.ts +2 -2
- package/dist/commonjs/multithread_types.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
- package/dist/commonjs/parsers/manifest/local/representation_index.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/local/representation_index.js +29 -8
- package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.js +31 -10
- package/dist/commonjs/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/smooth/create_parser.js +2 -1
- package/dist/commonjs/parsers/manifest/smooth/shared_smooth_segment_timeline.js +26 -4
- package/dist/commonjs/parsers/manifest/utils/get_first_time_from_adaptation.js +29 -7
- package/dist/commonjs/parsers/manifest/utils/get_last_time_from_adaptation.js +29 -7
- package/dist/commonjs/parsers/texttracks/srt/html.js +28 -6
- package/dist/commonjs/parsers/texttracks/ttml/html/create_element.js +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/html/parse_ttml_to_div.js +29 -7
- package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +26 -5
- package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.js +25 -4
- package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
- package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.js +9 -3
- package/dist/commonjs/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +30 -8
- package/dist/commonjs/public_types.d.ts +5 -7
- package/dist/commonjs/public_types.d.ts.map +1 -1
- package/dist/commonjs/transports/smooth/extract_timings_infos.js +30 -8
- package/dist/commonjs/utils/array_find.d.ts +1 -1
- package/dist/commonjs/utils/array_find.d.ts.map +1 -1
- package/dist/commonjs/utils/array_find.js +3 -1
- package/dist/commonjs/utils/array_find_index.d.ts +1 -1
- package/dist/commonjs/utils/array_find_index.d.ts.map +1 -1
- package/dist/commonjs/utils/array_find_index.js +3 -1
- package/dist/commonjs/utils/array_includes.d.ts.map +1 -1
- package/dist/commonjs/utils/array_includes.js +1 -3
- package/dist/commonjs/utils/assert.d.ts.map +1 -1
- package/dist/commonjs/utils/assert.js +0 -2
- package/dist/commonjs/utils/base64.d.ts +1 -1
- package/dist/commonjs/utils/base64.d.ts.map +1 -1
- package/dist/commonjs/utils/base64.js +3 -2
- package/dist/commonjs/utils/event_emitter.js +1 -1
- package/dist/commonjs/utils/flat_map.d.ts.map +1 -1
- package/dist/commonjs/utils/flat_map.js +1 -2
- package/dist/commonjs/utils/id_generator.d.ts.map +1 -1
- package/dist/commonjs/utils/id_generator.js +0 -1
- package/dist/commonjs/utils/logger.js +1 -1
- package/dist/commonjs/utils/monotonic_timestamp.js +2 -2
- package/dist/commonjs/utils/noop.js +1 -2
- package/dist/commonjs/utils/object_assign.d.ts.map +1 -1
- package/dist/commonjs/utils/object_assign.js +27 -6
- package/dist/commonjs/utils/object_values.d.ts.map +1 -1
- package/dist/commonjs/utils/object_values.js +1 -1
- package/dist/commonjs/utils/reference.js +1 -1
- package/dist/commonjs/utils/request/xhr.js +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/es2017/compat/add_class_name.d.ts.map +1 -1
- package/dist/es2017/compat/add_class_name.js +1 -2
- package/dist/es2017/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/es2017/compat/browser_compatibility_types.js +4 -1
- package/dist/es2017/compat/browser_detection.d.ts +3 -1
- package/dist/es2017/compat/browser_detection.d.ts.map +1 -1
- package/dist/es2017/compat/browser_detection.js +7 -1
- package/dist/es2017/compat/can_reuse_media_keys.d.ts +2 -0
- package/dist/es2017/compat/can_reuse_media_keys.d.ts.map +1 -1
- package/dist/es2017/compat/can_reuse_media_keys.js +4 -2
- package/dist/es2017/compat/clear_element_src.js +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
- package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
- package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
- package/dist/es2017/compat/eme/eme-api-implementation.js +0 -2
- package/dist/es2017/compat/event_listeners.d.ts.map +1 -1
- package/dist/es2017/compat/event_listeners.js +2 -6
- package/dist/es2017/compat/has_mse_in_worker.js +1 -1
- package/dist/es2017/compat/is_codec_supported.d.ts.map +1 -1
- package/dist/es2017/compat/is_codec_supported.js +0 -2
- package/dist/es2017/compat/is_vtt_cue.d.ts.map +1 -1
- package/dist/es2017/compat/is_vtt_cue.js +1 -2
- package/dist/es2017/compat/on_height_width_change.d.ts.map +1 -1
- package/dist/es2017/compat/patch_webkit_source_buffer.d.ts.map +1 -1
- package/dist/es2017/compat/patch_webkit_source_buffer.js +8 -18
- package/dist/es2017/compat/remove_cue.js +2 -2
- package/dist/es2017/core/cmcd/cmcd_data_builder.js +1 -1
- package/dist/es2017/core/fetchers/index.d.ts +4 -4
- package/dist/es2017/core/fetchers/index.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/index.js +2 -2
- package/dist/es2017/core/fetchers/segment/index.d.ts +6 -5
- package/dist/es2017/core/fetchers/segment/index.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/segment/index.js +2 -2
- package/dist/es2017/core/{stream/representation/utils/downloading_queue.d.ts → fetchers/segment/segment_queue.d.ts} +63 -80
- package/dist/es2017/core/fetchers/segment/segment_queue.d.ts.map +1 -0
- package/dist/es2017/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +126 -105
- package/dist/{commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts → es2017/core/fetchers/segment/segment_queue_creator.d.ts} +25 -12
- package/dist/es2017/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
- package/dist/es2017/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +12 -6
- package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts +9 -0
- package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/segment/task_prioritizer.js +10 -2
- package/dist/es2017/core/fetchers/utils/schedule_request.js +1 -1
- package/dist/es2017/core/main/common/content_time_boundaries_observer.js +4 -4
- package/dist/es2017/core/main/worker/content_preparer.d.ts +3 -3
- package/dist/es2017/core/main/worker/content_preparer.d.ts.map +1 -1
- package/dist/es2017/core/main/worker/content_preparer.js +3 -3
- package/dist/es2017/core/main/worker/send_message.js +1 -1
- package/dist/es2017/core/main/worker/worker_main.js +3 -2
- package/dist/es2017/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
- package/dist/es2017/core/segment_sinks/inventory/segment_inventory.js +1 -2
- package/dist/es2017/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
- package/dist/es2017/core/segment_sinks/segment_buffers_store.js +3 -2
- package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.js +3 -3
- package/dist/es2017/core/stream/adaptation/types.d.ts +2 -2
- package/dist/es2017/core/stream/adaptation/types.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.js +1 -2
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +3 -3
- package/dist/es2017/core/stream/period/period_stream.d.ts +1 -1
- package/dist/es2017/core/stream/period/period_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/period/period_stream.js +2 -2
- package/dist/es2017/core/stream/period/types.d.ts +2 -2
- package/dist/es2017/core/stream/period/types.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.d.ts +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.js +19 -28
- package/dist/es2017/core/stream/representation/types.d.ts +2 -2
- package/dist/es2017/core/stream/representation/types.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +1 -2
- package/dist/es2017/core/types.d.ts +2 -2
- package/dist/es2017/core/types.d.ts.map +1 -1
- package/dist/es2017/default_config.d.ts.map +1 -1
- package/dist/es2017/default_config.js +0 -8
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
- package/dist/es2017/features/add_features.d.ts.map +1 -1
- package/dist/es2017/features/add_features.js +1 -2
- package/dist/es2017/main_thread/api/option_utils.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/option_utils.js +2 -6
- package/dist/es2017/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/public_api.js +29 -23
- package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.js +2 -1
- package/dist/es2017/main_thread/init/media_source_content_initializer.js +6 -6
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.js +7 -12
- package/dist/es2017/main_thread/text_displayer/html/html_text_displayer.js +1 -5
- package/dist/es2017/main_thread/text_displayer/native/native_text_displayer.js +3 -7
- package/dist/es2017/main_thread/tracks_store/track_dispatcher.js +1 -1
- package/dist/es2017/main_thread/types.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/adaptation.d.ts +13 -13
- package/dist/es2017/manifest/classes/manifest.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/manifest.js +0 -6
- package/dist/es2017/manifest/classes/representation.d.ts +20 -12
- package/dist/es2017/manifest/classes/representation.d.ts.map +1 -1
- package/dist/es2017/manifest/utils.d.ts.map +1 -1
- package/dist/es2017/manifest/utils.js +1 -2
- package/dist/es2017/mse/main_media_source_interface.js +1 -1
- package/dist/es2017/multithread_types.d.ts +2 -2
- package/dist/es2017/multithread_types.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +1 -2
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
- package/dist/es2017/parsers/manifest/local/representation_index.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/local/representation_index.js +1 -2
- package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.js +2 -3
- package/dist/es2017/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/smooth/create_parser.js +2 -1
- package/dist/es2017/parsers/manifest/smooth/shared_smooth_segment_timeline.js +2 -2
- package/dist/es2017/parsers/manifest/utils/get_first_time_from_adaptation.js +2 -2
- package/dist/es2017/parsers/manifest/utils/get_last_time_from_adaptation.js +2 -2
- package/dist/es2017/parsers/texttracks/srt/html.js +2 -2
- package/dist/es2017/parsers/texttracks/ttml/html/create_element.js +1 -1
- package/dist/es2017/parsers/texttracks/ttml/html/parse_ttml_to_div.js +3 -3
- package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +1 -2
- package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.js +1 -2
- package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
- package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/webvtt/html/to_html.js +9 -3
- package/dist/es2017/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +2 -2
- package/dist/es2017/public_types.d.ts +5 -7
- package/dist/es2017/public_types.d.ts.map +1 -1
- package/dist/es2017/transports/smooth/extract_timings_infos.js +3 -3
- package/dist/es2017/utils/array_find.d.ts +1 -1
- package/dist/es2017/utils/array_find.d.ts.map +1 -1
- package/dist/es2017/utils/array_find.js +3 -1
- package/dist/es2017/utils/array_find_index.d.ts +1 -1
- package/dist/es2017/utils/array_find_index.d.ts.map +1 -1
- package/dist/es2017/utils/array_find_index.js +3 -1
- package/dist/es2017/utils/array_includes.d.ts.map +1 -1
- package/dist/es2017/utils/array_includes.js +1 -3
- package/dist/es2017/utils/assert.d.ts.map +1 -1
- package/dist/es2017/utils/assert.js +0 -2
- package/dist/es2017/utils/base64.d.ts +1 -1
- package/dist/es2017/utils/base64.d.ts.map +1 -1
- package/dist/es2017/utils/base64.js +3 -2
- package/dist/es2017/utils/event_emitter.js +1 -1
- package/dist/es2017/utils/flat_map.d.ts.map +1 -1
- package/dist/es2017/utils/flat_map.js +1 -2
- package/dist/es2017/utils/id_generator.d.ts.map +1 -1
- package/dist/es2017/utils/id_generator.js +0 -1
- package/dist/es2017/utils/logger.js +1 -1
- package/dist/es2017/utils/monotonic_timestamp.js +2 -2
- package/dist/es2017/utils/noop.js +1 -2
- package/dist/es2017/utils/object_assign.d.ts.map +1 -1
- package/dist/es2017/utils/object_assign.js +1 -2
- package/dist/es2017/utils/object_values.d.ts.map +1 -1
- package/dist/es2017/utils/object_values.js +1 -2
- package/dist/es2017/utils/reference.js +1 -1
- package/dist/es2017/utils/request/xhr.js +1 -1
- package/dist/mpd-parser.wasm +0 -0
- package/dist/rx-player.js +39336 -18
- package/dist/rx-player.min.js +18 -0
- package/dist/worker.js +5 -5
- package/package.json +16 -9
- package/src/__GENERATED_CODE/embedded_dash_wasm.ts +1 -1
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/compat/__tests__/add_text_track.test.ts +8 -12
- package/src/compat/__tests__/browser_compatibility_types.test.ts +0 -7
- package/src/compat/__tests__/browser_version.test.ts +20 -19
- package/src/compat/__tests__/can_patch_isobmff.test.ts +7 -10
- package/src/compat/__tests__/can_rely_on_video_visibility_and_size.test.ts +17 -21
- package/src/compat/__tests__/can_reuse_media_keys.test.ts +38 -15
- package/src/compat/__tests__/clear_element_src.test.ts +37 -34
- package/src/compat/__tests__/enable_audio_track.test.ts +22 -21
- package/src/compat/__tests__/is_codec_supported.test.ts +17 -18
- package/src/compat/__tests__/is_seeking_approximate.test.ts +8 -14
- package/src/compat/__tests__/is_vtt_cue.test.ts +8 -13
- package/src/compat/__tests__/make_vtt_cue.test.ts +7 -12
- package/src/compat/__tests__/patch_webkit_source_buffer.test.ts +44 -32
- package/src/compat/__tests__/remove_cue.test.ts +30 -31
- package/src/compat/__tests__/should_favour_custom_safari_EME.test.ts +21 -26
- package/src/compat/__tests__/should_renew_media_key_system_access.test.ts +9 -17
- package/src/compat/__tests__/should_unset_media_keys.test.ts +7 -14
- package/src/compat/__tests__/should_validate_metadata.test.ts +7 -17
- package/src/compat/__tests__/should_wait_for_data_before_loaded.test.ts +17 -26
- package/src/compat/__tests__/should_wait_for_have_enough_data.test.ts +10 -15
- package/src/compat/add_class_name.ts +1 -2
- package/src/compat/browser_compatibility_types.ts +4 -2
- package/src/compat/browser_detection.ts +9 -0
- package/src/compat/can_reuse_media_keys.ts +4 -2
- package/src/compat/clear_element_src.ts +1 -1
- package/src/compat/eme/custom_media_keys/moz_media_keys_constructor.ts +1 -2
- package/src/compat/eme/custom_media_keys/ms_media_keys_constructor.ts +1 -2
- package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +3 -6
- package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +2 -17
- package/src/compat/eme/custom_media_keys/webkit_media_keys_constructor.ts +1 -4
- package/src/compat/eme/eme-api-implementation.ts +0 -2
- package/src/compat/event_listeners.ts +2 -6
- package/src/compat/has_mse_in_worker.ts +1 -1
- package/src/compat/is_codec_supported.ts +0 -2
- package/src/compat/is_debug_mode_enabled.ts +1 -1
- package/src/compat/is_vtt_cue.ts +1 -2
- package/src/compat/on_height_width_change.ts +1 -2
- package/src/compat/patch_webkit_source_buffer.ts +48 -29
- package/src/compat/remove_cue.ts +2 -2
- package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +21 -26
- package/src/core/cmcd/cmcd_data_builder.ts +1 -1
- package/src/core/fetchers/README.md +13 -12
- package/src/core/fetchers/index.ts +5 -8
- package/src/core/fetchers/segment/__tests__/task_prioritizer.test.ts +17 -23
- package/src/core/fetchers/segment/index.ts +6 -5
- package/src/core/{stream/representation/utils/downloading_queue.ts → fetchers/segment/segment_queue.ts} +204 -166
- package/src/core/fetchers/segment/{segment_fetcher_creator.ts → segment_queue_creator.ts} +31 -14
- package/src/core/fetchers/segment/task_prioritizer.ts +10 -2
- package/src/core/fetchers/utils/schedule_request.ts +1 -1
- package/src/core/main/common/content_time_boundaries_observer.ts +4 -4
- package/src/core/main/worker/content_preparer.ts +5 -5
- package/src/core/main/worker/send_message.ts +1 -1
- package/src/core/main/worker/worker_main.ts +3 -2
- package/src/core/segment_sinks/implementations/text/text_segment_buffer.ts +1 -5
- package/src/core/segment_sinks/inventory/segment_inventory.ts +1 -2
- package/src/core/segment_sinks/segment_buffers_store.ts +3 -2
- package/src/core/stream/adaptation/adaptation_stream.ts +3 -3
- package/src/core/stream/adaptation/types.ts +2 -2
- package/src/core/stream/orchestrator/get_time_ranges_for_content.ts +1 -2
- package/src/core/stream/orchestrator/stream_orchestrator.ts +4 -4
- package/src/core/stream/period/period_stream.ts +2 -2
- package/src/core/stream/period/types.ts +2 -2
- package/src/core/stream/representation/representation_stream.ts +59 -56
- package/src/core/stream/representation/types.ts +3 -4
- package/src/core/stream/representation/utils/get_needed_segments.ts +1 -2
- package/src/core/types.ts +2 -4
- package/src/default_config.ts +0 -8
- package/src/errors/__tests__/format_error.test.ts +18 -18
- package/src/experimental/features/__tests__/multi_thread.test.ts +5 -5
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/capabilities.test.ts +11 -11
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +18 -26
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +13 -21
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/decodingInfos.test.ts +24 -20
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/defaultCodecFinder.test.ts +28 -30
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaContentType.test.ts +32 -38
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +64 -51
- package/src/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.ts +4 -17
- package/src/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.ts +0 -4
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.ts +1 -2
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts +16 -14
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +1 -2
- package/src/features/__tests__/add_features.test.ts +12 -11
- package/src/features/add_features.ts +1 -2
- package/src/features/list/__tests__/dash_wasm.test.ts +4 -4
- package/src/main_thread/api/__tests__/option_utils.test.ts +114 -70
- package/src/main_thread/api/__tests__/public_api.test.ts +85 -48
- package/src/main_thread/api/option_utils.ts +2 -6
- package/src/main_thread/api/public_api.ts +24 -18
- package/src/main_thread/decrypt/__tests__/__global__/get_license.test.ts +12 -18
- package/src/main_thread/decrypt/__tests__/__global__/init_data.test.ts +128 -101
- package/src/main_thread/decrypt/__tests__/__global__/media_key_system_access.test.ts +26 -33
- package/src/main_thread/decrypt/__tests__/__global__/media_keys.test.ts +46 -48
- package/src/main_thread/decrypt/__tests__/__global__/server_certificate.test.ts +33 -34
- package/src/main_thread/decrypt/__tests__/__global__/utils.ts +13 -17
- package/src/main_thread/decrypt/session_events_listener.ts +1 -1
- package/src/main_thread/decrypt/utils/__tests__/clean_old_loaded_sessions.test.ts +0 -5
- package/src/main_thread/decrypt/utils/__tests__/clean_old_stored_persistent_info.test.ts +14 -17
- package/src/main_thread/decrypt/utils/persistent_sessions_store.ts +2 -1
- package/src/main_thread/init/media_source_content_initializer.ts +7 -7
- package/src/main_thread/init/multi_thread_content_initializer.ts +7 -12
- package/src/main_thread/init/utils/__tests__/are_same_stream_events.test.ts +11 -16
- package/src/main_thread/init/utils/__tests__/refresh_scheduled_events_list.test.ts +48 -18
- package/src/main_thread/text_displayer/html/__tests__/text_track_cues_store.test.ts +32 -17
- package/src/main_thread/text_displayer/html/html_text_displayer.ts +1 -5
- package/src/main_thread/text_displayer/native/native_text_displayer.ts +3 -7
- package/src/main_thread/tracks_store/__tests__/media_element_tracks_store.test.ts +33 -28
- package/src/main_thread/tracks_store/track_dispatcher.ts +1 -1
- package/src/main_thread/types.ts +0 -1
- package/src/manifest/classes/__tests__/adaptation.test.ts +167 -62
- package/src/manifest/classes/__tests__/manifest.test.ts +130 -74
- package/src/manifest/classes/__tests__/period.test.ts +293 -211
- package/src/manifest/classes/__tests__/update_period_in_place.test.ts +0 -2
- package/src/manifest/classes/__tests__/update_periods.test.ts +57 -57
- package/src/manifest/classes/adaptation.ts +13 -13
- package/src/manifest/classes/manifest.ts +0 -6
- package/src/manifest/classes/representation.ts +20 -12
- package/src/manifest/utils.ts +1 -2
- package/src/mse/main_media_source_interface.ts +1 -1
- package/src/mse/types.ts +1 -1
- package/src/multithread_types.ts +2 -2
- package/src/parsers/manifest/dash/common/__tests__/get_clock_offset.test.ts +5 -10
- package/src/parsers/manifest/dash/common/__tests__/get_http_utc-timing_url.test.ts +38 -30
- package/src/parsers/manifest/dash/common/__tests__/get_periods_time_infos.test.ts +0 -3
- package/src/parsers/manifest/dash/common/indexes/timeline/parse_s_element.ts +12 -6
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.ts +14 -7
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.ts +8 -4
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Period.ts +10 -5
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.ts +10 -5
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
- package/src/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.ts +14 -7
- package/src/parsers/manifest/dash/native-parser/node_parsers/EventStream.ts +2 -1
- package/src/parsers/manifest/dash/native-parser/node_parsers/MPD.ts +8 -4
- package/src/parsers/manifest/dash/native-parser/node_parsers/Period.ts +10 -5
- package/src/parsers/manifest/dash/native-parser/node_parsers/Representation.ts +10 -5
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentTimeline.test.ts +9 -14
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
- package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +1 -2
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.ts +2 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.ts +2 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.ts +4 -2
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/MPD.ts +10 -5
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/Period.ts +2 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/root.ts +2 -1
- package/src/parsers/manifest/local/representation_index.ts +1 -2
- package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +2 -3
- package/src/parsers/manifest/smooth/create_parser.ts +2 -1
- package/src/parsers/manifest/smooth/shared_smooth_segment_timeline.ts +2 -2
- package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +3 -8
- package/src/parsers/manifest/utils/get_first_time_from_adaptation.ts +2 -2
- package/src/parsers/manifest/utils/get_last_time_from_adaptation.ts +2 -2
- package/src/parsers/texttracks/srt/html.ts +2 -2
- package/src/parsers/texttracks/ttml/__tests__/resolve_styles_inheritance.test.ts +3 -7
- package/src/parsers/texttracks/ttml/html/__tests__/__global__/html_ttml_parser.test.ts +4 -4
- package/src/parsers/texttracks/ttml/html/create_element.ts +1 -1
- package/src/parsers/texttracks/ttml/html/parse_ttml_to_div.ts +3 -3
- package/src/parsers/texttracks/ttml/native/parse_ttml_to_vtt.ts +1 -2
- package/src/parsers/texttracks/ttml/resolve_styles_inheritance.ts +1 -2
- package/src/parsers/texttracks/webvtt/__tests__/parse_cue_block.test.ts +11 -11
- package/src/parsers/texttracks/webvtt/html/__tests__/convert_payload_to_html.test.ts +5 -18
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_style_block.test.ts +23 -28
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_webvtt_to_div.test.ts +9 -14
- package/src/parsers/texttracks/webvtt/html/__tests__/to_html.test.ts +11 -11
- package/src/parsers/texttracks/webvtt/html/to_html.ts +9 -3
- package/src/parsers/texttracks/webvtt/native/parse_vtt_to_cues.ts +2 -2
- package/src/public_types.ts +7 -8
- package/src/tools/TextTrackRenderer/text_track_renderer.ts +1 -1
- package/src/transports/smooth/extract_timings_infos.ts +3 -3
- package/src/transports/smooth/isobmff/__tests__/create_boxes.test.ts +30 -28
- package/src/transports/utils/__tests__/check_isobmff_integrity.test.ts +38 -44
- package/src/utils/__tests__/array_find.test.ts +12 -12
- package/src/utils/__tests__/array_find_index.test.ts +13 -12
- package/src/utils/__tests__/array_includes.test.ts +7 -7
- package/src/utils/__tests__/assert.test.ts +19 -25
- package/src/utils/__tests__/base64.test.ts +18 -13
- package/src/utils/__tests__/event_emitter.test.ts +225 -50
- package/src/utils/__tests__/flat_map.test.ts +2 -6
- package/src/utils/__tests__/starts_with.test.ts +7 -8
- package/src/utils/array_find.ts +3 -7
- package/src/utils/array_find_index.ts +3 -7
- package/src/utils/array_includes.ts +1 -3
- package/src/utils/assert.ts +0 -2
- package/src/utils/base64.ts +3 -2
- package/src/utils/event_emitter.ts +1 -1
- package/src/utils/flat_map.ts +1 -2
- package/src/utils/id_generator.ts +0 -2
- package/src/utils/is_worker.ts +1 -1
- package/src/utils/logger.ts +1 -1
- package/src/utils/monotonic_timestamp.ts +2 -2
- package/src/utils/noop.ts +1 -2
- package/src/utils/object_assign.ts +1 -2
- package/src/utils/object_values.ts +1 -2
- package/src/utils/reference.ts +1 -1
- package/src/utils/request/xhr.ts +1 -1
- package/.vscode/settings.json +0 -7
- package/dist/commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
- package/dist/commonjs/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
- package/dist/es2017/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
- package/dist/es2017/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
package/src/core/types.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
} from "./adaptive";
|
|
6
6
|
import type {
|
|
7
7
|
IManifestFetcherSettings,
|
|
8
|
-
|
|
8
|
+
ISegmentQueueCreatorBackoffOptions,
|
|
9
9
|
} from "./fetchers";
|
|
10
10
|
import type {
|
|
11
11
|
IBufferedChunk,
|
|
@@ -33,16 +33,14 @@ export type {
|
|
|
33
33
|
IAdaptiveRepresentationSelectorArguments,
|
|
34
34
|
IABRThrottlers,
|
|
35
35
|
IResolutionInfo,
|
|
36
|
-
|
|
37
36
|
// Fetchers Metadata
|
|
38
37
|
IManifestFetcherSettings,
|
|
39
|
-
|
|
38
|
+
ISegmentQueueCreatorBackoffOptions,
|
|
40
39
|
|
|
41
40
|
// Media Sinks Metadata
|
|
42
41
|
IBufferType,
|
|
43
42
|
IBufferedChunk,
|
|
44
43
|
ITextDisplayerInterface,
|
|
45
|
-
|
|
46
44
|
// Stream Metadata
|
|
47
45
|
IAdaptationChoice,
|
|
48
46
|
IInbandEvent,
|
package/src/default_config.ts
CHANGED
|
@@ -137,7 +137,6 @@ const DEFAULT_CONFIG = {
|
|
|
137
137
|
*/
|
|
138
138
|
DEFAULT_MAX_VIDEO_BUFFER_SIZE: Infinity,
|
|
139
139
|
|
|
140
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
141
140
|
/**
|
|
142
141
|
* Maximum possible buffer ahead for each type of buffer, to avoid too much
|
|
143
142
|
* memory usage when playing for a long time.
|
|
@@ -147,9 +146,7 @@ const DEFAULT_CONFIG = {
|
|
|
147
146
|
MAXIMUM_MAX_BUFFER_AHEAD: {
|
|
148
147
|
text: 5 * 60 * 60,
|
|
149
148
|
} as Partial<Record<"audio" | "video" | "text", number>>,
|
|
150
|
-
/* eslint-enable @typescript-eslint/consistent-type-assertions */
|
|
151
149
|
|
|
152
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
153
150
|
/**
|
|
154
151
|
* Minimum possible buffer ahead for each type of buffer, to avoid Garbage
|
|
155
152
|
* Collecting too much data when it would have adverse effects.
|
|
@@ -164,9 +161,7 @@ const DEFAULT_CONFIG = {
|
|
|
164
161
|
// same text track.
|
|
165
162
|
text: 2 * 60,
|
|
166
163
|
} as Partial<Record<"audio" | "video" | "image" | "text", number>>,
|
|
167
|
-
/* eslint-enable @typescript-eslint/consistent-type-assertions */
|
|
168
164
|
|
|
169
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
170
165
|
/**
|
|
171
166
|
* Maximum possible buffer behind for each type of buffer, to avoid too much
|
|
172
167
|
* memory usage when playing for a long time.
|
|
@@ -176,7 +171,6 @@ const DEFAULT_CONFIG = {
|
|
|
176
171
|
MAXIMUM_MAX_BUFFER_BEHIND: {
|
|
177
172
|
text: 5 * 60 * 60,
|
|
178
173
|
} as Partial<Record<"audio" | "video" | "text", number>>,
|
|
179
|
-
/* eslint-enable @typescript-eslint/consistent-type-assertions */
|
|
180
174
|
|
|
181
175
|
/**
|
|
182
176
|
* Default bitrate ceils initially set as the first content begins.
|
|
@@ -893,7 +887,6 @@ const DEFAULT_CONFIG = {
|
|
|
893
887
|
* or "playready" as a keySystem.
|
|
894
888
|
* @type {Object}
|
|
895
889
|
*/
|
|
896
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
897
890
|
EME_KEY_SYSTEMS: {
|
|
898
891
|
clearkey: ["webkit-org.w3.clearkey", "org.w3.clearkey"],
|
|
899
892
|
widevine: ["com.widevine.alpha"],
|
|
@@ -905,7 +898,6 @@ const DEFAULT_CONFIG = {
|
|
|
905
898
|
],
|
|
906
899
|
fairplay: ["com.apple.fps.1_0"],
|
|
907
900
|
} as Partial<Record<string, string[]>>,
|
|
908
|
-
/* eslint-enable @typescript-eslint/consistent-type-assertions */
|
|
909
901
|
|
|
910
902
|
/**
|
|
911
903
|
* The Manifest parsing logic has a notion of "unsafeMode" which allows to
|
|
@@ -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 IFormatError from "../format_error";
|
|
8
3
|
|
|
9
4
|
describe("errors - formatError", () => {
|
|
10
5
|
beforeEach(() => {
|
|
@@ -15,40 +10,45 @@ describe("errors - formatError", () => {
|
|
|
15
10
|
vi.doMock("../is_known_error", () => ({
|
|
16
11
|
default: () => true,
|
|
17
12
|
}));
|
|
18
|
-
const formatError = (
|
|
13
|
+
const formatError = (await vi.importActual("../format_error"))
|
|
14
|
+
.default as typeof IFormatError;
|
|
19
15
|
const error1 = new Error("Aaaaaa");
|
|
20
|
-
expect(formatError(error1, { defaultCode: "
|
|
16
|
+
expect(formatError(error1, { defaultCode: "NONE", defaultReason: "a" })).toBe(error1);
|
|
21
17
|
});
|
|
22
18
|
|
|
23
19
|
it("should stringify error if it is an Error but not a Custom Error", async () => {
|
|
24
20
|
vi.doMock("../is_known_error", () => ({
|
|
25
21
|
default: () => false,
|
|
26
22
|
}));
|
|
27
|
-
const OtherError = (
|
|
28
|
-
|
|
23
|
+
const OtherError = (await vi.importActual("../other_error"))
|
|
24
|
+
.default as typeof IFormatError;
|
|
25
|
+
const formatError = (await vi.importActual("../format_error"))
|
|
26
|
+
.default as typeof IFormatError;
|
|
29
27
|
const error1 = new Error("Abcdef");
|
|
30
28
|
const formattedError = formatError(error1, {
|
|
31
|
-
defaultCode: "
|
|
29
|
+
defaultCode: "NONE",
|
|
32
30
|
defaultReason: "a",
|
|
33
31
|
});
|
|
34
32
|
expect(formattedError).toBeInstanceOf(OtherError);
|
|
35
|
-
expect(formattedError.message).toBe("
|
|
36
|
-
expect(formattedError.code).toBe("
|
|
33
|
+
expect(formattedError.message).toBe("NONE: Error: Abcdef");
|
|
34
|
+
expect(formattedError.code).toBe("NONE");
|
|
37
35
|
});
|
|
38
36
|
|
|
39
37
|
it("should stringify error if it is an Error but not a Custom Error", async () => {
|
|
40
38
|
vi.doMock("../is_known_error", () => ({
|
|
41
39
|
default: () => false,
|
|
42
40
|
}));
|
|
43
|
-
const OtherError = (
|
|
44
|
-
|
|
41
|
+
const OtherError = (await vi.importActual("../other_error"))
|
|
42
|
+
.default as typeof IFormatError;
|
|
43
|
+
const formatError = (await vi.importActual("../format_error"))
|
|
44
|
+
.default as typeof IFormatError;
|
|
45
45
|
const error1 = {};
|
|
46
46
|
const formattedError = formatError(error1, {
|
|
47
|
-
defaultCode: "
|
|
47
|
+
defaultCode: "NONE",
|
|
48
48
|
defaultReason: "a",
|
|
49
49
|
});
|
|
50
50
|
expect(formattedError).toBeInstanceOf(OtherError);
|
|
51
|
-
expect(formattedError.message).toBe("
|
|
52
|
-
expect(formattedError.code).toBe("
|
|
51
|
+
expect(formattedError.message).toBe("NONE: a");
|
|
52
|
+
expect(formattedError.code).toBe("NONE");
|
|
53
53
|
});
|
|
54
54
|
});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest";
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
4
|
-
|
|
2
|
+
import type { IFeaturesObject } from "../../../features/types";
|
|
5
3
|
import MultiThreadContentInitializer from "../../../main_thread/init/multi_thread_content_initializer";
|
|
6
4
|
import addMultiThreadFeature from "../multi_thread";
|
|
7
5
|
|
|
8
6
|
describe("Features list - EME", () => {
|
|
9
7
|
it("should add the ContentDecryptor in the current features", () => {
|
|
10
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
-
const featureObject:
|
|
9
|
+
const featureObject: IFeaturesObject = {} as IFeaturesObject;
|
|
12
10
|
addMultiThreadFeature(featureObject);
|
|
13
11
|
expect(featureObject).toEqual({
|
|
14
12
|
multithread: { init: MultiThreadContentInitializer },
|
|
15
13
|
});
|
|
16
|
-
expect(featureObject.multithread
|
|
14
|
+
expect(featureObject.multithread).not.toBe(null);
|
|
15
|
+
expect(featureObject.multithread).not.toBe(undefined);
|
|
16
|
+
expect(featureObject.multithread?.init).toBe(MultiThreadContentInitializer);
|
|
17
17
|
});
|
|
18
18
|
});
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { describe, 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 IGetProbedConfiguration from "../capabilities";
|
|
3
|
+
import type { ICapabilitiesTypes } from "../capabilities";
|
|
8
4
|
|
|
9
5
|
describe("MediaCapabilitiesProber - getProbedConfiguration", () => {
|
|
10
6
|
it("should return result from filtered configuration", async () => {
|
|
@@ -15,10 +11,14 @@ describe("MediaCapabilitiesProber - getProbedConfiguration", () => {
|
|
|
15
11
|
extend: mockExtend,
|
|
16
12
|
filterConfigurationWithCapabilities: mockFilterConfigurationWithCapabilities,
|
|
17
13
|
}));
|
|
18
|
-
const getProbedConfiguration = (
|
|
19
|
-
.default;
|
|
20
|
-
expect(
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
const getProbedConfiguration = (await vi.importActual("../capabilities"))
|
|
15
|
+
.default as typeof IGetProbedConfiguration;
|
|
16
|
+
expect(
|
|
17
|
+
getProbedConfiguration({}, [
|
|
18
|
+
"Athos",
|
|
19
|
+
"Portos",
|
|
20
|
+
"Aramis",
|
|
21
|
+
] as unknown as ICapabilitiesTypes[]),
|
|
22
|
+
).toEqual(expectedResult);
|
|
23
23
|
});
|
|
24
24
|
});
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { describe, afterEach, it, expect, vi } from "vitest";
|
|
2
|
+
import type IProbeDRMInfos from "../../probers/DRMInfos";
|
|
2
3
|
import { ProberStatus } from "../../types";
|
|
3
4
|
|
|
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 */
|
|
9
|
-
/* eslint-disable no-restricted-properties */
|
|
10
|
-
|
|
11
5
|
describe("MediaCapabilitiesProber probers - DRMInfos", () => {
|
|
12
6
|
afterEach(() => {
|
|
13
7
|
vi.resetModules();
|
|
@@ -15,28 +9,26 @@ describe("MediaCapabilitiesProber probers - DRMInfos", () => {
|
|
|
15
9
|
|
|
16
10
|
it("should throw if no keySystem provided", async () => {
|
|
17
11
|
const configuration = {};
|
|
18
|
-
const probeDRMInfos = (
|
|
19
|
-
.default;
|
|
20
|
-
|
|
12
|
+
const probeDRMInfos = (await vi.importActual("../../probers/DRMInfos"))
|
|
13
|
+
.default as typeof IProbeDRMInfos;
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
21
15
|
expect(probeDRMInfos(configuration)).rejects.toEqual(
|
|
22
16
|
"MediaCapabilitiesProber >>> API_CALL: " +
|
|
23
17
|
"Missing a type argument to request a media key system access.",
|
|
24
18
|
);
|
|
25
|
-
/* eslint-enable @typescript-eslint/no-floating-promises */
|
|
26
19
|
});
|
|
27
20
|
|
|
28
21
|
it("should throw if no type of keySystem provided", async () => {
|
|
29
22
|
const configuration = {
|
|
30
23
|
keySystem: {},
|
|
31
24
|
};
|
|
32
|
-
const probeDRMInfos = (
|
|
33
|
-
.default;
|
|
34
|
-
|
|
25
|
+
const probeDRMInfos = (await vi.importActual("../../probers/DRMInfos"))
|
|
26
|
+
.default as typeof IProbeDRMInfos;
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
35
28
|
expect(probeDRMInfos(configuration)).rejects.toEqual(
|
|
36
29
|
"MediaCapabilitiesProber >>> API_CALL: " +
|
|
37
30
|
"Missing a type argument to request a media key system access.",
|
|
38
31
|
);
|
|
39
|
-
/* eslint-enable @typescript-eslint/no-floating-promises */
|
|
40
32
|
});
|
|
41
33
|
|
|
42
34
|
it("should resolve with `NotSupported` if no requestMediaKeySystemAccess", async () => {
|
|
@@ -48,13 +40,13 @@ describe("MediaCapabilitiesProber probers - DRMInfos", () => {
|
|
|
48
40
|
vi.doMock("../../../../../compat/eme", () => ({
|
|
49
41
|
default: {},
|
|
50
42
|
}));
|
|
51
|
-
const probeDRMInfos = (
|
|
52
|
-
.default;
|
|
53
|
-
|
|
54
|
-
expect(probeDRMInfos(configuration)).resolves.toEqual(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
);
|
|
43
|
+
const probeDRMInfos = (await vi.importActual("../../probers/DRMInfos"))
|
|
44
|
+
.default as typeof IProbeDRMInfos;
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
46
|
+
expect(probeDRMInfos(configuration)).resolves.toEqual([
|
|
47
|
+
ProberStatus.NotSupported,
|
|
48
|
+
{ configuration: {}, type: "clearkick" },
|
|
49
|
+
]);
|
|
58
50
|
});
|
|
59
51
|
|
|
60
52
|
it("should resolve with `Supported` if config is supported", async () => {
|
|
@@ -71,8 +63,8 @@ describe("MediaCapabilitiesProber probers - DRMInfos", () => {
|
|
|
71
63
|
vi.doMock("../../../../../compat/eme", () => ({
|
|
72
64
|
default: { requestMediaKeySystemAccess: mockRequestMediaKeySystemAccess },
|
|
73
65
|
}));
|
|
74
|
-
const probeDRMInfos = (
|
|
75
|
-
.default;
|
|
66
|
+
const probeDRMInfos = (await vi.importActual("../../probers/DRMInfos"))
|
|
67
|
+
.default as typeof IProbeDRMInfos;
|
|
76
68
|
await probeDRMInfos(configuration)
|
|
77
69
|
.then((res: unknown) => {
|
|
78
70
|
expect(res).toEqual([
|
|
@@ -99,8 +91,8 @@ describe("MediaCapabilitiesProber probers - DRMInfos", () => {
|
|
|
99
91
|
default: { requestMediaKeySystemAccess: mockRequestMediaKeySystemAccess },
|
|
100
92
|
}));
|
|
101
93
|
|
|
102
|
-
const probeDRMInfos = (
|
|
103
|
-
.default;
|
|
94
|
+
const probeDRMInfos = (await vi.importActual("../../probers/DRMInfos"))
|
|
95
|
+
.default as typeof IProbeDRMInfos;
|
|
104
96
|
await probeDRMInfos(configuration)
|
|
105
97
|
.then((res: unknown) => {
|
|
106
98
|
expect(res).toEqual([
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { describe, afterEach, it, expect, vi } from "vitest";
|
|
2
|
+
import type IProbeHDCPPolicy from "../../probers/HDCPPolicy";
|
|
2
3
|
import { ProberStatus } from "../../types";
|
|
3
4
|
|
|
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 */
|
|
9
|
-
/* eslint-disable no-restricted-properties */
|
|
10
|
-
|
|
11
5
|
describe("MediaCapabilitiesProber probers - HDCPPolicy", () => {
|
|
12
6
|
afterEach(() => {
|
|
13
7
|
vi.resetModules();
|
|
@@ -17,13 +11,12 @@ describe("MediaCapabilitiesProber probers - HDCPPolicy", () => {
|
|
|
17
11
|
vi.doMock("../../../../../compat/eme", () => ({
|
|
18
12
|
default: vi.fn(),
|
|
19
13
|
}));
|
|
20
|
-
const probeHDCPPolicy = (
|
|
21
|
-
.default;
|
|
22
|
-
|
|
14
|
+
const probeHDCPPolicy = (await vi.importActual("../../probers/HDCPPolicy"))
|
|
15
|
+
.default as typeof IProbeHDCPPolicy;
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
23
17
|
expect(probeHDCPPolicy({})).rejects.toEqual(
|
|
24
18
|
"MediaCapabilitiesProber >>> API_CALL: API not available",
|
|
25
19
|
);
|
|
26
|
-
/* eslint-enable @typescript-eslint/no-floating-promises */
|
|
27
20
|
});
|
|
28
21
|
|
|
29
22
|
it("should throw if no hdcp attribute in config", async () => {
|
|
@@ -37,14 +30,13 @@ describe("MediaCapabilitiesProber probers - HDCPPolicy", () => {
|
|
|
37
30
|
requestMediaKeySystemAccess: mockRequestMediaKeySystemAccess,
|
|
38
31
|
},
|
|
39
32
|
}));
|
|
40
|
-
const probeHDCPPolicy = (
|
|
41
|
-
.default;
|
|
42
|
-
|
|
33
|
+
const probeHDCPPolicy = (await vi.importActual("../../probers/HDCPPolicy"))
|
|
34
|
+
.default as typeof IProbeHDCPPolicy;
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
43
36
|
expect(probeHDCPPolicy({})).rejects.toEqual(
|
|
44
37
|
"MediaCapabilitiesProber >>> API_CALL: " +
|
|
45
38
|
"Missing policy argument for calling getStatusForPolicy.",
|
|
46
39
|
);
|
|
47
|
-
/* eslint-enable @typescript-eslint/no-floating-promises */
|
|
48
40
|
});
|
|
49
41
|
|
|
50
42
|
it("should resolve with `Unknown` if no getStatusForPolicy API", async () => {
|
|
@@ -62,8 +54,8 @@ describe("MediaCapabilitiesProber probers - HDCPPolicy", () => {
|
|
|
62
54
|
},
|
|
63
55
|
}));
|
|
64
56
|
|
|
65
|
-
const probeHDCPPolicy = (
|
|
66
|
-
.default;
|
|
57
|
+
const probeHDCPPolicy = (await vi.importActual("../../probers/HDCPPolicy"))
|
|
58
|
+
.default as typeof IProbeHDCPPolicy;
|
|
67
59
|
|
|
68
60
|
await probeHDCPPolicy({ hdcp: "1.1" }).then(([res]: [unknown]) => {
|
|
69
61
|
expect(res).toEqual(ProberStatus.Unknown);
|
|
@@ -89,8 +81,8 @@ describe("MediaCapabilitiesProber probers - HDCPPolicy", () => {
|
|
|
89
81
|
},
|
|
90
82
|
}));
|
|
91
83
|
|
|
92
|
-
const probeHDCPPolicy = (
|
|
93
|
-
.default;
|
|
84
|
+
const probeHDCPPolicy = (await vi.importActual("../../probers/HDCPPolicy"))
|
|
85
|
+
.default as typeof IProbeHDCPPolicy;
|
|
94
86
|
|
|
95
87
|
await probeHDCPPolicy({ hdcp: "1.1" }).then(([res]: [unknown]) => {
|
|
96
88
|
expect(res).toEqual(ProberStatus.Supported);
|
|
@@ -116,8 +108,8 @@ describe("MediaCapabilitiesProber probers - HDCPPolicy", () => {
|
|
|
116
108
|
},
|
|
117
109
|
}));
|
|
118
110
|
|
|
119
|
-
const probeHDCPPolicy = (
|
|
120
|
-
.default;
|
|
111
|
+
const probeHDCPPolicy = (await vi.importActual("../../probers/HDCPPolicy"))
|
|
112
|
+
.default as typeof IProbeHDCPPolicy;
|
|
121
113
|
await probeHDCPPolicy({ hdcp: "1.1" }).then(([res]: [unknown]) => {
|
|
122
114
|
expect(res).toEqual(ProberStatus.NotSupported);
|
|
123
115
|
expect(mockCreateMediaKeys).toHaveBeenCalledTimes(1);
|
package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/decodingInfos.test.ts
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { describe, beforeEach, afterEach, it, expect, vi } from "vitest";
|
|
2
|
+
import isNullOrUndefined from "../../../../../utils/is_null_or_undefined";
|
|
2
3
|
import probeDecodingInfos from "../../probers/decodingInfo";
|
|
3
4
|
import type { IMediaConfiguration } from "../../types";
|
|
4
5
|
import { ProberStatus } from "../../types";
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
9
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
10
|
-
/* eslint-disable @typescript-eslint/strict-boolean-expressions */
|
|
11
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
12
|
-
|
|
13
|
-
const origDecodingInfo = (navigator as any).mediaCapabilities;
|
|
14
|
-
const origMediaCapabilities = (navigator as any).mediaCapabilities;
|
|
7
|
+
const origDecodingInfo = navigator.mediaCapabilities;
|
|
8
|
+
const origMediaCapabilities = navigator.mediaCapabilities;
|
|
15
9
|
|
|
16
10
|
/**
|
|
17
11
|
* Stub decodingInfo API to resolve.
|
|
@@ -33,7 +27,9 @@ function stubDecodingInfo(isSupported: boolean, mustReject?: boolean) {
|
|
|
33
27
|
decodingInfo: decodingInfoStub,
|
|
34
28
|
};
|
|
35
29
|
|
|
36
|
-
|
|
30
|
+
// @ts-expect-error: `navigator.mediaCapabilities` is read-only normally, for
|
|
31
|
+
// now, we're going through JSDom through so that's OK.
|
|
32
|
+
navigator.mediaCapabilities = mockMediaCapabilities;
|
|
37
33
|
return decodingInfoStub;
|
|
38
34
|
}
|
|
39
35
|
|
|
@@ -41,7 +37,9 @@ function stubDecodingInfo(isSupported: boolean, mustReject?: boolean) {
|
|
|
41
37
|
* Reset decodingInfo to native implementation.
|
|
42
38
|
*/
|
|
43
39
|
function resetDecodingInfos(): void {
|
|
44
|
-
|
|
40
|
+
// @ts-expect-error: `navigator.mediaCapabilities` is read-only normally, for
|
|
41
|
+
// now, we're going through JSDom through so that's OK.
|
|
42
|
+
navigator.mediaCapabilities = origDecodingInfo;
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
describe("MediaCapabilitiesProber probers - decodingInfo", () => {
|
|
@@ -49,7 +47,9 @@ describe("MediaCapabilitiesProber probers - decodingInfo", () => {
|
|
|
49
47
|
vi.resetModules();
|
|
50
48
|
});
|
|
51
49
|
afterEach(() => {
|
|
52
|
-
|
|
50
|
+
// @ts-expect-error: `navigator.mediaCapabilities` is read-only normally, for
|
|
51
|
+
// now, we're going through JSDom through so that's OK.
|
|
52
|
+
navigator.mediaCapabilities = origMediaCapabilities;
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
it("should throw if no video and audio config", () => {
|
|
@@ -163,25 +163,29 @@ describe("MediaCapabilitiesProber probers - decodingInfo", () => {
|
|
|
163
163
|
});
|
|
164
164
|
|
|
165
165
|
it("should throw if API mediaCapabilities not available", () => {
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
// @ts-expect-error: `navigator.mediaCapabilities` is read-only normally, for
|
|
167
|
+
// now, we're going through JSDom through so that's OK.
|
|
168
|
+
delete navigator.mediaCapabilities;
|
|
169
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
168
170
|
expect(probeDecodingInfos({})).rejects.toThrowError(
|
|
169
171
|
"MediaCapabilitiesProber >>> API_CALL: MediaCapabilities API not available",
|
|
170
172
|
);
|
|
171
|
-
/* eslint-enable @typescript-eslint/no-floating-promises */
|
|
172
173
|
});
|
|
173
174
|
|
|
174
175
|
it("should throw if API decodingInfo not available", () => {
|
|
175
|
-
if ((navigator
|
|
176
|
-
|
|
176
|
+
if (!isNullOrUndefined(navigator.mediaCapabilities)) {
|
|
177
|
+
// @ts-expect-error: `navigator.mediaCapabilities` is read-only normally, for
|
|
178
|
+
// now, we're going through JSDom through so that's OK.
|
|
179
|
+
delete navigator.mediaCapabilities.decodingInfo;
|
|
177
180
|
} else {
|
|
178
|
-
|
|
181
|
+
// @ts-expect-error: `navigator.mediaCapabilities` is read-only normally, for
|
|
182
|
+
// now, we're going through JSDom through so that's OK.
|
|
183
|
+
navigator.mediaCapabilities = {};
|
|
179
184
|
}
|
|
180
|
-
|
|
185
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
181
186
|
expect(probeDecodingInfos({})).rejects.toThrowError(
|
|
182
187
|
"MediaCapabilitiesProber >>> API_CALL: Decoding Info not available",
|
|
183
188
|
);
|
|
184
|
-
/* eslint-enable @typescript-eslint/no-floating-promises */
|
|
185
189
|
});
|
|
186
190
|
|
|
187
191
|
it("should resolve with `Supported` if decodingInfo supports (video only)", () => {
|
package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/defaultCodecFinder.test.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import type {
|
|
3
|
+
findDefaultVideoCodec as IFindDefaultVideoCodec,
|
|
4
|
+
findDefaultAudioCodec as IFindDefaultAudioCodec,
|
|
5
|
+
} from "../../probers/defaultCodecsFinder";
|
|
8
6
|
|
|
9
7
|
describe("MediaCapabilitiesProber probers - findDefaultVideoCodec", () => {
|
|
10
8
|
beforeEach(() => {
|
|
@@ -24,9 +22,9 @@ describe("MediaCapabilitiesProber probers - findDefaultVideoCodec", () => {
|
|
|
24
22
|
isTypeSupported: mockIsTypeSupported,
|
|
25
23
|
},
|
|
26
24
|
}));
|
|
27
|
-
const
|
|
28
|
-
"../../probers/defaultCodecsFinder"
|
|
29
|
-
)
|
|
25
|
+
const findDefaultVideoCodec = (
|
|
26
|
+
await vi.importActual("../../probers/defaultCodecsFinder")
|
|
27
|
+
).findDefaultVideoCodec as typeof IFindDefaultVideoCodec;
|
|
30
28
|
expect(findDefaultVideoCodec()).toBe('video/mp4;codecs="avc1.4d401e"');
|
|
31
29
|
expect(mockIsTypeSupported).toHaveBeenCalledTimes(1);
|
|
32
30
|
});
|
|
@@ -38,9 +36,9 @@ describe("MediaCapabilitiesProber probers - findDefaultVideoCodec", () => {
|
|
|
38
36
|
isTypeSupported: mockIsTypeSupported,
|
|
39
37
|
},
|
|
40
38
|
}));
|
|
41
|
-
const
|
|
42
|
-
"../../probers/defaultCodecsFinder"
|
|
43
|
-
)
|
|
39
|
+
const findDefaultVideoCodec = (
|
|
40
|
+
await vi.importActual("../../probers/defaultCodecsFinder")
|
|
41
|
+
).findDefaultVideoCodec as typeof IFindDefaultVideoCodec;
|
|
44
42
|
expect(() => {
|
|
45
43
|
findDefaultVideoCodec();
|
|
46
44
|
}).toThrowError("No default video codec found.");
|
|
@@ -51,9 +49,9 @@ describe("MediaCapabilitiesProber probers - findDefaultVideoCodec", () => {
|
|
|
51
49
|
vi.doMock("../../../../../compat/browser_compatibility_types", () => ({
|
|
52
50
|
MediaSource_: null,
|
|
53
51
|
}));
|
|
54
|
-
const
|
|
55
|
-
"../../probers/defaultCodecsFinder"
|
|
56
|
-
)
|
|
52
|
+
const findDefaultVideoCodec = (
|
|
53
|
+
await vi.importActual("../../probers/defaultCodecsFinder")
|
|
54
|
+
).findDefaultVideoCodec as typeof IFindDefaultVideoCodec;
|
|
57
55
|
expect(() => {
|
|
58
56
|
findDefaultVideoCodec();
|
|
59
57
|
}).toThrowError("Cannot check video codec support: No API available.");
|
|
@@ -63,9 +61,9 @@ describe("MediaCapabilitiesProber probers - findDefaultVideoCodec", () => {
|
|
|
63
61
|
vi.doMock("../../../../../compat/browser_compatibility_types", () => ({
|
|
64
62
|
MediaSource_: {},
|
|
65
63
|
}));
|
|
66
|
-
const
|
|
67
|
-
"../../probers/defaultCodecsFinder"
|
|
68
|
-
)
|
|
64
|
+
const findDefaultVideoCodec = (
|
|
65
|
+
await vi.importActual("../../probers/defaultCodecsFinder")
|
|
66
|
+
).findDefaultVideoCodec as typeof IFindDefaultVideoCodec;
|
|
69
67
|
expect(() => {
|
|
70
68
|
findDefaultVideoCodec();
|
|
71
69
|
}).toThrowError("Cannot check video codec support: No API available.");
|
|
@@ -88,9 +86,9 @@ describe("MediaCapabilitiesProber probers - findDefaultAudioCodec", () => {
|
|
|
88
86
|
isTypeSupported: mockIsTypeSupported,
|
|
89
87
|
},
|
|
90
88
|
}));
|
|
91
|
-
const
|
|
92
|
-
"../../probers/defaultCodecsFinder"
|
|
93
|
-
)
|
|
89
|
+
const findDefaultAudioCodec = (
|
|
90
|
+
await vi.importActual("../../probers/defaultCodecsFinder")
|
|
91
|
+
).findDefaultAudioCodec as typeof IFindDefaultAudioCodec;
|
|
94
92
|
expect(findDefaultAudioCodec()).toBe('audio/mp4;codecs="mp4a.40.2"');
|
|
95
93
|
expect(mockIsTypeSupported).toHaveBeenCalledTimes(1);
|
|
96
94
|
});
|
|
@@ -102,9 +100,9 @@ describe("MediaCapabilitiesProber probers - findDefaultAudioCodec", () => {
|
|
|
102
100
|
isTypeSupported: mockIsTypeSupported,
|
|
103
101
|
},
|
|
104
102
|
}));
|
|
105
|
-
const
|
|
106
|
-
"../../probers/defaultCodecsFinder"
|
|
107
|
-
)
|
|
103
|
+
const findDefaultAudioCodec = (
|
|
104
|
+
await vi.importActual("../../probers/defaultCodecsFinder")
|
|
105
|
+
).findDefaultAudioCodec as typeof IFindDefaultAudioCodec;
|
|
108
106
|
expect(() => {
|
|
109
107
|
findDefaultAudioCodec();
|
|
110
108
|
}).toThrowError("No default audio codec found.");
|
|
@@ -115,9 +113,9 @@ describe("MediaCapabilitiesProber probers - findDefaultAudioCodec", () => {
|
|
|
115
113
|
vi.doMock("../../../../../compat/browser_compatibility_types", () => ({
|
|
116
114
|
MediaSource_: null,
|
|
117
115
|
}));
|
|
118
|
-
const
|
|
119
|
-
"../../probers/defaultCodecsFinder"
|
|
120
|
-
)
|
|
116
|
+
const findDefaultAudioCodec = (
|
|
117
|
+
await vi.importActual("../../probers/defaultCodecsFinder")
|
|
118
|
+
).findDefaultAudioCodec as typeof IFindDefaultAudioCodec;
|
|
121
119
|
expect(() => {
|
|
122
120
|
findDefaultAudioCodec();
|
|
123
121
|
}).toThrowError("Cannot check audio codec support: No API available.");
|
|
@@ -127,9 +125,9 @@ describe("MediaCapabilitiesProber probers - findDefaultAudioCodec", () => {
|
|
|
127
125
|
vi.doMock("../../../../../compat/browser_compatibility_types", () => ({
|
|
128
126
|
MediaSource_: {},
|
|
129
127
|
}));
|
|
130
|
-
const
|
|
131
|
-
"../../probers/defaultCodecsFinder"
|
|
132
|
-
)
|
|
128
|
+
const findDefaultAudioCodec = (
|
|
129
|
+
await vi.importActual("../../probers/defaultCodecsFinder")
|
|
130
|
+
).findDefaultAudioCodec as typeof IFindDefaultAudioCodec;
|
|
133
131
|
expect(() => {
|
|
134
132
|
findDefaultAudioCodec();
|
|
135
133
|
}).toThrow("Cannot check audio codec support: No API available.");
|