rx-player 4.2.0-dev.2024090300 → 4.2.0-dev.2024090500
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/VERSION +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/commonjs/compat/add_class_name.d.ts.map +1 -1
- package/dist/commonjs/compat/add_class_name.js +1 -2
- package/dist/commonjs/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/commonjs/compat/browser_compatibility_types.js +4 -1
- package/dist/commonjs/compat/clear_element_src.js +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
- package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
- package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
- package/dist/commonjs/compat/eme/eme-api-implementation.js +0 -2
- package/dist/commonjs/compat/event_listeners.d.ts.map +1 -1
- package/dist/commonjs/compat/event_listeners.js +2 -6
- package/dist/commonjs/compat/has_mse_in_worker.js +1 -1
- package/dist/commonjs/compat/is_codec_supported.d.ts.map +1 -1
- package/dist/commonjs/compat/is_codec_supported.js +0 -2
- package/dist/commonjs/compat/is_vtt_cue.d.ts.map +1 -1
- package/dist/commonjs/compat/is_vtt_cue.js +1 -2
- package/dist/commonjs/compat/on_height_width_change.d.ts.map +1 -1
- package/dist/commonjs/compat/patch_webkit_source_buffer.d.ts.map +1 -1
- package/dist/commonjs/compat/patch_webkit_source_buffer.js +8 -18
- package/dist/commonjs/compat/remove_cue.js +2 -2
- package/dist/commonjs/core/fetchers/index.d.ts +4 -4
- package/dist/commonjs/core/fetchers/index.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/index.js +2 -2
- package/dist/commonjs/core/fetchers/segment/index.d.ts +6 -5
- package/dist/commonjs/core/fetchers/segment/index.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/segment/index.js +2 -2
- package/dist/{es2017/core/stream/representation/utils/downloading_queue.d.ts → commonjs/core/fetchers/segment/segment_queue.d.ts} +63 -80
- package/dist/commonjs/core/fetchers/segment/segment_queue.d.ts.map +1 -0
- package/dist/commonjs/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +132 -111
- package/dist/commonjs/core/fetchers/segment/{segment_fetcher_creator.d.ts → segment_queue_creator.d.ts} +25 -12
- package/dist/commonjs/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
- package/dist/commonjs/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +15 -9
- package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts +9 -0
- package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/segment/task_prioritizer.js +38 -8
- package/dist/commonjs/core/fetchers/utils/schedule_request.js +1 -1
- package/dist/commonjs/core/main/common/content_time_boundaries_observer.js +21 -10
- package/dist/commonjs/core/main/worker/content_preparer.d.ts +3 -3
- package/dist/commonjs/core/main/worker/content_preparer.d.ts.map +1 -1
- package/dist/commonjs/core/main/worker/content_preparer.js +2 -2
- package/dist/commonjs/core/main/worker/send_message.js +1 -1
- package/dist/commonjs/core/main/worker/worker_main.js +2 -2
- package/dist/commonjs/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
- package/dist/commonjs/core/segment_sinks/inventory/segment_inventory.js +39 -30
- package/dist/commonjs/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
- package/dist/commonjs/core/segment_sinks/segment_buffers_store.js +3 -2
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +3 -3
- package/dist/commonjs/core/stream/adaptation/types.d.ts +2 -2
- package/dist/commonjs/core/stream/adaptation/types.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.js +27 -6
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +3 -3
- package/dist/commonjs/core/stream/period/period_stream.d.ts +1 -1
- package/dist/commonjs/core/stream/period/period_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/period/period_stream.js +2 -2
- package/dist/commonjs/core/stream/period/types.d.ts +2 -2
- package/dist/commonjs/core/stream/period/types.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.d.ts +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.js +19 -28
- package/dist/commonjs/core/stream/representation/types.d.ts +2 -2
- package/dist/commonjs/core/stream/representation/types.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +39 -18
- package/dist/commonjs/core/types.d.ts +2 -2
- package/dist/commonjs/core/types.d.ts.map +1 -1
- package/dist/commonjs/default_config.d.ts.map +1 -1
- package/dist/commonjs/default_config.js +0 -8
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
- package/dist/commonjs/features/add_features.d.ts.map +1 -1
- package/dist/commonjs/features/add_features.js +31 -10
- package/dist/commonjs/main_thread/api/option_utils.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/option_utils.js +2 -6
- package/dist/commonjs/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/public_api.js +33 -27
- package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.js +4 -3
- package/dist/commonjs/main_thread/init/media_source_content_initializer.js +6 -6
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +32 -37
- package/dist/commonjs/main_thread/text_displayer/html/html_text_displayer.js +1 -5
- package/dist/commonjs/main_thread/text_displayer/native/native_text_displayer.js +3 -7
- package/dist/commonjs/main_thread/tracks_store/track_dispatcher.js +1 -1
- package/dist/commonjs/main_thread/types.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/manifest.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/manifest.js +0 -6
- package/dist/commonjs/manifest/utils.d.ts.map +1 -1
- package/dist/commonjs/manifest/utils.js +72 -62
- package/dist/commonjs/mse/main_media_source_interface.js +1 -1
- package/dist/commonjs/multithread_types.d.ts +2 -2
- package/dist/commonjs/multithread_types.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
- package/dist/commonjs/parsers/manifest/local/representation_index.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/local/representation_index.js +29 -8
- package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.js +31 -10
- package/dist/commonjs/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/smooth/create_parser.js +2 -1
- package/dist/commonjs/parsers/manifest/smooth/shared_smooth_segment_timeline.js +26 -4
- package/dist/commonjs/parsers/manifest/utils/get_first_time_from_adaptation.js +29 -7
- package/dist/commonjs/parsers/manifest/utils/get_last_time_from_adaptation.js +29 -7
- package/dist/commonjs/parsers/texttracks/srt/html.js +28 -6
- package/dist/commonjs/parsers/texttracks/ttml/html/create_element.js +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/html/parse_ttml_to_div.js +29 -7
- package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +26 -5
- package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.js +25 -4
- package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
- package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.js +9 -3
- package/dist/commonjs/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +30 -8
- package/dist/commonjs/public_types.d.ts +5 -7
- package/dist/commonjs/public_types.d.ts.map +1 -1
- package/dist/commonjs/transports/smooth/extract_timings_infos.js +30 -8
- package/dist/commonjs/utils/array_find.d.ts +1 -1
- package/dist/commonjs/utils/array_find.d.ts.map +1 -1
- package/dist/commonjs/utils/array_find.js +3 -1
- package/dist/commonjs/utils/array_find_index.d.ts +1 -1
- package/dist/commonjs/utils/array_find_index.d.ts.map +1 -1
- package/dist/commonjs/utils/array_find_index.js +3 -1
- package/dist/commonjs/utils/array_includes.d.ts.map +1 -1
- package/dist/commonjs/utils/array_includes.js +1 -3
- package/dist/commonjs/utils/assert.d.ts.map +1 -1
- package/dist/commonjs/utils/assert.js +0 -2
- package/dist/commonjs/utils/base64.d.ts +1 -1
- package/dist/commonjs/utils/base64.d.ts.map +1 -1
- package/dist/commonjs/utils/base64.js +3 -2
- package/dist/commonjs/utils/event_emitter.js +1 -1
- package/dist/commonjs/utils/flat_map.d.ts.map +1 -1
- package/dist/commonjs/utils/flat_map.js +1 -2
- package/dist/commonjs/utils/id_generator.d.ts.map +1 -1
- package/dist/commonjs/utils/id_generator.js +0 -1
- package/dist/commonjs/utils/logger.js +1 -1
- package/dist/commonjs/utils/monotonic_timestamp.js +2 -2
- package/dist/commonjs/utils/noop.js +1 -2
- package/dist/commonjs/utils/object_assign.d.ts.map +1 -1
- package/dist/commonjs/utils/object_assign.js +27 -6
- package/dist/commonjs/utils/object_values.d.ts.map +1 -1
- package/dist/commonjs/utils/object_values.js +1 -1
- package/dist/commonjs/utils/reference.js +1 -1
- package/dist/commonjs/utils/request/xhr.js +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/es2017/compat/add_class_name.d.ts.map +1 -1
- package/dist/es2017/compat/add_class_name.js +1 -2
- package/dist/es2017/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/es2017/compat/browser_compatibility_types.js +4 -1
- package/dist/es2017/compat/clear_element_src.js +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
- package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
- package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
- package/dist/es2017/compat/eme/eme-api-implementation.js +0 -2
- package/dist/es2017/compat/event_listeners.d.ts.map +1 -1
- package/dist/es2017/compat/event_listeners.js +2 -6
- package/dist/es2017/compat/has_mse_in_worker.js +1 -1
- package/dist/es2017/compat/is_codec_supported.d.ts.map +1 -1
- package/dist/es2017/compat/is_codec_supported.js +0 -2
- package/dist/es2017/compat/is_vtt_cue.d.ts.map +1 -1
- package/dist/es2017/compat/is_vtt_cue.js +1 -2
- package/dist/es2017/compat/on_height_width_change.d.ts.map +1 -1
- package/dist/es2017/compat/patch_webkit_source_buffer.d.ts.map +1 -1
- package/dist/es2017/compat/patch_webkit_source_buffer.js +8 -18
- package/dist/es2017/compat/remove_cue.js +2 -2
- package/dist/es2017/core/fetchers/index.d.ts +4 -4
- package/dist/es2017/core/fetchers/index.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/index.js +2 -2
- package/dist/es2017/core/fetchers/segment/index.d.ts +6 -5
- package/dist/es2017/core/fetchers/segment/index.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/segment/index.js +2 -2
- package/dist/{commonjs/core/stream/representation/utils/downloading_queue.d.ts → es2017/core/fetchers/segment/segment_queue.d.ts} +63 -80
- package/dist/es2017/core/fetchers/segment/segment_queue.d.ts.map +1 -0
- package/dist/es2017/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +126 -105
- package/dist/es2017/core/fetchers/segment/{segment_fetcher_creator.d.ts → segment_queue_creator.d.ts} +25 -12
- package/dist/es2017/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
- package/dist/es2017/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +12 -6
- package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts +9 -0
- package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/segment/task_prioritizer.js +10 -2
- package/dist/es2017/core/fetchers/utils/schedule_request.js +1 -1
- package/dist/es2017/core/main/common/content_time_boundaries_observer.js +4 -4
- package/dist/es2017/core/main/worker/content_preparer.d.ts +3 -3
- package/dist/es2017/core/main/worker/content_preparer.d.ts.map +1 -1
- package/dist/es2017/core/main/worker/content_preparer.js +3 -3
- package/dist/es2017/core/main/worker/send_message.js +1 -1
- package/dist/es2017/core/main/worker/worker_main.js +2 -2
- package/dist/es2017/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
- package/dist/es2017/core/segment_sinks/inventory/segment_inventory.js +1 -2
- package/dist/es2017/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
- package/dist/es2017/core/segment_sinks/segment_buffers_store.js +3 -2
- package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.js +3 -3
- package/dist/es2017/core/stream/adaptation/types.d.ts +2 -2
- package/dist/es2017/core/stream/adaptation/types.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.js +1 -2
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +3 -3
- package/dist/es2017/core/stream/period/period_stream.d.ts +1 -1
- package/dist/es2017/core/stream/period/period_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/period/period_stream.js +2 -2
- package/dist/es2017/core/stream/period/types.d.ts +2 -2
- package/dist/es2017/core/stream/period/types.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.d.ts +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.js +19 -28
- package/dist/es2017/core/stream/representation/types.d.ts +2 -2
- package/dist/es2017/core/stream/representation/types.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +1 -2
- package/dist/es2017/core/types.d.ts +2 -2
- package/dist/es2017/core/types.d.ts.map +1 -1
- package/dist/es2017/default_config.d.ts.map +1 -1
- package/dist/es2017/default_config.js +0 -8
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
- package/dist/es2017/features/add_features.d.ts.map +1 -1
- package/dist/es2017/features/add_features.js +1 -2
- package/dist/es2017/main_thread/api/option_utils.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/option_utils.js +2 -6
- package/dist/es2017/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/public_api.js +29 -23
- package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.js +2 -1
- package/dist/es2017/main_thread/init/media_source_content_initializer.js +6 -6
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.js +7 -12
- package/dist/es2017/main_thread/text_displayer/html/html_text_displayer.js +1 -5
- package/dist/es2017/main_thread/text_displayer/native/native_text_displayer.js +3 -7
- package/dist/es2017/main_thread/tracks_store/track_dispatcher.js +1 -1
- package/dist/es2017/main_thread/types.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/manifest.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/manifest.js +0 -6
- package/dist/es2017/manifest/utils.d.ts.map +1 -1
- package/dist/es2017/manifest/utils.js +1 -2
- package/dist/es2017/mse/main_media_source_interface.js +1 -1
- package/dist/es2017/multithread_types.d.ts +2 -2
- package/dist/es2017/multithread_types.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +1 -2
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
- package/dist/es2017/parsers/manifest/local/representation_index.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/local/representation_index.js +1 -2
- package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.js +2 -3
- package/dist/es2017/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/smooth/create_parser.js +2 -1
- package/dist/es2017/parsers/manifest/smooth/shared_smooth_segment_timeline.js +2 -2
- package/dist/es2017/parsers/manifest/utils/get_first_time_from_adaptation.js +2 -2
- package/dist/es2017/parsers/manifest/utils/get_last_time_from_adaptation.js +2 -2
- package/dist/es2017/parsers/texttracks/srt/html.js +2 -2
- package/dist/es2017/parsers/texttracks/ttml/html/create_element.js +1 -1
- package/dist/es2017/parsers/texttracks/ttml/html/parse_ttml_to_div.js +3 -3
- package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +1 -2
- package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.js +1 -2
- package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
- package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/webvtt/html/to_html.js +9 -3
- package/dist/es2017/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +2 -2
- package/dist/es2017/public_types.d.ts +5 -7
- package/dist/es2017/public_types.d.ts.map +1 -1
- package/dist/es2017/transports/smooth/extract_timings_infos.js +3 -3
- package/dist/es2017/utils/array_find.d.ts +1 -1
- package/dist/es2017/utils/array_find.d.ts.map +1 -1
- package/dist/es2017/utils/array_find.js +3 -1
- package/dist/es2017/utils/array_find_index.d.ts +1 -1
- package/dist/es2017/utils/array_find_index.d.ts.map +1 -1
- package/dist/es2017/utils/array_find_index.js +3 -1
- package/dist/es2017/utils/array_includes.d.ts.map +1 -1
- package/dist/es2017/utils/array_includes.js +1 -3
- package/dist/es2017/utils/assert.d.ts.map +1 -1
- package/dist/es2017/utils/assert.js +0 -2
- package/dist/es2017/utils/base64.d.ts +1 -1
- package/dist/es2017/utils/base64.d.ts.map +1 -1
- package/dist/es2017/utils/base64.js +3 -2
- package/dist/es2017/utils/event_emitter.js +1 -1
- package/dist/es2017/utils/flat_map.d.ts.map +1 -1
- package/dist/es2017/utils/flat_map.js +1 -2
- package/dist/es2017/utils/id_generator.d.ts.map +1 -1
- package/dist/es2017/utils/id_generator.js +0 -1
- package/dist/es2017/utils/logger.js +1 -1
- package/dist/es2017/utils/monotonic_timestamp.js +2 -2
- package/dist/es2017/utils/noop.js +1 -2
- package/dist/es2017/utils/object_assign.d.ts.map +1 -1
- package/dist/es2017/utils/object_assign.js +1 -2
- package/dist/es2017/utils/object_values.d.ts.map +1 -1
- package/dist/es2017/utils/object_values.js +1 -2
- package/dist/es2017/utils/reference.js +1 -1
- package/dist/es2017/utils/request/xhr.js +1 -1
- package/dist/rx-player.js +39336 -18
- package/dist/rx-player.min.js +18 -0
- package/dist/worker.js +5 -5
- package/package.json +16 -9
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/compat/__tests__/add_text_track.test.ts +8 -12
- package/src/compat/__tests__/browser_compatibility_types.test.ts +0 -7
- package/src/compat/__tests__/browser_version.test.ts +20 -19
- package/src/compat/__tests__/can_patch_isobmff.test.ts +7 -10
- package/src/compat/__tests__/can_rely_on_video_visibility_and_size.test.ts +17 -21
- package/src/compat/__tests__/can_reuse_media_keys.test.ts +13 -21
- package/src/compat/__tests__/clear_element_src.test.ts +37 -34
- package/src/compat/__tests__/enable_audio_track.test.ts +22 -21
- package/src/compat/__tests__/is_codec_supported.test.ts +17 -18
- package/src/compat/__tests__/is_seeking_approximate.test.ts +8 -14
- package/src/compat/__tests__/is_vtt_cue.test.ts +8 -13
- package/src/compat/__tests__/make_vtt_cue.test.ts +7 -12
- package/src/compat/__tests__/patch_webkit_source_buffer.test.ts +44 -32
- package/src/compat/__tests__/remove_cue.test.ts +30 -31
- package/src/compat/__tests__/should_favour_custom_safari_EME.test.ts +21 -26
- package/src/compat/__tests__/should_renew_media_key_system_access.test.ts +9 -17
- package/src/compat/__tests__/should_unset_media_keys.test.ts +7 -14
- package/src/compat/__tests__/should_validate_metadata.test.ts +7 -17
- package/src/compat/__tests__/should_wait_for_data_before_loaded.test.ts +17 -26
- package/src/compat/__tests__/should_wait_for_have_enough_data.test.ts +10 -15
- package/src/compat/add_class_name.ts +1 -2
- package/src/compat/browser_compatibility_types.ts +4 -2
- package/src/compat/clear_element_src.ts +1 -1
- package/src/compat/eme/custom_media_keys/moz_media_keys_constructor.ts +1 -2
- package/src/compat/eme/custom_media_keys/ms_media_keys_constructor.ts +1 -2
- package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +3 -6
- package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +2 -17
- package/src/compat/eme/custom_media_keys/webkit_media_keys_constructor.ts +1 -4
- package/src/compat/eme/eme-api-implementation.ts +0 -2
- package/src/compat/event_listeners.ts +2 -6
- package/src/compat/has_mse_in_worker.ts +1 -1
- package/src/compat/is_codec_supported.ts +0 -2
- package/src/compat/is_debug_mode_enabled.ts +1 -1
- package/src/compat/is_vtt_cue.ts +1 -2
- package/src/compat/on_height_width_change.ts +1 -2
- package/src/compat/patch_webkit_source_buffer.ts +48 -29
- package/src/compat/remove_cue.ts +2 -2
- package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +21 -26
- package/src/core/fetchers/README.md +13 -12
- package/src/core/fetchers/index.ts +5 -8
- package/src/core/fetchers/segment/__tests__/task_prioritizer.test.ts +17 -23
- package/src/core/fetchers/segment/index.ts +6 -5
- package/src/core/{stream/representation/utils/downloading_queue.ts → fetchers/segment/segment_queue.ts} +204 -166
- package/src/core/fetchers/segment/{segment_fetcher_creator.ts → segment_queue_creator.ts} +31 -14
- package/src/core/fetchers/segment/task_prioritizer.ts +10 -2
- package/src/core/fetchers/utils/schedule_request.ts +1 -1
- package/src/core/main/common/content_time_boundaries_observer.ts +4 -4
- package/src/core/main/worker/content_preparer.ts +5 -5
- package/src/core/main/worker/send_message.ts +1 -1
- package/src/core/main/worker/worker_main.ts +2 -2
- package/src/core/segment_sinks/implementations/text/text_segment_buffer.ts +1 -5
- package/src/core/segment_sinks/inventory/segment_inventory.ts +1 -2
- package/src/core/segment_sinks/segment_buffers_store.ts +3 -2
- package/src/core/stream/adaptation/adaptation_stream.ts +3 -3
- package/src/core/stream/adaptation/types.ts +2 -2
- package/src/core/stream/orchestrator/get_time_ranges_for_content.ts +1 -2
- package/src/core/stream/orchestrator/stream_orchestrator.ts +4 -4
- package/src/core/stream/period/period_stream.ts +2 -2
- package/src/core/stream/period/types.ts +2 -2
- package/src/core/stream/representation/representation_stream.ts +59 -56
- package/src/core/stream/representation/types.ts +3 -4
- package/src/core/stream/representation/utils/get_needed_segments.ts +1 -2
- package/src/core/types.ts +2 -4
- package/src/default_config.ts +0 -8
- package/src/errors/__tests__/format_error.test.ts +18 -18
- package/src/experimental/features/__tests__/multi_thread.test.ts +5 -5
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/capabilities.test.ts +11 -11
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +18 -26
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +13 -21
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/decodingInfos.test.ts +24 -20
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/defaultCodecFinder.test.ts +28 -30
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaContentType.test.ts +32 -38
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +64 -51
- package/src/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.ts +4 -17
- package/src/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.ts +0 -4
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.ts +1 -2
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts +16 -14
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +1 -2
- package/src/features/__tests__/add_features.test.ts +12 -11
- package/src/features/add_features.ts +1 -2
- package/src/features/list/__tests__/dash_wasm.test.ts +4 -4
- package/src/main_thread/api/__tests__/option_utils.test.ts +114 -70
- package/src/main_thread/api/__tests__/public_api.test.ts +85 -48
- package/src/main_thread/api/option_utils.ts +2 -6
- package/src/main_thread/api/public_api.ts +24 -18
- package/src/main_thread/decrypt/__tests__/__global__/get_license.test.ts +12 -18
- package/src/main_thread/decrypt/__tests__/__global__/init_data.test.ts +128 -101
- package/src/main_thread/decrypt/__tests__/__global__/media_key_system_access.test.ts +26 -33
- package/src/main_thread/decrypt/__tests__/__global__/media_keys.test.ts +46 -48
- package/src/main_thread/decrypt/__tests__/__global__/server_certificate.test.ts +33 -34
- package/src/main_thread/decrypt/__tests__/__global__/utils.ts +13 -17
- package/src/main_thread/decrypt/session_events_listener.ts +1 -1
- package/src/main_thread/decrypt/utils/__tests__/clean_old_loaded_sessions.test.ts +0 -5
- package/src/main_thread/decrypt/utils/__tests__/clean_old_stored_persistent_info.test.ts +14 -17
- package/src/main_thread/decrypt/utils/persistent_sessions_store.ts +2 -1
- package/src/main_thread/init/media_source_content_initializer.ts +7 -7
- package/src/main_thread/init/multi_thread_content_initializer.ts +7 -12
- package/src/main_thread/init/utils/__tests__/are_same_stream_events.test.ts +11 -16
- package/src/main_thread/init/utils/__tests__/refresh_scheduled_events_list.test.ts +48 -18
- package/src/main_thread/text_displayer/html/__tests__/text_track_cues_store.test.ts +32 -17
- package/src/main_thread/text_displayer/html/html_text_displayer.ts +1 -5
- package/src/main_thread/text_displayer/native/native_text_displayer.ts +3 -7
- package/src/main_thread/tracks_store/__tests__/media_element_tracks_store.test.ts +33 -28
- package/src/main_thread/tracks_store/track_dispatcher.ts +1 -1
- package/src/main_thread/types.ts +0 -1
- package/src/manifest/classes/__tests__/adaptation.test.ts +167 -62
- package/src/manifest/classes/__tests__/manifest.test.ts +130 -74
- package/src/manifest/classes/__tests__/period.test.ts +293 -211
- package/src/manifest/classes/__tests__/update_period_in_place.test.ts +0 -2
- package/src/manifest/classes/__tests__/update_periods.test.ts +57 -57
- package/src/manifest/classes/manifest.ts +0 -6
- package/src/manifest/utils.ts +1 -2
- package/src/mse/main_media_source_interface.ts +1 -1
- package/src/mse/types.ts +1 -1
- package/src/multithread_types.ts +2 -2
- package/src/parsers/manifest/dash/common/__tests__/get_clock_offset.test.ts +5 -10
- package/src/parsers/manifest/dash/common/__tests__/get_http_utc-timing_url.test.ts +38 -30
- package/src/parsers/manifest/dash/common/__tests__/get_periods_time_infos.test.ts +0 -3
- package/src/parsers/manifest/dash/common/indexes/timeline/parse_s_element.ts +12 -6
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.ts +14 -7
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.ts +8 -4
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Period.ts +10 -5
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.ts +10 -5
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
- package/src/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.ts +14 -7
- package/src/parsers/manifest/dash/native-parser/node_parsers/EventStream.ts +2 -1
- package/src/parsers/manifest/dash/native-parser/node_parsers/MPD.ts +8 -4
- package/src/parsers/manifest/dash/native-parser/node_parsers/Period.ts +10 -5
- package/src/parsers/manifest/dash/native-parser/node_parsers/Representation.ts +10 -5
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentTimeline.test.ts +9 -14
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
- package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +1 -2
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.ts +2 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.ts +2 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.ts +4 -2
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/MPD.ts +10 -5
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/Period.ts +2 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/root.ts +2 -1
- package/src/parsers/manifest/local/representation_index.ts +1 -2
- package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +2 -3
- package/src/parsers/manifest/smooth/create_parser.ts +2 -1
- package/src/parsers/manifest/smooth/shared_smooth_segment_timeline.ts +2 -2
- package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +3 -8
- package/src/parsers/manifest/utils/get_first_time_from_adaptation.ts +2 -2
- package/src/parsers/manifest/utils/get_last_time_from_adaptation.ts +2 -2
- package/src/parsers/texttracks/srt/html.ts +2 -2
- package/src/parsers/texttracks/ttml/__tests__/resolve_styles_inheritance.test.ts +3 -7
- package/src/parsers/texttracks/ttml/html/__tests__/__global__/html_ttml_parser.test.ts +4 -4
- package/src/parsers/texttracks/ttml/html/create_element.ts +1 -1
- package/src/parsers/texttracks/ttml/html/parse_ttml_to_div.ts +3 -3
- package/src/parsers/texttracks/ttml/native/parse_ttml_to_vtt.ts +1 -2
- package/src/parsers/texttracks/ttml/resolve_styles_inheritance.ts +1 -2
- package/src/parsers/texttracks/webvtt/__tests__/parse_cue_block.test.ts +11 -11
- package/src/parsers/texttracks/webvtt/html/__tests__/convert_payload_to_html.test.ts +5 -18
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_style_block.test.ts +23 -28
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_webvtt_to_div.test.ts +9 -14
- package/src/parsers/texttracks/webvtt/html/__tests__/to_html.test.ts +11 -11
- package/src/parsers/texttracks/webvtt/html/to_html.ts +9 -3
- package/src/parsers/texttracks/webvtt/native/parse_vtt_to_cues.ts +2 -2
- package/src/public_types.ts +7 -8
- package/src/tools/TextTrackRenderer/text_track_renderer.ts +1 -1
- package/src/transports/smooth/extract_timings_infos.ts +3 -3
- package/src/transports/smooth/isobmff/__tests__/create_boxes.test.ts +30 -28
- package/src/transports/utils/__tests__/check_isobmff_integrity.test.ts +38 -44
- package/src/utils/__tests__/array_find.test.ts +12 -12
- package/src/utils/__tests__/array_find_index.test.ts +13 -12
- package/src/utils/__tests__/array_includes.test.ts +7 -7
- package/src/utils/__tests__/assert.test.ts +19 -25
- package/src/utils/__tests__/base64.test.ts +18 -13
- package/src/utils/__tests__/event_emitter.test.ts +225 -50
- package/src/utils/__tests__/flat_map.test.ts +2 -6
- package/src/utils/__tests__/starts_with.test.ts +7 -8
- package/src/utils/array_find.ts +3 -7
- package/src/utils/array_find_index.ts +3 -7
- package/src/utils/array_includes.ts +1 -3
- package/src/utils/assert.ts +0 -2
- package/src/utils/base64.ts +3 -2
- package/src/utils/event_emitter.ts +1 -1
- package/src/utils/flat_map.ts +1 -2
- package/src/utils/id_generator.ts +0 -2
- package/src/utils/is_worker.ts +1 -1
- package/src/utils/logger.ts +1 -1
- package/src/utils/monotonic_timestamp.ts +2 -2
- package/src/utils/noop.ts +1 -2
- package/src/utils/object_assign.ts +1 -2
- package/src/utils/object_values.ts +1 -2
- package/src/utils/reference.ts +1 -1
- package/src/utils/request/xhr.ts +1 -1
- package/dist/commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
- package/dist/commonjs/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
- package/dist/es2017/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
- package/dist/es2017/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
|
+
import type { IParsedAdaptation, IParsedPeriod } from "../../../parsers/manifest";
|
|
2
3
|
import type Adaptation from "../adaptation";
|
|
3
4
|
import CodecSupportCache from "../codec_support_cache";
|
|
4
|
-
|
|
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 */
|
|
5
|
+
import type IPeriod from "../period";
|
|
10
6
|
|
|
11
7
|
describe("Manifest - Period", () => {
|
|
12
8
|
beforeEach(() => {
|
|
@@ -14,7 +10,7 @@ describe("Manifest - Period", () => {
|
|
|
14
10
|
});
|
|
15
11
|
|
|
16
12
|
it("should throw if no adaptation is given", async () => {
|
|
17
|
-
const mockAdaptation = vi.fn((arg) => ({
|
|
13
|
+
const mockAdaptation = vi.fn((arg: IParsedAdaptation) => ({
|
|
18
14
|
...arg,
|
|
19
15
|
supportStatus: {
|
|
20
16
|
hasSupportedCodec: undefined,
|
|
@@ -27,9 +23,9 @@ describe("Manifest - Period", () => {
|
|
|
27
23
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text"],
|
|
28
24
|
}));
|
|
29
25
|
|
|
30
|
-
const Period = (
|
|
26
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
31
27
|
const args = { id: "12", adaptations: {}, start: 0 };
|
|
32
|
-
let period = null;
|
|
28
|
+
let period: IPeriod | null = null;
|
|
33
29
|
let errorReceived: unknown = null;
|
|
34
30
|
const unsupportedAdaptations: Adaptation[] = [];
|
|
35
31
|
try {
|
|
@@ -55,20 +51,23 @@ describe("Manifest - Period", () => {
|
|
|
55
51
|
});
|
|
56
52
|
|
|
57
53
|
it("should throw if no audio nor video adaptation is given", async () => {
|
|
58
|
-
const mockAdaptation = vi.fn(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
const mockAdaptation = vi.fn(
|
|
55
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
56
|
+
({
|
|
57
|
+
...arg,
|
|
58
|
+
supportStatus: {
|
|
59
|
+
hasSupportedCodec: undefined,
|
|
60
|
+
hasCodecWithUndefinedSupport: true,
|
|
61
|
+
isDecipherable: undefined,
|
|
62
|
+
},
|
|
63
|
+
}) as unknown as Adaptation,
|
|
64
|
+
);
|
|
66
65
|
vi.doMock("../adaptation", () => ({
|
|
67
66
|
default: mockAdaptation,
|
|
68
67
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text", "foo"],
|
|
69
68
|
}));
|
|
70
69
|
|
|
71
|
-
const Period = (
|
|
70
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
72
71
|
const fooAda1 = {
|
|
73
72
|
type: "foo",
|
|
74
73
|
id: "54",
|
|
@@ -80,8 +79,12 @@ describe("Manifest - Period", () => {
|
|
|
80
79
|
representations: [{}],
|
|
81
80
|
};
|
|
82
81
|
const foo = [fooAda1, fooAda2];
|
|
83
|
-
const args
|
|
84
|
-
|
|
82
|
+
const args: IParsedPeriod = {
|
|
83
|
+
id: "12",
|
|
84
|
+
adaptations: { foo },
|
|
85
|
+
start: 0,
|
|
86
|
+
} as unknown as IParsedPeriod;
|
|
87
|
+
let period: IPeriod | null = null;
|
|
85
88
|
let errorReceived: unknown = null;
|
|
86
89
|
const unsupportedAdaptations: Adaptation[] = [];
|
|
87
90
|
const codecSupportCache = new CodecSupportCache([]);
|
|
@@ -111,22 +114,25 @@ describe("Manifest - Period", () => {
|
|
|
111
114
|
});
|
|
112
115
|
|
|
113
116
|
it("should throw if only empty audio and/or video adaptations is given", async () => {
|
|
114
|
-
const mockAdaptation = vi.fn(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
const mockAdaptation = vi.fn(
|
|
118
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
119
|
+
({
|
|
120
|
+
...arg,
|
|
121
|
+
supportStatus: {
|
|
122
|
+
hasSupportedCodec: undefined,
|
|
123
|
+
hasCodecWithUndefinedSupport: true,
|
|
124
|
+
isDecipherable: undefined,
|
|
125
|
+
},
|
|
126
|
+
}) as unknown as Adaptation,
|
|
127
|
+
);
|
|
122
128
|
vi.doMock("../adaptation", () => ({
|
|
123
129
|
default: mockAdaptation,
|
|
124
130
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text", "foo"],
|
|
125
131
|
}));
|
|
126
132
|
|
|
127
|
-
const Period = (
|
|
133
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
128
134
|
const args = { id: "12", adaptations: { video: [], audio: [] }, start: 0 };
|
|
129
|
-
let period = null;
|
|
135
|
+
let period: IPeriod | null = null;
|
|
130
136
|
let errorReceived: unknown = null;
|
|
131
137
|
const unsupportedAdaptations: Adaptation[] = [];
|
|
132
138
|
try {
|
|
@@ -154,20 +160,23 @@ describe("Manifest - Period", () => {
|
|
|
154
160
|
});
|
|
155
161
|
|
|
156
162
|
it("should throw if we are left with no audio representation", async () => {
|
|
157
|
-
const mockAdaptation = vi.fn(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
const mockAdaptation = vi.fn(
|
|
164
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
165
|
+
({
|
|
166
|
+
...arg,
|
|
167
|
+
supportStatus: {
|
|
168
|
+
hasSupportedCodec: undefined,
|
|
169
|
+
hasCodecWithUndefinedSupport: true,
|
|
170
|
+
isDecipherable: undefined,
|
|
171
|
+
},
|
|
172
|
+
}) as unknown as Adaptation,
|
|
173
|
+
);
|
|
165
174
|
vi.doMock("../adaptation", () => ({
|
|
166
175
|
default: mockAdaptation,
|
|
167
176
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text", "foo"],
|
|
168
177
|
}));
|
|
169
178
|
|
|
170
|
-
const Period = (
|
|
179
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
171
180
|
const videoAda1 = {
|
|
172
181
|
type: "video",
|
|
173
182
|
id: "54",
|
|
@@ -211,8 +220,12 @@ describe("Manifest - Period", () => {
|
|
|
211
220
|
},
|
|
212
221
|
};
|
|
213
222
|
const audio = [audioAda1, audioAda2];
|
|
214
|
-
const args
|
|
215
|
-
|
|
223
|
+
const args: IParsedPeriod = {
|
|
224
|
+
id: "12",
|
|
225
|
+
adaptations: { video, audio },
|
|
226
|
+
start: 0,
|
|
227
|
+
} as unknown as IParsedPeriod;
|
|
228
|
+
let period: IPeriod | null = null;
|
|
216
229
|
let errorReceived: unknown = null;
|
|
217
230
|
const unsupportedAdaptations: Adaptation[] = [];
|
|
218
231
|
try {
|
|
@@ -240,20 +253,23 @@ describe("Manifest - Period", () => {
|
|
|
240
253
|
});
|
|
241
254
|
|
|
242
255
|
it("should throw if no audio Adaptation is supported", async () => {
|
|
243
|
-
const mockAdaptation = vi.fn(
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
256
|
+
const mockAdaptation = vi.fn(
|
|
257
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
258
|
+
({
|
|
259
|
+
...arg,
|
|
260
|
+
supportStatus: {
|
|
261
|
+
hasSupportedCodec: arg.type !== "audio",
|
|
262
|
+
hasCodecWithUndefinedSupport: true,
|
|
263
|
+
isDecipherable: undefined,
|
|
264
|
+
},
|
|
265
|
+
}) as unknown as Adaptation,
|
|
266
|
+
);
|
|
251
267
|
vi.doMock("../adaptation", () => ({
|
|
252
268
|
default: mockAdaptation,
|
|
253
269
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text", "foo"],
|
|
254
270
|
}));
|
|
255
271
|
|
|
256
|
-
const Period = (
|
|
272
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
257
273
|
const videoAda1 = {
|
|
258
274
|
type: "video",
|
|
259
275
|
id: "54",
|
|
@@ -278,7 +294,11 @@ describe("Manifest - Period", () => {
|
|
|
278
294
|
return videoAda3;
|
|
279
295
|
},
|
|
280
296
|
};
|
|
281
|
-
const video = [
|
|
297
|
+
const video: IParsedAdaptation[] = [
|
|
298
|
+
videoAda1,
|
|
299
|
+
videoAda2,
|
|
300
|
+
videoAda3,
|
|
301
|
+
] as unknown as IParsedAdaptation[];
|
|
282
302
|
|
|
283
303
|
const audioAda1 = {
|
|
284
304
|
type: "audio",
|
|
@@ -296,9 +316,16 @@ describe("Manifest - Period", () => {
|
|
|
296
316
|
return audioAda1;
|
|
297
317
|
},
|
|
298
318
|
};
|
|
299
|
-
const audio = [
|
|
300
|
-
|
|
301
|
-
|
|
319
|
+
const audio: IParsedAdaptation[] = [
|
|
320
|
+
audioAda1,
|
|
321
|
+
audioAda2,
|
|
322
|
+
] as unknown as IParsedAdaptation[];
|
|
323
|
+
const args: IParsedPeriod = {
|
|
324
|
+
id: "12",
|
|
325
|
+
adaptations: { video, audio },
|
|
326
|
+
start: 0,
|
|
327
|
+
};
|
|
328
|
+
let period: IPeriod | null = null;
|
|
302
329
|
let errorReceived: unknown = null;
|
|
303
330
|
const unsupportedAdaptations: Adaptation[] = [];
|
|
304
331
|
try {
|
|
@@ -328,20 +355,23 @@ describe("Manifest - Period", () => {
|
|
|
328
355
|
});
|
|
329
356
|
|
|
330
357
|
it("should throw if we are left with no video representation", async () => {
|
|
331
|
-
const mockAdaptation = vi.fn(
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
358
|
+
const mockAdaptation = vi.fn(
|
|
359
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
360
|
+
({
|
|
361
|
+
...arg,
|
|
362
|
+
supportStatus: {
|
|
363
|
+
hasSupportedCodec: undefined,
|
|
364
|
+
hasCodecWithUndefinedSupport: true,
|
|
365
|
+
isDecipherable: undefined,
|
|
366
|
+
},
|
|
367
|
+
}) as unknown as Adaptation,
|
|
368
|
+
);
|
|
339
369
|
vi.doMock("../adaptation", () => ({
|
|
340
370
|
default: mockAdaptation,
|
|
341
371
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text", "foo"],
|
|
342
372
|
}));
|
|
343
373
|
|
|
344
|
-
const Period = (
|
|
374
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
345
375
|
const videoAda1 = {
|
|
346
376
|
type: "video",
|
|
347
377
|
id: "54",
|
|
@@ -366,7 +396,11 @@ describe("Manifest - Period", () => {
|
|
|
366
396
|
return videoAda3;
|
|
367
397
|
},
|
|
368
398
|
};
|
|
369
|
-
const video = [
|
|
399
|
+
const video: IParsedAdaptation[] = [
|
|
400
|
+
videoAda1,
|
|
401
|
+
videoAda2,
|
|
402
|
+
videoAda3,
|
|
403
|
+
] as unknown as IParsedAdaptation[];
|
|
370
404
|
|
|
371
405
|
const audioAda1 = {
|
|
372
406
|
type: "audio",
|
|
@@ -384,9 +418,12 @@ describe("Manifest - Period", () => {
|
|
|
384
418
|
return audioAda2;
|
|
385
419
|
},
|
|
386
420
|
};
|
|
387
|
-
const audio = [
|
|
388
|
-
|
|
389
|
-
|
|
421
|
+
const audio: IParsedAdaptation[] = [
|
|
422
|
+
audioAda1,
|
|
423
|
+
audioAda2,
|
|
424
|
+
] as unknown as IParsedAdaptation[];
|
|
425
|
+
const args: IParsedPeriod = { id: "12", adaptations: { video, audio }, start: 0 };
|
|
426
|
+
let period: IPeriod | null = null;
|
|
390
427
|
let errorReceived: unknown = null;
|
|
391
428
|
const unsupportedAdaptations: Adaptation[] = [];
|
|
392
429
|
try {
|
|
@@ -414,20 +451,23 @@ describe("Manifest - Period", () => {
|
|
|
414
451
|
});
|
|
415
452
|
|
|
416
453
|
it("should throw if no video adaptation is supported", async () => {
|
|
417
|
-
const mockAdaptation = vi.fn(
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
454
|
+
const mockAdaptation = vi.fn(
|
|
455
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
456
|
+
({
|
|
457
|
+
...arg,
|
|
458
|
+
supportStatus: {
|
|
459
|
+
hasSupportedCodec: arg.type !== "video",
|
|
460
|
+
hasCodecWithUndefinedSupport: true,
|
|
461
|
+
isDecipherable: undefined,
|
|
462
|
+
},
|
|
463
|
+
}) as unknown as Adaptation,
|
|
464
|
+
);
|
|
425
465
|
vi.doMock("../adaptation", () => ({
|
|
426
466
|
default: mockAdaptation,
|
|
427
467
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text", "foo"],
|
|
428
468
|
}));
|
|
429
469
|
|
|
430
|
-
const Period = (
|
|
470
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
431
471
|
const videoAda1 = {
|
|
432
472
|
type: "video",
|
|
433
473
|
id: "54",
|
|
@@ -452,7 +492,11 @@ describe("Manifest - Period", () => {
|
|
|
452
492
|
return videoAda3;
|
|
453
493
|
},
|
|
454
494
|
};
|
|
455
|
-
const video = [
|
|
495
|
+
const video: IParsedAdaptation[] = [
|
|
496
|
+
videoAda1,
|
|
497
|
+
videoAda2,
|
|
498
|
+
videoAda3,
|
|
499
|
+
] as unknown as IParsedAdaptation[];
|
|
456
500
|
|
|
457
501
|
const audioAda1 = {
|
|
458
502
|
type: "audio",
|
|
@@ -470,9 +514,9 @@ describe("Manifest - Period", () => {
|
|
|
470
514
|
return audioAda2;
|
|
471
515
|
},
|
|
472
516
|
};
|
|
473
|
-
const audio = [audioAda1, audioAda2];
|
|
517
|
+
const audio = [audioAda1, audioAda2] as unknown as IParsedAdaptation[];
|
|
474
518
|
const args = { id: "12", adaptations: { video, audio }, start: 0 };
|
|
475
|
-
let period = null;
|
|
519
|
+
let period: IPeriod | null = null;
|
|
476
520
|
let errorReceived: unknown = null;
|
|
477
521
|
const unsupportedAdaptations: Adaptation[] = [];
|
|
478
522
|
try {
|
|
@@ -500,20 +544,23 @@ describe("Manifest - Period", () => {
|
|
|
500
544
|
});
|
|
501
545
|
|
|
502
546
|
it("should set a parsing error if an unsupported adaptation is given", async () => {
|
|
503
|
-
const mockAdaptation = vi.fn(
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
547
|
+
const mockAdaptation = vi.fn(
|
|
548
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
549
|
+
({
|
|
550
|
+
...arg,
|
|
551
|
+
supportStatus: {
|
|
552
|
+
hasSupportedCodec: arg.id !== "56",
|
|
553
|
+
hasCodecWithUndefinedSupport: true,
|
|
554
|
+
isDecipherable: undefined,
|
|
555
|
+
},
|
|
556
|
+
}) as unknown as Adaptation,
|
|
557
|
+
);
|
|
511
558
|
vi.doMock("../adaptation", () => ({
|
|
512
559
|
default: mockAdaptation,
|
|
513
560
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text", "foo"],
|
|
514
561
|
}));
|
|
515
562
|
|
|
516
|
-
const Period = (
|
|
563
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
517
564
|
|
|
518
565
|
const videoAda1 = {
|
|
519
566
|
type: "video",
|
|
@@ -523,7 +570,7 @@ describe("Manifest - Period", () => {
|
|
|
523
570
|
return videoAda1;
|
|
524
571
|
},
|
|
525
572
|
};
|
|
526
|
-
const video = [videoAda1];
|
|
573
|
+
const video = [videoAda1] as unknown as IParsedAdaptation[];
|
|
527
574
|
const videoAda2 = {
|
|
528
575
|
type: "video",
|
|
529
576
|
id: "56",
|
|
@@ -532,7 +579,7 @@ describe("Manifest - Period", () => {
|
|
|
532
579
|
return videoAda2;
|
|
533
580
|
},
|
|
534
581
|
};
|
|
535
|
-
const video2 = [videoAda2];
|
|
582
|
+
const video2 = [videoAda2] as unknown as IParsedAdaptation[];
|
|
536
583
|
const args = { id: "12", adaptations: { video, video2 }, start: 0 };
|
|
537
584
|
const unsupportedAdaptations: Adaptation[] = [];
|
|
538
585
|
const codecSupportCache = new CodecSupportCache([]);
|
|
@@ -543,7 +590,7 @@ describe("Manifest - Period", () => {
|
|
|
543
590
|
expect(mockAdaptation).toHaveReturnedTimes(2);
|
|
544
591
|
expect(mockAdaptation).toHaveBeenCalledWith(videoAda1, codecSupportCache, {});
|
|
545
592
|
expect(mockAdaptation).toHaveBeenCalledWith(videoAda2, codecSupportCache, {});
|
|
546
|
-
expect(mockAdaptation).toHaveReturnedWith(period.adaptations.video[0]);
|
|
593
|
+
expect(mockAdaptation).toHaveReturnedWith(period.adaptations.video?.[0]);
|
|
547
594
|
|
|
548
595
|
const [adap] = unsupportedAdaptations;
|
|
549
596
|
expect(adap.id).toBe("56");
|
|
@@ -551,20 +598,23 @@ describe("Manifest - Period", () => {
|
|
|
551
598
|
});
|
|
552
599
|
|
|
553
600
|
it("should not set a parsing error if an empty unsupported adaptation is given", async () => {
|
|
554
|
-
const mockAdaptation = vi.fn(
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
601
|
+
const mockAdaptation = vi.fn(
|
|
602
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
603
|
+
({
|
|
604
|
+
...arg,
|
|
605
|
+
supportStatus: {
|
|
606
|
+
hasSupportedCodec: undefined,
|
|
607
|
+
hasCodecWithUndefinedSupport: true,
|
|
608
|
+
isDecipherable: undefined,
|
|
609
|
+
},
|
|
610
|
+
}) as unknown as Adaptation,
|
|
611
|
+
);
|
|
562
612
|
vi.doMock("../adaptation", () => ({
|
|
563
613
|
default: mockAdaptation,
|
|
564
614
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text", "foo"],
|
|
565
615
|
}));
|
|
566
616
|
|
|
567
|
-
const Period = (
|
|
617
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
568
618
|
|
|
569
619
|
const videoAda1 = {
|
|
570
620
|
type: "video",
|
|
@@ -574,7 +624,7 @@ describe("Manifest - Period", () => {
|
|
|
574
624
|
return videoAda1;
|
|
575
625
|
},
|
|
576
626
|
};
|
|
577
|
-
const video = [videoAda1];
|
|
627
|
+
const video = [videoAda1] as unknown as IParsedAdaptation[];
|
|
578
628
|
const bar = undefined;
|
|
579
629
|
const args = { id: "12", adaptations: { bar, video }, start: 0 };
|
|
580
630
|
const unsupportedAdaptations: Adaptation[] = [];
|
|
@@ -597,21 +647,24 @@ describe("Manifest - Period", () => {
|
|
|
597
647
|
});
|
|
598
648
|
|
|
599
649
|
it("should give a representationFilter to the adaptation", async () => {
|
|
600
|
-
const mockAdaptation = vi.fn(
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
650
|
+
const mockAdaptation = vi.fn(
|
|
651
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
652
|
+
({
|
|
653
|
+
...arg,
|
|
654
|
+
supportStatus: {
|
|
655
|
+
hasSupportedCodec: undefined,
|
|
656
|
+
hasCodecWithUndefinedSupport: true,
|
|
657
|
+
isDecipherable: undefined,
|
|
658
|
+
},
|
|
659
|
+
}) as unknown as Adaptation,
|
|
660
|
+
);
|
|
608
661
|
const representationFilter = vi.fn();
|
|
609
662
|
vi.doMock("../adaptation", () => ({
|
|
610
663
|
default: mockAdaptation,
|
|
611
664
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text"],
|
|
612
665
|
}));
|
|
613
666
|
|
|
614
|
-
const Period = (
|
|
667
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
615
668
|
const videoAda1 = {
|
|
616
669
|
type: "video",
|
|
617
670
|
id: "54",
|
|
@@ -628,7 +681,7 @@ describe("Manifest - Period", () => {
|
|
|
628
681
|
return videoAda2;
|
|
629
682
|
},
|
|
630
683
|
};
|
|
631
|
-
const video = [videoAda1, videoAda2];
|
|
684
|
+
const video = [videoAda1, videoAda2] as unknown as IParsedAdaptation[];
|
|
632
685
|
const args = { id: "12", adaptations: { video }, start: 0 };
|
|
633
686
|
const unsupportedAdaptations: Adaptation[] = [];
|
|
634
687
|
const codecSupportCache = new CodecSupportCache([]);
|
|
@@ -653,20 +706,23 @@ describe("Manifest - Period", () => {
|
|
|
653
706
|
});
|
|
654
707
|
|
|
655
708
|
it("should report if Adaptations are not supported", async () => {
|
|
656
|
-
const mockAdaptation = vi.fn(
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
709
|
+
const mockAdaptation = vi.fn(
|
|
710
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
711
|
+
({
|
|
712
|
+
...arg,
|
|
713
|
+
supportStatus: {
|
|
714
|
+
hasSupportedCodec: arg.id === "55",
|
|
715
|
+
hasCodecWithUndefinedSupport: true,
|
|
716
|
+
isDecipherable: undefined,
|
|
717
|
+
},
|
|
718
|
+
}) as unknown as Adaptation,
|
|
719
|
+
);
|
|
664
720
|
vi.doMock("../adaptation", () => ({
|
|
665
721
|
default: mockAdaptation,
|
|
666
722
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text"],
|
|
667
723
|
}));
|
|
668
724
|
|
|
669
|
-
const Period = (
|
|
725
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
670
726
|
const videoAda1 = {
|
|
671
727
|
type: "video",
|
|
672
728
|
id: "54",
|
|
@@ -688,7 +744,7 @@ describe("Manifest - Period", () => {
|
|
|
688
744
|
id: "12",
|
|
689
745
|
representations: [{}],
|
|
690
746
|
};
|
|
691
|
-
const video = [videoAda1, videoAda2];
|
|
747
|
+
const video = [videoAda1, videoAda2] as unknown as IParsedAdaptation[];
|
|
692
748
|
const foo = [fooAda1];
|
|
693
749
|
const args = { id: "12", adaptations: { video, foo }, start: 0 };
|
|
694
750
|
const unsupportedAdaptations: Adaptation[] = [];
|
|
@@ -702,20 +758,23 @@ describe("Manifest - Period", () => {
|
|
|
702
758
|
});
|
|
703
759
|
|
|
704
760
|
it("should not report if an Adaptation has no Representation", async () => {
|
|
705
|
-
const mockAdaptation = vi.fn(
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
761
|
+
const mockAdaptation = vi.fn(
|
|
762
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
763
|
+
({
|
|
764
|
+
...arg,
|
|
765
|
+
supportStatus: {
|
|
766
|
+
hasSupportedCodec: undefined,
|
|
767
|
+
hasCodecWithUndefinedSupport: true,
|
|
768
|
+
isDecipherable: undefined,
|
|
769
|
+
},
|
|
770
|
+
}) as unknown as Adaptation,
|
|
771
|
+
);
|
|
713
772
|
vi.doMock("../adaptation", () => ({
|
|
714
773
|
default: mockAdaptation,
|
|
715
774
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text"],
|
|
716
775
|
}));
|
|
717
776
|
|
|
718
|
-
const Period = (
|
|
777
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
719
778
|
const videoAda1 = {
|
|
720
779
|
type: "video",
|
|
721
780
|
id: "54",
|
|
@@ -737,7 +796,7 @@ describe("Manifest - Period", () => {
|
|
|
737
796
|
id: "12",
|
|
738
797
|
representations: [],
|
|
739
798
|
};
|
|
740
|
-
const video = [videoAda1, videoAda2];
|
|
799
|
+
const video = [videoAda1, videoAda2] as unknown as IParsedAdaptation[];
|
|
741
800
|
const foo = [fooAda1];
|
|
742
801
|
const args = { id: "12", adaptations: { video, foo }, start: 0 };
|
|
743
802
|
const unsupportedAdaptations: Adaptation[] = [];
|
|
@@ -747,20 +806,23 @@ describe("Manifest - Period", () => {
|
|
|
747
806
|
});
|
|
748
807
|
|
|
749
808
|
it("should set the given start", async () => {
|
|
750
|
-
const mockAdaptation = vi.fn(
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
809
|
+
const mockAdaptation = vi.fn(
|
|
810
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
811
|
+
({
|
|
812
|
+
...arg,
|
|
813
|
+
supportStatus: {
|
|
814
|
+
hasSupportedCodec: undefined,
|
|
815
|
+
hasCodecWithUndefinedSupport: true,
|
|
816
|
+
isDecipherable: undefined,
|
|
817
|
+
},
|
|
818
|
+
}) as unknown as Adaptation,
|
|
819
|
+
);
|
|
758
820
|
vi.doMock("../adaptation", () => ({
|
|
759
821
|
default: mockAdaptation,
|
|
760
822
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text"],
|
|
761
823
|
}));
|
|
762
824
|
|
|
763
|
-
const Period = (
|
|
825
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
764
826
|
const videoAda1 = {
|
|
765
827
|
type: "video",
|
|
766
828
|
id: "54",
|
|
@@ -777,7 +839,7 @@ describe("Manifest - Period", () => {
|
|
|
777
839
|
return videoAda2;
|
|
778
840
|
},
|
|
779
841
|
};
|
|
780
|
-
const video = [videoAda1, videoAda2];
|
|
842
|
+
const video = [videoAda1, videoAda2] as unknown as IParsedAdaptation[];
|
|
781
843
|
const args = { id: "12", adaptations: { video }, start: 72 };
|
|
782
844
|
const unsupportedAdaptations: Adaptation[] = [];
|
|
783
845
|
const codecSupportCache = new CodecSupportCache([]);
|
|
@@ -789,20 +851,23 @@ describe("Manifest - Period", () => {
|
|
|
789
851
|
});
|
|
790
852
|
|
|
791
853
|
it("should set a given duration", async () => {
|
|
792
|
-
const mockAdaptation = vi.fn(
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
854
|
+
const mockAdaptation = vi.fn(
|
|
855
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
856
|
+
({
|
|
857
|
+
...arg,
|
|
858
|
+
supportStatus: {
|
|
859
|
+
hasSupportedCodec: undefined,
|
|
860
|
+
hasCodecWithUndefinedSupport: true,
|
|
861
|
+
isDecipherable: undefined,
|
|
862
|
+
},
|
|
863
|
+
}) as unknown as Adaptation,
|
|
864
|
+
);
|
|
800
865
|
vi.doMock("../adaptation", () => ({
|
|
801
866
|
default: mockAdaptation,
|
|
802
867
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text"],
|
|
803
868
|
}));
|
|
804
869
|
|
|
805
|
-
const Period = (
|
|
870
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
806
871
|
const videoAda1 = {
|
|
807
872
|
type: "video",
|
|
808
873
|
id: "54",
|
|
@@ -819,7 +884,7 @@ describe("Manifest - Period", () => {
|
|
|
819
884
|
return videoAda2;
|
|
820
885
|
},
|
|
821
886
|
};
|
|
822
|
-
const video = [videoAda1, videoAda2];
|
|
887
|
+
const video = [videoAda1, videoAda2] as unknown as IParsedAdaptation[];
|
|
823
888
|
const args = { id: "12", adaptations: { video }, start: 0, duration: 12 };
|
|
824
889
|
const unsupportedAdaptations: Adaptation[] = [];
|
|
825
890
|
const codecSupportCache = new CodecSupportCache([]);
|
|
@@ -831,20 +896,23 @@ describe("Manifest - Period", () => {
|
|
|
831
896
|
});
|
|
832
897
|
|
|
833
898
|
it("should infer the end from the start and the duration", async () => {
|
|
834
|
-
const mockAdaptation = vi.fn(
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
899
|
+
const mockAdaptation = vi.fn(
|
|
900
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
901
|
+
({
|
|
902
|
+
...arg,
|
|
903
|
+
supportStatus: {
|
|
904
|
+
hasSupportedCodec: undefined,
|
|
905
|
+
hasCodecWithUndefinedSupport: true,
|
|
906
|
+
isDecipherable: undefined,
|
|
907
|
+
},
|
|
908
|
+
}) as unknown as Adaptation,
|
|
909
|
+
);
|
|
842
910
|
vi.doMock("../adaptation", () => ({
|
|
843
911
|
default: mockAdaptation,
|
|
844
912
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text"],
|
|
845
913
|
}));
|
|
846
914
|
|
|
847
|
-
const Period = (
|
|
915
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
848
916
|
const videoAda1 = {
|
|
849
917
|
type: "video",
|
|
850
918
|
id: "54",
|
|
@@ -861,7 +929,7 @@ describe("Manifest - Period", () => {
|
|
|
861
929
|
return videoAda2;
|
|
862
930
|
},
|
|
863
931
|
};
|
|
864
|
-
const video = [videoAda1, videoAda2];
|
|
932
|
+
const video = [videoAda1, videoAda2] as unknown as IParsedAdaptation[];
|
|
865
933
|
const args = { id: "12", adaptations: { video }, start: 50, duration: 12 };
|
|
866
934
|
const unsupportedAdaptations: Adaptation[] = [];
|
|
867
935
|
const codecSupportCache = new CodecSupportCache([]);
|
|
@@ -873,20 +941,23 @@ describe("Manifest - Period", () => {
|
|
|
873
941
|
});
|
|
874
942
|
|
|
875
943
|
it("should return every Adaptations combined with `getAdaptations`", async () => {
|
|
876
|
-
const mockAdaptation = vi.fn(
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
944
|
+
const mockAdaptation = vi.fn(
|
|
945
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
946
|
+
({
|
|
947
|
+
...arg,
|
|
948
|
+
supportStatus: {
|
|
949
|
+
hasSupportedCodec: undefined,
|
|
950
|
+
hasCodecWithUndefinedSupport: true,
|
|
951
|
+
isDecipherable: undefined,
|
|
952
|
+
},
|
|
953
|
+
}) as unknown as Adaptation,
|
|
954
|
+
);
|
|
884
955
|
vi.doMock("../adaptation", () => ({
|
|
885
956
|
default: mockAdaptation,
|
|
886
957
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text"],
|
|
887
958
|
}));
|
|
888
959
|
|
|
889
|
-
const Period = (
|
|
960
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
890
961
|
const videoAda1 = {
|
|
891
962
|
type: "video",
|
|
892
963
|
id: "54",
|
|
@@ -903,7 +974,7 @@ describe("Manifest - Period", () => {
|
|
|
903
974
|
return videoAda2;
|
|
904
975
|
},
|
|
905
976
|
};
|
|
906
|
-
const video = [videoAda1, videoAda2];
|
|
977
|
+
const video = [videoAda1, videoAda2] as unknown as IParsedAdaptation[];
|
|
907
978
|
|
|
908
979
|
const audioAda1 = {
|
|
909
980
|
type: "audio",
|
|
@@ -913,7 +984,7 @@ describe("Manifest - Period", () => {
|
|
|
913
984
|
return audioAda1;
|
|
914
985
|
},
|
|
915
986
|
};
|
|
916
|
-
const audio = [audioAda1];
|
|
987
|
+
const audio = [audioAda1] as unknown as IParsedAdaptation[];
|
|
917
988
|
|
|
918
989
|
const args = {
|
|
919
990
|
id: "12",
|
|
@@ -926,26 +997,29 @@ describe("Manifest - Period", () => {
|
|
|
926
997
|
const period = new Period(args, unsupportedAdaptations, codecSupportCache);
|
|
927
998
|
expect(unsupportedAdaptations).toHaveLength(0);
|
|
928
999
|
expect(period.getAdaptations()).toHaveLength(3);
|
|
929
|
-
expect(period.getAdaptations()).toContain(period.adaptations.video[0]);
|
|
930
|
-
expect(period.getAdaptations()).toContain(period.adaptations.video[1]);
|
|
931
|
-
expect(period.getAdaptations()).toContain(period.adaptations.audio[0]);
|
|
1000
|
+
expect(period.getAdaptations()).toContain(period.adaptations.video?.[0]);
|
|
1001
|
+
expect(period.getAdaptations()).toContain(period.adaptations.video?.[1]);
|
|
1002
|
+
expect(period.getAdaptations()).toContain(period.adaptations.audio?.[0]);
|
|
932
1003
|
});
|
|
933
1004
|
|
|
934
1005
|
it("should return every Adaptations from a given type with `getAdaptationsForType`", async () => {
|
|
935
|
-
const mockAdaptation = vi.fn(
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
1006
|
+
const mockAdaptation = vi.fn(
|
|
1007
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
1008
|
+
({
|
|
1009
|
+
...arg,
|
|
1010
|
+
supportStatus: {
|
|
1011
|
+
hasSupportedCodec: undefined,
|
|
1012
|
+
hasCodecWithUndefinedSupport: true,
|
|
1013
|
+
isDecipherable: undefined,
|
|
1014
|
+
},
|
|
1015
|
+
}) as unknown as Adaptation,
|
|
1016
|
+
);
|
|
943
1017
|
vi.doMock("../adaptation", () => ({
|
|
944
1018
|
default: mockAdaptation,
|
|
945
1019
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text"],
|
|
946
1020
|
}));
|
|
947
1021
|
|
|
948
|
-
const Period = (
|
|
1022
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
949
1023
|
const videoAda1 = {
|
|
950
1024
|
type: "video",
|
|
951
1025
|
id: "54",
|
|
@@ -962,7 +1036,7 @@ describe("Manifest - Period", () => {
|
|
|
962
1036
|
return videoAda2;
|
|
963
1037
|
},
|
|
964
1038
|
};
|
|
965
|
-
const video = [videoAda1, videoAda2];
|
|
1039
|
+
const video = [videoAda1, videoAda2] as unknown as IParsedAdaptation[];
|
|
966
1040
|
|
|
967
1041
|
const audioAda1 = {
|
|
968
1042
|
type: "audio",
|
|
@@ -972,7 +1046,7 @@ describe("Manifest - Period", () => {
|
|
|
972
1046
|
return audioAda1;
|
|
973
1047
|
},
|
|
974
1048
|
};
|
|
975
|
-
const audio = [audioAda1];
|
|
1049
|
+
const audio = [audioAda1] as unknown as IParsedAdaptation[];
|
|
976
1050
|
|
|
977
1051
|
const args = {
|
|
978
1052
|
id: "12",
|
|
@@ -987,31 +1061,36 @@ describe("Manifest - Period", () => {
|
|
|
987
1061
|
|
|
988
1062
|
expect(period.getAdaptationsForType("video")).toHaveLength(2);
|
|
989
1063
|
expect(period.getAdaptationsForType("video")).toEqual([
|
|
990
|
-
period.adaptations.video[0],
|
|
991
|
-
period.adaptations.video[1],
|
|
1064
|
+
period.adaptations.video?.[0],
|
|
1065
|
+
period.adaptations.video?.[1],
|
|
992
1066
|
]);
|
|
993
1067
|
|
|
994
1068
|
expect(period.getAdaptationsForType("audio")).toHaveLength(1);
|
|
995
|
-
expect(period.getAdaptationsForType("audio")).toEqual([
|
|
1069
|
+
expect(period.getAdaptationsForType("audio")).toEqual([
|
|
1070
|
+
period.adaptations.audio?.[0],
|
|
1071
|
+
]);
|
|
996
1072
|
|
|
997
1073
|
expect(period.getAdaptationsForType("text")).toHaveLength(0);
|
|
998
1074
|
});
|
|
999
1075
|
|
|
1000
1076
|
it("should return the first Adaptations with a given Id when calling `getAdaptation`", async () => {
|
|
1001
|
-
const mockAdaptation = vi.fn(
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1077
|
+
const mockAdaptation = vi.fn(
|
|
1078
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
1079
|
+
({
|
|
1080
|
+
...arg,
|
|
1081
|
+
supportStatus: {
|
|
1082
|
+
hasSupportedCodec: undefined,
|
|
1083
|
+
hasCodecWithUndefinedSupport: true,
|
|
1084
|
+
isDecipherable: undefined,
|
|
1085
|
+
},
|
|
1086
|
+
}) as unknown as Adaptation,
|
|
1087
|
+
);
|
|
1009
1088
|
vi.doMock("../adaptation", () => ({
|
|
1010
1089
|
default: mockAdaptation,
|
|
1011
1090
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text"],
|
|
1012
1091
|
}));
|
|
1013
1092
|
|
|
1014
|
-
const Period = (
|
|
1093
|
+
const Period = (await vi.importActual("../period")).default as typeof IPeriod;
|
|
1015
1094
|
const videoAda1 = {
|
|
1016
1095
|
type: "video",
|
|
1017
1096
|
id: "54",
|
|
@@ -1036,7 +1115,7 @@ describe("Manifest - Period", () => {
|
|
|
1036
1115
|
return videoAda3;
|
|
1037
1116
|
},
|
|
1038
1117
|
};
|
|
1039
|
-
const video = [videoAda1, videoAda2, videoAda3];
|
|
1118
|
+
const video = [videoAda1, videoAda2, videoAda3] as unknown as IParsedAdaptation[];
|
|
1040
1119
|
|
|
1041
1120
|
const audioAda1 = {
|
|
1042
1121
|
type: "audio",
|
|
@@ -1046,7 +1125,7 @@ describe("Manifest - Period", () => {
|
|
|
1046
1125
|
return audioAda1;
|
|
1047
1126
|
},
|
|
1048
1127
|
};
|
|
1049
|
-
const audio = [audioAda1];
|
|
1128
|
+
const audio = [audioAda1] as unknown as IParsedAdaptation[];
|
|
1050
1129
|
|
|
1051
1130
|
const args = {
|
|
1052
1131
|
id: "12",
|
|
@@ -1058,20 +1137,23 @@ describe("Manifest - Period", () => {
|
|
|
1058
1137
|
const codecSupportCache = new CodecSupportCache([]);
|
|
1059
1138
|
const period = new Period(args, [], codecSupportCache);
|
|
1060
1139
|
expect(unsupportedAdaptations).toHaveLength(0);
|
|
1061
|
-
expect(period.getAdaptation("54")).toEqual(period.adaptations.video[0]);
|
|
1062
|
-
expect(period.getAdaptation("55")).toEqual(period.adaptations.video[1]);
|
|
1063
|
-
expect(period.getAdaptation("56")).toEqual(period.adaptations.audio[0]);
|
|
1140
|
+
expect(period.getAdaptation("54")).toEqual(period.adaptations.video?.[0]);
|
|
1141
|
+
expect(period.getAdaptation("55")).toEqual(period.adaptations.video?.[1]);
|
|
1142
|
+
expect(period.getAdaptation("56")).toEqual(period.adaptations.audio?.[0]);
|
|
1064
1143
|
});
|
|
1065
1144
|
|
|
1066
1145
|
it("should return undefind if no adaptation has the given Id when calling `getAdaptation`", () => {
|
|
1067
|
-
const mockAdaptation = vi.fn(
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1146
|
+
const mockAdaptation = vi.fn(
|
|
1147
|
+
(arg: IParsedAdaptation): Adaptation =>
|
|
1148
|
+
({
|
|
1149
|
+
...arg,
|
|
1150
|
+
supportStatus: {
|
|
1151
|
+
hasSupportedCodec: undefined,
|
|
1152
|
+
hasCodecWithUndefinedSupport: true,
|
|
1153
|
+
isDecipherable: undefined,
|
|
1154
|
+
},
|
|
1155
|
+
}) as unknown as Adaptation,
|
|
1156
|
+
);
|
|
1075
1157
|
vi.doMock("../adaptation", () => ({
|
|
1076
1158
|
default: mockAdaptation,
|
|
1077
1159
|
SUPPORTED_ADAPTATIONS_TYPE: ["audio", "video", "text"],
|