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
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
2
|
import type { ITNode } from "../../../../../../utils/xml-parser";
|
|
3
3
|
import { parseXml } from "../../../../../../utils/xml-parser";
|
|
4
|
-
|
|
5
|
-
|
|
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 */
|
|
4
|
+
import type IParseSegmentURL from "../SegmentURL";
|
|
5
|
+
import type { MPDError as IMPDError } from "../utils";
|
|
10
6
|
|
|
11
7
|
describe("DASH Node Parsers - SegmentURL", () => {
|
|
12
8
|
beforeEach(() => {
|
|
@@ -18,7 +14,8 @@ describe("DASH Node Parsers - SegmentURL", () => {
|
|
|
18
14
|
vi.doMock("../../../../../../log", () => log);
|
|
19
15
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
20
16
|
|
|
21
|
-
const parseSegmentURL = (
|
|
17
|
+
const parseSegmentURL = (await vi.importActual("../SegmentURL"))
|
|
18
|
+
.default as typeof IParseSegmentURL;
|
|
22
19
|
const element1 = parseXml("<Foo />")[0] as ITNode;
|
|
23
20
|
expect(parseSegmentURL(element1)).toEqual([{}, []]);
|
|
24
21
|
|
|
@@ -34,7 +31,8 @@ describe("DASH Node Parsers - SegmentURL", () => {
|
|
|
34
31
|
vi.doMock("../../../../../../log", () => log);
|
|
35
32
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
36
33
|
|
|
37
|
-
const parseSegmentURL = (
|
|
34
|
+
const parseSegmentURL = (await vi.importActual("../SegmentURL"))
|
|
35
|
+
.default as typeof IParseSegmentURL;
|
|
38
36
|
const element1 = parseXml('<Foo mediaRange="10-100" />')[0] as ITNode;
|
|
39
37
|
expect(parseSegmentURL(element1)).toEqual([{ mediaRange: [10, 100] }, []]);
|
|
40
38
|
|
|
@@ -50,8 +48,9 @@ describe("DASH Node Parsers - SegmentURL", () => {
|
|
|
50
48
|
vi.doMock("../../../../../../log", () => log);
|
|
51
49
|
const mockLog = vi.spyOn(log.default, "warn").mockImplementation(vi.fn());
|
|
52
50
|
|
|
53
|
-
const parseSegmentURL = (
|
|
54
|
-
|
|
51
|
+
const parseSegmentURL = (await vi.importActual("../SegmentURL"))
|
|
52
|
+
.default as typeof IParseSegmentURL;
|
|
53
|
+
const MPDError = (await vi.importActual("../utils")).MPDError as typeof IMPDError;
|
|
55
54
|
const element1 = parseXml('<Foo mediaRange="a" />')[0] as ITNode;
|
|
56
55
|
const error1 = new MPDError('`mediaRange` property has an unrecognized format "a"');
|
|
57
56
|
expect(parseSegmentURL(element1)).toEqual([{}, [error1]]);
|
|
@@ -76,7 +75,8 @@ describe("DASH Node Parsers - SegmentURL", () => {
|
|
|
76
75
|
vi.doMock("../../../../../../log", () => log);
|
|
77
76
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
78
77
|
|
|
79
|
-
const parseSegmentURL = (
|
|
78
|
+
const parseSegmentURL = (await vi.importActual("../SegmentURL"))
|
|
79
|
+
.default as typeof IParseSegmentURL;
|
|
80
80
|
const element1 = parseXml('<Foo indexRange="0-100" />')[0] as ITNode;
|
|
81
81
|
expect(parseSegmentURL(element1)).toEqual([{ indexRange: [0, 100] }, []]);
|
|
82
82
|
|
|
@@ -92,8 +92,9 @@ describe("DASH Node Parsers - SegmentURL", () => {
|
|
|
92
92
|
vi.doMock("../../../../../../log", () => log);
|
|
93
93
|
const mockLog = vi.spyOn(log.default, "warn").mockImplementation(vi.fn());
|
|
94
94
|
|
|
95
|
-
const parseSegmentURL = (
|
|
96
|
-
|
|
95
|
+
const parseSegmentURL = (await vi.importActual("../SegmentURL"))
|
|
96
|
+
.default as typeof IParseSegmentURL;
|
|
97
|
+
const MPDError = (await vi.importActual("../utils")).MPDError as typeof IMPDError;
|
|
97
98
|
const element1 = parseXml('<Foo indexRange="a" />')[0] as ITNode;
|
|
98
99
|
const error1 = new MPDError('`indexRange` property has an unrecognized format "a"');
|
|
99
100
|
expect(parseSegmentURL(element1)).toEqual([{}, [error1]]);
|
|
@@ -116,7 +117,8 @@ describe("DASH Node Parsers - SegmentURL", () => {
|
|
|
116
117
|
vi.doMock("../../../../../../log", () => log);
|
|
117
118
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
118
119
|
|
|
119
|
-
const parseSegmentURL = (
|
|
120
|
+
const parseSegmentURL = (await vi.importActual("../SegmentURL"))
|
|
121
|
+
.default as typeof IParseSegmentURL;
|
|
120
122
|
const element1 = parseXml('<Foo media="a" />')[0] as ITNode;
|
|
121
123
|
expect(parseSegmentURL(element1)).toEqual([{ media: "a" }, []]);
|
|
122
124
|
|
|
@@ -132,7 +134,8 @@ describe("DASH Node Parsers - SegmentURL", () => {
|
|
|
132
134
|
vi.doMock("../../../../../../log", () => log);
|
|
133
135
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
134
136
|
|
|
135
|
-
const parseSegmentURL = (
|
|
137
|
+
const parseSegmentURL = (await vi.importActual("../SegmentURL"))
|
|
138
|
+
.default as typeof IParseSegmentURL;
|
|
136
139
|
const element1 = parseXml('<Foo index="a" />')[0] as ITNode;
|
|
137
140
|
expect(parseSegmentURL(element1)).toEqual([{ index: "a" }, []]);
|
|
138
141
|
|
|
@@ -64,7 +64,7 @@ function parseAdaptationSetChildren(
|
|
|
64
64
|
}
|
|
65
65
|
break;
|
|
66
66
|
|
|
67
|
-
case "BaseURL":
|
|
67
|
+
case "BaseURL": {
|
|
68
68
|
const [baseURLObj, baseURLWarnings] = parseBaseURL(currentElement);
|
|
69
69
|
if (baseURLObj !== undefined) {
|
|
70
70
|
children.baseURLs.push(baseURLObj);
|
|
@@ -73,6 +73,7 @@ function parseAdaptationSetChildren(
|
|
|
73
73
|
warnings = warnings.concat(baseURLWarnings);
|
|
74
74
|
}
|
|
75
75
|
break;
|
|
76
|
+
}
|
|
76
77
|
|
|
77
78
|
case "ContentComponent":
|
|
78
79
|
children.contentComponent = parseContentComponent(currentElement);
|
|
@@ -93,15 +94,16 @@ function parseAdaptationSetChildren(
|
|
|
93
94
|
children.inbandEventStreams.push(parseScheme(currentElement));
|
|
94
95
|
break;
|
|
95
96
|
|
|
96
|
-
case "Label":
|
|
97
|
+
case "Label": {
|
|
97
98
|
const label = currentElement.textContent;
|
|
98
99
|
|
|
99
100
|
if (label !== null && label !== undefined) {
|
|
100
101
|
children.label = label;
|
|
101
102
|
}
|
|
102
103
|
break;
|
|
104
|
+
}
|
|
103
105
|
|
|
104
|
-
case "Representation":
|
|
106
|
+
case "Representation": {
|
|
105
107
|
const [representation, representationWarnings] =
|
|
106
108
|
createRepresentationIntermediateRepresentation(currentElement);
|
|
107
109
|
children.representations.push(representation);
|
|
@@ -109,6 +111,7 @@ function parseAdaptationSetChildren(
|
|
|
109
111
|
warnings = warnings.concat(representationWarnings);
|
|
110
112
|
}
|
|
111
113
|
break;
|
|
114
|
+
}
|
|
112
115
|
|
|
113
116
|
case "Role":
|
|
114
117
|
if (isNullOrUndefined(children.roles)) {
|
|
@@ -126,23 +129,25 @@ function parseAdaptationSetChildren(
|
|
|
126
129
|
}
|
|
127
130
|
break;
|
|
128
131
|
|
|
129
|
-
case "SegmentBase":
|
|
132
|
+
case "SegmentBase": {
|
|
130
133
|
const [segmentBase, segmentBaseWarnings] = parseSegmentBase(currentElement);
|
|
131
134
|
children.segmentBase = segmentBase;
|
|
132
135
|
if (segmentBaseWarnings.length > 0) {
|
|
133
136
|
warnings = warnings.concat(segmentBaseWarnings);
|
|
134
137
|
}
|
|
135
138
|
break;
|
|
139
|
+
}
|
|
136
140
|
|
|
137
|
-
case "SegmentList":
|
|
141
|
+
case "SegmentList": {
|
|
138
142
|
const [segmentList, segmentListWarnings] = parseSegmentList(currentElement);
|
|
139
143
|
children.segmentList = segmentList;
|
|
140
144
|
if (segmentListWarnings.length > 0) {
|
|
141
145
|
warnings = warnings.concat(segmentListWarnings);
|
|
142
146
|
}
|
|
143
147
|
break;
|
|
148
|
+
}
|
|
144
149
|
|
|
145
|
-
case "SegmentTemplate":
|
|
150
|
+
case "SegmentTemplate": {
|
|
146
151
|
const [segmentTemplate, segmentTemplateWarnings] =
|
|
147
152
|
parseSegmentTemplate(currentElement);
|
|
148
153
|
children.segmentTemplate = segmentTemplate;
|
|
@@ -150,8 +155,9 @@ function parseAdaptationSetChildren(
|
|
|
150
155
|
warnings = warnings.concat(segmentTemplateWarnings);
|
|
151
156
|
}
|
|
152
157
|
break;
|
|
158
|
+
}
|
|
153
159
|
|
|
154
|
-
case "ContentProtection":
|
|
160
|
+
case "ContentProtection": {
|
|
155
161
|
const [contentProtection, contentProtectionWarnings] =
|
|
156
162
|
parseContentProtection(currentElement);
|
|
157
163
|
if (contentProtectionWarnings.length > 0) {
|
|
@@ -161,6 +167,7 @@ function parseAdaptationSetChildren(
|
|
|
161
167
|
contentProtections.push(contentProtection);
|
|
162
168
|
}
|
|
163
169
|
break;
|
|
170
|
+
}
|
|
164
171
|
|
|
165
172
|
// case "Rating":
|
|
166
173
|
// children.rating = currentElement;
|
|
@@ -63,13 +63,14 @@ export default function parseEventStream(
|
|
|
63
63
|
const currentElement = element.childNodes[i] as Element;
|
|
64
64
|
|
|
65
65
|
switch (currentElement.nodeName) {
|
|
66
|
-
case "Event":
|
|
66
|
+
case "Event": {
|
|
67
67
|
const [event, eventWarnings] = parseEvent(currentElement);
|
|
68
68
|
eventStreamIR.children.events.push(event);
|
|
69
69
|
if (eventWarnings.length > 0) {
|
|
70
70
|
warnings = warnings.concat(eventWarnings);
|
|
71
71
|
}
|
|
72
72
|
break;
|
|
73
|
+
}
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
}
|
|
@@ -45,31 +45,34 @@ function parseMPDChildren(mpdChildren: NodeList): [IMPDChildren, Error[]] {
|
|
|
45
45
|
if (mpdChildren[i].nodeType === Node.ELEMENT_NODE) {
|
|
46
46
|
const currentNode = mpdChildren[i] as Element;
|
|
47
47
|
switch (currentNode.nodeName) {
|
|
48
|
-
case "BaseURL":
|
|
48
|
+
case "BaseURL": {
|
|
49
49
|
const [baseURLObj, baseURLWarnings] = parseBaseURL(currentNode);
|
|
50
50
|
if (baseURLObj !== undefined) {
|
|
51
51
|
baseURLs.push(baseURLObj);
|
|
52
52
|
}
|
|
53
53
|
warnings = warnings.concat(baseURLWarnings);
|
|
54
54
|
break;
|
|
55
|
+
}
|
|
55
56
|
|
|
56
57
|
case "Location":
|
|
57
58
|
locations.push(currentNode.textContent === null ? "" : currentNode.textContent);
|
|
58
59
|
break;
|
|
59
60
|
|
|
60
|
-
case "Period":
|
|
61
|
+
case "Period": {
|
|
61
62
|
const [period, periodWarnings] =
|
|
62
63
|
createPeriodIntermediateRepresentation(currentNode);
|
|
63
64
|
periods.push(period);
|
|
64
65
|
warnings = warnings.concat(periodWarnings);
|
|
65
66
|
break;
|
|
67
|
+
}
|
|
66
68
|
|
|
67
|
-
case "UTCTiming":
|
|
69
|
+
case "UTCTiming": {
|
|
68
70
|
const utcTiming = parseScheme(currentNode);
|
|
69
71
|
utcTimings.push(utcTiming);
|
|
70
72
|
break;
|
|
73
|
+
}
|
|
71
74
|
|
|
72
|
-
case "ContentProtection":
|
|
75
|
+
case "ContentProtection": {
|
|
73
76
|
const [contentProtection, contentProtectionWarnings] =
|
|
74
77
|
parseContentProtection(currentNode);
|
|
75
78
|
if (contentProtectionWarnings.length > 0) {
|
|
@@ -79,6 +82,7 @@ function parseMPDChildren(mpdChildren: NodeList): [IMPDChildren, Error[]] {
|
|
|
79
82
|
contentProtections.push(contentProtection);
|
|
80
83
|
}
|
|
81
84
|
break;
|
|
85
|
+
}
|
|
82
86
|
}
|
|
83
87
|
}
|
|
84
88
|
}
|
|
@@ -47,28 +47,31 @@ function parsePeriodChildren(periodChildren: NodeList): [IPeriodChildren, Error[
|
|
|
47
47
|
const currentElement = periodChildren[i] as Element;
|
|
48
48
|
|
|
49
49
|
switch (currentElement.nodeName) {
|
|
50
|
-
case "BaseURL":
|
|
50
|
+
case "BaseURL": {
|
|
51
51
|
const [baseURLObj, baseURLWarnings] = parseBaseURL(currentElement);
|
|
52
52
|
if (baseURLObj !== undefined) {
|
|
53
53
|
baseURLs.push(baseURLObj);
|
|
54
54
|
}
|
|
55
55
|
warnings = warnings.concat(baseURLWarnings);
|
|
56
56
|
break;
|
|
57
|
+
}
|
|
57
58
|
|
|
58
|
-
case "AdaptationSet":
|
|
59
|
+
case "AdaptationSet": {
|
|
59
60
|
const [adaptation, adaptationWarnings] =
|
|
60
61
|
createAdaptationSetIntermediateRepresentation(currentElement);
|
|
61
62
|
adaptations.push(adaptation);
|
|
62
63
|
warnings = warnings.concat(adaptationWarnings);
|
|
63
64
|
break;
|
|
65
|
+
}
|
|
64
66
|
|
|
65
|
-
case "EventStream":
|
|
67
|
+
case "EventStream": {
|
|
66
68
|
const [eventStream, eventStreamWarnings] = parseEventStream(currentElement);
|
|
67
69
|
eventStreams.push(eventStream);
|
|
68
70
|
warnings = warnings.concat(eventStreamWarnings);
|
|
69
71
|
break;
|
|
72
|
+
}
|
|
70
73
|
|
|
71
|
-
case "SegmentTemplate":
|
|
74
|
+
case "SegmentTemplate": {
|
|
72
75
|
const [parsedSegmentTemplate, segmentTemplateWarnings] =
|
|
73
76
|
parseSegmentTemplate(currentElement);
|
|
74
77
|
segmentTemplate = parsedSegmentTemplate;
|
|
@@ -76,8 +79,9 @@ function parsePeriodChildren(periodChildren: NodeList): [IPeriodChildren, Error[
|
|
|
76
79
|
warnings = warnings.concat(segmentTemplateWarnings);
|
|
77
80
|
}
|
|
78
81
|
break;
|
|
82
|
+
}
|
|
79
83
|
|
|
80
|
-
case "ContentProtection":
|
|
84
|
+
case "ContentProtection": {
|
|
81
85
|
const [contentProtection, contentProtectionWarnings] =
|
|
82
86
|
parseContentProtection(currentElement);
|
|
83
87
|
if (contentProtectionWarnings.length > 0) {
|
|
@@ -87,6 +91,7 @@ function parsePeriodChildren(periodChildren: NodeList): [IPeriodChildren, Error[
|
|
|
87
91
|
contentProtections.push(contentProtection);
|
|
88
92
|
}
|
|
89
93
|
break;
|
|
94
|
+
}
|
|
90
95
|
}
|
|
91
96
|
}
|
|
92
97
|
}
|
|
@@ -53,39 +53,43 @@ function parseRepresentationChildren(
|
|
|
53
53
|
const currentElement = representationChildren[i] as Element;
|
|
54
54
|
|
|
55
55
|
switch (currentElement.nodeName) {
|
|
56
|
-
case "BaseURL":
|
|
56
|
+
case "BaseURL": {
|
|
57
57
|
const [baseURLObj, baseURLWarnings] = parseBaseURL(currentElement);
|
|
58
58
|
if (baseURLObj !== undefined) {
|
|
59
59
|
children.baseURLs.push(baseURLObj);
|
|
60
60
|
}
|
|
61
61
|
warnings = warnings.concat(baseURLWarnings);
|
|
62
62
|
break;
|
|
63
|
+
}
|
|
63
64
|
case "InbandEventStream":
|
|
64
65
|
if (children.inbandEventStreams === undefined) {
|
|
65
66
|
children.inbandEventStreams = [];
|
|
66
67
|
}
|
|
67
68
|
children.inbandEventStreams.push(parseScheme(currentElement));
|
|
68
69
|
break;
|
|
69
|
-
case "SegmentBase":
|
|
70
|
+
case "SegmentBase": {
|
|
70
71
|
const [segmentBase, segmentBaseWarnings] = parseSegmentBase(currentElement);
|
|
71
72
|
children.segmentBase = segmentBase;
|
|
72
73
|
if (segmentBaseWarnings.length > 0) {
|
|
73
74
|
warnings = warnings.concat(segmentBaseWarnings);
|
|
74
75
|
}
|
|
75
76
|
break;
|
|
76
|
-
|
|
77
|
+
}
|
|
78
|
+
case "SegmentList": {
|
|
77
79
|
const [segmentList, segmentListWarnings] = parseSegmentList(currentElement);
|
|
78
80
|
warnings = warnings.concat(segmentListWarnings);
|
|
79
81
|
children.segmentList = segmentList;
|
|
80
82
|
break;
|
|
81
|
-
|
|
83
|
+
}
|
|
84
|
+
case "SegmentTemplate": {
|
|
82
85
|
const [segmentTemplate, segmentTemplateWarnings] =
|
|
83
86
|
parseSegmentTemplate(currentElement);
|
|
84
87
|
warnings = warnings.concat(segmentTemplateWarnings);
|
|
85
88
|
children.segmentTemplate = segmentTemplate;
|
|
86
89
|
break;
|
|
90
|
+
}
|
|
87
91
|
|
|
88
|
-
case "ContentProtection":
|
|
92
|
+
case "ContentProtection": {
|
|
89
93
|
const [contentProtection, contentProtectionWarnings] =
|
|
90
94
|
parseContentProtection(currentElement);
|
|
91
95
|
if (contentProtectionWarnings.length > 0) {
|
|
@@ -95,6 +99,7 @@ function parseRepresentationChildren(
|
|
|
95
99
|
contentProtections.push(contentProtection);
|
|
96
100
|
}
|
|
97
101
|
break;
|
|
102
|
+
}
|
|
98
103
|
case "SupplementalProperty":
|
|
99
104
|
if (isNullOrUndefined(children.supplementalProperties)) {
|
|
100
105
|
children.supplementalProperties = [parseScheme(currentElement)];
|
package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/ContentProtection.test.ts
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
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 IParseContentProtection from "../ContentProtection";
|
|
8
3
|
|
|
9
4
|
function testStringAttribute(attributeName: string, variableName?: string): void {
|
|
10
5
|
const _variableName = variableName ?? attributeName;
|
|
11
6
|
|
|
12
7
|
it(`should correctly parse a ContentProtection element with a correct ${attributeName} attribute`, async () => {
|
|
13
|
-
const parseContentProtection = (
|
|
14
|
-
|
|
15
|
-
).default;
|
|
8
|
+
const parseContentProtection = (await vi.importActual("../ContentProtection"))
|
|
9
|
+
.default as typeof IParseContentProtection;
|
|
16
10
|
const element1 = new DOMParser().parseFromString(
|
|
17
11
|
`<ContentProtection ${attributeName}="foobar" />`,
|
|
18
12
|
"text/xml",
|
|
@@ -39,9 +33,8 @@ describe("DASH Node Parsers - ContentProtection", () => {
|
|
|
39
33
|
});
|
|
40
34
|
|
|
41
35
|
it("should correctly parse a ContentProtection element without attributes", async () => {
|
|
42
|
-
const parseContentProtection = (
|
|
43
|
-
|
|
44
|
-
).default;
|
|
36
|
+
const parseContentProtection = (await vi.importActual("../ContentProtection"))
|
|
37
|
+
.default as typeof IParseContentProtection;
|
|
45
38
|
const element = new DOMParser().parseFromString("<ContentProtection />", "text/xml")
|
|
46
39
|
.childNodes[0] as Element;
|
|
47
40
|
expect(parseContentProtection(element)).toEqual([
|
|
@@ -61,9 +54,8 @@ describe("DASH Node Parsers - ContentProtection", () => {
|
|
|
61
54
|
vi.doMock("../../../../../../utils/string_parsing", () => ({
|
|
62
55
|
hexToBytes: mockHexToBytes,
|
|
63
56
|
}));
|
|
64
|
-
const parseContentProtection = (
|
|
65
|
-
|
|
66
|
-
).default;
|
|
57
|
+
const parseContentProtection = (await vi.importActual("../ContentProtection"))
|
|
58
|
+
.default as typeof IParseContentProtection;
|
|
67
59
|
const element1 = new DOMParser()
|
|
68
60
|
.parseFromString(
|
|
69
61
|
`<?xml version="1.0" encoding="utf-8"?>
|
|
@@ -97,9 +89,8 @@ describe("DASH Node Parsers - ContentProtection", () => {
|
|
|
97
89
|
vi.doMock("../../../../../../utils/string_parsing", () => ({
|
|
98
90
|
hexToBytes: mockHexToBytes,
|
|
99
91
|
}));
|
|
100
|
-
const parseContentProtection = (
|
|
101
|
-
|
|
102
|
-
).default;
|
|
92
|
+
const parseContentProtection = (await vi.importActual("../ContentProtection"))
|
|
93
|
+
.default as typeof IParseContentProtection;
|
|
103
94
|
const element = new DOMParser()
|
|
104
95
|
.parseFromString(
|
|
105
96
|
`<?xml version="1.0" encoding="utf-8"?>
|
|
@@ -130,9 +121,8 @@ describe("DASH Node Parsers - ContentProtection", () => {
|
|
|
130
121
|
});
|
|
131
122
|
|
|
132
123
|
it("should correctly parse a ContentProtection with cenc:pssh children", async () => {
|
|
133
|
-
const parseContentProtection = (
|
|
134
|
-
|
|
135
|
-
).default;
|
|
124
|
+
const parseContentProtection = (await vi.importActual("../ContentProtection"))
|
|
125
|
+
.default as typeof IParseContentProtection;
|
|
136
126
|
const element = new DOMParser()
|
|
137
127
|
.parseFromString(
|
|
138
128
|
`<?xml version="1.0" encoding="utf-8"?>
|
|
@@ -171,9 +161,8 @@ describe("DASH Node Parsers - ContentProtection", () => {
|
|
|
171
161
|
vi.doMock("../../../../../../utils/string_parsing", () => ({
|
|
172
162
|
hexToBytes: mockHexToBytes,
|
|
173
163
|
}));
|
|
174
|
-
const parseContentProtection = (
|
|
175
|
-
|
|
176
|
-
).default;
|
|
164
|
+
const parseContentProtection = (await vi.importActual("../ContentProtection"))
|
|
165
|
+
.default as typeof IParseContentProtection;
|
|
177
166
|
const element = new DOMParser()
|
|
178
167
|
.parseFromString(
|
|
179
168
|
`<?xml version="1.0" encoding="utf-8"?>
|
|
@@ -209,9 +198,8 @@ describe("DASH Node Parsers - ContentProtection", () => {
|
|
|
209
198
|
});
|
|
210
199
|
|
|
211
200
|
it("should return a warning if one of the cenc:pssh is invalid base64", async () => {
|
|
212
|
-
const parseContentProtection = (
|
|
213
|
-
|
|
214
|
-
).default;
|
|
201
|
+
const parseContentProtection = (await vi.importActual("../ContentProtection"))
|
|
202
|
+
.default as typeof IParseContentProtection;
|
|
215
203
|
const element = new DOMParser()
|
|
216
204
|
.parseFromString(
|
|
217
205
|
`<?xml version="1.0" encoding="utf-8"?>
|
package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/Initialization.test.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import type IInitialization from "../Initialization";
|
|
3
|
+
import type { MPDError as IMPDError } from "../utils";
|
|
8
4
|
|
|
9
5
|
describe("DASH Node Parsers - Initialization", () => {
|
|
10
6
|
beforeEach(() => {
|
|
@@ -16,8 +12,8 @@ describe("DASH Node Parsers - Initialization", () => {
|
|
|
16
12
|
vi.doMock("../../../../../../log", () => log);
|
|
17
13
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
18
14
|
|
|
19
|
-
const parseInitialization = (
|
|
20
|
-
.default;
|
|
15
|
+
const parseInitialization = (await vi.importActual("../Initialization"))
|
|
16
|
+
.default as typeof IInitialization;
|
|
21
17
|
const element1 = new DOMParser().parseFromString("<Foo />", "text/xml")
|
|
22
18
|
.childNodes[0] as Element;
|
|
23
19
|
expect(parseInitialization(element1)).toEqual([{}, []]);
|
|
@@ -35,8 +31,8 @@ describe("DASH Node Parsers - Initialization", () => {
|
|
|
35
31
|
vi.doMock("../../../../../../log", () => log);
|
|
36
32
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
37
33
|
|
|
38
|
-
const parseInitialization = (
|
|
39
|
-
.default;
|
|
34
|
+
const parseInitialization = (await vi.importActual("../Initialization"))
|
|
35
|
+
.default as typeof IInitialization;
|
|
40
36
|
const element1 = new DOMParser().parseFromString('<Foo range="0-1" />', "text/xml")
|
|
41
37
|
.childNodes[0] as Element;
|
|
42
38
|
expect(parseInitialization(element1)).toEqual([{ range: [0, 1] }, []]);
|
|
@@ -56,9 +52,9 @@ describe("DASH Node Parsers - Initialization", () => {
|
|
|
56
52
|
vi.doMock("../../../../../../log", () => log);
|
|
57
53
|
const mockLog = vi.spyOn(log.default, "warn").mockImplementation(vi.fn());
|
|
58
54
|
|
|
59
|
-
const parseInitialization = (
|
|
60
|
-
.default;
|
|
61
|
-
const MPDError = (
|
|
55
|
+
const parseInitialization = (await vi.importActual("../Initialization"))
|
|
56
|
+
.default as typeof IInitialization;
|
|
57
|
+
const MPDError = (await vi.importActual("../utils")).MPDError as typeof IMPDError;
|
|
62
58
|
const element1 = new DOMParser().parseFromString('<Foo range="a" />', "text/xml")
|
|
63
59
|
.childNodes[0] as Element;
|
|
64
60
|
const error1 = new MPDError('`range` property has an unrecognized format "a"');
|
|
@@ -83,8 +79,8 @@ describe("DASH Node Parsers - Initialization", () => {
|
|
|
83
79
|
vi.doMock("../../../../../../log", () => log);
|
|
84
80
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
85
81
|
|
|
86
|
-
const parseInitialization = (
|
|
87
|
-
.default;
|
|
82
|
+
const parseInitialization = (await vi.importActual("../Initialization"))
|
|
83
|
+
.default as typeof IInitialization;
|
|
88
84
|
const element1 = new DOMParser().parseFromString('<Foo sourceURL="a" />', "text/xml")
|
|
89
85
|
.childNodes[0] as Element;
|
|
90
86
|
expect(parseInitialization(element1)).toEqual([{ media: "a" }, []]);
|
|
@@ -102,8 +98,8 @@ describe("DASH Node Parsers - Initialization", () => {
|
|
|
102
98
|
vi.doMock("../../../../../../log", () => log);
|
|
103
99
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
104
100
|
|
|
105
|
-
const parseInitialization = (
|
|
106
|
-
.default;
|
|
101
|
+
const parseInitialization = (await vi.importActual("../Initialization"))
|
|
102
|
+
.default as typeof IInitialization;
|
|
107
103
|
const element1 = new DOMParser().parseFromString(
|
|
108
104
|
'<Foo sourceURL="a" range="4-10" />',
|
|
109
105
|
"text/xml",
|
package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentTimeline.test.ts
CHANGED
|
@@ -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 SegmentTimelineParser from "../SegmentTimeline";
|
|
8
3
|
|
|
9
4
|
describe("DASH Node parsers - SegmentTimeline", () => {
|
|
10
5
|
beforeEach(() => {
|
|
@@ -12,8 +7,8 @@ describe("DASH Node parsers - SegmentTimeline", () => {
|
|
|
12
7
|
});
|
|
13
8
|
|
|
14
9
|
it("should return a function to parse lazily the timeline", async () => {
|
|
15
|
-
const parseSegmentTimeline = (
|
|
16
|
-
.default;
|
|
10
|
+
const parseSegmentTimeline = (await vi.importActual("../SegmentTimeline"))
|
|
11
|
+
.default as typeof SegmentTimelineParser;
|
|
17
12
|
|
|
18
13
|
const element = new DOMParser().parseFromString("<Root><S /></Root>", "text/xml")
|
|
19
14
|
.childNodes[0] as Element;
|
|
@@ -26,8 +21,8 @@ describe("DASH Node parsers - SegmentTimeline", () => {
|
|
|
26
21
|
});
|
|
27
22
|
|
|
28
23
|
it("should return an empty HTMLCollection if no S element is present", async () => {
|
|
29
|
-
const parseSegmentTimeline = (
|
|
30
|
-
.default;
|
|
24
|
+
const parseSegmentTimeline = (await vi.importActual("../SegmentTimeline"))
|
|
25
|
+
.default as typeof SegmentTimelineParser;
|
|
31
26
|
|
|
32
27
|
const element = new DOMParser().parseFromString("<Root />", "text/xml")
|
|
33
28
|
.childNodes[0] as Element;
|
|
@@ -43,8 +38,8 @@ describe("DASH Node parsers - SegmentTimeline", () => {
|
|
|
43
38
|
});
|
|
44
39
|
|
|
45
40
|
it("should return an empty HTMLCollection for an Invalid XML", async () => {
|
|
46
|
-
const parseSegmentTimeline = (
|
|
47
|
-
.default;
|
|
41
|
+
const parseSegmentTimeline = (await vi.importActual("../SegmentTimeline"))
|
|
42
|
+
.default as typeof SegmentTimelineParser;
|
|
48
43
|
|
|
49
44
|
const element = new DOMParser().parseFromString(
|
|
50
45
|
"<Root><S></S><S<S></Root>",
|
|
@@ -62,8 +57,8 @@ describe("DASH Node parsers - SegmentTimeline", () => {
|
|
|
62
57
|
});
|
|
63
58
|
|
|
64
59
|
it("should parse S elements only when called for the first time", async () => {
|
|
65
|
-
const parseSegmentTimeline = (
|
|
66
|
-
.default;
|
|
60
|
+
const parseSegmentTimeline = (await vi.importActual("../SegmentTimeline"))
|
|
61
|
+
.default as typeof SegmentTimelineParser;
|
|
67
62
|
|
|
68
63
|
const sElement1 = new DOMParser().parseFromString("<S>1</S>", "text/xml")
|
|
69
64
|
.childNodes[0] as Element;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import type ISegmentUrl from "../SegmentURL";
|
|
3
|
+
import type { MPDError as IMPDError } from "../utils";
|
|
8
4
|
|
|
9
5
|
describe("DASH Node Parsers - SegmentURL", () => {
|
|
10
6
|
beforeEach(() => {
|
|
@@ -16,7 +12,8 @@ describe("DASH Node Parsers - SegmentURL", () => {
|
|
|
16
12
|
vi.doMock("../../../../../../log", () => log);
|
|
17
13
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
18
14
|
|
|
19
|
-
const parseSegmentURL = (
|
|
15
|
+
const parseSegmentURL = (await vi.importActual("../SegmentURL"))
|
|
16
|
+
.default as typeof ISegmentUrl;
|
|
20
17
|
const element1 = new DOMParser().parseFromString("<Foo />", "text/xml")
|
|
21
18
|
.childNodes[0] as Element;
|
|
22
19
|
expect(parseSegmentURL(element1)).toEqual([{}, []]);
|
|
@@ -34,7 +31,8 @@ describe("DASH Node Parsers - SegmentURL", () => {
|
|
|
34
31
|
vi.doMock("../../../../../../log", () => log);
|
|
35
32
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
36
33
|
|
|
37
|
-
const parseSegmentURL = (
|
|
34
|
+
const parseSegmentURL = (await vi.importActual("../SegmentURL"))
|
|
35
|
+
.default as typeof ISegmentUrl;
|
|
38
36
|
const element1 = new DOMParser().parseFromString(
|
|
39
37
|
'<Foo mediaRange="10-100" />',
|
|
40
38
|
"text/xml",
|
|
@@ -56,8 +54,9 @@ describe("DASH Node Parsers - SegmentURL", () => {
|
|
|
56
54
|
vi.doMock("../../../../../../log", () => log);
|
|
57
55
|
const mockLog = vi.spyOn(log.default, "warn").mockImplementation(vi.fn());
|
|
58
56
|
|
|
59
|
-
const parseSegmentURL = (
|
|
60
|
-
|
|
57
|
+
const parseSegmentURL = (await vi.importActual("../SegmentURL"))
|
|
58
|
+
.default as typeof ISegmentUrl;
|
|
59
|
+
const MPDError = (await vi.importActual("../utils")).MPDError as typeof IMPDError;
|
|
61
60
|
const element1 = new DOMParser().parseFromString('<Foo mediaRange="a" />', "text/xml")
|
|
62
61
|
.childNodes[0] as Element;
|
|
63
62
|
const error1 = new MPDError('`mediaRange` property has an unrecognized format "a"');
|
|
@@ -84,7 +83,8 @@ describe("DASH Node Parsers - SegmentURL", () => {
|
|
|
84
83
|
vi.doMock("../../../../../../log", () => log);
|
|
85
84
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
86
85
|
|
|
87
|
-
const parseSegmentURL = (
|
|
86
|
+
const parseSegmentURL = (await vi.importActual("../SegmentURL"))
|
|
87
|
+
.default as typeof ISegmentUrl;
|
|
88
88
|
const element1 = new DOMParser().parseFromString(
|
|
89
89
|
'<Foo indexRange="0-100" />',
|
|
90
90
|
"text/xml",
|
|
@@ -106,8 +106,9 @@ describe("DASH Node Parsers - SegmentURL", () => {
|
|
|
106
106
|
vi.doMock("../../../../../../log", () => log);
|
|
107
107
|
const mockLog = vi.spyOn(log.default, "warn").mockImplementation(vi.fn());
|
|
108
108
|
|
|
109
|
-
const parseSegmentURL = (
|
|
110
|
-
|
|
109
|
+
const parseSegmentURL = (await vi.importActual("../SegmentURL"))
|
|
110
|
+
.default as typeof ISegmentUrl;
|
|
111
|
+
const MPDError = (await vi.importActual("../utils")).MPDError as typeof IMPDError;
|
|
111
112
|
const element1 = new DOMParser().parseFromString('<Foo indexRange="a" />', "text/xml")
|
|
112
113
|
.childNodes[0] as Element;
|
|
113
114
|
const error1 = new MPDError('`indexRange` property has an unrecognized format "a"');
|
|
@@ -132,7 +133,8 @@ describe("DASH Node Parsers - SegmentURL", () => {
|
|
|
132
133
|
vi.doMock("../../../../../../log", () => log);
|
|
133
134
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
134
135
|
|
|
135
|
-
const parseSegmentURL = (
|
|
136
|
+
const parseSegmentURL = (await vi.importActual("../SegmentURL"))
|
|
137
|
+
.default as typeof ISegmentUrl;
|
|
136
138
|
const element1 = new DOMParser().parseFromString('<Foo media="a" />', "text/xml")
|
|
137
139
|
.childNodes[0] as Element;
|
|
138
140
|
expect(parseSegmentURL(element1)).toEqual([{ media: "a" }, []]);
|
|
@@ -150,7 +152,8 @@ describe("DASH Node Parsers - SegmentURL", () => {
|
|
|
150
152
|
vi.doMock("../../../../../../log", () => log);
|
|
151
153
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
152
154
|
|
|
153
|
-
const parseSegmentURL = (
|
|
155
|
+
const parseSegmentURL = (await vi.importActual("../SegmentURL"))
|
|
156
|
+
.default as typeof ISegmentUrl;
|
|
154
157
|
const element1 = new DOMParser().parseFromString('<Foo index="a" />', "text/xml")
|
|
155
158
|
.childNodes[0] as Element;
|
|
156
159
|
expect(parseSegmentURL(element1)).toEqual([{ index: "a" }, []]);
|