rx-player 4.2.0-dev.2024090300 → 4.2.0-dev.2024090500
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/VERSION +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/commonjs/compat/add_class_name.d.ts.map +1 -1
- package/dist/commonjs/compat/add_class_name.js +1 -2
- package/dist/commonjs/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/commonjs/compat/browser_compatibility_types.js +4 -1
- package/dist/commonjs/compat/clear_element_src.js +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
- package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
- package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
- package/dist/commonjs/compat/eme/eme-api-implementation.js +0 -2
- package/dist/commonjs/compat/event_listeners.d.ts.map +1 -1
- package/dist/commonjs/compat/event_listeners.js +2 -6
- package/dist/commonjs/compat/has_mse_in_worker.js +1 -1
- package/dist/commonjs/compat/is_codec_supported.d.ts.map +1 -1
- package/dist/commonjs/compat/is_codec_supported.js +0 -2
- package/dist/commonjs/compat/is_vtt_cue.d.ts.map +1 -1
- package/dist/commonjs/compat/is_vtt_cue.js +1 -2
- package/dist/commonjs/compat/on_height_width_change.d.ts.map +1 -1
- package/dist/commonjs/compat/patch_webkit_source_buffer.d.ts.map +1 -1
- package/dist/commonjs/compat/patch_webkit_source_buffer.js +8 -18
- package/dist/commonjs/compat/remove_cue.js +2 -2
- package/dist/commonjs/core/fetchers/index.d.ts +4 -4
- package/dist/commonjs/core/fetchers/index.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/index.js +2 -2
- package/dist/commonjs/core/fetchers/segment/index.d.ts +6 -5
- package/dist/commonjs/core/fetchers/segment/index.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/segment/index.js +2 -2
- package/dist/{es2017/core/stream/representation/utils/downloading_queue.d.ts → commonjs/core/fetchers/segment/segment_queue.d.ts} +63 -80
- package/dist/commonjs/core/fetchers/segment/segment_queue.d.ts.map +1 -0
- package/dist/commonjs/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +132 -111
- package/dist/commonjs/core/fetchers/segment/{segment_fetcher_creator.d.ts → segment_queue_creator.d.ts} +25 -12
- package/dist/commonjs/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
- package/dist/commonjs/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +15 -9
- package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts +9 -0
- package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/segment/task_prioritizer.js +38 -8
- package/dist/commonjs/core/fetchers/utils/schedule_request.js +1 -1
- package/dist/commonjs/core/main/common/content_time_boundaries_observer.js +21 -10
- package/dist/commonjs/core/main/worker/content_preparer.d.ts +3 -3
- package/dist/commonjs/core/main/worker/content_preparer.d.ts.map +1 -1
- package/dist/commonjs/core/main/worker/content_preparer.js +2 -2
- package/dist/commonjs/core/main/worker/send_message.js +1 -1
- package/dist/commonjs/core/main/worker/worker_main.js +2 -2
- package/dist/commonjs/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
- package/dist/commonjs/core/segment_sinks/inventory/segment_inventory.js +39 -30
- package/dist/commonjs/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
- package/dist/commonjs/core/segment_sinks/segment_buffers_store.js +3 -2
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +3 -3
- package/dist/commonjs/core/stream/adaptation/types.d.ts +2 -2
- package/dist/commonjs/core/stream/adaptation/types.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.js +27 -6
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +3 -3
- package/dist/commonjs/core/stream/period/period_stream.d.ts +1 -1
- package/dist/commonjs/core/stream/period/period_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/period/period_stream.js +2 -2
- package/dist/commonjs/core/stream/period/types.d.ts +2 -2
- package/dist/commonjs/core/stream/period/types.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.d.ts +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.js +19 -28
- package/dist/commonjs/core/stream/representation/types.d.ts +2 -2
- package/dist/commonjs/core/stream/representation/types.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +39 -18
- package/dist/commonjs/core/types.d.ts +2 -2
- package/dist/commonjs/core/types.d.ts.map +1 -1
- package/dist/commonjs/default_config.d.ts.map +1 -1
- package/dist/commonjs/default_config.js +0 -8
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
- package/dist/commonjs/features/add_features.d.ts.map +1 -1
- package/dist/commonjs/features/add_features.js +31 -10
- package/dist/commonjs/main_thread/api/option_utils.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/option_utils.js +2 -6
- package/dist/commonjs/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/public_api.js +33 -27
- package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.js +4 -3
- package/dist/commonjs/main_thread/init/media_source_content_initializer.js +6 -6
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +32 -37
- package/dist/commonjs/main_thread/text_displayer/html/html_text_displayer.js +1 -5
- package/dist/commonjs/main_thread/text_displayer/native/native_text_displayer.js +3 -7
- package/dist/commonjs/main_thread/tracks_store/track_dispatcher.js +1 -1
- package/dist/commonjs/main_thread/types.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/manifest.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/manifest.js +0 -6
- package/dist/commonjs/manifest/utils.d.ts.map +1 -1
- package/dist/commonjs/manifest/utils.js +72 -62
- package/dist/commonjs/mse/main_media_source_interface.js +1 -1
- package/dist/commonjs/multithread_types.d.ts +2 -2
- package/dist/commonjs/multithread_types.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
- package/dist/commonjs/parsers/manifest/local/representation_index.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/local/representation_index.js +29 -8
- package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.js +31 -10
- package/dist/commonjs/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/smooth/create_parser.js +2 -1
- package/dist/commonjs/parsers/manifest/smooth/shared_smooth_segment_timeline.js +26 -4
- package/dist/commonjs/parsers/manifest/utils/get_first_time_from_adaptation.js +29 -7
- package/dist/commonjs/parsers/manifest/utils/get_last_time_from_adaptation.js +29 -7
- package/dist/commonjs/parsers/texttracks/srt/html.js +28 -6
- package/dist/commonjs/parsers/texttracks/ttml/html/create_element.js +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/html/parse_ttml_to_div.js +29 -7
- package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +26 -5
- package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.js +25 -4
- package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
- package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.js +9 -3
- package/dist/commonjs/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +30 -8
- package/dist/commonjs/public_types.d.ts +5 -7
- package/dist/commonjs/public_types.d.ts.map +1 -1
- package/dist/commonjs/transports/smooth/extract_timings_infos.js +30 -8
- package/dist/commonjs/utils/array_find.d.ts +1 -1
- package/dist/commonjs/utils/array_find.d.ts.map +1 -1
- package/dist/commonjs/utils/array_find.js +3 -1
- package/dist/commonjs/utils/array_find_index.d.ts +1 -1
- package/dist/commonjs/utils/array_find_index.d.ts.map +1 -1
- package/dist/commonjs/utils/array_find_index.js +3 -1
- package/dist/commonjs/utils/array_includes.d.ts.map +1 -1
- package/dist/commonjs/utils/array_includes.js +1 -3
- package/dist/commonjs/utils/assert.d.ts.map +1 -1
- package/dist/commonjs/utils/assert.js +0 -2
- package/dist/commonjs/utils/base64.d.ts +1 -1
- package/dist/commonjs/utils/base64.d.ts.map +1 -1
- package/dist/commonjs/utils/base64.js +3 -2
- package/dist/commonjs/utils/event_emitter.js +1 -1
- package/dist/commonjs/utils/flat_map.d.ts.map +1 -1
- package/dist/commonjs/utils/flat_map.js +1 -2
- package/dist/commonjs/utils/id_generator.d.ts.map +1 -1
- package/dist/commonjs/utils/id_generator.js +0 -1
- package/dist/commonjs/utils/logger.js +1 -1
- package/dist/commonjs/utils/monotonic_timestamp.js +2 -2
- package/dist/commonjs/utils/noop.js +1 -2
- package/dist/commonjs/utils/object_assign.d.ts.map +1 -1
- package/dist/commonjs/utils/object_assign.js +27 -6
- package/dist/commonjs/utils/object_values.d.ts.map +1 -1
- package/dist/commonjs/utils/object_values.js +1 -1
- package/dist/commonjs/utils/reference.js +1 -1
- package/dist/commonjs/utils/request/xhr.js +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/es2017/compat/add_class_name.d.ts.map +1 -1
- package/dist/es2017/compat/add_class_name.js +1 -2
- package/dist/es2017/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/es2017/compat/browser_compatibility_types.js +4 -1
- package/dist/es2017/compat/clear_element_src.js +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
- package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
- package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
- package/dist/es2017/compat/eme/eme-api-implementation.js +0 -2
- package/dist/es2017/compat/event_listeners.d.ts.map +1 -1
- package/dist/es2017/compat/event_listeners.js +2 -6
- package/dist/es2017/compat/has_mse_in_worker.js +1 -1
- package/dist/es2017/compat/is_codec_supported.d.ts.map +1 -1
- package/dist/es2017/compat/is_codec_supported.js +0 -2
- package/dist/es2017/compat/is_vtt_cue.d.ts.map +1 -1
- package/dist/es2017/compat/is_vtt_cue.js +1 -2
- package/dist/es2017/compat/on_height_width_change.d.ts.map +1 -1
- package/dist/es2017/compat/patch_webkit_source_buffer.d.ts.map +1 -1
- package/dist/es2017/compat/patch_webkit_source_buffer.js +8 -18
- package/dist/es2017/compat/remove_cue.js +2 -2
- package/dist/es2017/core/fetchers/index.d.ts +4 -4
- package/dist/es2017/core/fetchers/index.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/index.js +2 -2
- package/dist/es2017/core/fetchers/segment/index.d.ts +6 -5
- package/dist/es2017/core/fetchers/segment/index.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/segment/index.js +2 -2
- package/dist/{commonjs/core/stream/representation/utils/downloading_queue.d.ts → es2017/core/fetchers/segment/segment_queue.d.ts} +63 -80
- package/dist/es2017/core/fetchers/segment/segment_queue.d.ts.map +1 -0
- package/dist/es2017/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +126 -105
- package/dist/es2017/core/fetchers/segment/{segment_fetcher_creator.d.ts → segment_queue_creator.d.ts} +25 -12
- package/dist/es2017/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
- package/dist/es2017/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +12 -6
- package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts +9 -0
- package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/segment/task_prioritizer.js +10 -2
- package/dist/es2017/core/fetchers/utils/schedule_request.js +1 -1
- package/dist/es2017/core/main/common/content_time_boundaries_observer.js +4 -4
- package/dist/es2017/core/main/worker/content_preparer.d.ts +3 -3
- package/dist/es2017/core/main/worker/content_preparer.d.ts.map +1 -1
- package/dist/es2017/core/main/worker/content_preparer.js +3 -3
- package/dist/es2017/core/main/worker/send_message.js +1 -1
- package/dist/es2017/core/main/worker/worker_main.js +2 -2
- package/dist/es2017/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
- package/dist/es2017/core/segment_sinks/inventory/segment_inventory.js +1 -2
- package/dist/es2017/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
- package/dist/es2017/core/segment_sinks/segment_buffers_store.js +3 -2
- package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.js +3 -3
- package/dist/es2017/core/stream/adaptation/types.d.ts +2 -2
- package/dist/es2017/core/stream/adaptation/types.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.js +1 -2
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +3 -3
- package/dist/es2017/core/stream/period/period_stream.d.ts +1 -1
- package/dist/es2017/core/stream/period/period_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/period/period_stream.js +2 -2
- package/dist/es2017/core/stream/period/types.d.ts +2 -2
- package/dist/es2017/core/stream/period/types.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.d.ts +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.js +19 -28
- package/dist/es2017/core/stream/representation/types.d.ts +2 -2
- package/dist/es2017/core/stream/representation/types.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +1 -2
- package/dist/es2017/core/types.d.ts +2 -2
- package/dist/es2017/core/types.d.ts.map +1 -1
- package/dist/es2017/default_config.d.ts.map +1 -1
- package/dist/es2017/default_config.js +0 -8
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
- package/dist/es2017/features/add_features.d.ts.map +1 -1
- package/dist/es2017/features/add_features.js +1 -2
- package/dist/es2017/main_thread/api/option_utils.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/option_utils.js +2 -6
- package/dist/es2017/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/public_api.js +29 -23
- package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.js +2 -1
- package/dist/es2017/main_thread/init/media_source_content_initializer.js +6 -6
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.js +7 -12
- package/dist/es2017/main_thread/text_displayer/html/html_text_displayer.js +1 -5
- package/dist/es2017/main_thread/text_displayer/native/native_text_displayer.js +3 -7
- package/dist/es2017/main_thread/tracks_store/track_dispatcher.js +1 -1
- package/dist/es2017/main_thread/types.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/manifest.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/manifest.js +0 -6
- package/dist/es2017/manifest/utils.d.ts.map +1 -1
- package/dist/es2017/manifest/utils.js +1 -2
- package/dist/es2017/mse/main_media_source_interface.js +1 -1
- package/dist/es2017/multithread_types.d.ts +2 -2
- package/dist/es2017/multithread_types.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +1 -2
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
- package/dist/es2017/parsers/manifest/local/representation_index.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/local/representation_index.js +1 -2
- package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.js +2 -3
- package/dist/es2017/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/smooth/create_parser.js +2 -1
- package/dist/es2017/parsers/manifest/smooth/shared_smooth_segment_timeline.js +2 -2
- package/dist/es2017/parsers/manifest/utils/get_first_time_from_adaptation.js +2 -2
- package/dist/es2017/parsers/manifest/utils/get_last_time_from_adaptation.js +2 -2
- package/dist/es2017/parsers/texttracks/srt/html.js +2 -2
- package/dist/es2017/parsers/texttracks/ttml/html/create_element.js +1 -1
- package/dist/es2017/parsers/texttracks/ttml/html/parse_ttml_to_div.js +3 -3
- package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +1 -2
- package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.js +1 -2
- package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
- package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/webvtt/html/to_html.js +9 -3
- package/dist/es2017/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +2 -2
- package/dist/es2017/public_types.d.ts +5 -7
- package/dist/es2017/public_types.d.ts.map +1 -1
- package/dist/es2017/transports/smooth/extract_timings_infos.js +3 -3
- package/dist/es2017/utils/array_find.d.ts +1 -1
- package/dist/es2017/utils/array_find.d.ts.map +1 -1
- package/dist/es2017/utils/array_find.js +3 -1
- package/dist/es2017/utils/array_find_index.d.ts +1 -1
- package/dist/es2017/utils/array_find_index.d.ts.map +1 -1
- package/dist/es2017/utils/array_find_index.js +3 -1
- package/dist/es2017/utils/array_includes.d.ts.map +1 -1
- package/dist/es2017/utils/array_includes.js +1 -3
- package/dist/es2017/utils/assert.d.ts.map +1 -1
- package/dist/es2017/utils/assert.js +0 -2
- package/dist/es2017/utils/base64.d.ts +1 -1
- package/dist/es2017/utils/base64.d.ts.map +1 -1
- package/dist/es2017/utils/base64.js +3 -2
- package/dist/es2017/utils/event_emitter.js +1 -1
- package/dist/es2017/utils/flat_map.d.ts.map +1 -1
- package/dist/es2017/utils/flat_map.js +1 -2
- package/dist/es2017/utils/id_generator.d.ts.map +1 -1
- package/dist/es2017/utils/id_generator.js +0 -1
- package/dist/es2017/utils/logger.js +1 -1
- package/dist/es2017/utils/monotonic_timestamp.js +2 -2
- package/dist/es2017/utils/noop.js +1 -2
- package/dist/es2017/utils/object_assign.d.ts.map +1 -1
- package/dist/es2017/utils/object_assign.js +1 -2
- package/dist/es2017/utils/object_values.d.ts.map +1 -1
- package/dist/es2017/utils/object_values.js +1 -2
- package/dist/es2017/utils/reference.js +1 -1
- package/dist/es2017/utils/request/xhr.js +1 -1
- package/dist/rx-player.js +39336 -18
- package/dist/rx-player.min.js +18 -0
- package/dist/worker.js +5 -5
- package/package.json +16 -9
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/compat/__tests__/add_text_track.test.ts +8 -12
- package/src/compat/__tests__/browser_compatibility_types.test.ts +0 -7
- package/src/compat/__tests__/browser_version.test.ts +20 -19
- package/src/compat/__tests__/can_patch_isobmff.test.ts +7 -10
- package/src/compat/__tests__/can_rely_on_video_visibility_and_size.test.ts +17 -21
- package/src/compat/__tests__/can_reuse_media_keys.test.ts +13 -21
- package/src/compat/__tests__/clear_element_src.test.ts +37 -34
- package/src/compat/__tests__/enable_audio_track.test.ts +22 -21
- package/src/compat/__tests__/is_codec_supported.test.ts +17 -18
- package/src/compat/__tests__/is_seeking_approximate.test.ts +8 -14
- package/src/compat/__tests__/is_vtt_cue.test.ts +8 -13
- package/src/compat/__tests__/make_vtt_cue.test.ts +7 -12
- package/src/compat/__tests__/patch_webkit_source_buffer.test.ts +44 -32
- package/src/compat/__tests__/remove_cue.test.ts +30 -31
- package/src/compat/__tests__/should_favour_custom_safari_EME.test.ts +21 -26
- package/src/compat/__tests__/should_renew_media_key_system_access.test.ts +9 -17
- package/src/compat/__tests__/should_unset_media_keys.test.ts +7 -14
- package/src/compat/__tests__/should_validate_metadata.test.ts +7 -17
- package/src/compat/__tests__/should_wait_for_data_before_loaded.test.ts +17 -26
- package/src/compat/__tests__/should_wait_for_have_enough_data.test.ts +10 -15
- package/src/compat/add_class_name.ts +1 -2
- package/src/compat/browser_compatibility_types.ts +4 -2
- package/src/compat/clear_element_src.ts +1 -1
- package/src/compat/eme/custom_media_keys/moz_media_keys_constructor.ts +1 -2
- package/src/compat/eme/custom_media_keys/ms_media_keys_constructor.ts +1 -2
- package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +3 -6
- package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +2 -17
- package/src/compat/eme/custom_media_keys/webkit_media_keys_constructor.ts +1 -4
- package/src/compat/eme/eme-api-implementation.ts +0 -2
- package/src/compat/event_listeners.ts +2 -6
- package/src/compat/has_mse_in_worker.ts +1 -1
- package/src/compat/is_codec_supported.ts +0 -2
- package/src/compat/is_debug_mode_enabled.ts +1 -1
- package/src/compat/is_vtt_cue.ts +1 -2
- package/src/compat/on_height_width_change.ts +1 -2
- package/src/compat/patch_webkit_source_buffer.ts +48 -29
- package/src/compat/remove_cue.ts +2 -2
- package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +21 -26
- package/src/core/fetchers/README.md +13 -12
- package/src/core/fetchers/index.ts +5 -8
- package/src/core/fetchers/segment/__tests__/task_prioritizer.test.ts +17 -23
- package/src/core/fetchers/segment/index.ts +6 -5
- package/src/core/{stream/representation/utils/downloading_queue.ts → fetchers/segment/segment_queue.ts} +204 -166
- package/src/core/fetchers/segment/{segment_fetcher_creator.ts → segment_queue_creator.ts} +31 -14
- package/src/core/fetchers/segment/task_prioritizer.ts +10 -2
- package/src/core/fetchers/utils/schedule_request.ts +1 -1
- package/src/core/main/common/content_time_boundaries_observer.ts +4 -4
- package/src/core/main/worker/content_preparer.ts +5 -5
- package/src/core/main/worker/send_message.ts +1 -1
- package/src/core/main/worker/worker_main.ts +2 -2
- package/src/core/segment_sinks/implementations/text/text_segment_buffer.ts +1 -5
- package/src/core/segment_sinks/inventory/segment_inventory.ts +1 -2
- package/src/core/segment_sinks/segment_buffers_store.ts +3 -2
- package/src/core/stream/adaptation/adaptation_stream.ts +3 -3
- package/src/core/stream/adaptation/types.ts +2 -2
- package/src/core/stream/orchestrator/get_time_ranges_for_content.ts +1 -2
- package/src/core/stream/orchestrator/stream_orchestrator.ts +4 -4
- package/src/core/stream/period/period_stream.ts +2 -2
- package/src/core/stream/period/types.ts +2 -2
- package/src/core/stream/representation/representation_stream.ts +59 -56
- package/src/core/stream/representation/types.ts +3 -4
- package/src/core/stream/representation/utils/get_needed_segments.ts +1 -2
- package/src/core/types.ts +2 -4
- package/src/default_config.ts +0 -8
- package/src/errors/__tests__/format_error.test.ts +18 -18
- package/src/experimental/features/__tests__/multi_thread.test.ts +5 -5
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/capabilities.test.ts +11 -11
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +18 -26
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +13 -21
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/decodingInfos.test.ts +24 -20
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/defaultCodecFinder.test.ts +28 -30
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaContentType.test.ts +32 -38
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +64 -51
- package/src/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.ts +4 -17
- package/src/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.ts +0 -4
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.ts +1 -2
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts +16 -14
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +1 -2
- package/src/features/__tests__/add_features.test.ts +12 -11
- package/src/features/add_features.ts +1 -2
- package/src/features/list/__tests__/dash_wasm.test.ts +4 -4
- package/src/main_thread/api/__tests__/option_utils.test.ts +114 -70
- package/src/main_thread/api/__tests__/public_api.test.ts +85 -48
- package/src/main_thread/api/option_utils.ts +2 -6
- package/src/main_thread/api/public_api.ts +24 -18
- package/src/main_thread/decrypt/__tests__/__global__/get_license.test.ts +12 -18
- package/src/main_thread/decrypt/__tests__/__global__/init_data.test.ts +128 -101
- package/src/main_thread/decrypt/__tests__/__global__/media_key_system_access.test.ts +26 -33
- package/src/main_thread/decrypt/__tests__/__global__/media_keys.test.ts +46 -48
- package/src/main_thread/decrypt/__tests__/__global__/server_certificate.test.ts +33 -34
- package/src/main_thread/decrypt/__tests__/__global__/utils.ts +13 -17
- package/src/main_thread/decrypt/session_events_listener.ts +1 -1
- package/src/main_thread/decrypt/utils/__tests__/clean_old_loaded_sessions.test.ts +0 -5
- package/src/main_thread/decrypt/utils/__tests__/clean_old_stored_persistent_info.test.ts +14 -17
- package/src/main_thread/decrypt/utils/persistent_sessions_store.ts +2 -1
- package/src/main_thread/init/media_source_content_initializer.ts +7 -7
- package/src/main_thread/init/multi_thread_content_initializer.ts +7 -12
- package/src/main_thread/init/utils/__tests__/are_same_stream_events.test.ts +11 -16
- package/src/main_thread/init/utils/__tests__/refresh_scheduled_events_list.test.ts +48 -18
- package/src/main_thread/text_displayer/html/__tests__/text_track_cues_store.test.ts +32 -17
- package/src/main_thread/text_displayer/html/html_text_displayer.ts +1 -5
- package/src/main_thread/text_displayer/native/native_text_displayer.ts +3 -7
- package/src/main_thread/tracks_store/__tests__/media_element_tracks_store.test.ts +33 -28
- package/src/main_thread/tracks_store/track_dispatcher.ts +1 -1
- package/src/main_thread/types.ts +0 -1
- package/src/manifest/classes/__tests__/adaptation.test.ts +167 -62
- package/src/manifest/classes/__tests__/manifest.test.ts +130 -74
- package/src/manifest/classes/__tests__/period.test.ts +293 -211
- package/src/manifest/classes/__tests__/update_period_in_place.test.ts +0 -2
- package/src/manifest/classes/__tests__/update_periods.test.ts +57 -57
- package/src/manifest/classes/manifest.ts +0 -6
- package/src/manifest/utils.ts +1 -2
- package/src/mse/main_media_source_interface.ts +1 -1
- package/src/mse/types.ts +1 -1
- package/src/multithread_types.ts +2 -2
- package/src/parsers/manifest/dash/common/__tests__/get_clock_offset.test.ts +5 -10
- package/src/parsers/manifest/dash/common/__tests__/get_http_utc-timing_url.test.ts +38 -30
- package/src/parsers/manifest/dash/common/__tests__/get_periods_time_infos.test.ts +0 -3
- package/src/parsers/manifest/dash/common/indexes/timeline/parse_s_element.ts +12 -6
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.ts +14 -7
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.ts +8 -4
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Period.ts +10 -5
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.ts +10 -5
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
- package/src/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.ts +14 -7
- package/src/parsers/manifest/dash/native-parser/node_parsers/EventStream.ts +2 -1
- package/src/parsers/manifest/dash/native-parser/node_parsers/MPD.ts +8 -4
- package/src/parsers/manifest/dash/native-parser/node_parsers/Period.ts +10 -5
- package/src/parsers/manifest/dash/native-parser/node_parsers/Representation.ts +10 -5
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentTimeline.test.ts +9 -14
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
- package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +1 -2
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.ts +2 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.ts +2 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.ts +4 -2
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/MPD.ts +10 -5
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/Period.ts +2 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/root.ts +2 -1
- package/src/parsers/manifest/local/representation_index.ts +1 -2
- package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +2 -3
- package/src/parsers/manifest/smooth/create_parser.ts +2 -1
- package/src/parsers/manifest/smooth/shared_smooth_segment_timeline.ts +2 -2
- package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +3 -8
- package/src/parsers/manifest/utils/get_first_time_from_adaptation.ts +2 -2
- package/src/parsers/manifest/utils/get_last_time_from_adaptation.ts +2 -2
- package/src/parsers/texttracks/srt/html.ts +2 -2
- package/src/parsers/texttracks/ttml/__tests__/resolve_styles_inheritance.test.ts +3 -7
- package/src/parsers/texttracks/ttml/html/__tests__/__global__/html_ttml_parser.test.ts +4 -4
- package/src/parsers/texttracks/ttml/html/create_element.ts +1 -1
- package/src/parsers/texttracks/ttml/html/parse_ttml_to_div.ts +3 -3
- package/src/parsers/texttracks/ttml/native/parse_ttml_to_vtt.ts +1 -2
- package/src/parsers/texttracks/ttml/resolve_styles_inheritance.ts +1 -2
- package/src/parsers/texttracks/webvtt/__tests__/parse_cue_block.test.ts +11 -11
- package/src/parsers/texttracks/webvtt/html/__tests__/convert_payload_to_html.test.ts +5 -18
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_style_block.test.ts +23 -28
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_webvtt_to_div.test.ts +9 -14
- package/src/parsers/texttracks/webvtt/html/__tests__/to_html.test.ts +11 -11
- package/src/parsers/texttracks/webvtt/html/to_html.ts +9 -3
- package/src/parsers/texttracks/webvtt/native/parse_vtt_to_cues.ts +2 -2
- package/src/public_types.ts +7 -8
- package/src/tools/TextTrackRenderer/text_track_renderer.ts +1 -1
- package/src/transports/smooth/extract_timings_infos.ts +3 -3
- package/src/transports/smooth/isobmff/__tests__/create_boxes.test.ts +30 -28
- package/src/transports/utils/__tests__/check_isobmff_integrity.test.ts +38 -44
- package/src/utils/__tests__/array_find.test.ts +12 -12
- package/src/utils/__tests__/array_find_index.test.ts +13 -12
- package/src/utils/__tests__/array_includes.test.ts +7 -7
- package/src/utils/__tests__/assert.test.ts +19 -25
- package/src/utils/__tests__/base64.test.ts +18 -13
- package/src/utils/__tests__/event_emitter.test.ts +225 -50
- package/src/utils/__tests__/flat_map.test.ts +2 -6
- package/src/utils/__tests__/starts_with.test.ts +7 -8
- package/src/utils/array_find.ts +3 -7
- package/src/utils/array_find_index.ts +3 -7
- package/src/utils/array_includes.ts +1 -3
- package/src/utils/assert.ts +0 -2
- package/src/utils/base64.ts +3 -2
- package/src/utils/event_emitter.ts +1 -1
- package/src/utils/flat_map.ts +1 -2
- package/src/utils/id_generator.ts +0 -2
- package/src/utils/is_worker.ts +1 -1
- package/src/utils/logger.ts +1 -1
- package/src/utils/monotonic_timestamp.ts +2 -2
- package/src/utils/noop.ts +1 -2
- package/src/utils/object_assign.ts +1 -2
- package/src/utils/object_values.ts +1 -2
- package/src/utils/reference.ts +1 -1
- package/src/utils/request/xhr.ts +1 -1
- package/dist/commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
- package/dist/commonjs/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
- package/dist/es2017/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
- package/dist/es2017/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
|
@@ -1,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 IPublicAPI from "../public_api";
|
|
8
3
|
|
|
9
4
|
describe("API - Public API", () => {
|
|
10
5
|
beforeEach(() => {
|
|
@@ -14,14 +9,16 @@ describe("API - Public API", () => {
|
|
|
14
9
|
describe("static properties", () => {
|
|
15
10
|
describe("ErrorTypes", () => {
|
|
16
11
|
it("should expose static ErrorTypes property", async () => {
|
|
17
|
-
const PublicAPI = (
|
|
12
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
13
|
+
.default as typeof IPublicAPI;
|
|
18
14
|
expect(typeof PublicAPI.ErrorTypes).toBe("object");
|
|
19
15
|
});
|
|
20
16
|
});
|
|
21
17
|
|
|
22
18
|
describe("ErrorCodes", () => {
|
|
23
19
|
it("should expose static ErrorCodes property", async () => {
|
|
24
|
-
const PublicAPI = (
|
|
20
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
21
|
+
.default as typeof IPublicAPI;
|
|
25
22
|
expect(typeof PublicAPI.ErrorTypes).toBe("object");
|
|
26
23
|
});
|
|
27
24
|
});
|
|
@@ -30,7 +27,8 @@ describe("API - Public API", () => {
|
|
|
30
27
|
describe("public methods", () => {
|
|
31
28
|
describe("getError", () => {
|
|
32
29
|
it("should have no error by default", async () => {
|
|
33
|
-
const PublicAPI = (
|
|
30
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
31
|
+
.default as typeof IPublicAPI;
|
|
34
32
|
const player = new PublicAPI();
|
|
35
33
|
expect(player.getError()).toBe(null);
|
|
36
34
|
});
|
|
@@ -38,7 +36,8 @@ describe("API - Public API", () => {
|
|
|
38
36
|
|
|
39
37
|
describe("getPlayerState", () => {
|
|
40
38
|
it('should return "STOPPED" in getPlayerState by default', async () => {
|
|
41
|
-
const PublicAPI = (
|
|
39
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
40
|
+
.default as typeof IPublicAPI;
|
|
42
41
|
const player = new PublicAPI();
|
|
43
42
|
expect(player.getPlayerState()).toBe("STOPPED");
|
|
44
43
|
});
|
|
@@ -46,7 +45,8 @@ describe("API - Public API", () => {
|
|
|
46
45
|
|
|
47
46
|
describe("isLive", () => {
|
|
48
47
|
it("should return false in isLive by default", async () => {
|
|
49
|
-
const PublicAPI = (
|
|
48
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
49
|
+
.default as typeof IPublicAPI;
|
|
50
50
|
const player = new PublicAPI();
|
|
51
51
|
expect(player.isLive()).toBe(false);
|
|
52
52
|
});
|
|
@@ -54,7 +54,8 @@ describe("API - Public API", () => {
|
|
|
54
54
|
|
|
55
55
|
describe("getContentUrls", () => {
|
|
56
56
|
it("should return undefined in getContentUrls by default", async () => {
|
|
57
|
-
const PublicAPI = (
|
|
57
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
58
|
+
.default as typeof IPublicAPI;
|
|
58
59
|
const player = new PublicAPI();
|
|
59
60
|
expect(player.getContentUrls()).toBe(undefined);
|
|
60
61
|
});
|
|
@@ -62,7 +63,8 @@ describe("API - Public API", () => {
|
|
|
62
63
|
|
|
63
64
|
describe("getMediaDuration", () => {
|
|
64
65
|
it("should return the video element initial duration in getMediaDuration by default", async () => {
|
|
65
|
-
const PublicAPI = (
|
|
66
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
67
|
+
.default as typeof IPublicAPI;
|
|
66
68
|
const player = new PublicAPI();
|
|
67
69
|
|
|
68
70
|
// ! HAHA ! NaN is not === to NaN
|
|
@@ -76,7 +78,8 @@ describe("API - Public API", () => {
|
|
|
76
78
|
|
|
77
79
|
describe("getCurrentBufferGap", () => {
|
|
78
80
|
it("should return 0 in getCurrentBufferGap by default", async () => {
|
|
79
|
-
const PublicAPI = (
|
|
81
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
82
|
+
.default as typeof IPublicAPI;
|
|
80
83
|
const player = new PublicAPI();
|
|
81
84
|
expect(player.getCurrentBufferGap()).toBe(0);
|
|
82
85
|
});
|
|
@@ -84,7 +87,8 @@ describe("API - Public API", () => {
|
|
|
84
87
|
|
|
85
88
|
describe("getWallClockTime", () => {
|
|
86
89
|
it("should return 0 in getWallClockTime by default", async () => {
|
|
87
|
-
const PublicAPI = (
|
|
90
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
91
|
+
.default as typeof IPublicAPI;
|
|
88
92
|
const player = new PublicAPI();
|
|
89
93
|
expect(player.getWallClockTime()).toBe(0);
|
|
90
94
|
});
|
|
@@ -92,7 +96,8 @@ describe("API - Public API", () => {
|
|
|
92
96
|
|
|
93
97
|
describe("getPosition", () => {
|
|
94
98
|
it("should return 0 in getPosition by default", async () => {
|
|
95
|
-
const PublicAPI = (
|
|
99
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
100
|
+
.default as typeof IPublicAPI;
|
|
96
101
|
const player = new PublicAPI();
|
|
97
102
|
expect(player.getPosition()).toBe(0);
|
|
98
103
|
});
|
|
@@ -100,7 +105,8 @@ describe("API - Public API", () => {
|
|
|
100
105
|
|
|
101
106
|
describe("getPlaybackRate", () => {
|
|
102
107
|
it("should return 1 in getPlaybackRate by default", async () => {
|
|
103
|
-
const PublicAPI = (
|
|
108
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
109
|
+
.default as typeof IPublicAPI;
|
|
104
110
|
const player = new PublicAPI();
|
|
105
111
|
expect(player.getPlaybackRate()).toBe(1);
|
|
106
112
|
});
|
|
@@ -108,7 +114,8 @@ describe("API - Public API", () => {
|
|
|
108
114
|
|
|
109
115
|
describe("getVolume", () => {
|
|
110
116
|
it("should return 1 in getVolume by default", async () => {
|
|
111
|
-
const PublicAPI = (
|
|
117
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
118
|
+
.default as typeof IPublicAPI;
|
|
112
119
|
const player = new PublicAPI();
|
|
113
120
|
expect(player.getVolume()).toBe(1);
|
|
114
121
|
});
|
|
@@ -116,7 +123,8 @@ describe("API - Public API", () => {
|
|
|
116
123
|
|
|
117
124
|
describe("getVideoRepresentation", () => {
|
|
118
125
|
it("should return undefined in getVideoRepresentation by default", async () => {
|
|
119
|
-
const PublicAPI = (
|
|
126
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
127
|
+
.default as typeof IPublicAPI;
|
|
120
128
|
const player = new PublicAPI();
|
|
121
129
|
expect(player.getVideoRepresentation()).toBe(undefined);
|
|
122
130
|
});
|
|
@@ -124,7 +132,8 @@ describe("API - Public API", () => {
|
|
|
124
132
|
|
|
125
133
|
describe("getAudioRepresentation", () => {
|
|
126
134
|
it("should return undefined in getAudioRepresentation by default", async () => {
|
|
127
|
-
const PublicAPI = (
|
|
135
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
136
|
+
.default as typeof IPublicAPI;
|
|
128
137
|
const player = new PublicAPI();
|
|
129
138
|
expect(player.getAudioRepresentation()).toBe(undefined);
|
|
130
139
|
});
|
|
@@ -132,7 +141,8 @@ describe("API - Public API", () => {
|
|
|
132
141
|
|
|
133
142
|
describe("getWantedBufferAhead", () => {
|
|
134
143
|
it("should return 30 in getWantedBufferAhead by default", async () => {
|
|
135
|
-
const PublicAPI = (
|
|
144
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
145
|
+
.default as typeof IPublicAPI;
|
|
136
146
|
const player = new PublicAPI();
|
|
137
147
|
expect(player.getWantedBufferAhead()).toBe(30);
|
|
138
148
|
});
|
|
@@ -140,7 +150,8 @@ describe("API - Public API", () => {
|
|
|
140
150
|
|
|
141
151
|
describe("getMaxBufferBehind", () => {
|
|
142
152
|
it("should return Infinity in getMaxBufferBehind by default", async () => {
|
|
143
|
-
const PublicAPI = (
|
|
153
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
154
|
+
.default as typeof IPublicAPI;
|
|
144
155
|
const player = new PublicAPI();
|
|
145
156
|
expect(player.getMaxBufferBehind()).toBe(Infinity);
|
|
146
157
|
});
|
|
@@ -148,7 +159,8 @@ describe("API - Public API", () => {
|
|
|
148
159
|
|
|
149
160
|
describe("getMaxBufferAhead", () => {
|
|
150
161
|
it("should return Infinity in getMaxBufferAhead by default", async () => {
|
|
151
|
-
const PublicAPI = (
|
|
162
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
163
|
+
.default as typeof IPublicAPI;
|
|
152
164
|
const player = new PublicAPI();
|
|
153
165
|
expect(player.getMaxBufferAhead()).toBe(Infinity);
|
|
154
166
|
});
|
|
@@ -156,7 +168,8 @@ describe("API - Public API", () => {
|
|
|
156
168
|
|
|
157
169
|
describe("getPlaybackRate/setPlaybackRate", () => {
|
|
158
170
|
it("should allow to change the playback rate through setPlaybackRate", async () => {
|
|
159
|
-
const PublicAPI = (
|
|
171
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
172
|
+
.default as typeof IPublicAPI;
|
|
160
173
|
const player = new PublicAPI();
|
|
161
174
|
player.setPlaybackRate(4);
|
|
162
175
|
expect(player.getPlaybackRate()).toBe(4);
|
|
@@ -180,7 +193,8 @@ describe("API - Public API", () => {
|
|
|
180
193
|
|
|
181
194
|
describe("seekTo", () => {
|
|
182
195
|
it("should throw in seekTo by default", async () => {
|
|
183
|
-
const PublicAPI = (
|
|
196
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
197
|
+
.default as typeof IPublicAPI;
|
|
184
198
|
const player = new PublicAPI();
|
|
185
199
|
expect(() => player.seekTo(10)).toThrow();
|
|
186
200
|
expect(() => player.seekTo(54)).toThrow();
|
|
@@ -192,13 +206,15 @@ describe("API - Public API", () => {
|
|
|
192
206
|
|
|
193
207
|
describe("getVolume/setVolume", () => {
|
|
194
208
|
it("should throw in setVolume by default if no volume has been given", async () => {
|
|
195
|
-
const PublicAPI = (
|
|
209
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
210
|
+
.default as typeof IPublicAPI;
|
|
196
211
|
const player = new PublicAPI();
|
|
197
212
|
expect(() => player.setVolume(5)).toThrow();
|
|
198
213
|
});
|
|
199
214
|
|
|
200
215
|
it("should set the volume in setVolume by default if a volume has been given", async () => {
|
|
201
|
-
const PublicAPI = (
|
|
216
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
217
|
+
.default as typeof IPublicAPI;
|
|
202
218
|
const player = new PublicAPI();
|
|
203
219
|
const videoElement = player.getVideoElement();
|
|
204
220
|
if (videoElement === null) {
|
|
@@ -217,7 +233,8 @@ describe("API - Public API", () => {
|
|
|
217
233
|
|
|
218
234
|
describe("mute/unMute/isMute", () => {
|
|
219
235
|
it("should keep the volume yet mute the media element in mute by default", async () => {
|
|
220
|
-
const PublicAPI = (
|
|
236
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
237
|
+
.default as typeof IPublicAPI;
|
|
221
238
|
const player = new PublicAPI();
|
|
222
239
|
const videoElement = player.getVideoElement();
|
|
223
240
|
if (videoElement === null) {
|
|
@@ -242,7 +259,8 @@ describe("API - Public API", () => {
|
|
|
242
259
|
});
|
|
243
260
|
|
|
244
261
|
it("should unmute without changing the volume in unMute by default", async () => {
|
|
245
|
-
const PublicAPI = (
|
|
262
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
263
|
+
.default as typeof IPublicAPI;
|
|
246
264
|
const player = new PublicAPI();
|
|
247
265
|
// back to a "normal" state.
|
|
248
266
|
player.unMute();
|
|
@@ -275,13 +293,15 @@ describe("API - Public API", () => {
|
|
|
275
293
|
});
|
|
276
294
|
|
|
277
295
|
it("should return false in isMute by default", async () => {
|
|
278
|
-
const PublicAPI = (
|
|
296
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
297
|
+
.default as typeof IPublicAPI;
|
|
279
298
|
const player = new PublicAPI();
|
|
280
299
|
expect(player.isMute()).toBe(false);
|
|
281
300
|
});
|
|
282
301
|
|
|
283
302
|
it("should not return true in isMute if just the volume is equal to 0", async () => {
|
|
284
|
-
const PublicAPI = (
|
|
303
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
304
|
+
.default as typeof IPublicAPI;
|
|
285
305
|
const player = new PublicAPI();
|
|
286
306
|
|
|
287
307
|
expect(player.isMute()).toBe(false);
|
|
@@ -293,7 +313,8 @@ describe("API - Public API", () => {
|
|
|
293
313
|
|
|
294
314
|
describe("getMaxBufferBehind/setMaxBufferBehind", () => {
|
|
295
315
|
it("should update the max buffer behind through setMaxBufferBehind by default", async () => {
|
|
296
|
-
const PublicAPI = (
|
|
316
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
317
|
+
.default as typeof IPublicAPI;
|
|
297
318
|
const player = new PublicAPI();
|
|
298
319
|
player.setMaxBufferBehind(50);
|
|
299
320
|
expect(player.getMaxBufferBehind()).toBe(50);
|
|
@@ -305,7 +326,8 @@ describe("API - Public API", () => {
|
|
|
305
326
|
|
|
306
327
|
describe("getMaxBufferAhead/setMaxBufferAhead", () => {
|
|
307
328
|
it("should update the max buffer behind through setMaxBufferAhead by default", async () => {
|
|
308
|
-
const PublicAPI = (
|
|
329
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
330
|
+
.default as typeof IPublicAPI;
|
|
309
331
|
const player = new PublicAPI();
|
|
310
332
|
player.setMaxBufferAhead(50);
|
|
311
333
|
expect(player.getMaxBufferAhead()).toBe(50);
|
|
@@ -317,7 +339,8 @@ describe("API - Public API", () => {
|
|
|
317
339
|
|
|
318
340
|
describe("getWantedBufferAhead/setWantedBufferAhead", () => {
|
|
319
341
|
it("should update the buffer goal through setWantedBufferAhead by default", async () => {
|
|
320
|
-
const PublicAPI = (
|
|
342
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
343
|
+
.default as typeof IPublicAPI;
|
|
321
344
|
const player = new PublicAPI();
|
|
322
345
|
player.setWantedBufferAhead(50);
|
|
323
346
|
expect(player.getWantedBufferAhead()).toBe(50);
|
|
@@ -329,7 +352,8 @@ describe("API - Public API", () => {
|
|
|
329
352
|
|
|
330
353
|
describe("getAvailableAudioTracks", () => {
|
|
331
354
|
it("should return an empty array through getAvailableAudioTracks by default", async () => {
|
|
332
|
-
const PublicAPI = (
|
|
355
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
356
|
+
.default as typeof IPublicAPI;
|
|
333
357
|
const player = new PublicAPI();
|
|
334
358
|
expect(player.getAvailableAudioTracks()).toEqual([]);
|
|
335
359
|
});
|
|
@@ -337,7 +361,8 @@ describe("API - Public API", () => {
|
|
|
337
361
|
|
|
338
362
|
describe("getAvailableTextTracks", () => {
|
|
339
363
|
it("should return an empty array through getAvailableTextTracks by default", async () => {
|
|
340
|
-
const PublicAPI = (
|
|
364
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
365
|
+
.default as typeof IPublicAPI;
|
|
341
366
|
const player = new PublicAPI();
|
|
342
367
|
expect(player.getAvailableTextTracks()).toEqual([]);
|
|
343
368
|
});
|
|
@@ -345,7 +370,8 @@ describe("API - Public API", () => {
|
|
|
345
370
|
|
|
346
371
|
describe("getAvailableVideoTracks", () => {
|
|
347
372
|
it("should return an empty array through getAvailableVideoTracks by default", async () => {
|
|
348
|
-
const PublicAPI = (
|
|
373
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
374
|
+
.default as typeof IPublicAPI;
|
|
349
375
|
const player = new PublicAPI();
|
|
350
376
|
expect(player.getAvailableVideoTracks()).toEqual([]);
|
|
351
377
|
});
|
|
@@ -353,7 +379,8 @@ describe("API - Public API", () => {
|
|
|
353
379
|
|
|
354
380
|
describe("getAudioTrack", () => {
|
|
355
381
|
it("should return undefined through getAudioTrack by default", async () => {
|
|
356
|
-
const PublicAPI = (
|
|
382
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
383
|
+
.default as typeof IPublicAPI;
|
|
357
384
|
const player = new PublicAPI();
|
|
358
385
|
expect(player.getAudioTrack()).toBe(undefined);
|
|
359
386
|
});
|
|
@@ -361,7 +388,8 @@ describe("API - Public API", () => {
|
|
|
361
388
|
|
|
362
389
|
describe("getTextTrack", () => {
|
|
363
390
|
it("should return undefined through getTextTrack by default", async () => {
|
|
364
|
-
const PublicAPI = (
|
|
391
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
392
|
+
.default as typeof IPublicAPI;
|
|
365
393
|
const player = new PublicAPI();
|
|
366
394
|
expect(player.getTextTrack()).toBe(undefined);
|
|
367
395
|
});
|
|
@@ -369,7 +397,8 @@ describe("API - Public API", () => {
|
|
|
369
397
|
|
|
370
398
|
describe("getVideoTrack", () => {
|
|
371
399
|
it("should return undefined through getVideoTrack by default", async () => {
|
|
372
|
-
const PublicAPI = (
|
|
400
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
401
|
+
.default as typeof IPublicAPI;
|
|
373
402
|
const player = new PublicAPI();
|
|
374
403
|
expect(player.getVideoTrack()).toBe(undefined);
|
|
375
404
|
});
|
|
@@ -377,7 +406,8 @@ describe("API - Public API", () => {
|
|
|
377
406
|
|
|
378
407
|
describe("setAudioTrack", () => {
|
|
379
408
|
it("should throw in setAudioTrack by default", async () => {
|
|
380
|
-
const PublicAPI = (
|
|
409
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
410
|
+
.default as typeof IPublicAPI;
|
|
381
411
|
const player = new PublicAPI();
|
|
382
412
|
expect(() => player.setAudioTrack("a")).toThrow();
|
|
383
413
|
expect(() => player.setAudioTrack("test")).toThrow();
|
|
@@ -386,7 +416,8 @@ describe("API - Public API", () => {
|
|
|
386
416
|
|
|
387
417
|
describe("setTextTrack", () => {
|
|
388
418
|
it("should throw in setTextTrack by default", async () => {
|
|
389
|
-
const PublicAPI = (
|
|
419
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
420
|
+
.default as typeof IPublicAPI;
|
|
390
421
|
const player = new PublicAPI();
|
|
391
422
|
expect(() => player.setTextTrack("a")).toThrow();
|
|
392
423
|
expect(() => player.setTextTrack("test")).toThrow();
|
|
@@ -395,7 +426,8 @@ describe("API - Public API", () => {
|
|
|
395
426
|
|
|
396
427
|
describe("setVideoTrack", () => {
|
|
397
428
|
it("should throw in setVideoTrack by default", async () => {
|
|
398
|
-
const PublicAPI = (
|
|
429
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
430
|
+
.default as typeof IPublicAPI;
|
|
399
431
|
const player = new PublicAPI();
|
|
400
432
|
expect(() => player.setVideoTrack("a")).toThrow();
|
|
401
433
|
expect(() => player.setVideoTrack("test")).toThrow();
|
|
@@ -404,7 +436,8 @@ describe("API - Public API", () => {
|
|
|
404
436
|
|
|
405
437
|
describe("disableTextTrack", () => {
|
|
406
438
|
it("should disable text tracks in disableTextTrack by default", async () => {
|
|
407
|
-
const PublicAPI = (
|
|
439
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
440
|
+
.default as typeof IPublicAPI;
|
|
408
441
|
const player = new PublicAPI();
|
|
409
442
|
player.disableTextTrack();
|
|
410
443
|
expect(player.getTextTrack()).toBe(undefined);
|
|
@@ -413,7 +446,8 @@ describe("API - Public API", () => {
|
|
|
413
446
|
|
|
414
447
|
describe("getMinimumPosition", () => {
|
|
415
448
|
it("should return null in getMinimumPosition by default", async () => {
|
|
416
|
-
const PublicAPI = (
|
|
449
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
450
|
+
.default as typeof IPublicAPI;
|
|
417
451
|
const player = new PublicAPI();
|
|
418
452
|
expect(player.getMinimumPosition()).toBe(null);
|
|
419
453
|
});
|
|
@@ -421,7 +455,8 @@ describe("API - Public API", () => {
|
|
|
421
455
|
|
|
422
456
|
describe("getMaximumPosition", () => {
|
|
423
457
|
it("should return null in getMaximumPosition by default", async () => {
|
|
424
|
-
const PublicAPI = (
|
|
458
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
459
|
+
.default as typeof IPublicAPI;
|
|
425
460
|
const player = new PublicAPI();
|
|
426
461
|
expect(player.getMinimumPosition()).toBe(null);
|
|
427
462
|
});
|
|
@@ -429,7 +464,8 @@ describe("API - Public API", () => {
|
|
|
429
464
|
|
|
430
465
|
describe("Player instantiation", () => {
|
|
431
466
|
it("should log a warning if creating two players attached to the same video element", async () => {
|
|
432
|
-
const PublicAPI = (
|
|
467
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
468
|
+
.default as typeof IPublicAPI;
|
|
433
469
|
const warn = vi.spyOn(console, "warn").mockImplementation(vi.fn());
|
|
434
470
|
const videoElement = document.createElement("video");
|
|
435
471
|
const player1 = new PublicAPI({ videoElement });
|
|
@@ -457,7 +493,8 @@ describe("API - Public API", () => {
|
|
|
457
493
|
|
|
458
494
|
it(`should not log a warning if creating a player attached to
|
|
459
495
|
the same video element after the previous one was disposed`, async () => {
|
|
460
|
-
const PublicAPI = (
|
|
496
|
+
const PublicAPI = (await vi.importActual("../public_api"))
|
|
497
|
+
.default as typeof IPublicAPI;
|
|
461
498
|
const warn = vi.spyOn(console, "warn").mockImplementation(vi.fn());
|
|
462
499
|
const videoElement = document.createElement("video");
|
|
463
500
|
const player1 = new PublicAPI({ videoElement });
|
|
@@ -433,15 +433,11 @@ function parseLoadVideoOptions(options: ILoadVideoOptions): IParsedLoadVideoOpti
|
|
|
433
433
|
|
|
434
434
|
// All those eslint disable are needed because the option is voluntarily
|
|
435
435
|
// hidden from the base type to limit discovery of this hidden API.
|
|
436
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
437
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
438
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
439
436
|
return {
|
|
437
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
440
438
|
__priv_patchLastSegmentInSidx: (options as any).__priv_patchLastSegmentInSidx,
|
|
439
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
441
440
|
__priv_manifestUpdateUrl: (options as any).__priv_manifestUpdateUrl,
|
|
442
|
-
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
443
|
-
/* eslint-enable @typescript-eslint/no-unsafe-assignment */
|
|
444
|
-
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
|
|
445
441
|
checkMediaSegmentIntegrity: options.checkMediaSegmentIntegrity,
|
|
446
442
|
checkManifestIntegrity: options.checkManifestIntegrity,
|
|
447
443
|
autoPlay,
|
|
@@ -409,7 +409,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
409
409
|
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
|
|
410
410
|
videoElement.preload = "auto";
|
|
411
411
|
|
|
412
|
-
this.version = /* PLAYER_VERSION */ "4.2.0-dev.
|
|
412
|
+
this.version = /* PLAYER_VERSION */ "4.2.0-dev.2024090500";
|
|
413
413
|
this.log = log;
|
|
414
414
|
this.state = "STOPPED";
|
|
415
415
|
this.videoElement = videoElement;
|
|
@@ -1131,11 +1131,12 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
1131
1131
|
.getValue()
|
|
1132
1132
|
.position.getPolled();
|
|
1133
1133
|
break;
|
|
1134
|
-
default:
|
|
1134
|
+
default: {
|
|
1135
1135
|
const o = playbackObserver.getReference().getValue();
|
|
1136
1136
|
this._priv_reloadingMetadata.reloadInPause = o.paused;
|
|
1137
1137
|
this._priv_reloadingMetadata.reloadPosition = o.position.getWanted();
|
|
1138
1138
|
break;
|
|
1139
|
+
}
|
|
1139
1140
|
}
|
|
1140
1141
|
};
|
|
1141
1142
|
|
|
@@ -1277,11 +1278,11 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
1277
1278
|
* @returns {HTMLMediaElement|null} - The HTMLMediaElement used (`null` when
|
|
1278
1279
|
* disposed)
|
|
1279
1280
|
*/
|
|
1280
|
-
|
|
1281
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-types
|
|
1281
1282
|
getVideoElement(): HTMLMediaElement | null {
|
|
1283
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-types
|
|
1282
1284
|
return this.videoElement as HTMLMediaElement;
|
|
1283
1285
|
}
|
|
1284
|
-
/* eslint-enable @typescript-eslint/no-restricted-types */
|
|
1285
1286
|
|
|
1286
1287
|
/**
|
|
1287
1288
|
* Returns the player's current state.
|
|
@@ -1616,9 +1617,8 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
1616
1617
|
}
|
|
1617
1618
|
|
|
1618
1619
|
const playPromise = this.videoElement.play();
|
|
1619
|
-
|
|
1620
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
1620
1621
|
if (isNullOrUndefined(playPromise) || typeof playPromise.catch !== "function") {
|
|
1621
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
1622
1622
|
return Promise.resolve();
|
|
1623
1623
|
}
|
|
1624
1624
|
return playPromise.catch((error: Error) => {
|
|
@@ -2097,7 +2097,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
2097
2097
|
const audioId = typeof arg === "string" ? arg : arg.trackId;
|
|
2098
2098
|
mediaElementTracksStore?.setAudioTrackById(audioId);
|
|
2099
2099
|
return;
|
|
2100
|
-
} catch (
|
|
2100
|
+
} catch (_e) {
|
|
2101
2101
|
throw new Error("player: unknown audio track");
|
|
2102
2102
|
}
|
|
2103
2103
|
}
|
|
@@ -2143,7 +2143,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
2143
2143
|
const textId = typeof arg === "string" ? arg : arg.trackId;
|
|
2144
2144
|
mediaElementTracksStore?.setTextTrackById(textId);
|
|
2145
2145
|
return;
|
|
2146
|
-
} catch (
|
|
2146
|
+
} catch (_e) {
|
|
2147
2147
|
throw new Error("player: unknown text track");
|
|
2148
2148
|
}
|
|
2149
2149
|
}
|
|
@@ -2195,7 +2195,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
2195
2195
|
const videoId = typeof arg === "string" ? arg : arg.trackId;
|
|
2196
2196
|
mediaElementTracksStore?.setVideoTrackById(videoId);
|
|
2197
2197
|
return;
|
|
2198
|
-
} catch (
|
|
2198
|
+
} catch (_e) {
|
|
2199
2199
|
throw new Error("player: unknown video track");
|
|
2200
2200
|
}
|
|
2201
2201
|
}
|
|
@@ -2925,7 +2925,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
2925
2925
|
return;
|
|
2926
2926
|
}
|
|
2927
2927
|
switch (type) {
|
|
2928
|
-
case "audio":
|
|
2928
|
+
case "audio": {
|
|
2929
2929
|
const audioTrack = tracksStore.getChosenAudioTrack(periodRef, true);
|
|
2930
2930
|
this._priv_triggerEventIfNotStopped(
|
|
2931
2931
|
"audioTrackChange",
|
|
@@ -2933,11 +2933,13 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
2933
2933
|
cancelSignal,
|
|
2934
2934
|
);
|
|
2935
2935
|
break;
|
|
2936
|
-
|
|
2936
|
+
}
|
|
2937
|
+
case "text": {
|
|
2937
2938
|
const textTrack = tracksStore.getChosenTextTrack(periodRef);
|
|
2938
2939
|
this._priv_triggerEventIfNotStopped("textTrackChange", textTrack, cancelSignal);
|
|
2939
2940
|
break;
|
|
2940
|
-
|
|
2941
|
+
}
|
|
2942
|
+
case "video": {
|
|
2941
2943
|
const videoTrack = tracksStore.getChosenVideoTrack(periodRef, true);
|
|
2942
2944
|
this._priv_triggerEventIfNotStopped(
|
|
2943
2945
|
"videoTrackChange",
|
|
@@ -2945,6 +2947,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
2945
2947
|
cancelSignal,
|
|
2946
2948
|
);
|
|
2947
2949
|
break;
|
|
2950
|
+
}
|
|
2948
2951
|
}
|
|
2949
2952
|
}
|
|
2950
2953
|
}
|
|
@@ -3028,9 +3031,9 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
3028
3031
|
}
|
|
3029
3032
|
this.trigger(
|
|
3030
3033
|
// !!! undocumented API :O !!!
|
|
3031
|
-
|
|
3034
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3032
3035
|
"__priv_bitrateEstimateChange" as any,
|
|
3033
|
-
|
|
3036
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3034
3037
|
{ type, bitrate } as any,
|
|
3035
3038
|
);
|
|
3036
3039
|
}
|
|
@@ -3249,7 +3252,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
3249
3252
|
return;
|
|
3250
3253
|
}
|
|
3251
3254
|
switch (trackType) {
|
|
3252
|
-
case "video":
|
|
3255
|
+
case "video": {
|
|
3253
3256
|
const videoTracks = tracksStore.getAvailableVideoTracks(periodRef, true);
|
|
3254
3257
|
this._priv_triggerEventIfNotStopped(
|
|
3255
3258
|
"availableVideoTracksChange",
|
|
@@ -3257,7 +3260,8 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
3257
3260
|
cancelSignal,
|
|
3258
3261
|
);
|
|
3259
3262
|
break;
|
|
3260
|
-
|
|
3263
|
+
}
|
|
3264
|
+
case "audio": {
|
|
3261
3265
|
const audioTracks = tracksStore.getAvailableAudioTracks(periodRef, true);
|
|
3262
3266
|
this._priv_triggerEventIfNotStopped(
|
|
3263
3267
|
"availableAudioTracksChange",
|
|
@@ -3265,7 +3269,8 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
3265
3269
|
cancelSignal,
|
|
3266
3270
|
);
|
|
3267
3271
|
break;
|
|
3268
|
-
|
|
3272
|
+
}
|
|
3273
|
+
case "text": {
|
|
3269
3274
|
const textTracks = tracksStore.getAvailableTextTracks(periodRef);
|
|
3270
3275
|
this._priv_triggerEventIfNotStopped(
|
|
3271
3276
|
"availableTextTracksChange",
|
|
@@ -3273,6 +3278,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
3273
3278
|
cancelSignal,
|
|
3274
3279
|
);
|
|
3275
3280
|
break;
|
|
3281
|
+
}
|
|
3276
3282
|
default:
|
|
3277
3283
|
assertUnreachable(trackType);
|
|
3278
3284
|
}
|
|
@@ -3307,7 +3313,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
3307
3313
|
}
|
|
3308
3314
|
}
|
|
3309
3315
|
}
|
|
3310
|
-
Player.version = /* PLAYER_VERSION */ "4.2.0-dev.
|
|
3316
|
+
Player.version = /* PLAYER_VERSION */ "4.2.0-dev.2024090500";
|
|
3311
3317
|
|
|
3312
3318
|
/** Every events sent by the RxPlayer's public API. */
|
|
3313
3319
|
interface IPublicAPIEvent {
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import { describe, afterEach, 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/restrict-template-expressions */
|
|
8
|
-
/* eslint-disable no-restricted-properties */
|
|
9
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10
|
-
|
|
11
|
-
import type { IPlayerError } from "../../../../public_types";
|
|
2
|
+
import type { IKeySystemOption, IPlayerError } from "../../../../public_types";
|
|
12
3
|
import { concat } from "../../../../utils/byte_parsing";
|
|
4
|
+
import type IContentDecryptor from "../../content_decryptor";
|
|
5
|
+
import type { ContentDecryptorState as IContentDecryptorState } from "../../types";
|
|
13
6
|
import {
|
|
14
7
|
formatFakeChallengeFromInitData,
|
|
15
8
|
MediaKeySessionImpl,
|
|
@@ -315,7 +308,7 @@ async function checkGetLicense({
|
|
|
315
308
|
vi.spyOn(MediaKeysImpl.prototype, "createSession").mockReturnValue(mediaKeySession);
|
|
316
309
|
const mockUpdate = vi.spyOn(mediaKeySession, "update");
|
|
317
310
|
let remainingRetries = nbRetries;
|
|
318
|
-
const mockGetLicense = vi.fn(() => {
|
|
311
|
+
const mockGetLicense = vi.fn((): BufferSource | Promise<BufferSource | null> | null => {
|
|
319
312
|
const callIdx = nbRetries - remainingRetries;
|
|
320
313
|
const timeout = getTimeout(callIdx);
|
|
321
314
|
if (remainingRetries === 0) {
|
|
@@ -342,16 +335,17 @@ async function checkGetLicense({
|
|
|
342
335
|
return Promise.reject(new Error("AAAA"));
|
|
343
336
|
});
|
|
344
337
|
mockCompat();
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
|
|
338
|
+
const ContentDecryptorState = (await vi.importActual("../../types"))
|
|
339
|
+
.ContentDecryptorState as typeof IContentDecryptorState;
|
|
340
|
+
const ContentDecryptor = (await vi.importActual("../../content_decryptor"))
|
|
341
|
+
.default as typeof IContentDecryptor;
|
|
348
342
|
return new Promise((res, rej) => {
|
|
349
343
|
// == vars ==
|
|
350
344
|
/** Default keySystems configuration used in our tests. */
|
|
351
345
|
const maxRetries = configuredRetries === undefined ? 2 : configuredRetries;
|
|
352
346
|
const shouldFail = nbRetries > maxRetries;
|
|
353
347
|
let warningsLeft = nbRetries;
|
|
354
|
-
const ksConfig = [
|
|
348
|
+
const ksConfig: IKeySystemOption[] = [
|
|
355
349
|
{
|
|
356
350
|
type: "com.widevine.alpha",
|
|
357
351
|
getLicense: mockGetLicense,
|
|
@@ -384,7 +378,7 @@ async function checkGetLicense({
|
|
|
384
378
|
contentDecryptor.attach();
|
|
385
379
|
});
|
|
386
380
|
|
|
387
|
-
contentDecryptor.addEventListener("error", (error:
|
|
381
|
+
contentDecryptor.addEventListener("error", (error: Error) => {
|
|
388
382
|
if (shouldFail) {
|
|
389
383
|
try {
|
|
390
384
|
checkKeyLoadError(error);
|
|
@@ -404,7 +398,7 @@ async function checkGetLicense({
|
|
|
404
398
|
rej(e);
|
|
405
399
|
}
|
|
406
400
|
} else {
|
|
407
|
-
rej(new Error(`Unexpected error: ${error}`));
|
|
401
|
+
rej(new Error(`Unexpected error: ${error.toString()}`));
|
|
408
402
|
}
|
|
409
403
|
});
|
|
410
404
|
|
|
@@ -425,7 +419,7 @@ async function checkGetLicense({
|
|
|
425
419
|
rej(e);
|
|
426
420
|
}
|
|
427
421
|
} else {
|
|
428
|
-
rej(new Error(`Unexpected warning: ${warning}`));
|
|
422
|
+
rej(new Error(`Unexpected warning: ${warning.toString()}`));
|
|
429
423
|
}
|
|
430
424
|
});
|
|
431
425
|
|