rx-player 4.2.0-dev.2024090300 → 4.2.0-dev.2024090500
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/VERSION +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/commonjs/compat/add_class_name.d.ts.map +1 -1
- package/dist/commonjs/compat/add_class_name.js +1 -2
- package/dist/commonjs/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/commonjs/compat/browser_compatibility_types.js +4 -1
- package/dist/commonjs/compat/clear_element_src.js +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
- package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
- package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
- package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
- package/dist/commonjs/compat/eme/eme-api-implementation.js +0 -2
- package/dist/commonjs/compat/event_listeners.d.ts.map +1 -1
- package/dist/commonjs/compat/event_listeners.js +2 -6
- package/dist/commonjs/compat/has_mse_in_worker.js +1 -1
- package/dist/commonjs/compat/is_codec_supported.d.ts.map +1 -1
- package/dist/commonjs/compat/is_codec_supported.js +0 -2
- package/dist/commonjs/compat/is_vtt_cue.d.ts.map +1 -1
- package/dist/commonjs/compat/is_vtt_cue.js +1 -2
- package/dist/commonjs/compat/on_height_width_change.d.ts.map +1 -1
- package/dist/commonjs/compat/patch_webkit_source_buffer.d.ts.map +1 -1
- package/dist/commonjs/compat/patch_webkit_source_buffer.js +8 -18
- package/dist/commonjs/compat/remove_cue.js +2 -2
- package/dist/commonjs/core/fetchers/index.d.ts +4 -4
- package/dist/commonjs/core/fetchers/index.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/index.js +2 -2
- package/dist/commonjs/core/fetchers/segment/index.d.ts +6 -5
- package/dist/commonjs/core/fetchers/segment/index.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/segment/index.js +2 -2
- package/dist/{es2017/core/stream/representation/utils/downloading_queue.d.ts → commonjs/core/fetchers/segment/segment_queue.d.ts} +63 -80
- package/dist/commonjs/core/fetchers/segment/segment_queue.d.ts.map +1 -0
- package/dist/commonjs/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +132 -111
- package/dist/commonjs/core/fetchers/segment/{segment_fetcher_creator.d.ts → segment_queue_creator.d.ts} +25 -12
- package/dist/commonjs/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
- package/dist/commonjs/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +15 -9
- package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts +9 -0
- package/dist/commonjs/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/segment/task_prioritizer.js +38 -8
- package/dist/commonjs/core/fetchers/utils/schedule_request.js +1 -1
- package/dist/commonjs/core/main/common/content_time_boundaries_observer.js +21 -10
- package/dist/commonjs/core/main/worker/content_preparer.d.ts +3 -3
- package/dist/commonjs/core/main/worker/content_preparer.d.ts.map +1 -1
- package/dist/commonjs/core/main/worker/content_preparer.js +2 -2
- package/dist/commonjs/core/main/worker/send_message.js +1 -1
- package/dist/commonjs/core/main/worker/worker_main.js +2 -2
- package/dist/commonjs/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
- package/dist/commonjs/core/segment_sinks/inventory/segment_inventory.js +39 -30
- package/dist/commonjs/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
- package/dist/commonjs/core/segment_sinks/segment_buffers_store.js +3 -2
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +3 -3
- package/dist/commonjs/core/stream/adaptation/types.d.ts +2 -2
- package/dist/commonjs/core/stream/adaptation/types.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/get_time_ranges_for_content.js +27 -6
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +3 -3
- package/dist/commonjs/core/stream/period/period_stream.d.ts +1 -1
- package/dist/commonjs/core/stream/period/period_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/period/period_stream.js +2 -2
- package/dist/commonjs/core/stream/period/types.d.ts +2 -2
- package/dist/commonjs/core/stream/period/types.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.d.ts +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.js +19 -28
- package/dist/commonjs/core/stream/representation/types.d.ts +2 -2
- package/dist/commonjs/core/stream/representation/types.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +39 -18
- package/dist/commonjs/core/types.d.ts +2 -2
- package/dist/commonjs/core/types.d.ts.map +1 -1
- package/dist/commonjs/default_config.d.ts.map +1 -1
- package/dist/commonjs/default_config.js +0 -8
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
- package/dist/commonjs/features/add_features.d.ts.map +1 -1
- package/dist/commonjs/features/add_features.js +31 -10
- package/dist/commonjs/main_thread/api/option_utils.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/option_utils.js +2 -6
- package/dist/commonjs/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/public_api.js +33 -27
- package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/utils/persistent_sessions_store.js +4 -3
- package/dist/commonjs/main_thread/init/media_source_content_initializer.js +6 -6
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +32 -37
- package/dist/commonjs/main_thread/text_displayer/html/html_text_displayer.js +1 -5
- package/dist/commonjs/main_thread/text_displayer/native/native_text_displayer.js +3 -7
- package/dist/commonjs/main_thread/tracks_store/track_dispatcher.js +1 -1
- package/dist/commonjs/main_thread/types.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/manifest.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/manifest.js +0 -6
- package/dist/commonjs/manifest/utils.d.ts.map +1 -1
- package/dist/commonjs/manifest/utils.js +72 -62
- package/dist/commonjs/mse/main_media_source_interface.js +1 -1
- package/dist/commonjs/multithread_types.d.ts +2 -2
- package/dist/commonjs/multithread_types.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
- package/dist/commonjs/parsers/manifest/local/representation_index.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/local/representation_index.js +29 -8
- package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.js +31 -10
- package/dist/commonjs/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/smooth/create_parser.js +2 -1
- package/dist/commonjs/parsers/manifest/smooth/shared_smooth_segment_timeline.js +26 -4
- package/dist/commonjs/parsers/manifest/utils/get_first_time_from_adaptation.js +29 -7
- package/dist/commonjs/parsers/manifest/utils/get_last_time_from_adaptation.js +29 -7
- package/dist/commonjs/parsers/texttracks/srt/html.js +28 -6
- package/dist/commonjs/parsers/texttracks/ttml/html/create_element.js +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/html/parse_ttml_to_div.js +29 -7
- package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +26 -5
- package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/resolve_styles_inheritance.js +25 -4
- package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
- package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/webvtt/html/to_html.js +9 -3
- package/dist/commonjs/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +30 -8
- package/dist/commonjs/public_types.d.ts +5 -7
- package/dist/commonjs/public_types.d.ts.map +1 -1
- package/dist/commonjs/transports/smooth/extract_timings_infos.js +30 -8
- package/dist/commonjs/utils/array_find.d.ts +1 -1
- package/dist/commonjs/utils/array_find.d.ts.map +1 -1
- package/dist/commonjs/utils/array_find.js +3 -1
- package/dist/commonjs/utils/array_find_index.d.ts +1 -1
- package/dist/commonjs/utils/array_find_index.d.ts.map +1 -1
- package/dist/commonjs/utils/array_find_index.js +3 -1
- package/dist/commonjs/utils/array_includes.d.ts.map +1 -1
- package/dist/commonjs/utils/array_includes.js +1 -3
- package/dist/commonjs/utils/assert.d.ts.map +1 -1
- package/dist/commonjs/utils/assert.js +0 -2
- package/dist/commonjs/utils/base64.d.ts +1 -1
- package/dist/commonjs/utils/base64.d.ts.map +1 -1
- package/dist/commonjs/utils/base64.js +3 -2
- package/dist/commonjs/utils/event_emitter.js +1 -1
- package/dist/commonjs/utils/flat_map.d.ts.map +1 -1
- package/dist/commonjs/utils/flat_map.js +1 -2
- package/dist/commonjs/utils/id_generator.d.ts.map +1 -1
- package/dist/commonjs/utils/id_generator.js +0 -1
- package/dist/commonjs/utils/logger.js +1 -1
- package/dist/commonjs/utils/monotonic_timestamp.js +2 -2
- package/dist/commonjs/utils/noop.js +1 -2
- package/dist/commonjs/utils/object_assign.d.ts.map +1 -1
- package/dist/commonjs/utils/object_assign.js +27 -6
- package/dist/commonjs/utils/object_values.d.ts.map +1 -1
- package/dist/commonjs/utils/object_values.js +1 -1
- package/dist/commonjs/utils/reference.js +1 -1
- package/dist/commonjs/utils/request/xhr.js +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/es2017/compat/add_class_name.d.ts.map +1 -1
- package/dist/es2017/compat/add_class_name.js +1 -2
- package/dist/es2017/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/es2017/compat/browser_compatibility_types.js +4 -1
- package/dist/es2017/compat/clear_element_src.js +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/moz_media_keys_constructor.js +2 -4
- package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/ms_media_keys_constructor.js +2 -4
- package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/old_webkit_media_keys.js +3 -6
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.js +2 -17
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts.map +1 -1
- package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +1 -2
- package/dist/es2017/compat/eme/eme-api-implementation.js +0 -2
- package/dist/es2017/compat/event_listeners.d.ts.map +1 -1
- package/dist/es2017/compat/event_listeners.js +2 -6
- package/dist/es2017/compat/has_mse_in_worker.js +1 -1
- package/dist/es2017/compat/is_codec_supported.d.ts.map +1 -1
- package/dist/es2017/compat/is_codec_supported.js +0 -2
- package/dist/es2017/compat/is_vtt_cue.d.ts.map +1 -1
- package/dist/es2017/compat/is_vtt_cue.js +1 -2
- package/dist/es2017/compat/on_height_width_change.d.ts.map +1 -1
- package/dist/es2017/compat/patch_webkit_source_buffer.d.ts.map +1 -1
- package/dist/es2017/compat/patch_webkit_source_buffer.js +8 -18
- package/dist/es2017/compat/remove_cue.js +2 -2
- package/dist/es2017/core/fetchers/index.d.ts +4 -4
- package/dist/es2017/core/fetchers/index.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/index.js +2 -2
- package/dist/es2017/core/fetchers/segment/index.d.ts +6 -5
- package/dist/es2017/core/fetchers/segment/index.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/segment/index.js +2 -2
- package/dist/{commonjs/core/stream/representation/utils/downloading_queue.d.ts → es2017/core/fetchers/segment/segment_queue.d.ts} +63 -80
- package/dist/es2017/core/fetchers/segment/segment_queue.d.ts.map +1 -0
- package/dist/es2017/core/{stream/representation/utils/downloading_queue.js → fetchers/segment/segment_queue.js} +126 -105
- package/dist/es2017/core/fetchers/segment/{segment_fetcher_creator.d.ts → segment_queue_creator.d.ts} +25 -12
- package/dist/es2017/core/fetchers/segment/segment_queue_creator.d.ts.map +1 -0
- package/dist/es2017/core/fetchers/segment/{segment_fetcher_creator.js → segment_queue_creator.js} +12 -6
- package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts +9 -0
- package/dist/es2017/core/fetchers/segment/task_prioritizer.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/segment/task_prioritizer.js +10 -2
- package/dist/es2017/core/fetchers/utils/schedule_request.js +1 -1
- package/dist/es2017/core/main/common/content_time_boundaries_observer.js +4 -4
- package/dist/es2017/core/main/worker/content_preparer.d.ts +3 -3
- package/dist/es2017/core/main/worker/content_preparer.d.ts.map +1 -1
- package/dist/es2017/core/main/worker/content_preparer.js +3 -3
- package/dist/es2017/core/main/worker/send_message.js +1 -1
- package/dist/es2017/core/main/worker/worker_main.js +2 -2
- package/dist/es2017/core/segment_sinks/implementations/text/text_segment_buffer.js +1 -5
- package/dist/es2017/core/segment_sinks/inventory/segment_inventory.js +1 -2
- package/dist/es2017/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
- package/dist/es2017/core/segment_sinks/segment_buffers_store.js +3 -2
- package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.js +3 -3
- package/dist/es2017/core/stream/adaptation/types.d.ts +2 -2
- package/dist/es2017/core/stream/adaptation/types.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/get_time_ranges_for_content.js +1 -2
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts +3 -3
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.d.ts.map +1 -1
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +3 -3
- package/dist/es2017/core/stream/period/period_stream.d.ts +1 -1
- package/dist/es2017/core/stream/period/period_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/period/period_stream.js +2 -2
- package/dist/es2017/core/stream/period/types.d.ts +2 -2
- package/dist/es2017/core/stream/period/types.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.d.ts +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.js +19 -28
- package/dist/es2017/core/stream/representation/types.d.ts +2 -2
- package/dist/es2017/core/stream/representation/types.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/utils/get_needed_segments.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +1 -2
- package/dist/es2017/core/types.d.ts +2 -2
- package/dist/es2017/core/types.d.ts.map +1 -1
- package/dist/es2017/default_config.d.ts.map +1 -1
- package/dist/es2017/default_config.js +0 -8
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +0 -13
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +0 -4
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -13
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
- package/dist/es2017/features/add_features.d.ts.map +1 -1
- package/dist/es2017/features/add_features.js +1 -2
- package/dist/es2017/main_thread/api/option_utils.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/option_utils.js +2 -6
- package/dist/es2017/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/public_api.js +29 -23
- package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/utils/persistent_sessions_store.js +2 -1
- package/dist/es2017/main_thread/init/media_source_content_initializer.js +6 -6
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.js +7 -12
- package/dist/es2017/main_thread/text_displayer/html/html_text_displayer.js +1 -5
- package/dist/es2017/main_thread/text_displayer/native/native_text_displayer.js +3 -7
- package/dist/es2017/main_thread/tracks_store/track_dispatcher.js +1 -1
- package/dist/es2017/main_thread/types.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/manifest.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/manifest.js +0 -6
- package/dist/es2017/manifest/utils.d.ts.map +1 -1
- package/dist/es2017/manifest/utils.js +1 -2
- package/dist/es2017/mse/main_media_source_interface.js +1 -1
- package/dist/es2017/multithread_types.d.ts +2 -2
- package/dist/es2017/multithread_types.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/parse_s_element.js +12 -6
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.js +8 -4
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Period.js +10 -5
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.js +10 -5
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.js +14 -7
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/EventStream.js +2 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/MPD.js +8 -4
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Period.js +10 -5
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/Representation.js +10 -5
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +1 -2
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +2 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +2 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +4 -2
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +10 -5
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +2 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/root.js +2 -1
- package/dist/es2017/parsers/manifest/local/representation_index.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/local/representation_index.js +1 -2
- package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.js +2 -3
- package/dist/es2017/parsers/manifest/smooth/create_parser.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/smooth/create_parser.js +2 -1
- package/dist/es2017/parsers/manifest/smooth/shared_smooth_segment_timeline.js +2 -2
- package/dist/es2017/parsers/manifest/utils/get_first_time_from_adaptation.js +2 -2
- package/dist/es2017/parsers/manifest/utils/get_last_time_from_adaptation.js +2 -2
- package/dist/es2017/parsers/texttracks/srt/html.js +2 -2
- package/dist/es2017/parsers/texttracks/ttml/html/create_element.js +1 -1
- package/dist/es2017/parsers/texttracks/ttml/html/parse_ttml_to_div.js +3 -3
- package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/ttml/native/parse_ttml_to_vtt.js +1 -2
- package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/ttml/resolve_styles_inheritance.js +1 -2
- package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts +9 -3
- package/dist/es2017/parsers/texttracks/webvtt/html/to_html.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/webvtt/html/to_html.js +9 -3
- package/dist/es2017/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +2 -2
- package/dist/es2017/public_types.d.ts +5 -7
- package/dist/es2017/public_types.d.ts.map +1 -1
- package/dist/es2017/transports/smooth/extract_timings_infos.js +3 -3
- package/dist/es2017/utils/array_find.d.ts +1 -1
- package/dist/es2017/utils/array_find.d.ts.map +1 -1
- package/dist/es2017/utils/array_find.js +3 -1
- package/dist/es2017/utils/array_find_index.d.ts +1 -1
- package/dist/es2017/utils/array_find_index.d.ts.map +1 -1
- package/dist/es2017/utils/array_find_index.js +3 -1
- package/dist/es2017/utils/array_includes.d.ts.map +1 -1
- package/dist/es2017/utils/array_includes.js +1 -3
- package/dist/es2017/utils/assert.d.ts.map +1 -1
- package/dist/es2017/utils/assert.js +0 -2
- package/dist/es2017/utils/base64.d.ts +1 -1
- package/dist/es2017/utils/base64.d.ts.map +1 -1
- package/dist/es2017/utils/base64.js +3 -2
- package/dist/es2017/utils/event_emitter.js +1 -1
- package/dist/es2017/utils/flat_map.d.ts.map +1 -1
- package/dist/es2017/utils/flat_map.js +1 -2
- package/dist/es2017/utils/id_generator.d.ts.map +1 -1
- package/dist/es2017/utils/id_generator.js +0 -1
- package/dist/es2017/utils/logger.js +1 -1
- package/dist/es2017/utils/monotonic_timestamp.js +2 -2
- package/dist/es2017/utils/noop.js +1 -2
- package/dist/es2017/utils/object_assign.d.ts.map +1 -1
- package/dist/es2017/utils/object_assign.js +1 -2
- package/dist/es2017/utils/object_values.d.ts.map +1 -1
- package/dist/es2017/utils/object_values.js +1 -2
- package/dist/es2017/utils/reference.js +1 -1
- package/dist/es2017/utils/request/xhr.js +1 -1
- package/dist/rx-player.js +39336 -18
- package/dist/rx-player.min.js +18 -0
- package/dist/worker.js +5 -5
- package/package.json +16 -9
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/compat/__tests__/add_text_track.test.ts +8 -12
- package/src/compat/__tests__/browser_compatibility_types.test.ts +0 -7
- package/src/compat/__tests__/browser_version.test.ts +20 -19
- package/src/compat/__tests__/can_patch_isobmff.test.ts +7 -10
- package/src/compat/__tests__/can_rely_on_video_visibility_and_size.test.ts +17 -21
- package/src/compat/__tests__/can_reuse_media_keys.test.ts +13 -21
- package/src/compat/__tests__/clear_element_src.test.ts +37 -34
- package/src/compat/__tests__/enable_audio_track.test.ts +22 -21
- package/src/compat/__tests__/is_codec_supported.test.ts +17 -18
- package/src/compat/__tests__/is_seeking_approximate.test.ts +8 -14
- package/src/compat/__tests__/is_vtt_cue.test.ts +8 -13
- package/src/compat/__tests__/make_vtt_cue.test.ts +7 -12
- package/src/compat/__tests__/patch_webkit_source_buffer.test.ts +44 -32
- package/src/compat/__tests__/remove_cue.test.ts +30 -31
- package/src/compat/__tests__/should_favour_custom_safari_EME.test.ts +21 -26
- package/src/compat/__tests__/should_renew_media_key_system_access.test.ts +9 -17
- package/src/compat/__tests__/should_unset_media_keys.test.ts +7 -14
- package/src/compat/__tests__/should_validate_metadata.test.ts +7 -17
- package/src/compat/__tests__/should_wait_for_data_before_loaded.test.ts +17 -26
- package/src/compat/__tests__/should_wait_for_have_enough_data.test.ts +10 -15
- package/src/compat/add_class_name.ts +1 -2
- package/src/compat/browser_compatibility_types.ts +4 -2
- package/src/compat/clear_element_src.ts +1 -1
- package/src/compat/eme/custom_media_keys/moz_media_keys_constructor.ts +1 -2
- package/src/compat/eme/custom_media_keys/ms_media_keys_constructor.ts +1 -2
- package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +3 -6
- package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +2 -17
- package/src/compat/eme/custom_media_keys/webkit_media_keys_constructor.ts +1 -4
- package/src/compat/eme/eme-api-implementation.ts +0 -2
- package/src/compat/event_listeners.ts +2 -6
- package/src/compat/has_mse_in_worker.ts +1 -1
- package/src/compat/is_codec_supported.ts +0 -2
- package/src/compat/is_debug_mode_enabled.ts +1 -1
- package/src/compat/is_vtt_cue.ts +1 -2
- package/src/compat/on_height_width_change.ts +1 -2
- package/src/compat/patch_webkit_source_buffer.ts +48 -29
- package/src/compat/remove_cue.ts +2 -2
- package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +21 -26
- package/src/core/fetchers/README.md +13 -12
- package/src/core/fetchers/index.ts +5 -8
- package/src/core/fetchers/segment/__tests__/task_prioritizer.test.ts +17 -23
- package/src/core/fetchers/segment/index.ts +6 -5
- package/src/core/{stream/representation/utils/downloading_queue.ts → fetchers/segment/segment_queue.ts} +204 -166
- package/src/core/fetchers/segment/{segment_fetcher_creator.ts → segment_queue_creator.ts} +31 -14
- package/src/core/fetchers/segment/task_prioritizer.ts +10 -2
- package/src/core/fetchers/utils/schedule_request.ts +1 -1
- package/src/core/main/common/content_time_boundaries_observer.ts +4 -4
- package/src/core/main/worker/content_preparer.ts +5 -5
- package/src/core/main/worker/send_message.ts +1 -1
- package/src/core/main/worker/worker_main.ts +2 -2
- package/src/core/segment_sinks/implementations/text/text_segment_buffer.ts +1 -5
- package/src/core/segment_sinks/inventory/segment_inventory.ts +1 -2
- package/src/core/segment_sinks/segment_buffers_store.ts +3 -2
- package/src/core/stream/adaptation/adaptation_stream.ts +3 -3
- package/src/core/stream/adaptation/types.ts +2 -2
- package/src/core/stream/orchestrator/get_time_ranges_for_content.ts +1 -2
- package/src/core/stream/orchestrator/stream_orchestrator.ts +4 -4
- package/src/core/stream/period/period_stream.ts +2 -2
- package/src/core/stream/period/types.ts +2 -2
- package/src/core/stream/representation/representation_stream.ts +59 -56
- package/src/core/stream/representation/types.ts +3 -4
- package/src/core/stream/representation/utils/get_needed_segments.ts +1 -2
- package/src/core/types.ts +2 -4
- package/src/default_config.ts +0 -8
- package/src/errors/__tests__/format_error.test.ts +18 -18
- package/src/experimental/features/__tests__/multi_thread.test.ts +5 -5
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/capabilities.test.ts +11 -11
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +18 -26
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +13 -21
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/decodingInfos.test.ts +24 -20
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/defaultCodecFinder.test.ts +28 -30
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaContentType.test.ts +32 -38
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +64 -51
- package/src/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.ts +4 -17
- package/src/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.ts +0 -4
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.ts +1 -2
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts +16 -14
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +1 -2
- package/src/features/__tests__/add_features.test.ts +12 -11
- package/src/features/add_features.ts +1 -2
- package/src/features/list/__tests__/dash_wasm.test.ts +4 -4
- package/src/main_thread/api/__tests__/option_utils.test.ts +114 -70
- package/src/main_thread/api/__tests__/public_api.test.ts +85 -48
- package/src/main_thread/api/option_utils.ts +2 -6
- package/src/main_thread/api/public_api.ts +24 -18
- package/src/main_thread/decrypt/__tests__/__global__/get_license.test.ts +12 -18
- package/src/main_thread/decrypt/__tests__/__global__/init_data.test.ts +128 -101
- package/src/main_thread/decrypt/__tests__/__global__/media_key_system_access.test.ts +26 -33
- package/src/main_thread/decrypt/__tests__/__global__/media_keys.test.ts +46 -48
- package/src/main_thread/decrypt/__tests__/__global__/server_certificate.test.ts +33 -34
- package/src/main_thread/decrypt/__tests__/__global__/utils.ts +13 -17
- package/src/main_thread/decrypt/session_events_listener.ts +1 -1
- package/src/main_thread/decrypt/utils/__tests__/clean_old_loaded_sessions.test.ts +0 -5
- package/src/main_thread/decrypt/utils/__tests__/clean_old_stored_persistent_info.test.ts +14 -17
- package/src/main_thread/decrypt/utils/persistent_sessions_store.ts +2 -1
- package/src/main_thread/init/media_source_content_initializer.ts +7 -7
- package/src/main_thread/init/multi_thread_content_initializer.ts +7 -12
- package/src/main_thread/init/utils/__tests__/are_same_stream_events.test.ts +11 -16
- package/src/main_thread/init/utils/__tests__/refresh_scheduled_events_list.test.ts +48 -18
- package/src/main_thread/text_displayer/html/__tests__/text_track_cues_store.test.ts +32 -17
- package/src/main_thread/text_displayer/html/html_text_displayer.ts +1 -5
- package/src/main_thread/text_displayer/native/native_text_displayer.ts +3 -7
- package/src/main_thread/tracks_store/__tests__/media_element_tracks_store.test.ts +33 -28
- package/src/main_thread/tracks_store/track_dispatcher.ts +1 -1
- package/src/main_thread/types.ts +0 -1
- package/src/manifest/classes/__tests__/adaptation.test.ts +167 -62
- package/src/manifest/classes/__tests__/manifest.test.ts +130 -74
- package/src/manifest/classes/__tests__/period.test.ts +293 -211
- package/src/manifest/classes/__tests__/update_period_in_place.test.ts +0 -2
- package/src/manifest/classes/__tests__/update_periods.test.ts +57 -57
- package/src/manifest/classes/manifest.ts +0 -6
- package/src/manifest/utils.ts +1 -2
- package/src/mse/main_media_source_interface.ts +1 -1
- package/src/mse/types.ts +1 -1
- package/src/multithread_types.ts +2 -2
- package/src/parsers/manifest/dash/common/__tests__/get_clock_offset.test.ts +5 -10
- package/src/parsers/manifest/dash/common/__tests__/get_http_utc-timing_url.test.ts +38 -30
- package/src/parsers/manifest/dash/common/__tests__/get_periods_time_infos.test.ts +0 -3
- package/src/parsers/manifest/dash/common/indexes/timeline/parse_s_element.ts +12 -6
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/AdaptationSet.ts +14 -7
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/MPD.ts +8 -4
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Period.ts +10 -5
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/Representation.ts +10 -5
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
- package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
- package/src/parsers/manifest/dash/native-parser/node_parsers/AdaptationSet.ts +14 -7
- package/src/parsers/manifest/dash/native-parser/node_parsers/EventStream.ts +2 -1
- package/src/parsers/manifest/dash/native-parser/node_parsers/MPD.ts +8 -4
- package/src/parsers/manifest/dash/native-parser/node_parsers/Period.ts +10 -5
- package/src/parsers/manifest/dash/native-parser/node_parsers/Representation.ts +10 -5
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/ContentProtection.test.ts +15 -27
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/Initialization.test.ts +13 -17
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentTimeline.test.ts +9 -14
- package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/SegmentURL.test.ts +18 -15
- package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +1 -2
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.ts +2 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.ts +2 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.ts +4 -2
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/MPD.ts +10 -5
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/Period.ts +2 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/root.ts +2 -1
- package/src/parsers/manifest/local/representation_index.ts +1 -2
- package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +2 -3
- package/src/parsers/manifest/smooth/create_parser.ts +2 -1
- package/src/parsers/manifest/smooth/shared_smooth_segment_timeline.ts +2 -2
- package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +3 -8
- package/src/parsers/manifest/utils/get_first_time_from_adaptation.ts +2 -2
- package/src/parsers/manifest/utils/get_last_time_from_adaptation.ts +2 -2
- package/src/parsers/texttracks/srt/html.ts +2 -2
- package/src/parsers/texttracks/ttml/__tests__/resolve_styles_inheritance.test.ts +3 -7
- package/src/parsers/texttracks/ttml/html/__tests__/__global__/html_ttml_parser.test.ts +4 -4
- package/src/parsers/texttracks/ttml/html/create_element.ts +1 -1
- package/src/parsers/texttracks/ttml/html/parse_ttml_to_div.ts +3 -3
- package/src/parsers/texttracks/ttml/native/parse_ttml_to_vtt.ts +1 -2
- package/src/parsers/texttracks/ttml/resolve_styles_inheritance.ts +1 -2
- package/src/parsers/texttracks/webvtt/__tests__/parse_cue_block.test.ts +11 -11
- package/src/parsers/texttracks/webvtt/html/__tests__/convert_payload_to_html.test.ts +5 -18
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_style_block.test.ts +23 -28
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_webvtt_to_div.test.ts +9 -14
- package/src/parsers/texttracks/webvtt/html/__tests__/to_html.test.ts +11 -11
- package/src/parsers/texttracks/webvtt/html/to_html.ts +9 -3
- package/src/parsers/texttracks/webvtt/native/parse_vtt_to_cues.ts +2 -2
- package/src/public_types.ts +7 -8
- package/src/tools/TextTrackRenderer/text_track_renderer.ts +1 -1
- package/src/transports/smooth/extract_timings_infos.ts +3 -3
- package/src/transports/smooth/isobmff/__tests__/create_boxes.test.ts +30 -28
- package/src/transports/utils/__tests__/check_isobmff_integrity.test.ts +38 -44
- package/src/utils/__tests__/array_find.test.ts +12 -12
- package/src/utils/__tests__/array_find_index.test.ts +13 -12
- package/src/utils/__tests__/array_includes.test.ts +7 -7
- package/src/utils/__tests__/assert.test.ts +19 -25
- package/src/utils/__tests__/base64.test.ts +18 -13
- package/src/utils/__tests__/event_emitter.test.ts +225 -50
- package/src/utils/__tests__/flat_map.test.ts +2 -6
- package/src/utils/__tests__/starts_with.test.ts +7 -8
- package/src/utils/array_find.ts +3 -7
- package/src/utils/array_find_index.ts +3 -7
- package/src/utils/array_includes.ts +1 -3
- package/src/utils/assert.ts +0 -2
- package/src/utils/base64.ts +3 -2
- package/src/utils/event_emitter.ts +1 -1
- package/src/utils/flat_map.ts +1 -2
- package/src/utils/id_generator.ts +0 -2
- package/src/utils/is_worker.ts +1 -1
- package/src/utils/logger.ts +1 -1
- package/src/utils/monotonic_timestamp.ts +2 -2
- package/src/utils/noop.ts +1 -2
- package/src/utils/object_assign.ts +1 -2
- package/src/utils/object_values.ts +1 -2
- package/src/utils/reference.ts +1 -1
- package/src/utils/request/xhr.ts +1 -1
- package/dist/commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
- package/dist/commonjs/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
- package/dist/es2017/core/fetchers/segment/segment_fetcher_creator.d.ts.map +0 -1
- package/dist/es2017/core/stream/representation/utils/downloading_queue.d.ts.map +0 -1
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import type { MockInstance } from "vitest";
|
|
2
2
|
import { describe, beforeEach, afterEach, it, expect, vi } from "vitest";
|
|
3
3
|
import type { IIndexSegment } from "../index_helpers";
|
|
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 IUpdateSegmentTimeline from "../update_segment_timeline";
|
|
10
5
|
|
|
11
6
|
describe("Manifest Parsers utils - updateSegmentTimeline", () => {
|
|
12
7
|
let mockLogWarn: MockInstance | undefined;
|
|
@@ -22,8 +17,8 @@ describe("Manifest Parsers utils - updateSegmentTimeline", () => {
|
|
|
22
17
|
warn: mockLogWarn,
|
|
23
18
|
},
|
|
24
19
|
}));
|
|
25
|
-
updateSegmentTimeline = (
|
|
26
|
-
.default;
|
|
20
|
+
updateSegmentTimeline = (await vi.importActual("../update_segment_timeline"))
|
|
21
|
+
.default as typeof IUpdateSegmentTimeline;
|
|
27
22
|
});
|
|
28
23
|
|
|
29
24
|
afterEach(() => {
|
|
@@ -31,8 +31,8 @@ export default function getFirstPositionFromAdaptation(
|
|
|
31
31
|
): number | undefined | null {
|
|
32
32
|
const { representations } = adaptation;
|
|
33
33
|
let max: null | number = null;
|
|
34
|
-
for (
|
|
35
|
-
const firstPosition =
|
|
34
|
+
for (const representation of representations) {
|
|
35
|
+
const firstPosition = representation.index.getFirstAvailablePosition();
|
|
36
36
|
if (firstPosition === undefined) {
|
|
37
37
|
// we cannot tell
|
|
38
38
|
return undefined;
|
|
@@ -33,8 +33,8 @@ export default function getLastPositionFromAdaptation(
|
|
|
33
33
|
): number | undefined | null {
|
|
34
34
|
const { representations } = adaptation;
|
|
35
35
|
let min: null | number = null;
|
|
36
|
-
for (
|
|
37
|
-
const lastPosition =
|
|
36
|
+
for (const representation of representations) {
|
|
37
|
+
const lastPosition = representation.index.getLastAvailablePosition();
|
|
38
38
|
if (lastPosition === undefined) {
|
|
39
39
|
// we cannot tell
|
|
40
40
|
return undefined;
|
|
@@ -49,8 +49,8 @@ export default function parseSRTStringToHTML(
|
|
|
49
49
|
const cueBlocks: string[][] = getCueBlocks(lines);
|
|
50
50
|
|
|
51
51
|
const cues: ISRTHTMLCue[] = [];
|
|
52
|
-
for (
|
|
53
|
-
const cueObject = parseCueBlock(
|
|
52
|
+
for (const cueBlock of cueBlocks) {
|
|
53
|
+
const cueObject = parseCueBlock(cueBlock, timeOffset);
|
|
54
54
|
if (cueObject !== null) {
|
|
55
55
|
const htmlCue = toHTML(cueObject);
|
|
56
56
|
if (htmlCue !== null) {
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { describe, beforeEach, afterEach, it, expect, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
2
|
+
import type IResolveStylesInheritance from "../resolve_styles_inheritance";
|
|
7
3
|
|
|
8
4
|
const logWarnMock = vi.fn();
|
|
9
|
-
let resolveStylesInheritance:
|
|
5
|
+
let resolveStylesInheritance: typeof IResolveStylesInheritance;
|
|
10
6
|
|
|
11
7
|
describe("resolve_styles_inheritance", () => {
|
|
12
8
|
beforeEach(async () => {
|
|
@@ -16,7 +12,7 @@ describe("resolve_styles_inheritance", () => {
|
|
|
16
12
|
},
|
|
17
13
|
}));
|
|
18
14
|
resolveStylesInheritance = (await vi.importActual("../resolve_styles_inheritance"))
|
|
19
|
-
.default;
|
|
15
|
+
.default as typeof IResolveStylesInheritance;
|
|
20
16
|
});
|
|
21
17
|
afterEach(() => {
|
|
22
18
|
vi.resetModules();
|
|
@@ -164,8 +164,8 @@ describe("Global TTML HTML parsing tests", () => {
|
|
|
164
164
|
let nbTextNodes = 0;
|
|
165
165
|
{
|
|
166
166
|
const textNodes = findTextNodes(res[5].element);
|
|
167
|
-
for (
|
|
168
|
-
const parentElement =
|
|
167
|
+
for (const textNode of textNodes) {
|
|
168
|
+
const parentElement = textNode.parentElement;
|
|
169
169
|
if (parentElement !== null) {
|
|
170
170
|
expect(globalScope.getComputedStyle(parentElement).color).toEqual(
|
|
171
171
|
"rgb(255, 255, 0)",
|
|
@@ -176,8 +176,8 @@ describe("Global TTML HTML parsing tests", () => {
|
|
|
176
176
|
}
|
|
177
177
|
{
|
|
178
178
|
const textNodes = findTextNodes(res[6].element);
|
|
179
|
-
for (
|
|
180
|
-
const parentElement =
|
|
179
|
+
for (const textNode of textNodes) {
|
|
180
|
+
const parentElement = textNode.parentElement;
|
|
181
181
|
if (parentElement !== null) {
|
|
182
182
|
expect(globalScope.getComputedStyle(parentElement).color).toEqual(
|
|
183
183
|
"rgb(255, 255, 255)",
|
|
@@ -425,7 +425,7 @@ function generateTextContent(
|
|
|
425
425
|
if (isNonEmptyString(backgroundColor)) {
|
|
426
426
|
style.backgroundColor = backgroundColor;
|
|
427
427
|
} else {
|
|
428
|
-
|
|
428
|
+
style.backgroundColor = "";
|
|
429
429
|
}
|
|
430
430
|
const el = createTextElement(currentNode, style, shouldTrimWhiteSpaceFromParent);
|
|
431
431
|
elements.push(el);
|
|
@@ -42,12 +42,12 @@ import parseCue from "./parse_cue";
|
|
|
42
42
|
export default function parseTTMLToDiv(str: string, timeOffset: number): ITTMLHTMLCue[] {
|
|
43
43
|
const parsedCues = parseTtml(str, timeOffset);
|
|
44
44
|
const cues: ITTMLHTMLCue[] = [];
|
|
45
|
-
for (
|
|
46
|
-
const { paragraphStyle } =
|
|
45
|
+
for (const parsedCue of parsedCues) {
|
|
46
|
+
const { paragraphStyle } = parsedCue;
|
|
47
47
|
if (shouldApplyDefaultTTMLStyle(paragraphStyle)) {
|
|
48
48
|
applyDefaultTTMLStyle(paragraphStyle);
|
|
49
49
|
}
|
|
50
|
-
const cue = parseCue(
|
|
50
|
+
const cue = parseCue(parsedCue);
|
|
51
51
|
if (cue !== null) {
|
|
52
52
|
cues.push(cue);
|
|
53
53
|
}
|
|
@@ -28,8 +28,7 @@ export default function parseTtmlToNative(
|
|
|
28
28
|
): Array<TextTrackCue | ICompatVTTCue> {
|
|
29
29
|
const parsedCues = parseTtml(str, timeOffset);
|
|
30
30
|
const cues: Array<TextTrackCue | ICompatVTTCue> = [];
|
|
31
|
-
for (
|
|
32
|
-
const parsedCue = parsedCues[i];
|
|
31
|
+
for (const parsedCue of parsedCues) {
|
|
33
32
|
const cue = parseCue(parsedCue);
|
|
34
33
|
if (cue !== null) {
|
|
35
34
|
cues.push(cue);
|
|
@@ -57,8 +57,7 @@ export default function resolveStylesInheritance(styles: IStyleObject[]): void {
|
|
|
57
57
|
const recursivelyBrowsedIndexes: number[] = [];
|
|
58
58
|
function resolveStyleInheritance(styleElt: IStyleObject, index: number) {
|
|
59
59
|
recursivelyBrowsedIndexes.push(index);
|
|
60
|
-
for (
|
|
61
|
-
const extendedStyleID = styleElt.extendsStyles[j];
|
|
60
|
+
for (const extendedStyleID of styleElt.extendsStyles) {
|
|
62
61
|
const extendedStyleIndex = arrayFindIndex(styles, (x) => x.id === extendedStyleID);
|
|
63
62
|
if (extendedStyleIndex < 0) {
|
|
64
63
|
log.warn("TTML Parser: unknown style inheritance: " + extendedStyleID);
|
|
@@ -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 IParseCueBlock from "../parse_cue_block";
|
|
8
3
|
|
|
9
4
|
const cueBlock1 = [
|
|
10
5
|
"112",
|
|
@@ -45,7 +40,8 @@ describe("parsers - srt - parseCueBlocks", () => {
|
|
|
45
40
|
});
|
|
46
41
|
|
|
47
42
|
it("should correctly parse regular cue blocks", async () => {
|
|
48
|
-
const parseCueBlock = (
|
|
43
|
+
const parseCueBlock = (await vi.importActual("../parse_cue_block"))
|
|
44
|
+
.default as typeof IParseCueBlock;
|
|
49
45
|
expect(parseCueBlock(cueBlock1, 0)).toEqual({
|
|
50
46
|
start: 31.08,
|
|
51
47
|
end: 452.2,
|
|
@@ -92,7 +88,8 @@ describe("parsers - srt - parseCueBlocks", () => {
|
|
|
92
88
|
});
|
|
93
89
|
|
|
94
90
|
it("should add timeOffset in seconds", async () => {
|
|
95
|
-
const parseCueBlock = (
|
|
91
|
+
const parseCueBlock = (await vi.importActual("../parse_cue_block"))
|
|
92
|
+
.default as typeof IParseCueBlock;
|
|
96
93
|
expect(parseCueBlock(cueBlock1, 10.1)).toEqual({
|
|
97
94
|
start: 41.18,
|
|
98
95
|
end: 462.3,
|
|
@@ -150,7 +147,8 @@ describe("parsers - srt - parseCueBlocks", () => {
|
|
|
150
147
|
});
|
|
151
148
|
|
|
152
149
|
it("should return null for invalid cue blocks", async () => {
|
|
153
|
-
const parseCueBlock = (
|
|
150
|
+
const parseCueBlock = (await vi.importActual("../parse_cue_block"))
|
|
151
|
+
.default as typeof IParseCueBlock;
|
|
154
152
|
expect(parseCueBlock(notCueBlock1, 0)).toEqual(null);
|
|
155
153
|
expect(parseCueBlock(notCueBlock1, 5)).toEqual(null);
|
|
156
154
|
expect(parseCueBlock(notCueBlock2, 0)).toEqual(null);
|
|
@@ -168,7 +166,8 @@ describe("parsers - srt - parseCueBlocks", () => {
|
|
|
168
166
|
vi.doMock("../parse_timestamp", () => ({
|
|
169
167
|
default: parseTimestamp,
|
|
170
168
|
}));
|
|
171
|
-
const parseCueBlock = (
|
|
169
|
+
const parseCueBlock = (await vi.importActual("../parse_cue_block"))
|
|
170
|
+
.default as typeof IParseCueBlock;
|
|
172
171
|
|
|
173
172
|
expect(parseCueBlock(cueBlock1, 0)).toEqual(null);
|
|
174
173
|
expect(parseTimestamp).toHaveBeenCalledTimes(2);
|
|
@@ -179,7 +178,8 @@ describe("parsers - srt - parseCueBlocks", () => {
|
|
|
179
178
|
vi.doMock("../parse_timestamp", () => ({
|
|
180
179
|
default: parseTimestamp,
|
|
181
180
|
}));
|
|
182
|
-
const parseCueBlock = (
|
|
181
|
+
const parseCueBlock = (await vi.importActual("../parse_cue_block"))
|
|
182
|
+
.default as typeof IParseCueBlock;
|
|
183
183
|
|
|
184
184
|
expect(parseCueBlock(cueBlock1, 0)).toEqual(null);
|
|
185
185
|
expect(parseTimestamp).toHaveBeenCalledTimes(2);
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
2
|
import globalScope from "../../../../../utils/global_scope";
|
|
3
|
-
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
8
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
import type IConvertPayloadToHTML from "../convert_payload_to_html";
|
|
9
4
|
|
|
10
5
|
describe("parsers - webvtt - convertPayloadToHTML", () => {
|
|
11
6
|
beforeEach(() => {
|
|
@@ -26,9 +21,6 @@ describe("parsers - webvtt - convertPayloadToHTML", () => {
|
|
|
26
21
|
|
|
27
22
|
const origDOMParser = gs.DOMParser;
|
|
28
23
|
gs.DOMParser = class MockDOMParser {
|
|
29
|
-
constructor() {
|
|
30
|
-
// Useless constructor in mock
|
|
31
|
-
}
|
|
32
24
|
public parseFromString() {
|
|
33
25
|
return spyParseFromString();
|
|
34
26
|
}
|
|
@@ -39,9 +31,8 @@ describe("parsers - webvtt - convertPayloadToHTML", () => {
|
|
|
39
31
|
default: spy,
|
|
40
32
|
}));
|
|
41
33
|
|
|
42
|
-
const convertPayloadToHTML = (
|
|
43
|
-
|
|
44
|
-
).default;
|
|
34
|
+
const convertPayloadToHTML = (await vi.importActual("../convert_payload_to_html"))
|
|
35
|
+
.default as typeof IConvertPayloadToHTML;
|
|
45
36
|
expect(convertPayloadToHTML("", {})).toEqual([]);
|
|
46
37
|
expect(spyParseFromString).toHaveBeenCalledTimes(1);
|
|
47
38
|
expect(spy).not.toHaveBeenCalled();
|
|
@@ -75,17 +66,13 @@ describe("parsers - webvtt - convertPayloadToHTML", () => {
|
|
|
75
66
|
|
|
76
67
|
const origDOMParser = gs.DOMParser;
|
|
77
68
|
gs.DOMParser = class MockDOMParser {
|
|
78
|
-
constructor() {
|
|
79
|
-
// Useless constructor in mock
|
|
80
|
-
}
|
|
81
69
|
public parseFromString() {
|
|
82
70
|
return spyParseFromString();
|
|
83
71
|
}
|
|
84
72
|
};
|
|
85
73
|
|
|
86
|
-
const convertPayloadToHTML = (
|
|
87
|
-
|
|
88
|
-
).default;
|
|
74
|
+
const convertPayloadToHTML = (await vi.importActual("../convert_payload_to_html"))
|
|
75
|
+
.default as typeof IConvertPayloadToHTML;
|
|
89
76
|
expect(convertPayloadToHTML(innerText, {})).toEqual([bNode, span]);
|
|
90
77
|
expect(spyParseFromString).toHaveBeenCalledTimes(1);
|
|
91
78
|
expect(spyCreateStyledElement).toHaveBeenCalledTimes(2);
|
|
@@ -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 IParseStyleBlock from "../parse_style_block";
|
|
8
3
|
|
|
9
4
|
describe("parsers - webvtt - parseStyleBlock", () => {
|
|
10
5
|
beforeEach(() => {
|
|
@@ -20,8 +15,8 @@ describe("parsers - webvtt - parseStyleBlock", () => {
|
|
|
20
15
|
return mockCreateDefaultStyleElements();
|
|
21
16
|
},
|
|
22
17
|
}));
|
|
23
|
-
const parseStyleBlock = (
|
|
24
|
-
.default;
|
|
18
|
+
const parseStyleBlock = (await vi.importActual("../parse_style_block"))
|
|
19
|
+
.default as typeof IParseStyleBlock;
|
|
25
20
|
expect(parseStyleBlock(webvttStyle)).toEqual({
|
|
26
21
|
classes: {},
|
|
27
22
|
global: "",
|
|
@@ -45,8 +40,8 @@ describe("parsers - webvtt - parseStyleBlock", () => {
|
|
|
45
40
|
return mockCreateDefaultStyleElements();
|
|
46
41
|
},
|
|
47
42
|
}));
|
|
48
|
-
const parseStyleBlock = (
|
|
49
|
-
.default;
|
|
43
|
+
const parseStyleBlock = (await vi.importActual("../parse_style_block"))
|
|
44
|
+
.default as typeof IParseStyleBlock;
|
|
50
45
|
expect(parseStyleBlock(webvttStyle)).toEqual({
|
|
51
46
|
classes: {},
|
|
52
47
|
global:
|
|
@@ -64,8 +59,8 @@ describe("parsers - webvtt - parseStyleBlock", () => {
|
|
|
64
59
|
return mockCreateDefaultStyleElements();
|
|
65
60
|
},
|
|
66
61
|
}));
|
|
67
|
-
const parseStyleBlock = (
|
|
68
|
-
.default;
|
|
62
|
+
const parseStyleBlock = (await vi.importActual("../parse_style_block"))
|
|
63
|
+
.default as typeof IParseStyleBlock;
|
|
69
64
|
expect(parseStyleBlock(webvttStyle)).toEqual({
|
|
70
65
|
classes: {
|
|
71
66
|
b: " color: peachpuff;",
|
|
@@ -92,8 +87,8 @@ describe("parsers - webvtt - parseStyleBlock", () => {
|
|
|
92
87
|
return mockCreateDefaultStyleElements();
|
|
93
88
|
},
|
|
94
89
|
}));
|
|
95
|
-
const parseStyleBlock = (
|
|
96
|
-
.default;
|
|
90
|
+
const parseStyleBlock = (await vi.importActual("../parse_style_block"))
|
|
91
|
+
.default as typeof IParseStyleBlock;
|
|
97
92
|
expect(parseStyleBlock(webvttStyle)).toEqual({
|
|
98
93
|
global:
|
|
99
94
|
"background-image: linear-gradient(to bottom, dimgray, lightgray);" +
|
|
@@ -116,8 +111,8 @@ describe("parsers - webvtt - parseStyleBlock", () => {
|
|
|
116
111
|
return mockCreateDefaultStyleElements();
|
|
117
112
|
},
|
|
118
113
|
}));
|
|
119
|
-
const parseStyleBlock = (
|
|
120
|
-
.default;
|
|
114
|
+
const parseStyleBlock = (await vi.importActual("../parse_style_block"))
|
|
115
|
+
.default as typeof IParseStyleBlock;
|
|
121
116
|
expect(parseStyleBlock(webvttStyle)).toEqual({
|
|
122
117
|
classes: {
|
|
123
118
|
b: " color: peachpuff;",
|
|
@@ -138,8 +133,8 @@ describe("parsers - webvtt - parseStyleBlock", () => {
|
|
|
138
133
|
return mockCreateDefaultStyleElements();
|
|
139
134
|
},
|
|
140
135
|
}));
|
|
141
|
-
const parseStyleBlock = (
|
|
142
|
-
.default;
|
|
136
|
+
const parseStyleBlock = (await vi.importActual("../parse_style_block"))
|
|
137
|
+
.default as typeof IParseStyleBlock;
|
|
143
138
|
expect(parseStyleBlock(webvttStyle)).toEqual({
|
|
144
139
|
classes: {
|
|
145
140
|
b: " color: peachpuff; background-color: dark;",
|
|
@@ -167,8 +162,8 @@ describe("parsers - webvtt - parseStyleBlock", () => {
|
|
|
167
162
|
return mockCreateDefaultStyleElements();
|
|
168
163
|
},
|
|
169
164
|
}));
|
|
170
|
-
const parseStyleBlock = (
|
|
171
|
-
.default;
|
|
165
|
+
const parseStyleBlock = (await vi.importActual("../parse_style_block"))
|
|
166
|
+
.default as typeof IParseStyleBlock;
|
|
172
167
|
expect(parseStyleBlock(webvttStyle)).toEqual({
|
|
173
168
|
classes: {
|
|
174
169
|
b: " background-color: dark;",
|
|
@@ -197,8 +192,8 @@ describe("parsers - webvtt - parseStyleBlock", () => {
|
|
|
197
192
|
return mockCreateDefaultStyleElements();
|
|
198
193
|
},
|
|
199
194
|
}));
|
|
200
|
-
const parseStyleBlock = (
|
|
201
|
-
.default;
|
|
195
|
+
const parseStyleBlock = (await vi.importActual("../parse_style_block"))
|
|
196
|
+
.default as typeof IParseStyleBlock;
|
|
202
197
|
expect(parseStyleBlock(webvttStyle)).toEqual({
|
|
203
198
|
classes: {
|
|
204
199
|
b: " background-color: dark; color: salmon;",
|
|
@@ -226,8 +221,8 @@ describe("parsers - webvtt - parseStyleBlock", () => {
|
|
|
226
221
|
return mockCreateDefaultStyleElements();
|
|
227
222
|
},
|
|
228
223
|
}));
|
|
229
|
-
const parseStyleBlock = (
|
|
230
|
-
.default;
|
|
224
|
+
const parseStyleBlock = (await vi.importActual("../parse_style_block"))
|
|
225
|
+
.default as typeof IParseStyleBlock;
|
|
231
226
|
expect(parseStyleBlock(webvttStyle)).toEqual({
|
|
232
227
|
classes: {
|
|
233
228
|
b: " background-color: dark; color: salmon;",
|
|
@@ -248,8 +243,8 @@ describe("parsers - webvtt - parseStyleBlock", () => {
|
|
|
248
243
|
return mockCreateDefaultStyleElements();
|
|
249
244
|
},
|
|
250
245
|
}));
|
|
251
|
-
const parseStyleBlock = (
|
|
252
|
-
.default;
|
|
246
|
+
const parseStyleBlock = (await vi.importActual("../parse_style_block"))
|
|
247
|
+
.default as typeof IParseStyleBlock;
|
|
253
248
|
expect(parseStyleBlock(webvttStyle)).toEqual({
|
|
254
249
|
classes: {
|
|
255
250
|
b: " background-color: dark;",
|
|
@@ -269,8 +264,8 @@ describe("parsers - webvtt - parseStyleBlock", () => {
|
|
|
269
264
|
return mockCreateDefaultStyleElements();
|
|
270
265
|
},
|
|
271
266
|
}));
|
|
272
|
-
const parseStyleBlock = (
|
|
273
|
-
.default;
|
|
267
|
+
const parseStyleBlock = (await vi.importActual("../parse_style_block"))
|
|
268
|
+
.default as typeof IParseStyleBlock;
|
|
274
269
|
expect(parseStyleBlock(webvttStyle)).toEqual({
|
|
275
270
|
classes: {},
|
|
276
271
|
global: "",
|
|
@@ -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 IParseWebVTT from "../parse_webvtt_to_div";
|
|
8
3
|
|
|
9
4
|
describe("parsers - webvtt - parseWebVTT", () => {
|
|
10
5
|
beforeEach(() => {
|
|
@@ -12,14 +7,14 @@ describe("parsers - webvtt - parseWebVTT", () => {
|
|
|
12
7
|
});
|
|
13
8
|
|
|
14
9
|
it("should throw if text is empty", async () => {
|
|
15
|
-
const parseWebVTT = (
|
|
16
|
-
.default;
|
|
10
|
+
const parseWebVTT = (await vi.importActual("../parse_webvtt_to_div"))
|
|
11
|
+
.default as typeof IParseWebVTT;
|
|
17
12
|
expect(() => parseWebVTT("", 0)).toThrowError("Can't parse WebVTT: Invalid File.");
|
|
18
13
|
});
|
|
19
14
|
|
|
20
15
|
it("should throw if file seems to be invalid", async () => {
|
|
21
|
-
const parseWebVTT = (
|
|
22
|
-
.default;
|
|
16
|
+
const parseWebVTT = (await vi.importActual("../parse_webvtt_to_div"))
|
|
17
|
+
.default as typeof IParseWebVTT;
|
|
23
18
|
expect(() => parseWebVTT("WEBWTT\n", 0)).toThrowError(
|
|
24
19
|
"Can't parse WebVTT: Invalid File.",
|
|
25
20
|
);
|
|
@@ -76,8 +71,8 @@ describe("parsers - webvtt - parseWebVTT", () => {
|
|
|
76
71
|
getFirstLineAfterHeader: spyGetFirstLineAfterHeader,
|
|
77
72
|
}));
|
|
78
73
|
|
|
79
|
-
const parseWebVTT = (
|
|
80
|
-
.default;
|
|
74
|
+
const parseWebVTT = (await vi.importActual("../parse_webvtt_to_div"))
|
|
75
|
+
.default as typeof IParseWebVTT;
|
|
81
76
|
expect(parseWebVTT("WEBVTT\n", 0)).toEqual([
|
|
82
77
|
{
|
|
83
78
|
element: document.createElement("div"),
|
|
@@ -143,8 +138,8 @@ describe("parsers - webvtt - parseWebVTT", () => {
|
|
|
143
138
|
getFirstLineAfterHeader: spyGetFirstLineAfterHeader,
|
|
144
139
|
}));
|
|
145
140
|
|
|
146
|
-
const parseWebVTT = (
|
|
147
|
-
.default;
|
|
141
|
+
const parseWebVTT = (await vi.importActual("../parse_webvtt_to_div"))
|
|
142
|
+
.default as typeof IParseWebVTT;
|
|
148
143
|
expect(parseWebVTT("WEBVTT\n", 0)).toEqual([]);
|
|
149
144
|
expect(spyGetFirstLineAfterHeader).toHaveBeenCalledTimes(1);
|
|
150
145
|
expect(spyGetStyleBlock).toHaveBeenCalledTimes(1);
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { describe, beforeEach, it, expect, vi } from "vitest";
|
|
2
2
|
import type { IStyleElements } from "../parse_style_block";
|
|
3
|
-
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
8
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
import type IToHtml from "../to_html";
|
|
9
4
|
|
|
10
5
|
describe("parsers - webvtt - toHTML", () => {
|
|
11
6
|
beforeEach(() => {
|
|
@@ -19,12 +14,13 @@ describe("parsers - webvtt - toHTML", () => {
|
|
|
19
14
|
},
|
|
20
15
|
}));
|
|
21
16
|
|
|
22
|
-
const toHTML = (
|
|
17
|
+
const toHTML = (await vi.importActual("../to_html")).default as typeof IToHtml;
|
|
23
18
|
const cueObject = {
|
|
24
19
|
start: 0,
|
|
25
20
|
end: 100,
|
|
26
21
|
header: "b",
|
|
27
22
|
payload: ["<body><b></b><p>Hello<p><body>"],
|
|
23
|
+
settings: {},
|
|
28
24
|
};
|
|
29
25
|
|
|
30
26
|
const classes: IStyleElements = {};
|
|
@@ -57,12 +53,13 @@ describe("parsers - webvtt - toHTML", () => {
|
|
|
57
53
|
},
|
|
58
54
|
}));
|
|
59
55
|
|
|
60
|
-
const toHTML = (
|
|
56
|
+
const toHTML = (await vi.importActual("../to_html")).default as typeof IToHtml;
|
|
61
57
|
const cueObject = {
|
|
62
58
|
start: 0,
|
|
63
59
|
end: 100,
|
|
64
60
|
header: "b",
|
|
65
61
|
payload: ["<body><b></b><p>Hello<p><body>"],
|
|
62
|
+
settings: {},
|
|
66
63
|
};
|
|
67
64
|
|
|
68
65
|
const classes: IStyleElements = {
|
|
@@ -97,12 +94,13 @@ describe("parsers - webvtt - toHTML", () => {
|
|
|
97
94
|
},
|
|
98
95
|
}));
|
|
99
96
|
|
|
100
|
-
const toHTML = (
|
|
97
|
+
const toHTML = (await vi.importActual("../to_html")).default as typeof IToHtml;
|
|
101
98
|
const cueObject = {
|
|
102
99
|
start: 0,
|
|
103
100
|
end: 100,
|
|
104
101
|
header: "b",
|
|
105
102
|
payload: ["<body><b></b><p>Hello<p><body>"],
|
|
103
|
+
settings: {},
|
|
106
104
|
};
|
|
107
105
|
|
|
108
106
|
const classes: IStyleElements = {};
|
|
@@ -136,12 +134,13 @@ describe("parsers - webvtt - toHTML", () => {
|
|
|
136
134
|
},
|
|
137
135
|
}));
|
|
138
136
|
|
|
139
|
-
const toHTML = (
|
|
137
|
+
const toHTML = (await vi.importActual("../to_html")).default as typeof IToHtml;
|
|
140
138
|
const cueObject = {
|
|
141
139
|
start: 0,
|
|
142
140
|
end: 100,
|
|
143
141
|
header: "b",
|
|
144
142
|
payload: ["<body><b></b><p>Hello<p><body>"],
|
|
143
|
+
settings: {},
|
|
145
144
|
};
|
|
146
145
|
|
|
147
146
|
const classes: IStyleElements = { b: "bar: baz;" };
|
|
@@ -176,11 +175,12 @@ describe("parsers - webvtt - toHTML", () => {
|
|
|
176
175
|
},
|
|
177
176
|
}));
|
|
178
177
|
|
|
179
|
-
const toHTML = (
|
|
178
|
+
const toHTML = (await vi.importActual("../to_html")).default as typeof IToHtml;
|
|
180
179
|
const cueObject = {
|
|
181
180
|
start: 0,
|
|
182
181
|
end: 100,
|
|
183
182
|
payload: [],
|
|
183
|
+
settings: {},
|
|
184
184
|
};
|
|
185
185
|
|
|
186
186
|
const classes: IStyleElements = {};
|
|
@@ -32,9 +32,15 @@ export interface IVTTHTMLCue {
|
|
|
32
32
|
* - element {HTMLElement}: the cue text, translated into an HTMLElement
|
|
33
33
|
*
|
|
34
34
|
* Returns undefined if the cue block could not be parsed.
|
|
35
|
-
* @param {
|
|
36
|
-
* @param {Number}
|
|
37
|
-
* @param {
|
|
35
|
+
* @param {Object} cueObj
|
|
36
|
+
* @param {Number} cueObj.start
|
|
37
|
+
* @param {Number} cueObj.end
|
|
38
|
+
* @param {Object} cueObj.settings;
|
|
39
|
+
* @param {string|undefined} cueObj.header
|
|
40
|
+
* @param {Array.<string>} cueObj.payload
|
|
41
|
+
* @param {Object} styling
|
|
42
|
+
* @param {Object} styling.classes
|
|
43
|
+
* @param {string|undefined} styling.global
|
|
38
44
|
* @returns {Object|undefined}
|
|
39
45
|
*/
|
|
40
46
|
export default function toHTML(
|
|
@@ -52,8 +52,8 @@ export default function parseVTTStringToVTTCues(
|
|
|
52
52
|
const firstLineAfterHeader = getFirstLineAfterHeader(lines);
|
|
53
53
|
const cueBlocks: string[][] = getCueBlocks(lines, firstLineAfterHeader);
|
|
54
54
|
const cues: Array<ICompatVTTCue | TextTrackCue> = [];
|
|
55
|
-
for (
|
|
56
|
-
const cueObject = parseCueBlock(
|
|
55
|
+
for (const cueBlock of cueBlocks) {
|
|
56
|
+
const cueObject = parseCueBlock(cueBlock, timeOffset);
|
|
57
57
|
if (cueObject !== null) {
|
|
58
58
|
const nativeCue = toNativeCue(cueObject);
|
|
59
59
|
if (nativeCue !== null) {
|
package/src/public_types.ts
CHANGED
|
@@ -58,7 +58,7 @@ export interface IConstructorOptions {
|
|
|
58
58
|
videoResolutionLimit?: "videoElement" | "screen" | "none";
|
|
59
59
|
throttleVideoBitrateWhenHidden?: boolean;
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-types
|
|
62
62
|
videoElement?: HTMLMediaElement;
|
|
63
63
|
baseBandwidth?: number;
|
|
64
64
|
}
|
|
@@ -393,8 +393,7 @@ export type ISegmentLoader = (
|
|
|
393
393
|
totalSize?: number | undefined;
|
|
394
394
|
}) => void;
|
|
395
395
|
},
|
|
396
|
-
) => // returns either the aborting callback or nothing
|
|
397
|
-
(() => void) | void;
|
|
396
|
+
) => (() => void) | void; // returns either the aborting callback or nothing
|
|
398
397
|
|
|
399
398
|
/** Context given to a segment loader. */
|
|
400
399
|
export interface ISegmentLoaderContext {
|
|
@@ -509,8 +508,7 @@ export type IManifestLoader = (
|
|
|
509
508
|
reject: (err?: Error) => void;
|
|
510
509
|
fallback: () => void;
|
|
511
510
|
},
|
|
512
|
-
) => // returns either the aborting callback or nothing
|
|
513
|
-
(() => void) | void;
|
|
511
|
+
) => (() => void) | void; // returns either the aborting callback or nothing
|
|
514
512
|
|
|
515
513
|
export interface IManifestLoaderInfo {
|
|
516
514
|
/** URL at which the wanted Manifest can be accessed. */
|
|
@@ -538,7 +536,9 @@ export interface IKeySystemOption {
|
|
|
538
536
|
messageType: string,
|
|
539
537
|
) => Promise<BufferSource | null> | BufferSource | null;
|
|
540
538
|
/** Supplementary optional configuration for the getLicense call. */
|
|
541
|
-
getLicenseConfig?:
|
|
539
|
+
getLicenseConfig?:
|
|
540
|
+
| { retry?: number | undefined; timeout?: number | undefined }
|
|
541
|
+
| undefined;
|
|
542
542
|
/**
|
|
543
543
|
* Optional `serverCertificate` we will try to set to speed-up the
|
|
544
544
|
* license-fetching process.
|
|
@@ -1113,9 +1113,8 @@ export interface ITrackUpdateEventPayload {
|
|
|
1113
1113
|
export interface IRepresentationListUpdateContext {
|
|
1114
1114
|
period: IPeriod;
|
|
1115
1115
|
trackType: ITrackType;
|
|
1116
|
-
|
|
1116
|
+
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
|
1117
1117
|
reason: "decipherability-update" | string;
|
|
1118
|
-
/* eslint-enable @typescript-eslint/no-redundant-type-constituents */
|
|
1119
1118
|
}
|
|
1120
1119
|
|
|
1121
1120
|
export interface ILockedVideoRepresentationsSettings {
|
|
@@ -60,7 +60,7 @@ export default class TextTrackRenderer {
|
|
|
60
60
|
videoElement,
|
|
61
61
|
textTrackElement,
|
|
62
62
|
}: {
|
|
63
|
-
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-types
|
|
64
64
|
videoElement: HTMLMediaElement;
|
|
65
65
|
textTrackElement: HTMLElement;
|
|
66
66
|
}) {
|
|
@@ -89,10 +89,10 @@ export default function extractTimingsInfos(
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
if (tfrfSegments !== undefined) {
|
|
92
|
-
for (
|
|
92
|
+
for (const tfrfSeg of tfrfSegments) {
|
|
93
93
|
nextSegments.push({
|
|
94
|
-
time:
|
|
95
|
-
duration:
|
|
94
|
+
time: tfrfSeg.time,
|
|
95
|
+
duration: tfrfSeg.duration,
|
|
96
96
|
timescale: initTimescale,
|
|
97
97
|
});
|
|
98
98
|
}
|