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,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 { IMPDIntermediateRepresentation } from "../../node_parser_types";
|
|
3
|
+
import type IGetHTTPUTCTimingURL from "../get_http_utc-timing_url";
|
|
8
4
|
|
|
9
5
|
describe("DASH Parser - getHTTPUTCTimingURL", () => {
|
|
10
6
|
beforeEach(() => {
|
|
@@ -12,21 +8,26 @@ describe("DASH Parser - getHTTPUTCTimingURL", () => {
|
|
|
12
8
|
});
|
|
13
9
|
|
|
14
10
|
it("should return undefined if the given intermediate representation has no UTCTimings element", async () => {
|
|
15
|
-
const mpdIR = {
|
|
11
|
+
const mpdIR: IMPDIntermediateRepresentation = {
|
|
16
12
|
children: {
|
|
13
|
+
baseURLs: [],
|
|
14
|
+
locations: [],
|
|
15
|
+
periods: [],
|
|
17
16
|
utcTimings: [],
|
|
18
17
|
},
|
|
19
18
|
attributes: {},
|
|
20
19
|
};
|
|
21
|
-
const getHTTPUTCTimingURL = (
|
|
22
|
-
|
|
23
|
-
).default;
|
|
20
|
+
const getHTTPUTCTimingURL = (await vi.importActual("../get_http_utc-timing_url"))
|
|
21
|
+
.default as typeof IGetHTTPUTCTimingURL;
|
|
24
22
|
expect(getHTTPUTCTimingURL(mpdIR)).toEqual(undefined);
|
|
25
23
|
});
|
|
26
24
|
|
|
27
25
|
it("should return undefined if the given intermediate representation has no http-iso UTCTimings element", async () => {
|
|
28
|
-
const mpdIR = {
|
|
26
|
+
const mpdIR: IMPDIntermediateRepresentation = {
|
|
29
27
|
children: {
|
|
28
|
+
baseURLs: [],
|
|
29
|
+
locations: [],
|
|
30
|
+
periods: [],
|
|
30
31
|
utcTimings: [
|
|
31
32
|
{
|
|
32
33
|
schemeIdUri: "urn:mpeg:dash:utc:direct-iso:2014",
|
|
@@ -40,15 +41,17 @@ describe("DASH Parser - getHTTPUTCTimingURL", () => {
|
|
|
40
41
|
},
|
|
41
42
|
attributes: {},
|
|
42
43
|
};
|
|
43
|
-
const getHTTPUTCTimingURL = (
|
|
44
|
-
|
|
45
|
-
).default;
|
|
44
|
+
const getHTTPUTCTimingURL = (await vi.importActual("../get_http_utc-timing_url"))
|
|
45
|
+
.default as typeof IGetHTTPUTCTimingURL;
|
|
46
46
|
expect(getHTTPUTCTimingURL(mpdIR)).toEqual(undefined);
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
it("should return undefined if the given intermediate representation has no value for its http-iso UTCTimings element", async () => {
|
|
50
|
-
const mpdIR = {
|
|
50
|
+
const mpdIR: IMPDIntermediateRepresentation = {
|
|
51
51
|
children: {
|
|
52
|
+
baseURLs: [],
|
|
53
|
+
locations: [],
|
|
54
|
+
periods: [],
|
|
52
55
|
utcTimings: [
|
|
53
56
|
{
|
|
54
57
|
schemeIdUri: "urn:mpeg:dash:utc:http-iso:2014",
|
|
@@ -64,15 +67,17 @@ describe("DASH Parser - getHTTPUTCTimingURL", () => {
|
|
|
64
67
|
},
|
|
65
68
|
attributes: {},
|
|
66
69
|
};
|
|
67
|
-
const getHTTPUTCTimingURL = (
|
|
68
|
-
|
|
69
|
-
).default;
|
|
70
|
+
const getHTTPUTCTimingURL = (await vi.importActual("../get_http_utc-timing_url"))
|
|
71
|
+
.default as typeof IGetHTTPUTCTimingURL;
|
|
70
72
|
expect(getHTTPUTCTimingURL(mpdIR)).toEqual(undefined);
|
|
71
73
|
});
|
|
72
74
|
|
|
73
75
|
it("should return the value of a single http-iso UTCTimings element", async () => {
|
|
74
|
-
const mpdIR = {
|
|
76
|
+
const mpdIR: IMPDIntermediateRepresentation = {
|
|
75
77
|
children: {
|
|
78
|
+
baseURLs: [],
|
|
79
|
+
locations: [],
|
|
80
|
+
periods: [],
|
|
76
81
|
utcTimings: [
|
|
77
82
|
{
|
|
78
83
|
schemeIdUri: "urn:mpeg:dash:utc:http-iso:2014",
|
|
@@ -82,15 +87,17 @@ describe("DASH Parser - getHTTPUTCTimingURL", () => {
|
|
|
82
87
|
},
|
|
83
88
|
attributes: {},
|
|
84
89
|
};
|
|
85
|
-
const getHTTPUTCTimingURL = (
|
|
86
|
-
|
|
87
|
-
).default;
|
|
90
|
+
const getHTTPUTCTimingURL = (await vi.importActual("../get_http_utc-timing_url"))
|
|
91
|
+
.default as typeof IGetHTTPUTCTimingURL;
|
|
88
92
|
expect(getHTTPUTCTimingURL(mpdIR)).toEqual("foobar2000");
|
|
89
93
|
});
|
|
90
94
|
|
|
91
95
|
it("should return the first value of multiple http-iso UTCTimings elements", async () => {
|
|
92
|
-
const mpdIR = {
|
|
96
|
+
const mpdIR: IMPDIntermediateRepresentation = {
|
|
93
97
|
children: {
|
|
98
|
+
baseURLs: [],
|
|
99
|
+
locations: [],
|
|
100
|
+
periods: [],
|
|
94
101
|
utcTimings: [
|
|
95
102
|
{
|
|
96
103
|
schemeIdUri: "urn:mpeg:dash:utc:http-iso:2014",
|
|
@@ -108,15 +115,17 @@ describe("DASH Parser - getHTTPUTCTimingURL", () => {
|
|
|
108
115
|
},
|
|
109
116
|
attributes: {},
|
|
110
117
|
};
|
|
111
|
-
const getHTTPUTCTimingURL = (
|
|
112
|
-
|
|
113
|
-
).default;
|
|
118
|
+
const getHTTPUTCTimingURL = (await vi.importActual("../get_http_utc-timing_url"))
|
|
119
|
+
.default as typeof IGetHTTPUTCTimingURL;
|
|
114
120
|
expect(getHTTPUTCTimingURL(mpdIR)).toEqual("foobar1000");
|
|
115
121
|
});
|
|
116
122
|
|
|
117
123
|
it("should return the first value of a http-iso UTCTimings element when mixed with other elements", async () => {
|
|
118
|
-
const mpdIR = {
|
|
124
|
+
const mpdIR: IMPDIntermediateRepresentation = {
|
|
119
125
|
children: {
|
|
126
|
+
baseURLs: [],
|
|
127
|
+
locations: [],
|
|
128
|
+
periods: [],
|
|
120
129
|
utcTimings: [
|
|
121
130
|
{
|
|
122
131
|
schemeIdUri: "urn:mpeg:dash:utc:direct-iso:2014",
|
|
@@ -142,9 +151,8 @@ describe("DASH Parser - getHTTPUTCTimingURL", () => {
|
|
|
142
151
|
},
|
|
143
152
|
attributes: {},
|
|
144
153
|
};
|
|
145
|
-
const getHTTPUTCTimingURL = (
|
|
146
|
-
|
|
147
|
-
).default;
|
|
154
|
+
const getHTTPUTCTimingURL = (await vi.importActual("../get_http_utc-timing_url"))
|
|
155
|
+
.default as typeof IGetHTTPUTCTimingURL;
|
|
148
156
|
expect(getHTTPUTCTimingURL(mpdIR)).toEqual("foobar2000");
|
|
149
157
|
});
|
|
150
158
|
});
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest";
|
|
2
2
|
import type { IPeriodIntermediateRepresentation } from "../../node_parser_types";
|
|
3
3
|
import type { IParsedPeriodsContext } from "../get_periods_time_infos";
|
|
4
|
-
// https://github.com/typescript-eslint/typescript-eslint/issues/2315
|
|
5
|
-
/* eslint-disable no-duplicate-imports */
|
|
6
4
|
import getPeriodsTimeInformation from "../get_periods_time_infos";
|
|
7
|
-
/* eslint-enable no-duplicate-imports */
|
|
8
5
|
|
|
9
6
|
describe("DASH Parser - getPeriodsTimeInformation", () => {
|
|
10
7
|
it("should guess duration and end from next period.", () => {
|
|
@@ -47,7 +47,7 @@ export function parseSElementNode(root: ITNode): IParsedS {
|
|
|
47
47
|
continue;
|
|
48
48
|
}
|
|
49
49
|
switch (attributeName) {
|
|
50
|
-
case "t":
|
|
50
|
+
case "t": {
|
|
51
51
|
const start = parseInt(attributeVal, 10);
|
|
52
52
|
if (isNaN(start)) {
|
|
53
53
|
log.warn(`DASH: invalid t ("${attributeVal}")`);
|
|
@@ -55,7 +55,8 @@ export function parseSElementNode(root: ITNode): IParsedS {
|
|
|
55
55
|
parsedS.start = start;
|
|
56
56
|
}
|
|
57
57
|
break;
|
|
58
|
-
|
|
58
|
+
}
|
|
59
|
+
case "d": {
|
|
59
60
|
const duration = parseInt(attributeVal, 10);
|
|
60
61
|
if (isNaN(duration)) {
|
|
61
62
|
log.warn(`DASH: invalid d ("${attributeVal}")`);
|
|
@@ -63,7 +64,8 @@ export function parseSElementNode(root: ITNode): IParsedS {
|
|
|
63
64
|
parsedS.duration = duration;
|
|
64
65
|
}
|
|
65
66
|
break;
|
|
66
|
-
|
|
67
|
+
}
|
|
68
|
+
case "r": {
|
|
67
69
|
const repeatCount = parseInt(attributeVal, 10);
|
|
68
70
|
if (isNaN(repeatCount)) {
|
|
69
71
|
log.warn(`DASH: invalid r ("${attributeVal}")`);
|
|
@@ -71,6 +73,7 @@ export function parseSElementNode(root: ITNode): IParsedS {
|
|
|
71
73
|
parsedS.repeatCount = repeatCount;
|
|
72
74
|
}
|
|
73
75
|
break;
|
|
76
|
+
}
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
79
|
return parsedS;
|
|
@@ -88,7 +91,7 @@ export function parseSHTMLElement(root: Element): IParsedS {
|
|
|
88
91
|
for (let j = 0; j < root.attributes.length; j++) {
|
|
89
92
|
const attribute = root.attributes[j];
|
|
90
93
|
switch (attribute.name) {
|
|
91
|
-
case "t":
|
|
94
|
+
case "t": {
|
|
92
95
|
const start = parseInt(attribute.value, 10);
|
|
93
96
|
if (isNaN(start)) {
|
|
94
97
|
log.warn(`DASH: invalid t ("${attribute.value}")`);
|
|
@@ -96,7 +99,8 @@ export function parseSHTMLElement(root: Element): IParsedS {
|
|
|
96
99
|
parsedS.start = start;
|
|
97
100
|
}
|
|
98
101
|
break;
|
|
99
|
-
|
|
102
|
+
}
|
|
103
|
+
case "d": {
|
|
100
104
|
const duration = parseInt(attribute.value, 10);
|
|
101
105
|
if (isNaN(duration)) {
|
|
102
106
|
log.warn(`DASH: invalid d ("${attribute.value}")`);
|
|
@@ -104,7 +108,8 @@ export function parseSHTMLElement(root: Element): IParsedS {
|
|
|
104
108
|
parsedS.duration = duration;
|
|
105
109
|
}
|
|
106
110
|
break;
|
|
107
|
-
|
|
111
|
+
}
|
|
112
|
+
case "r": {
|
|
108
113
|
const repeatCount = parseInt(attribute.value, 10);
|
|
109
114
|
if (isNaN(repeatCount)) {
|
|
110
115
|
log.warn(`DASH: invalid r ("${attribute.value}")`);
|
|
@@ -112,6 +117,7 @@ export function parseSHTMLElement(root: Element): IParsedS {
|
|
|
112
117
|
parsedS.repeatCount = repeatCount;
|
|
113
118
|
}
|
|
114
119
|
break;
|
|
120
|
+
}
|
|
115
121
|
}
|
|
116
122
|
}
|
|
117
123
|
return parsedS;
|
|
@@ -67,7 +67,7 @@ function parseAdaptationSetChildren(
|
|
|
67
67
|
}
|
|
68
68
|
break;
|
|
69
69
|
|
|
70
|
-
case "BaseURL":
|
|
70
|
+
case "BaseURL": {
|
|
71
71
|
const [baseURLObj, baseURLWarnings] = parseBaseURL(currentNode);
|
|
72
72
|
if (baseURLObj !== undefined) {
|
|
73
73
|
children.baseURLs.push(baseURLObj);
|
|
@@ -76,6 +76,7 @@ function parseAdaptationSetChildren(
|
|
|
76
76
|
warnings = warnings.concat(baseURLWarnings);
|
|
77
77
|
}
|
|
78
78
|
break;
|
|
79
|
+
}
|
|
79
80
|
|
|
80
81
|
case "ContentComponent":
|
|
81
82
|
children.contentComponent = parseContentComponent(currentNode);
|
|
@@ -96,15 +97,16 @@ function parseAdaptationSetChildren(
|
|
|
96
97
|
children.inbandEventStreams.push(parseScheme(currentNode));
|
|
97
98
|
break;
|
|
98
99
|
|
|
99
|
-
case "Label":
|
|
100
|
+
case "Label": {
|
|
100
101
|
const label = textContent(currentNode.children);
|
|
101
102
|
|
|
102
103
|
if (label !== null && label !== undefined) {
|
|
103
104
|
children.label = label;
|
|
104
105
|
}
|
|
105
106
|
break;
|
|
107
|
+
}
|
|
106
108
|
|
|
107
|
-
case "Representation":
|
|
109
|
+
case "Representation": {
|
|
108
110
|
const [representation, representationWarnings] =
|
|
109
111
|
createRepresentationIntermediateRepresentation(currentNode);
|
|
110
112
|
children.representations.push(representation);
|
|
@@ -112,6 +114,7 @@ function parseAdaptationSetChildren(
|
|
|
112
114
|
warnings = warnings.concat(representationWarnings);
|
|
113
115
|
}
|
|
114
116
|
break;
|
|
117
|
+
}
|
|
115
118
|
|
|
116
119
|
case "Role":
|
|
117
120
|
if (isNullOrUndefined(children.roles)) {
|
|
@@ -129,23 +132,25 @@ function parseAdaptationSetChildren(
|
|
|
129
132
|
}
|
|
130
133
|
break;
|
|
131
134
|
|
|
132
|
-
case "SegmentBase":
|
|
135
|
+
case "SegmentBase": {
|
|
133
136
|
const [segmentBase, segmentBaseWarnings] = parseSegmentBase(currentNode);
|
|
134
137
|
children.segmentBase = segmentBase;
|
|
135
138
|
if (segmentBaseWarnings.length > 0) {
|
|
136
139
|
warnings = warnings.concat(segmentBaseWarnings);
|
|
137
140
|
}
|
|
138
141
|
break;
|
|
142
|
+
}
|
|
139
143
|
|
|
140
|
-
case "SegmentList":
|
|
144
|
+
case "SegmentList": {
|
|
141
145
|
const [segmentList, segmentListWarnings] = parseSegmentList(currentNode);
|
|
142
146
|
children.segmentList = segmentList;
|
|
143
147
|
if (segmentListWarnings.length > 0) {
|
|
144
148
|
warnings = warnings.concat(segmentListWarnings);
|
|
145
149
|
}
|
|
146
150
|
break;
|
|
151
|
+
}
|
|
147
152
|
|
|
148
|
-
case "SegmentTemplate":
|
|
153
|
+
case "SegmentTemplate": {
|
|
149
154
|
const [segmentTemplate, segmentTemplateWarnings] =
|
|
150
155
|
parseSegmentTemplate(currentNode);
|
|
151
156
|
children.segmentTemplate = segmentTemplate;
|
|
@@ -153,8 +158,9 @@ function parseAdaptationSetChildren(
|
|
|
153
158
|
warnings = warnings.concat(segmentTemplateWarnings);
|
|
154
159
|
}
|
|
155
160
|
break;
|
|
161
|
+
}
|
|
156
162
|
|
|
157
|
-
case "ContentProtection":
|
|
163
|
+
case "ContentProtection": {
|
|
158
164
|
const [contentProtection, contentProtectionWarnings] =
|
|
159
165
|
parseContentProtection(currentNode);
|
|
160
166
|
if (contentProtectionWarnings.length > 0) {
|
|
@@ -164,6 +170,7 @@ function parseAdaptationSetChildren(
|
|
|
164
170
|
contentProtections.push(contentProtection);
|
|
165
171
|
}
|
|
166
172
|
break;
|
|
173
|
+
}
|
|
167
174
|
|
|
168
175
|
// case "Rating":
|
|
169
176
|
// children.rating = currentNode;
|
|
@@ -59,19 +59,20 @@ function parseMPDChildren(
|
|
|
59
59
|
continue;
|
|
60
60
|
}
|
|
61
61
|
switch (currentNode.tagName) {
|
|
62
|
-
case "BaseURL":
|
|
62
|
+
case "BaseURL": {
|
|
63
63
|
const [baseURLObj, baseURLWarnings] = parseBaseURL(currentNode);
|
|
64
64
|
if (baseURLObj !== undefined) {
|
|
65
65
|
baseURLs.push(baseURLObj);
|
|
66
66
|
}
|
|
67
67
|
warnings = warnings.concat(baseURLWarnings);
|
|
68
68
|
break;
|
|
69
|
+
}
|
|
69
70
|
|
|
70
71
|
case "Location":
|
|
71
72
|
locations.push(textContent(currentNode.children));
|
|
72
73
|
break;
|
|
73
74
|
|
|
74
|
-
case "Period":
|
|
75
|
+
case "Period": {
|
|
75
76
|
const [period, periodWarnings] = createPeriodIntermediateRepresentation(
|
|
76
77
|
currentNode,
|
|
77
78
|
fullMpd,
|
|
@@ -79,13 +80,15 @@ function parseMPDChildren(
|
|
|
79
80
|
periods.push(period);
|
|
80
81
|
warnings = warnings.concat(periodWarnings);
|
|
81
82
|
break;
|
|
83
|
+
}
|
|
82
84
|
|
|
83
|
-
case "UTCTiming":
|
|
85
|
+
case "UTCTiming": {
|
|
84
86
|
const utcTiming = parseScheme(currentNode);
|
|
85
87
|
utcTimings.push(utcTiming);
|
|
86
88
|
break;
|
|
89
|
+
}
|
|
87
90
|
|
|
88
|
-
case "ContentProtection":
|
|
91
|
+
case "ContentProtection": {
|
|
89
92
|
const [contentProtection, contentProtectionWarnings] =
|
|
90
93
|
parseContentProtection(currentNode);
|
|
91
94
|
if (contentProtectionWarnings.length > 0) {
|
|
@@ -95,6 +98,7 @@ function parseMPDChildren(
|
|
|
95
98
|
contentProtections.push(contentProtection);
|
|
96
99
|
}
|
|
97
100
|
break;
|
|
101
|
+
}
|
|
98
102
|
}
|
|
99
103
|
}
|
|
100
104
|
return [{ baseURLs, locations, periods, utcTimings, contentProtections }, warnings];
|
|
@@ -56,29 +56,32 @@ function parsePeriodChildren(
|
|
|
56
56
|
continue;
|
|
57
57
|
}
|
|
58
58
|
switch (currentElement.tagName) {
|
|
59
|
-
case "BaseURL":
|
|
59
|
+
case "BaseURL": {
|
|
60
60
|
const [baseURLObj, baseURLWarnings] = parseBaseURL(currentElement);
|
|
61
61
|
if (baseURLObj !== undefined) {
|
|
62
62
|
baseURLs.push(baseURLObj);
|
|
63
63
|
}
|
|
64
64
|
warnings = warnings.concat(baseURLWarnings);
|
|
65
65
|
break;
|
|
66
|
+
}
|
|
66
67
|
|
|
67
|
-
case "AdaptationSet":
|
|
68
|
+
case "AdaptationSet": {
|
|
68
69
|
const [adaptation, adaptationWarnings] =
|
|
69
70
|
createAdaptationSetIntermediateRepresentation(currentElement);
|
|
70
71
|
adaptations.push(adaptation);
|
|
71
72
|
warnings = warnings.concat(adaptationWarnings);
|
|
72
73
|
break;
|
|
74
|
+
}
|
|
73
75
|
|
|
74
|
-
case "EventStream":
|
|
76
|
+
case "EventStream": {
|
|
75
77
|
const [eventStream, eventStreamWarnings] =
|
|
76
78
|
createEventStreamIntermediateRepresentation(currentElement, fullMpd);
|
|
77
79
|
eventStreams.push(eventStream);
|
|
78
80
|
warnings = warnings.concat(eventStreamWarnings);
|
|
79
81
|
break;
|
|
82
|
+
}
|
|
80
83
|
|
|
81
|
-
case "SegmentTemplate":
|
|
84
|
+
case "SegmentTemplate": {
|
|
82
85
|
const [parsedSegmentTemplate, segmentTemplateWarnings] =
|
|
83
86
|
parseSegmentTemplate(currentElement);
|
|
84
87
|
segmentTemplate = parsedSegmentTemplate;
|
|
@@ -86,8 +89,9 @@ function parsePeriodChildren(
|
|
|
86
89
|
warnings = warnings.concat(segmentTemplateWarnings);
|
|
87
90
|
}
|
|
88
91
|
break;
|
|
92
|
+
}
|
|
89
93
|
|
|
90
|
-
case "ContentProtection":
|
|
94
|
+
case "ContentProtection": {
|
|
91
95
|
const [contentProtection, contentProtectionWarnings] =
|
|
92
96
|
parseContentProtection(currentElement);
|
|
93
97
|
if (contentProtectionWarnings.length > 0) {
|
|
@@ -97,6 +101,7 @@ function parsePeriodChildren(
|
|
|
97
101
|
contentProtections.push(contentProtection);
|
|
98
102
|
}
|
|
99
103
|
break;
|
|
104
|
+
}
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
107
|
|
|
@@ -56,39 +56,43 @@ function parseRepresentationChildren(
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
switch (currentElement.tagName) {
|
|
59
|
-
case "BaseURL":
|
|
59
|
+
case "BaseURL": {
|
|
60
60
|
const [baseURLObj, baseURLWarnings] = parseBaseURL(currentElement);
|
|
61
61
|
if (baseURLObj !== undefined) {
|
|
62
62
|
children.baseURLs.push(baseURLObj);
|
|
63
63
|
}
|
|
64
64
|
warnings = warnings.concat(baseURLWarnings);
|
|
65
65
|
break;
|
|
66
|
+
}
|
|
66
67
|
case "InbandEventStream":
|
|
67
68
|
if (children.inbandEventStreams === undefined) {
|
|
68
69
|
children.inbandEventStreams = [];
|
|
69
70
|
}
|
|
70
71
|
children.inbandEventStreams.push(parseScheme(currentElement));
|
|
71
72
|
break;
|
|
72
|
-
case "SegmentBase":
|
|
73
|
+
case "SegmentBase": {
|
|
73
74
|
const [segmentBase, segmentBaseWarnings] = parseSegmentBase(currentElement);
|
|
74
75
|
children.segmentBase = segmentBase;
|
|
75
76
|
if (segmentBaseWarnings.length > 0) {
|
|
76
77
|
warnings = warnings.concat(segmentBaseWarnings);
|
|
77
78
|
}
|
|
78
79
|
break;
|
|
79
|
-
|
|
80
|
+
}
|
|
81
|
+
case "SegmentList": {
|
|
80
82
|
const [segmentList, segmentListWarnings] = parseSegmentList(currentElement);
|
|
81
83
|
warnings = warnings.concat(segmentListWarnings);
|
|
82
84
|
children.segmentList = segmentList;
|
|
83
85
|
break;
|
|
84
|
-
|
|
86
|
+
}
|
|
87
|
+
case "SegmentTemplate": {
|
|
85
88
|
const [segmentTemplate, segmentTemplateWarnings] =
|
|
86
89
|
parseSegmentTemplate(currentElement);
|
|
87
90
|
warnings = warnings.concat(segmentTemplateWarnings);
|
|
88
91
|
children.segmentTemplate = segmentTemplate;
|
|
89
92
|
break;
|
|
93
|
+
}
|
|
90
94
|
|
|
91
|
-
case "ContentProtection":
|
|
95
|
+
case "ContentProtection": {
|
|
92
96
|
const [contentProtection, contentProtectionWarnings] =
|
|
93
97
|
parseContentProtection(currentElement);
|
|
94
98
|
if (contentProtectionWarnings.length > 0) {
|
|
@@ -98,6 +102,7 @@ function parseRepresentationChildren(
|
|
|
98
102
|
contentProtections.push(contentProtection);
|
|
99
103
|
}
|
|
100
104
|
break;
|
|
105
|
+
}
|
|
101
106
|
case "SupplementalProperty":
|
|
102
107
|
if (isNullOrUndefined(children.supplementalProperties)) {
|
|
103
108
|
children.supplementalProperties = [parseScheme(currentElement)];
|
package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/ContentProtection.test.ts
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
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
|
-
/* 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 */
|
|
4
|
+
import type IContentProtection from "../ContentProtection";
|
|
10
5
|
|
|
11
6
|
function testStringAttribute(attributeName: string, variableName?: string): void {
|
|
12
7
|
const _variableName = variableName ?? attributeName;
|
|
13
8
|
|
|
14
9
|
it(`should correctly parse a ContentProtection element with a correct ${attributeName} attribute`, async () => {
|
|
15
|
-
const parseContentProtection = (
|
|
16
|
-
|
|
17
|
-
).default;
|
|
10
|
+
const parseContentProtection = (await vi.importActual("../ContentProtection"))
|
|
11
|
+
.default as typeof IContentProtection;
|
|
18
12
|
const element1 = parseXml(
|
|
19
13
|
`<ContentProtection ${attributeName}="foobar" />`,
|
|
20
14
|
)[0] as ITNode;
|
|
@@ -37,9 +31,8 @@ describe("DASH Node Parsers - ContentProtection", () => {
|
|
|
37
31
|
});
|
|
38
32
|
|
|
39
33
|
it("should correctly parse a ContentProtection element without attributes", async () => {
|
|
40
|
-
const parseContentProtection = (
|
|
41
|
-
|
|
42
|
-
).default;
|
|
34
|
+
const parseContentProtection = (await vi.importActual("../ContentProtection"))
|
|
35
|
+
.default as typeof IContentProtection;
|
|
43
36
|
const element = parseXml("<ContentProtection />")[0] as ITNode;
|
|
44
37
|
expect(parseContentProtection(element)).toEqual([
|
|
45
38
|
{ attributes: {}, children: { cencPssh: [] } },
|
|
@@ -58,9 +51,8 @@ describe("DASH Node Parsers - ContentProtection", () => {
|
|
|
58
51
|
vi.doMock("../../../../../../utils/string_parsing", () => ({
|
|
59
52
|
hexToBytes: mockHexToBytes,
|
|
60
53
|
}));
|
|
61
|
-
const parseContentProtection = (
|
|
62
|
-
|
|
63
|
-
).default;
|
|
54
|
+
const parseContentProtection = (await vi.importActual("../ContentProtection"))
|
|
55
|
+
.default as typeof IContentProtection;
|
|
64
56
|
const element1 = parseXml(
|
|
65
57
|
'<ContentProtection cenc:default_KID="dead-beef" />',
|
|
66
58
|
)[0] as ITNode;
|
|
@@ -81,9 +73,8 @@ describe("DASH Node Parsers - ContentProtection", () => {
|
|
|
81
73
|
vi.doMock("../../../../../../utils/string_parsing", () => ({
|
|
82
74
|
hexToBytes: mockHexToBytes,
|
|
83
75
|
}));
|
|
84
|
-
const parseContentProtection = (
|
|
85
|
-
|
|
86
|
-
).default;
|
|
76
|
+
const parseContentProtection = (await vi.importActual("../ContentProtection"))
|
|
77
|
+
.default as typeof IContentProtection;
|
|
87
78
|
const element = parseXml(
|
|
88
79
|
`<ContentProtection
|
|
89
80
|
schemeIdUri="foo"
|
|
@@ -101,9 +92,8 @@ describe("DASH Node Parsers - ContentProtection", () => {
|
|
|
101
92
|
});
|
|
102
93
|
|
|
103
94
|
it("should correctly parse a ContentProtection with cenc:pssh children", async () => {
|
|
104
|
-
const parseContentProtection = (
|
|
105
|
-
|
|
106
|
-
).default;
|
|
95
|
+
const parseContentProtection = (await vi.importActual("../ContentProtection"))
|
|
96
|
+
.default as typeof IContentProtection;
|
|
107
97
|
const element = parseXml(
|
|
108
98
|
`<ContentProtection>
|
|
109
99
|
<cenc:pssh>AABBCC</cenc:pssh>
|
|
@@ -131,9 +121,8 @@ describe("DASH Node Parsers - ContentProtection", () => {
|
|
|
131
121
|
vi.doMock("../../../../../../utils/string_parsing", () => ({
|
|
132
122
|
hexToBytes: mockHexToBytes,
|
|
133
123
|
}));
|
|
134
|
-
const parseContentProtection = (
|
|
135
|
-
|
|
136
|
-
).default;
|
|
124
|
+
const parseContentProtection = (await vi.importActual("../ContentProtection"))
|
|
125
|
+
.default as typeof IContentProtection;
|
|
137
126
|
const element = parseXml(
|
|
138
127
|
`<ContentProtection
|
|
139
128
|
schemeIdUri="foo"
|
|
@@ -156,9 +145,8 @@ describe("DASH Node Parsers - ContentProtection", () => {
|
|
|
156
145
|
});
|
|
157
146
|
|
|
158
147
|
it("should return a warning if one of the cenc:pssh is invalid base64", async () => {
|
|
159
|
-
const parseContentProtection = (
|
|
160
|
-
|
|
161
|
-
).default;
|
|
148
|
+
const parseContentProtection = (await vi.importActual("../ContentProtection"))
|
|
149
|
+
.default as typeof IContentProtection;
|
|
162
150
|
const element = parseXml(
|
|
163
151
|
`<ContentProtection>
|
|
164
152
|
<cenc:pssh>AA!BCC</cenc:pssh>
|
package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/Initialization.test.ts
CHANGED
|
@@ -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 IParseInitialization from "../Initialization";
|
|
5
|
+
import type { MPDError as IMPDError } from "../utils";
|
|
10
6
|
|
|
11
7
|
describe("DASH Node Parsers - Initialization", () => {
|
|
12
8
|
beforeEach(() => {
|
|
@@ -18,8 +14,8 @@ describe("DASH Node Parsers - Initialization", () => {
|
|
|
18
14
|
vi.doMock("../../../../../../log", () => log);
|
|
19
15
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
20
16
|
|
|
21
|
-
const parseInitialization = (
|
|
22
|
-
.default;
|
|
17
|
+
const parseInitialization = (await vi.importActual("../Initialization"))
|
|
18
|
+
.default as typeof IParseInitialization;
|
|
23
19
|
const element1 = parseXml("<Foo />")[0] as ITNode;
|
|
24
20
|
expect(parseInitialization(element1)).toEqual([{}, []]);
|
|
25
21
|
|
|
@@ -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 IParseInitialization;
|
|
40
36
|
const element1 = parseXml('<Foo range="0-1" />')[0] as ITNode;
|
|
41
37
|
expect(parseInitialization(element1)).toEqual([{ range: [0, 1] }, []]);
|
|
42
38
|
|
|
@@ -52,9 +48,9 @@ describe("DASH Node Parsers - Initialization", () => {
|
|
|
52
48
|
vi.doMock("../../../../../../log", () => log);
|
|
53
49
|
const mockLog = vi.spyOn(log.default, "warn").mockImplementation(vi.fn());
|
|
54
50
|
|
|
55
|
-
const parseInitialization = (
|
|
56
|
-
.default;
|
|
57
|
-
const MPDError = (
|
|
51
|
+
const parseInitialization = (await vi.importActual("../Initialization"))
|
|
52
|
+
.default as typeof IParseInitialization;
|
|
53
|
+
const MPDError = (await vi.importActual("../utils")).MPDError as typeof IMPDError;
|
|
58
54
|
const element1 = parseXml('<Foo range="a" />')[0] as ITNode;
|
|
59
55
|
const error1 = new MPDError('`range` property has an unrecognized format "a"');
|
|
60
56
|
expect(parseInitialization(element1)).toEqual([{}, [error1]]);
|
|
@@ -77,8 +73,8 @@ describe("DASH Node Parsers - Initialization", () => {
|
|
|
77
73
|
vi.doMock("../../../../../../log", () => log);
|
|
78
74
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
79
75
|
|
|
80
|
-
const parseInitialization = (
|
|
81
|
-
.default;
|
|
76
|
+
const parseInitialization = (await vi.importActual("../Initialization"))
|
|
77
|
+
.default as typeof IParseInitialization;
|
|
82
78
|
const element1 = parseXml('<Foo sourceURL="a" />')[0] as ITNode;
|
|
83
79
|
expect(parseInitialization(element1)).toEqual([{ media: "a" }, []]);
|
|
84
80
|
|
|
@@ -94,8 +90,8 @@ describe("DASH Node Parsers - Initialization", () => {
|
|
|
94
90
|
vi.doMock("../../../../../../log", () => log);
|
|
95
91
|
const mockLog = vi.spyOn(log.default, "warn");
|
|
96
92
|
|
|
97
|
-
const parseInitialization = (
|
|
98
|
-
.default;
|
|
93
|
+
const parseInitialization = (await vi.importActual("../Initialization"))
|
|
94
|
+
.default as typeof IParseInitialization;
|
|
99
95
|
const element1 = parseXml('<Foo sourceURL="a" range="4-10" />')[0] as ITNode;
|
|
100
96
|
expect(parseInitialization(element1)).toEqual([{ media: "a", range: [4, 10] }, []]);
|
|
101
97
|
|