rx-player 3.33.4-dev.2024083000 → 3.33.4
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/.prettierignore +1 -0
- package/.prettierrc +4 -0
- package/.vscode/settings.json +9 -0
- package/CHANGELOG.md +1662 -1076
- package/MAINTAINERS.md +9 -12
- package/README.md +111 -127
- package/VERSION +1 -1
- package/dist/_esm5.processed/compat/add_class_name.js +4 -3
- package/dist/_esm5.processed/compat/add_text_track.d.ts +1 -1
- package/dist/_esm5.processed/compat/add_text_track.js +4 -4
- package/dist/_esm5.processed/compat/browser_compatibility_types.d.ts +2 -1
- package/dist/_esm5.processed/compat/browser_compatibility_types.js +15 -10
- package/dist/_esm5.processed/compat/browser_detection.d.ts +3 -1
- package/dist/_esm5.processed/compat/browser_detection.js +18 -10
- package/dist/_esm5.processed/compat/can_reuse_media_keys.d.ts +4 -0
- package/dist/_esm5.processed/compat/can_reuse_media_keys.js +6 -2
- package/dist/_esm5.processed/compat/change_source_buffer_type.d.ts +1 -1
- package/dist/_esm5.processed/compat/eme/close_session.d.ts +1 -1
- package/dist/_esm5.processed/compat/eme/close_session.js +17 -13
- package/dist/_esm5.processed/compat/eme/custom_key_system_access.d.ts +1 -1
- package/dist/_esm5.processed/compat/eme/custom_media_keys/ie11_media_keys.d.ts +1 -1
- package/dist/_esm5.processed/compat/eme/custom_media_keys/ie11_media_keys.js +8 -9
- package/dist/_esm5.processed/compat/eme/custom_media_keys/index.d.ts +3 -2
- package/dist/_esm5.processed/compat/eme/custom_media_keys/index.js +1 -1
- package/dist/_esm5.processed/compat/eme/custom_media_keys/moz_media_keys_constructor.d.ts +1 -1
- package/dist/_esm5.processed/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts +1 -1
- package/dist/_esm5.processed/compat/eme/custom_media_keys/old_webkit_media_keys.js +7 -9
- package/dist/_esm5.processed/compat/eme/custom_media_keys/types.d.ts +4 -1
- package/dist/_esm5.processed/compat/eme/custom_media_keys/webkit_media_keys.d.ts +2 -2
- package/dist/_esm5.processed/compat/eme/custom_media_keys/webkit_media_keys.js +6 -12
- package/dist/_esm5.processed/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts +2 -1
- package/dist/_esm5.processed/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +3 -3
- package/dist/_esm5.processed/compat/eme/eme-api-implementation.d.ts +4 -4
- package/dist/_esm5.processed/compat/eme/eme-api-implementation.js +26 -11
- package/dist/_esm5.processed/compat/eme/generate_key_request.d.ts +1 -1
- package/dist/_esm5.processed/compat/eme/generate_key_request.js +17 -20
- package/dist/_esm5.processed/compat/eme/get_init_data.d.ts +3 -1
- package/dist/_esm5.processed/compat/eme/get_init_data.js +7 -9
- package/dist/_esm5.processed/compat/eme/get_uuid_kid_from_keystatus_kid.js +2 -3
- package/dist/_esm5.processed/compat/eme/get_webkit_fairplay_initdata.js +12 -13
- package/dist/_esm5.processed/compat/eme/index.d.ts +8 -5
- package/dist/_esm5.processed/compat/eme/index.js +1 -1
- package/dist/_esm5.processed/compat/eme/load_session.d.ts +1 -1
- package/dist/_esm5.processed/compat/enable_audio_track.d.ts +1 -1
- package/dist/_esm5.processed/compat/event_listeners.d.ts +26 -24
- package/dist/_esm5.processed/compat/event_listeners.js +14 -29
- package/dist/_esm5.processed/compat/fullscreen.d.ts +1 -1
- package/dist/_esm5.processed/compat/fullscreen.js +1 -1
- package/dist/_esm5.processed/compat/generate_init_data.js +3 -5
- package/dist/_esm5.processed/compat/index.d.ts +6 -3
- package/dist/_esm5.processed/compat/index.js +2 -2
- package/dist/_esm5.processed/compat/is_vtt_cue.d.ts +1 -1
- package/dist/_esm5.processed/compat/make_vtt_cue.d.ts +1 -1
- package/dist/_esm5.processed/compat/on_height_width_change.d.ts +2 -2
- package/dist/_esm5.processed/compat/on_height_width_change.js +3 -2
- package/dist/_esm5.processed/compat/patch_webkit_source_buffer.js +28 -29
- package/dist/_esm5.processed/compat/should_favour_custom_safari_EME.js +2 -2
- package/dist/_esm5.processed/compat/should_reload_media_source_on_decipherability_update.js +1 -2
- package/dist/_esm5.processed/config.d.ts +1 -1
- package/dist/_esm5.processed/config.js +0 -15
- package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.d.ts +7 -6
- package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.js +45 -22
- package/dist/_esm5.processed/core/adaptive/buffer_based_chooser.d.ts +1 -1
- package/dist/_esm5.processed/core/adaptive/buffer_based_chooser.js +11 -10
- package/dist/_esm5.processed/core/adaptive/guess_based_chooser.d.ts +4 -4
- package/dist/_esm5.processed/core/adaptive/guess_based_chooser.js +7 -6
- package/dist/_esm5.processed/core/adaptive/index.d.ts +3 -2
- package/dist/_esm5.processed/core/adaptive/network_analyzer.d.ts +4 -4
- package/dist/_esm5.processed/core/adaptive/network_analyzer.js +43 -38
- package/dist/_esm5.processed/core/adaptive/utils/bandwidth_estimator.js +1 -1
- package/dist/_esm5.processed/core/adaptive/utils/ewma.js +1 -2
- package/dist/_esm5.processed/core/adaptive/utils/filter_by_bitrate.d.ts +1 -1
- package/dist/_esm5.processed/core/adaptive/utils/filter_by_width.d.ts +1 -1
- package/dist/_esm5.processed/core/adaptive/utils/filter_by_width.js +3 -6
- package/dist/_esm5.processed/core/adaptive/utils/get_buffer_levels.js +7 -4
- package/dist/_esm5.processed/core/adaptive/utils/last_estimate_storage.d.ts +1 -1
- package/dist/_esm5.processed/core/adaptive/utils/pending_requests_store.d.ts +2 -1
- package/dist/_esm5.processed/core/adaptive/utils/representation_score_calculator.d.ts +1 -1
- package/dist/_esm5.processed/core/adaptive/utils/representation_score_calculator.js +8 -5
- package/dist/_esm5.processed/core/adaptive/utils/select_optimal_representation.d.ts +1 -1
- package/dist/_esm5.processed/core/adaptive/utils/select_optimal_representation.js +5 -3
- package/dist/_esm5.processed/core/api/debug/buffer_graph.d.ts +1 -1
- package/dist/_esm5.processed/core/api/debug/buffer_graph.js +3 -8
- package/dist/_esm5.processed/core/api/debug/buffer_size_graph.js +1 -2
- package/dist/_esm5.processed/core/api/debug/modules/general_info.d.ts +2 -2
- package/dist/_esm5.processed/core/api/debug/modules/general_info.js +17 -13
- package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_content.d.ts +3 -3
- package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_content.js +4 -2
- package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_size.d.ts +2 -2
- package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_size.js +1 -1
- package/dist/_esm5.processed/core/api/debug/render.d.ts +2 -2
- package/dist/_esm5.processed/core/api/debug/utils.d.ts +5 -5
- package/dist/_esm5.processed/core/api/index.d.ts +1 -1
- package/dist/_esm5.processed/core/api/option_utils.d.ts +3 -3
- package/dist/_esm5.processed/core/api/option_utils.js +85 -48
- package/dist/_esm5.processed/core/api/playback_observer.d.ts +16 -18
- package/dist/_esm5.processed/core/api/playback_observer.js +65 -42
- package/dist/_esm5.processed/core/api/public_api.d.ts +10 -9
- package/dist/_esm5.processed/core/api/public_api.js +103 -94
- package/dist/_esm5.processed/core/api/tracks_management/media_element_track_choice_manager.d.ts +1 -1
- package/dist/_esm5.processed/core/api/tracks_management/media_element_track_choice_manager.js +25 -14
- package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.d.ts +3 -3
- package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.js +72 -80
- package/dist/_esm5.processed/core/api/utils.d.ts +5 -5
- package/dist/_esm5.processed/core/api/utils.js +5 -8
- package/dist/_esm5.processed/core/decrypt/__tests__/__global__/utils.d.ts +12 -54
- package/dist/_esm5.processed/core/decrypt/__tests__/__global__/utils.js +55 -66
- package/dist/_esm5.processed/core/decrypt/attach_media_keys.d.ts +10 -5
- package/dist/_esm5.processed/core/decrypt/attach_media_keys.js +16 -8
- package/dist/_esm5.processed/core/decrypt/content_decryptor.d.ts +11 -2
- package/dist/_esm5.processed/core/decrypt/content_decryptor.js +136 -65
- package/dist/_esm5.processed/core/decrypt/create_or_load_session.d.ts +5 -4
- package/dist/_esm5.processed/core/decrypt/create_or_load_session.js +18 -7
- package/dist/_esm5.processed/core/decrypt/create_session.d.ts +5 -4
- package/dist/_esm5.processed/core/decrypt/create_session.js +6 -12
- package/dist/_esm5.processed/core/decrypt/dispose_decryption_resources.js +1 -2
- package/dist/_esm5.processed/core/decrypt/find_key_system.d.ts +13 -3
- package/dist/_esm5.processed/core/decrypt/find_key_system.js +45 -22
- package/dist/_esm5.processed/core/decrypt/get_key_system_configuration.js +1 -2
- package/dist/_esm5.processed/core/decrypt/get_media_keys.d.ts +9 -4
- package/dist/_esm5.processed/core/decrypt/get_media_keys.js +17 -6
- package/dist/_esm5.processed/core/decrypt/init_media_keys.d.ts +3 -3
- package/dist/_esm5.processed/core/decrypt/session_events_listener.d.ts +2 -2
- package/dist/_esm5.processed/core/decrypt/session_events_listener.js +12 -16
- package/dist/_esm5.processed/core/decrypt/set_server_certificate.d.ts +3 -3
- package/dist/_esm5.processed/core/decrypt/set_server_certificate.js +6 -7
- package/dist/_esm5.processed/core/decrypt/types.d.ts +11 -5
- package/dist/_esm5.processed/core/decrypt/utils/are_init_values_compatible.js +20 -12
- package/dist/_esm5.processed/core/decrypt/utils/check_key_statuses.d.ts +2 -2
- package/dist/_esm5.processed/core/decrypt/utils/check_key_statuses.js +5 -4
- package/dist/_esm5.processed/core/decrypt/utils/clean_old_loaded_sessions.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/utils/clean_old_stored_persistent_info.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/utils/init_data_values_container.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/utils/init_data_values_container.js +16 -9
- package/dist/_esm5.processed/core/decrypt/utils/is_session_usable.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/utils/is_session_usable.js +1 -2
- package/dist/_esm5.processed/core/decrypt/utils/key_session_record.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/utils/key_session_record.js +1 -2
- package/dist/_esm5.processed/core/decrypt/utils/loaded_sessions_store.d.ts +11 -13
- package/dist/_esm5.processed/core/decrypt/utils/loaded_sessions_store.js +13 -13
- package/dist/_esm5.processed/core/decrypt/utils/media_keys_infos_store.d.ts +8 -3
- package/dist/_esm5.processed/core/decrypt/utils/media_keys_infos_store.js +1 -2
- package/dist/_esm5.processed/core/decrypt/utils/persistent_sessions_store.d.ts +3 -3
- package/dist/_esm5.processed/core/decrypt/utils/persistent_sessions_store.js +27 -16
- package/dist/_esm5.processed/core/decrypt/utils/serializable_bytes.js +1 -1
- package/dist/_esm5.processed/core/decrypt/utils/server_certificate_store.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/utils/server_certificate_store.js +19 -12
- package/dist/_esm5.processed/core/fetchers/cdn_prioritizer.d.ts +2 -2
- package/dist/_esm5.processed/core/fetchers/cdn_prioritizer.js +5 -6
- package/dist/_esm5.processed/core/fetchers/index.d.ts +6 -3
- package/dist/_esm5.processed/core/fetchers/index.js +1 -1
- package/dist/_esm5.processed/core/fetchers/manifest/index.d.ts +3 -2
- package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.d.ts +2 -2
- package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +68 -61
- package/dist/_esm5.processed/core/fetchers/segment/index.d.ts +4 -3
- package/dist/_esm5.processed/core/fetchers/segment/prioritized_segment_fetcher.d.ts +4 -3
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.d.ts +9 -8
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +41 -29
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.d.ts +5 -5
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.js +2 -3
- package/dist/_esm5.processed/core/fetchers/segment/task_prioritizer.d.ts +1 -1
- package/dist/_esm5.processed/core/fetchers/segment/task_prioritizer.js +19 -18
- package/dist/_esm5.processed/core/fetchers/utils/error_selector.d.ts +1 -1
- package/dist/_esm5.processed/core/fetchers/utils/error_selector.js +1 -1
- package/dist/_esm5.processed/core/fetchers/utils/schedule_request.d.ts +3 -3
- package/dist/_esm5.processed/core/fetchers/utils/schedule_request.js +25 -25
- package/dist/_esm5.processed/core/init/directfile_content_initializer.d.ts +4 -4
- package/dist/_esm5.processed/core/init/directfile_content_initializer.js +21 -17
- package/dist/_esm5.processed/core/init/index.d.ts +2 -1
- package/dist/_esm5.processed/core/init/index.js +1 -1
- package/dist/_esm5.processed/core/init/media_source_content_initializer.d.ts +9 -9
- package/dist/_esm5.processed/core/init/media_source_content_initializer.js +64 -32
- package/dist/_esm5.processed/core/init/types.d.ts +10 -12
- package/dist/_esm5.processed/core/init/utils/content_time_boundaries_observer.d.ts +6 -5
- package/dist/_esm5.processed/core/init/utils/content_time_boundaries_observer.js +20 -19
- package/dist/_esm5.processed/core/init/utils/create_media_source.d.ts +1 -1
- package/dist/_esm5.processed/core/init/utils/create_media_source.js +2 -3
- package/dist/_esm5.processed/core/init/utils/create_stream_playback_observer.d.ts +6 -6
- package/dist/_esm5.processed/core/init/utils/create_stream_playback_observer.js +5 -3
- package/dist/_esm5.processed/core/init/utils/end_of_stream.d.ts +1 -1
- package/dist/_esm5.processed/core/init/utils/get_initial_time.d.ts +1 -1
- package/dist/_esm5.processed/core/init/utils/get_initial_time.js +12 -15
- package/dist/_esm5.processed/core/init/utils/get_loaded_reference.d.ts +3 -3
- package/dist/_esm5.processed/core/init/utils/get_loaded_reference.js +1 -2
- package/dist/_esm5.processed/core/init/utils/initial_seek_and_play.d.ts +9 -9
- package/dist/_esm5.processed/core/init/utils/initial_seek_and_play.js +39 -3
- package/dist/_esm5.processed/core/init/utils/initialize_content_decryption.d.ts +9 -8
- package/dist/_esm5.processed/core/init/utils/initialize_content_decryption.js +12 -9
- package/dist/_esm5.processed/core/init/utils/media_source_duration_updater.js +10 -7
- package/dist/_esm5.processed/core/init/utils/rebuffering_controller.d.ts +7 -6
- package/dist/_esm5.processed/core/init/utils/rebuffering_controller.js +24 -24
- package/dist/_esm5.processed/core/init/utils/stream_events_emitter/are_same_stream_events.js +1 -3
- package/dist/_esm5.processed/core/init/utils/stream_events_emitter/index.d.ts +1 -1
- package/dist/_esm5.processed/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.d.ts +2 -2
- package/dist/_esm5.processed/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.js +14 -6
- package/dist/_esm5.processed/core/init/utils/stream_events_emitter/stream_events_emitter.d.ts +3 -3
- package/dist/_esm5.processed/core/init/utils/stream_events_emitter/stream_events_emitter.js +12 -19
- package/dist/_esm5.processed/core/init/utils/stream_events_emitter/types.d.ts +1 -1
- package/dist/_esm5.processed/core/init/utils/throw_on_media_error.d.ts +1 -1
- package/dist/_esm5.processed/core/init/utils/throw_on_media_error.js +11 -6
- package/dist/_esm5.processed/core/segment_buffers/garbage_collector.d.ts +6 -6
- package/dist/_esm5.processed/core/segment_buffers/garbage_collector.js +12 -13
- package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.d.ts +3 -2
- package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +6 -9
- package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.d.ts +3 -2
- package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.js +1 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.d.ts +2 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +7 -7
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/text_track_cues_store.d.ts +1 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/text_track_cues_store.js +4 -4
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/update_proportional_elements.js +1 -2
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/utils.d.ts +1 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/utils.js +2 -6
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +2 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +2 -2
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/parsers.d.ts +1 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/types.d.ts +5 -7
- package/dist/_esm5.processed/core/segment_buffers/implementations/utils/manual_time_ranges.js +1 -1
- package/dist/_esm5.processed/core/segment_buffers/index.d.ts +8 -4
- package/dist/_esm5.processed/core/segment_buffers/index.js +2 -2
- package/dist/_esm5.processed/core/segment_buffers/inventory/buffered_history.d.ts +1 -1
- package/dist/_esm5.processed/core/segment_buffers/inventory/index.d.ts +6 -4
- package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.d.ts +4 -4
- package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.js +63 -54
- package/dist/_esm5.processed/core/segment_buffers/inventory/types.d.ts +1 -1
- package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.d.ts +2 -2
- package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.js +17 -23
- package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.d.ts +3 -3
- package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +49 -22
- package/dist/_esm5.processed/core/stream/adaptation/types.d.ts +8 -7
- package/dist/_esm5.processed/core/stream/adaptation/utils/create_representation_estimator.d.ts +7 -6
- package/dist/_esm5.processed/core/stream/adaptation/utils/create_representation_estimator.js +2 -1
- package/dist/_esm5.processed/core/stream/index.d.ts +6 -5
- package/dist/_esm5.processed/core/stream/orchestrator/get_time_ranges_for_content.d.ts +3 -3
- package/dist/_esm5.processed/core/stream/orchestrator/get_time_ranges_for_content.js +2 -2
- package/dist/_esm5.processed/core/stream/orchestrator/index.d.ts +3 -2
- package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.d.ts +9 -7
- package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +47 -34
- package/dist/_esm5.processed/core/stream/period/period_stream.d.ts +3 -3
- package/dist/_esm5.processed/core/stream/period/period_stream.js +49 -16
- package/dist/_esm5.processed/core/stream/period/types.d.ts +15 -12
- package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +9 -9
- package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.js +26 -25
- package/dist/_esm5.processed/core/stream/representation/representation_stream.d.ts +3 -3
- package/dist/_esm5.processed/core/stream/representation/representation_stream.js +47 -23
- package/dist/_esm5.processed/core/stream/representation/types.d.ts +9 -8
- package/dist/_esm5.processed/core/stream/representation/utils/append_segment_to_buffer.d.ts +4 -4
- package/dist/_esm5.processed/core/stream/representation/utils/append_segment_to_buffer.js +10 -7
- package/dist/_esm5.processed/core/stream/representation/utils/check_for_discontinuity.d.ts +4 -3
- package/dist/_esm5.processed/core/stream/representation/utils/check_for_discontinuity.js +16 -18
- package/dist/_esm5.processed/core/stream/representation/utils/downloading_queue.d.ts +7 -6
- package/dist/_esm5.processed/core/stream/representation/utils/downloading_queue.js +11 -11
- package/dist/_esm5.processed/core/stream/representation/utils/force_garbage_collection.d.ts +2 -2
- package/dist/_esm5.processed/core/stream/representation/utils/force_garbage_collection.js +6 -8
- package/dist/_esm5.processed/core/stream/representation/utils/get_buffer_status.d.ts +5 -4
- package/dist/_esm5.processed/core/stream/representation/utils/get_buffer_status.js +40 -19
- package/dist/_esm5.processed/core/stream/representation/utils/get_needed_segments.d.ts +4 -3
- package/dist/_esm5.processed/core/stream/representation/utils/get_needed_segments.js +27 -28
- package/dist/_esm5.processed/core/stream/representation/utils/push_init_segment.d.ts +6 -5
- package/dist/_esm5.processed/core/stream/representation/utils/push_init_segment.js +7 -5
- package/dist/_esm5.processed/core/stream/representation/utils/push_media_segment.d.ts +8 -7
- package/dist/_esm5.processed/core/stream/representation/utils/push_media_segment.js +13 -10
- package/dist/_esm5.processed/default_config.js +20 -16
- package/dist/_esm5.processed/errors/encrypted_media_error.d.ts +2 -2
- package/dist/_esm5.processed/errors/encrypted_media_error.js +1 -1
- package/dist/_esm5.processed/errors/error_codes.d.ts +1 -1
- package/dist/_esm5.processed/errors/error_codes.js +1 -1
- package/dist/_esm5.processed/errors/format_error.d.ts +2 -2
- package/dist/_esm5.processed/errors/format_error.js +1 -2
- package/dist/_esm5.processed/errors/index.d.ts +6 -3
- package/dist/_esm5.processed/errors/index.js +2 -2
- package/dist/_esm5.processed/errors/is_known_error.d.ts +1 -1
- package/dist/_esm5.processed/errors/is_known_error.js +2 -2
- package/dist/_esm5.processed/errors/media_error.d.ts +3 -3
- package/dist/_esm5.processed/errors/media_error.js +4 -7
- package/dist/_esm5.processed/errors/network_error.d.ts +2 -2
- package/dist/_esm5.processed/errors/network_error.js +3 -3
- package/dist/_esm5.processed/errors/other_error.d.ts +1 -1
- package/dist/_esm5.processed/errors/other_error.js +1 -1
- package/dist/_esm5.processed/errors/request_error.d.ts +1 -1
- package/dist/_esm5.processed/experimental/features/dash_wasm.d.ts +2 -2
- package/dist/_esm5.processed/experimental/features/debug_element.d.ts +1 -1
- package/dist/_esm5.processed/experimental/features/local.d.ts +1 -1
- package/dist/_esm5.processed/experimental/features/metaplaylist.d.ts +1 -1
- package/dist/_esm5.processed/experimental/index.d.ts +1 -1
- package/dist/_esm5.processed/experimental/index.js +1 -1
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/features/dash.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/features/metaplaylist.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/index.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/index.js +2 -2
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/load_and_push_segment.d.ts +3 -3
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/load_and_push_segment.js +7 -3
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +1 -2
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.d.ts +2 -2
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.js +2 -2
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/types.d.ts +3 -2
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.d.ts +2 -2
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +12 -18
- package/dist/_esm5.processed/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +13 -23
- package/dist/_esm5.processed/experimental/tools/createMetaplaylist/index.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/createMetaplaylist/index.js +8 -7
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/index.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/index.js +9 -13
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.d.ts +4 -3
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.js +5 -3
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/capabilities.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/capabilities.js +10 -47
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.d.ts +2 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.js +8 -5
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.d.ts +2 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.js +21 -13
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.d.ts +2 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +22 -18
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.js +4 -7
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/index.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts +2 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +3 -5
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/format.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/format.js +4 -10
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts +2 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +2 -3
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts +2 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +2 -3
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/types.d.ts +2 -2
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/utils.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/utils.js +6 -6
- package/dist/_esm5.processed/experimental/tools/parseBIFThumbnails.js +5 -4
- package/dist/_esm5.processed/features/add_features.d.ts +1 -1
- package/dist/_esm5.processed/features/features_object.d.ts +1 -1
- package/dist/_esm5.processed/features/features_object.js +4 -3
- package/dist/_esm5.processed/features/index.d.ts +3 -2
- package/dist/_esm5.processed/features/index.js +1 -1
- package/dist/_esm5.processed/features/list/bif_parser.d.ts +1 -1
- package/dist/_esm5.processed/features/list/dash.d.ts +1 -1
- package/dist/_esm5.processed/features/list/directfile.d.ts +1 -1
- package/dist/_esm5.processed/features/list/eme.d.ts +1 -1
- package/dist/_esm5.processed/features/list/html_sami_parser.d.ts +1 -1
- package/dist/_esm5.processed/features/list/html_srt_parser.d.ts +1 -1
- package/dist/_esm5.processed/features/list/html_text_buffer.d.ts +1 -1
- package/dist/_esm5.processed/features/list/html_ttml_parser.d.ts +1 -1
- package/dist/_esm5.processed/features/list/html_vtt_parser.d.ts +1 -1
- package/dist/_esm5.processed/features/list/image_buffer.d.ts +1 -1
- package/dist/_esm5.processed/features/list/native_sami_parser.d.ts +1 -1
- package/dist/_esm5.processed/features/list/native_srt_parser.d.ts +1 -1
- package/dist/_esm5.processed/features/list/native_text_buffer.d.ts +1 -1
- package/dist/_esm5.processed/features/list/native_ttml_parser.d.ts +1 -1
- package/dist/_esm5.processed/features/list/native_vtt_parser.d.ts +1 -1
- package/dist/_esm5.processed/features/list/smooth.d.ts +1 -1
- package/dist/_esm5.processed/features/types.d.ts +11 -11
- package/dist/_esm5.processed/manifest/adaptation.d.ts +3 -3
- package/dist/_esm5.processed/manifest/adaptation.js +24 -14
- package/dist/_esm5.processed/manifest/index.d.ts +9 -5
- package/dist/_esm5.processed/manifest/index.js +4 -8
- package/dist/_esm5.processed/manifest/manifest.d.ts +8 -7
- package/dist/_esm5.processed/manifest/manifest.js +37 -33
- package/dist/_esm5.processed/manifest/period.d.ts +4 -4
- package/dist/_esm5.processed/manifest/period.js +7 -14
- package/dist/_esm5.processed/manifest/representation.d.ts +4 -4
- package/dist/_esm5.processed/manifest/representation.js +5 -5
- package/dist/_esm5.processed/manifest/representation_index/index.d.ts +3 -2
- package/dist/_esm5.processed/manifest/representation_index/index.js +1 -1
- package/dist/_esm5.processed/manifest/representation_index/static.d.ts +1 -1
- package/dist/_esm5.processed/manifest/representation_index/static.js +6 -2
- package/dist/_esm5.processed/manifest/representation_index/types.d.ts +6 -5
- package/dist/_esm5.processed/manifest/update_period_in_place.d.ts +3 -3
- package/dist/_esm5.processed/manifest/update_period_in_place.js +9 -9
- package/dist/_esm5.processed/manifest/update_periods.d.ts +2 -2
- package/dist/_esm5.processed/manifest/update_periods.js +6 -3
- package/dist/_esm5.processed/manifest/utils.d.ts +4 -4
- package/dist/_esm5.processed/manifest/utils.js +6 -4
- package/dist/_esm5.processed/parsers/containers/isobmff/create_box.d.ts +1 -1
- package/dist/_esm5.processed/parsers/containers/isobmff/create_box.js +5 -4
- package/dist/_esm5.processed/parsers/containers/isobmff/drm/playready.js +2 -3
- package/dist/_esm5.processed/parsers/containers/isobmff/get_box.js +3 -5
- package/dist/_esm5.processed/parsers/containers/isobmff/index.d.ts +5 -4
- package/dist/_esm5.processed/parsers/containers/isobmff/index.js +4 -4
- package/dist/_esm5.processed/parsers/containers/isobmff/read.d.ts +1 -1
- package/dist/_esm5.processed/parsers/containers/isobmff/read.js +9 -9
- package/dist/_esm5.processed/parsers/containers/isobmff/take_pssh_out.js +3 -4
- package/dist/_esm5.processed/parsers/containers/isobmff/utils.js +51 -41
- package/dist/_esm5.processed/parsers/containers/matroska/index.d.ts +2 -1
- package/dist/_esm5.processed/parsers/containers/matroska/index.js +1 -1
- package/dist/_esm5.processed/parsers/containers/matroska/utils.js +29 -16
- package/dist/_esm5.processed/parsers/images/bif.js +15 -5
- package/dist/_esm5.processed/parsers/manifest/dash/common/attach_trickmode_track.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/convert_supplemental_codecs.js +1 -3
- package/dist/_esm5.processed/parsers/manifest/dash/common/flatten_overlapping_periods.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/flatten_overlapping_periods.js +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/get_hdr_information.js +4 -12
- package/dist/_esm5.processed/parsers/manifest/dash/common/get_http_utc-timing_url.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/get_http_utc-timing_url.js +4 -5
- package/dist/_esm5.processed/parsers/manifest/dash/common/get_minimum_and_maximum_positions.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/get_minimum_and_maximum_positions.js +5 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/get_periods_time_infos.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/get_periods_time_infos.js +5 -6
- package/dist/_esm5.processed/parsers/manifest/dash/common/index.d.ts +3 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.d.ts +4 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.js +34 -28
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_init_segment.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_init_segment.js +7 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +4 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -11
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/index.d.ts +10 -5
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.js +30 -18
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.d.ts +3 -3
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.js +56 -55
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +2 -6
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.js +11 -15
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/convert_element_to_index_segment.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/convert_element_to_index_segment.js +12 -9
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.js +29 -19
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/index.d.ts +3 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +6 -6
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +73 -59
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/tokens.js +2 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/manifest_bounds_calculator.js +7 -8
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.d.ts +4 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +52 -50
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_availability_start_time.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.d.ts +6 -6
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.js +52 -31
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.d.ts +4 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.js +41 -30
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.d.ts +4 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.js +1 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.d.ts +4 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.js +63 -64
- package/dist/_esm5.processed/parsers/manifest/dash/common/resolve_base_urls.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/resolve_base_urls.js +4 -2
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.js +73 -37
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/BaseURL.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/BaseURL.js +1 -2
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/ContentComponent.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/ContentProtection.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/EventStream.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/EventStream.js +13 -7
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Initialization.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Initialization.js +5 -3
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/MPD.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/MPD.js +44 -27
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Period.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Period.js +14 -8
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Representation.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Representation.js +36 -18
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentBase.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentBase.js +36 -18
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentList.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentTemplate.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentTemplate.js +17 -8
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentTimeline.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentURL.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/SegmentURL.js +9 -5
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/utils.d.ts +8 -26
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/utils.js +6 -12
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/parse_from_document.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/parse_from_document.js +9 -4
- package/dist/_esm5.processed/parsers/manifest/dash/parsers_types.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/index.d.ts +3 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +29 -16
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts +3 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +22 -35
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/BaseURL.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/ContentComponent.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.js +3 -1
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.d.ts +3 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.js +2 -4
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Label.d.ts +3 -0
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Label.js +9 -0
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/MPD.d.ts +3 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/MPD.js +5 -5
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Period.d.ts +3 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Period.js +9 -6
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Representation.d.ts +3 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Representation.js +8 -16
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Scheme.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentBase.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentBase.js +5 -10
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentList.d.ts +3 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentTemplate.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentTemplate.js +11 -18
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentUrl.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/SegmentUrl.js +2 -4
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/XLink.d.ts +3 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/XLink.js +5 -5
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/root.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/root.js +5 -6
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/parsers_stack.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/parsers_stack.js +1 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/types.d.ts +2 -1
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/utils.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/utils.js +2 -4
- package/dist/_esm5.processed/parsers/manifest/local/index.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/local/parse_local_manifest.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/local/parse_local_manifest.js +25 -16
- package/dist/_esm5.processed/parsers/manifest/local/representation_index.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/local/representation_index.js +5 -10
- package/dist/_esm5.processed/parsers/manifest/metaplaylist/index.d.ts +3 -2
- package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.js +33 -29
- package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.js +9 -7
- package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.d.ts +3 -3
- package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.js +136 -109
- package/dist/_esm5.processed/parsers/manifest/smooth/get_codecs.js +3 -3
- package/dist/_esm5.processed/parsers/manifest/smooth/index.d.ts +4 -2
- package/dist/_esm5.processed/parsers/manifest/smooth/index.js +1 -1
- package/dist/_esm5.processed/parsers/manifest/smooth/parse_C_nodes.js +6 -6
- package/dist/_esm5.processed/parsers/manifest/smooth/parse_protection_node.js +12 -8
- package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.js +48 -53
- package/dist/_esm5.processed/parsers/manifest/smooth/utils/add_segment_infos.js +10 -7
- package/dist/_esm5.processed/parsers/manifest/smooth/utils/tokens.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/smooth/utils/tokens.js +2 -3
- package/dist/_esm5.processed/parsers/manifest/types.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/utils/check_manifest_ids.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/utils/clear_timeline_from_position.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/utils/clear_timeline_from_position.js +9 -6
- package/dist/_esm5.processed/parsers/manifest/utils/get_first_time_from_adaptation.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/utils/get_first_time_from_adaptation.js +5 -4
- package/dist/_esm5.processed/parsers/manifest/utils/get_last_time_from_adaptation.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/utils/get_last_time_from_adaptation.js +5 -4
- package/dist/_esm5.processed/parsers/manifest/utils/get_maximum_positions.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/utils/get_maximum_positions.js +10 -16
- package/dist/_esm5.processed/parsers/manifest/utils/get_minimum_position.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/utils/get_minimum_position.js +4 -10
- package/dist/_esm5.processed/parsers/manifest/utils/index_helpers.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/utils/index_helpers.js +4 -5
- package/dist/_esm5.processed/parsers/manifest/utils/update_segment_timeline.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/utils/update_segment_timeline.js +18 -18
- package/dist/_esm5.processed/parsers/texttracks/index.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/sami/html.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/sami/html.js +15 -15
- package/dist/_esm5.processed/parsers/texttracks/sami/native.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/sami/native.js +7 -14
- package/dist/_esm5.processed/parsers/texttracks/srt/html.js +6 -6
- package/dist/_esm5.processed/parsers/texttracks/srt/native.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/srt/native.js +1 -7
- package/dist/_esm5.processed/parsers/texttracks/srt/parse_cue.js +4 -8
- package/dist/_esm5.processed/parsers/texttracks/ttml/get_parameters.js +4 -8
- package/dist/_esm5.processed/parsers/texttracks/ttml/get_time_delimiters.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/ttml/get_time_delimiters.js +6 -8
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_default_ttml_paragraph_style.js +2 -2
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_extent.js +2 -6
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_font_size.js +3 -4
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_origin.js +2 -6
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_padding.js +2 -6
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/create_element.d.ts +2 -2
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/create_element.js +22 -21
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/generate_css_test_outline.js +2 -2
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/parse_cue.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/parse_cue.js +5 -3
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/parse_ttml_to_div.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/ttml_color_to_css_color.js +34 -19
- package/dist/_esm5.processed/parsers/texttracks/ttml/native/parse_cue.d.ts +2 -2
- package/dist/_esm5.processed/parsers/texttracks/ttml/native/parse_cue.js +9 -10
- package/dist/_esm5.processed/parsers/texttracks/ttml/native/parse_ttml_to_vtt.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/ttml/parse_ttml.d.ts +3 -3
- package/dist/_esm5.processed/parsers/texttracks/ttml/parse_ttml.js +28 -16
- package/dist/_esm5.processed/parsers/texttracks/ttml/resolve_styles_inheritance.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/ttml/time_parsing.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/ttml/time_parsing.js +2 -2
- package/dist/_esm5.processed/parsers/texttracks/types.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/webvtt/get_cue_blocks.js +1 -1
- package/dist/_esm5.processed/parsers/texttracks/webvtt/get_style_blocks.js +2 -1
- package/dist/_esm5.processed/parsers/texttracks/webvtt/html/convert_payload_to_html.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/webvtt/html/create_default_style_elements.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/webvtt/html/create_style_attribute.js +6 -12
- package/dist/_esm5.processed/parsers/texttracks/webvtt/html/create_styled_element.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/webvtt/html/create_styled_element.js +7 -8
- package/dist/_esm5.processed/parsers/texttracks/webvtt/html/index.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/webvtt/html/parse_style_block.js +4 -4
- package/dist/_esm5.processed/parsers/texttracks/webvtt/html/parse_webvtt_to_div.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/webvtt/html/to_html.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/webvtt/html/to_html.js +4 -10
- package/dist/_esm5.processed/parsers/texttracks/webvtt/native/parse_vtt_to_cues.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/webvtt/native/parse_vtt_to_cues.js +2 -6
- package/dist/_esm5.processed/parsers/texttracks/webvtt/native/set_settings_on_cue.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/webvtt/native/to_native_cue.d.ts +1 -1
- package/dist/_esm5.processed/parsers/texttracks/webvtt/native/to_native_cue.js +1 -1
- package/dist/_esm5.processed/parsers/texttracks/webvtt/parse_cue_block.js +2 -4
- package/dist/_esm5.processed/parsers/texttracks/webvtt/parse_timestamp.js +1 -2
- package/dist/_esm5.processed/parsers/texttracks/webvtt/utils.js +6 -6
- package/dist/_esm5.processed/public_types.d.ts +13 -11
- package/dist/_esm5.processed/tools/TextTrackRenderer/index.d.ts +3 -2
- package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.d.ts +2 -2
- package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.js +15 -10
- package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.d.ts +1 -1
- package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +2 -3
- package/dist/_esm5.processed/transports/dash/construct_segment_url.d.ts +2 -2
- package/dist/_esm5.processed/transports/dash/construct_segment_url.js +5 -3
- package/dist/_esm5.processed/transports/dash/extract_complete_chunks.js +2 -2
- package/dist/_esm5.processed/transports/dash/get_events_out_of_emsgs.d.ts +2 -2
- package/dist/_esm5.processed/transports/dash/get_events_out_of_emsgs.js +9 -10
- package/dist/_esm5.processed/transports/dash/image_pipelines.d.ts +3 -3
- package/dist/_esm5.processed/transports/dash/image_pipelines.js +32 -19
- package/dist/_esm5.processed/transports/dash/init_segment_loader.d.ts +3 -3
- package/dist/_esm5.processed/transports/dash/init_segment_loader.js +46 -22
- package/dist/_esm5.processed/transports/dash/low_latency_segment_loader.d.ts +2 -2
- package/dist/_esm5.processed/transports/dash/low_latency_segment_loader.js +13 -9
- package/dist/_esm5.processed/transports/dash/manifest_parser.d.ts +2 -2
- package/dist/_esm5.processed/transports/dash/manifest_parser.js +35 -22
- package/dist/_esm5.processed/transports/dash/pipelines.d.ts +1 -1
- package/dist/_esm5.processed/transports/dash/pipelines.js +11 -15
- package/dist/_esm5.processed/transports/dash/segment_loader.d.ts +4 -4
- package/dist/_esm5.processed/transports/dash/segment_loader.js +30 -21
- package/dist/_esm5.processed/transports/dash/segment_parser.d.ts +2 -2
- package/dist/_esm5.processed/transports/dash/segment_parser.js +47 -21
- package/dist/_esm5.processed/transports/dash/text_loader.d.ts +2 -2
- package/dist/_esm5.processed/transports/dash/text_loader.js +19 -19
- package/dist/_esm5.processed/transports/dash/text_parser.d.ts +2 -2
- package/dist/_esm5.processed/transports/dash/text_parser.js +45 -24
- package/dist/_esm5.processed/transports/local/pipelines.d.ts +1 -1
- package/dist/_esm5.processed/transports/local/pipelines.js +7 -8
- package/dist/_esm5.processed/transports/local/segment_loader.d.ts +3 -3
- package/dist/_esm5.processed/transports/local/segment_loader.js +14 -6
- package/dist/_esm5.processed/transports/local/segment_parser.d.ts +1 -1
- package/dist/_esm5.processed/transports/local/segment_parser.js +31 -13
- package/dist/_esm5.processed/transports/local/text_parser.d.ts +1 -1
- package/dist/_esm5.processed/transports/local/text_parser.js +44 -19
- package/dist/_esm5.processed/transports/metaplaylist/manifest_loader.d.ts +4 -4
- package/dist/_esm5.processed/transports/metaplaylist/manifest_loader.js +9 -5
- package/dist/_esm5.processed/transports/metaplaylist/pipelines.d.ts +1 -1
- package/dist/_esm5.processed/transports/metaplaylist/pipelines.js +25 -18
- package/dist/_esm5.processed/transports/smooth/extract_timings_infos.d.ts +2 -2
- package/dist/_esm5.processed/transports/smooth/extract_timings_infos.js +16 -15
- package/dist/_esm5.processed/transports/smooth/isobmff/create_audio_init_segment.js +3 -3
- package/dist/_esm5.processed/transports/smooth/isobmff/create_boxes.js +14 -32
- package/dist/_esm5.processed/transports/smooth/isobmff/create_init_segment.js +2 -2
- package/dist/_esm5.processed/transports/smooth/isobmff/create_traf_box.js +2 -2
- package/dist/_esm5.processed/transports/smooth/isobmff/get_aaces_header.js +4 -16
- package/dist/_esm5.processed/transports/smooth/isobmff/index.d.ts +4 -2
- package/dist/_esm5.processed/transports/smooth/isobmff/parse_tfrf.js +2 -2
- package/dist/_esm5.processed/transports/smooth/isobmff/parse_tfxd.js +1 -1
- package/dist/_esm5.processed/transports/smooth/isobmff/patch_segment.js +11 -10
- package/dist/_esm5.processed/transports/smooth/pipelines.d.ts +1 -1
- package/dist/_esm5.processed/transports/smooth/pipelines.js +121 -79
- package/dist/_esm5.processed/transports/smooth/segment_loader.d.ts +3 -3
- package/dist/_esm5.processed/transports/smooth/segment_loader.js +53 -27
- package/dist/_esm5.processed/transports/smooth/utils.d.ts +2 -2
- package/dist/_esm5.processed/transports/smooth/utils.js +7 -5
- package/dist/_esm5.processed/transports/types.d.ts +11 -25
- package/dist/_esm5.processed/transports/utils/byte_range.js +1 -2
- package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.d.ts +3 -3
- package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +13 -7
- package/dist/_esm5.processed/transports/utils/check_isobmff_integrity.js +3 -3
- package/dist/_esm5.processed/transports/utils/find_complete_box.js +3 -2
- package/dist/_esm5.processed/transports/utils/generate_manifest_loader.d.ts +3 -3
- package/dist/_esm5.processed/transports/utils/generate_manifest_loader.js +18 -6
- package/dist/_esm5.processed/transports/utils/get_isobmff_timing_infos.d.ts +2 -2
- package/dist/_esm5.processed/transports/utils/get_isobmff_timing_infos.js +12 -11
- package/dist/_esm5.processed/transports/utils/infer_segment_container.d.ts +1 -1
- package/dist/_esm5.processed/transports/utils/infer_segment_container.js +1 -3
- package/dist/_esm5.processed/transports/utils/parse_text_track.d.ts +4 -4
- package/dist/_esm5.processed/transports/utils/parse_text_track.js +9 -6
- package/dist/_esm5.processed/utils/are_codecs_compatible.js +5 -1
- package/dist/_esm5.processed/utils/array_includes.js +2 -6
- package/dist/_esm5.processed/utils/assert.js +3 -4
- package/dist/_esm5.processed/utils/base64.js +87 -29
- package/dist/_esm5.processed/utils/byte_parsing.js +60 -56
- package/dist/_esm5.processed/utils/cancellable_sleep.d.ts +1 -1
- package/dist/_esm5.processed/utils/create_cancellable_promise.d.ts +1 -1
- package/dist/_esm5.processed/utils/deep_merge.js +4 -4
- package/dist/_esm5.processed/utils/event_emitter.d.ts +1 -1
- package/dist/_esm5.processed/utils/get_fuzzed_delay.js +1 -1
- package/dist/_esm5.processed/utils/hash_buffer.js +1 -1
- package/dist/_esm5.processed/utils/initialization_segment_cache.d.ts +2 -2
- package/dist/_esm5.processed/utils/languages/index.d.ts +4 -2
- package/dist/_esm5.processed/utils/languages/index.js +2 -2
- package/dist/_esm5.processed/utils/languages/normalize.d.ts +2 -1
- package/dist/_esm5.processed/utils/languages/normalize.js +5 -3
- package/dist/_esm5.processed/utils/logger.js +7 -14
- package/dist/_esm5.processed/utils/object_assign.js +5 -5
- package/dist/_esm5.processed/utils/object_values.d.ts +1 -1
- package/dist/_esm5.processed/utils/object_values.js +2 -3
- package/dist/_esm5.processed/utils/ranges.d.ts +2 -1
- package/dist/_esm5.processed/utils/ranges.js +19 -23
- package/dist/_esm5.processed/utils/reference.d.ts +3 -3
- package/dist/_esm5.processed/utils/reference.js +1 -3
- package/dist/_esm5.processed/utils/request/fetch.d.ts +1 -1
- package/dist/_esm5.processed/utils/request/fetch.js +34 -23
- package/dist/_esm5.processed/utils/request/index.d.ts +6 -3
- package/dist/_esm5.processed/utils/request/index.js +2 -2
- package/dist/_esm5.processed/utils/request/xhr.d.ts +1 -1
- package/dist/_esm5.processed/utils/request/xhr.js +28 -17
- package/dist/_esm5.processed/utils/retry_promise_with_backoff.d.ts +2 -2
- package/dist/_esm5.processed/utils/slice_uint8array.js +3 -3
- package/dist/_esm5.processed/utils/starts_with.js +3 -3
- package/dist/_esm5.processed/utils/string_parsing.js +16 -18
- package/dist/_esm5.processed/utils/task_canceller.js +1 -2
- package/dist/_esm5.processed/utils/uniq.d.ts +1 -1
- package/dist/_esm5.processed/utils/uniq.js +4 -3
- package/dist/_esm5.processed/utils/weak_map_memory.js +0 -1
- package/dist/_esm5.processed/utils/wrapInPromise.d.ts +1 -1
- package/dist/mpd-parser.wasm +0 -0
- package/dist/rx-player.js +345 -236
- package/dist/rx-player.min.js +1 -1
- package/experimental/features/index.d.ts-E +16 -0
- package/experimental/features/index.js-E +16 -0
- package/experimental/index.d.ts +1 -1
- package/experimental/index.d.ts-E +16 -0
- package/experimental/index.js +1 -1
- package/experimental/index.js-E +16 -0
- package/experimental/tools/VideoThumbnailLoader/index.d.ts-E +18 -0
- package/experimental/tools/VideoThumbnailLoader/index.js-E +18 -0
- package/experimental/tools/index.d.ts-E +16 -0
- package/experimental/tools/index.js-E +16 -0
- package/features/index.d.ts-E +16 -0
- package/features/index.js-E +16 -0
- package/logger/index.d.ts-E +17 -0
- package/logger/index.js-E +17 -0
- package/minimal/index.d.ts-E +17 -0
- package/minimal/index.js-E +17 -0
- package/package.json +29 -14
- package/tools/TextTrackRenderer.d.ts-E +18 -0
- package/tools/TextTrackRenderer.js-E +18 -0
- package/tools/index.d.ts-E +16 -0
- package/tools/index.js-E +16 -0
- package/tools/string-utils.d.ts-E +18 -0
- package/tools/string-utils.js-E +18 -0
- package/types/index.d.ts-E +16 -0
- package/types/index.js-E +15 -0
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ITTMLHTMLCue } from "./parse_cue";
|
|
16
|
+
import type { ITTMLHTMLCue } from "./parse_cue";
|
|
17
17
|
/**
|
|
18
18
|
* Create array of objects which should represent the given TTML text track.
|
|
19
19
|
* These objects have the following structure
|
|
@@ -24,34 +24,49 @@ export default function ttmlColorToCSSColor(color) {
|
|
|
24
24
|
var regRes;
|
|
25
25
|
regRes = REGXP_8_HEX_COLOR.exec(color);
|
|
26
26
|
if (regRes != null) {
|
|
27
|
-
return "rgba(" +
|
|
28
|
-
String(parseInt(regRes[1], 16)) +
|
|
29
|
-
|
|
30
|
-
String(parseInt(regRes[
|
|
31
|
-
|
|
27
|
+
return ("rgba(" +
|
|
28
|
+
String(parseInt(regRes[1], 16)) +
|
|
29
|
+
"," +
|
|
30
|
+
String(parseInt(regRes[2], 16)) +
|
|
31
|
+
"," +
|
|
32
|
+
String(parseInt(regRes[3], 16)) +
|
|
33
|
+
"," +
|
|
34
|
+
String(parseInt(regRes[4], 16) / 255) +
|
|
35
|
+
")");
|
|
32
36
|
}
|
|
33
37
|
regRes = REGXP_4_HEX_COLOR.exec(color);
|
|
34
38
|
if (regRes != null) {
|
|
35
|
-
return "rgba(" +
|
|
36
|
-
String(parseInt(regRes[1] + regRes[1], 16)) +
|
|
37
|
-
|
|
38
|
-
String(parseInt(regRes[
|
|
39
|
-
|
|
39
|
+
return ("rgba(" +
|
|
40
|
+
String(parseInt(regRes[1] + regRes[1], 16)) +
|
|
41
|
+
"," +
|
|
42
|
+
String(parseInt(regRes[2] + regRes[2], 16)) +
|
|
43
|
+
"," +
|
|
44
|
+
String(parseInt(regRes[3] + regRes[3], 16)) +
|
|
45
|
+
"," +
|
|
46
|
+
String(parseInt(regRes[4] + regRes[4], 16) / 255) +
|
|
47
|
+
")");
|
|
40
48
|
}
|
|
41
49
|
regRes = REGXP_RGB_COLOR.exec(color);
|
|
42
50
|
if (regRes != null) {
|
|
43
|
-
return "rgb(" +
|
|
44
|
-
String(+regRes[1]) +
|
|
45
|
-
|
|
46
|
-
String(+regRes[
|
|
51
|
+
return ("rgb(" +
|
|
52
|
+
String(+regRes[1]) +
|
|
53
|
+
"," +
|
|
54
|
+
String(+regRes[2]) +
|
|
55
|
+
"," +
|
|
56
|
+
String(+regRes[3]) +
|
|
57
|
+
")");
|
|
47
58
|
}
|
|
48
59
|
regRes = REGXP_RGBA_COLOR.exec(color);
|
|
49
60
|
if (regRes != null) {
|
|
50
|
-
return "rgba(" +
|
|
51
|
-
String(+regRes[1]) +
|
|
52
|
-
|
|
53
|
-
String(+regRes[
|
|
54
|
-
|
|
61
|
+
return ("rgba(" +
|
|
62
|
+
String(+regRes[1]) +
|
|
63
|
+
"," +
|
|
64
|
+
String(+regRes[2]) +
|
|
65
|
+
"," +
|
|
66
|
+
String(+regRes[3]) +
|
|
67
|
+
"," +
|
|
68
|
+
String(+regRes[4] / 255) +
|
|
69
|
+
")");
|
|
55
70
|
}
|
|
56
71
|
return color;
|
|
57
72
|
}
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ICompatVTTCue } from "../../../../compat";
|
|
17
|
-
import { IParsedTTMLCue } from "../parse_ttml";
|
|
16
|
+
import type { ICompatVTTCue } from "../../../../compat";
|
|
17
|
+
import type { IParsedTTMLCue } from "../parse_ttml";
|
|
18
18
|
/**
|
|
19
19
|
* Parses an Element into a TextTrackCue or VTTCue.
|
|
20
20
|
* /!\ Mutates the given cueElement Element
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { isVTTCue, makeVTTCue
|
|
16
|
+
import { isVTTCue, makeVTTCue } from "../../../../compat";
|
|
17
17
|
import isNonEmptyString from "../../../../utils/is_non_empty_string";
|
|
18
18
|
import getTimeDelimiters from "../get_time_delimiters";
|
|
19
19
|
import { REGXP_PERCENT_VALUES } from "../regexps";
|
|
20
|
-
import { isLineBreakElement, isSpanElement
|
|
20
|
+
import { isLineBreakElement, isSpanElement } from "../xml_utils";
|
|
21
21
|
var TEXT_ALIGN_TO_LIGN_ALIGN = {
|
|
22
22
|
left: "start",
|
|
23
23
|
center: "center",
|
|
@@ -51,7 +51,8 @@ export default function parseCue(parsedCue) {
|
|
|
51
51
|
// TTML allows for empty elements like <div></div>.
|
|
52
52
|
// If paragraph has neither time attributes, nor
|
|
53
53
|
// non-whitespace text, don't try to make a cue out of it.
|
|
54
|
-
if (!paragraph.hasAttribute("begin") &&
|
|
54
|
+
if (!paragraph.hasAttribute("begin") &&
|
|
55
|
+
!paragraph.hasAttribute("end") &&
|
|
55
56
|
/^\s*$/.test(paragraph.textContent === null ? "" : paragraph.textContent)) {
|
|
56
57
|
return null;
|
|
57
58
|
}
|
|
@@ -116,9 +117,9 @@ function generateTextContent(paragraph, shouldTrimWhiteSpaceForParagraph) {
|
|
|
116
117
|
currentNode.nodeType === Node.ELEMENT_NODE &&
|
|
117
118
|
currentNode.childNodes.length > 0) {
|
|
118
119
|
var spaceAttribute = currentNode.getAttribute("xml:space");
|
|
119
|
-
var shouldTrimWhiteSpaceForSpan = isNonEmptyString(spaceAttribute)
|
|
120
|
-
spaceAttribute === "default"
|
|
121
|
-
shouldTrimWhiteSpaceFromParent;
|
|
120
|
+
var shouldTrimWhiteSpaceForSpan = isNonEmptyString(spaceAttribute)
|
|
121
|
+
? spaceAttribute === "default"
|
|
122
|
+
: shouldTrimWhiteSpaceFromParent;
|
|
122
123
|
text += loop(currentNode, shouldTrimWhiteSpaceForSpan);
|
|
123
124
|
}
|
|
124
125
|
}
|
|
@@ -193,10 +194,8 @@ function addStyle(cue, style) {
|
|
|
193
194
|
cue.position = "auto";
|
|
194
195
|
}
|
|
195
196
|
var positionAlign = TEXT_ALIGN_TO_POSITION_ALIGN[align];
|
|
196
|
-
cue.positionAlign = positionAlign === undefined ? "" :
|
|
197
|
-
positionAlign;
|
|
197
|
+
cue.positionAlign = positionAlign === undefined ? "" : positionAlign;
|
|
198
198
|
var lineAlign = TEXT_ALIGN_TO_LIGN_ALIGN[align];
|
|
199
|
-
cue.lineAlign = lineAlign === undefined ? "" :
|
|
200
|
-
lineAlign;
|
|
199
|
+
cue.lineAlign = lineAlign === undefined ? "" : lineAlign;
|
|
201
200
|
}
|
|
202
201
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ICompatVTTCue } from "../../../../compat";
|
|
16
|
+
import type { ICompatVTTCue } from "../../../../compat";
|
|
17
17
|
/**
|
|
18
18
|
* @param str
|
|
19
19
|
* @param timeOffset
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ITTParameters } from "./get_parameters";
|
|
17
|
-
import { IStyleObject } from "./get_styling";
|
|
16
|
+
import type { ITTParameters } from "./get_parameters";
|
|
17
|
+
import type { IStyleObject } from "./get_styling";
|
|
18
18
|
export interface IParsedTTMLCue {
|
|
19
|
-
paragraph: Element;
|
|
19
|
+
/** The DOM Element that contains text node */ paragraph: Element;
|
|
20
20
|
/** An offset to apply to cues start and end */
|
|
21
21
|
timeOffset: number;
|
|
22
22
|
/** An array of objects containing TTML styles */
|
|
@@ -26,10 +26,11 @@ import arrayFind from "../../../utils/array_find";
|
|
|
26
26
|
import isNonEmptyString from "../../../utils/is_non_empty_string";
|
|
27
27
|
import objectAssign from "../../../utils/object_assign";
|
|
28
28
|
import getParameters from "./get_parameters";
|
|
29
|
-
import { getStylingAttributes, getStylingFromElement
|
|
29
|
+
import { getStylingAttributes, getStylingFromElement } from "./get_styling";
|
|
30
30
|
import resolveStylesInheritance from "./resolve_styles_inheritance";
|
|
31
31
|
import { getParentDivElements, getBodyNode, getRegionNodes, getStyleNodes, getTextNodes, } from "./xml_utils";
|
|
32
|
-
var STYLE_ATTRIBUTES = [
|
|
32
|
+
var STYLE_ATTRIBUTES = [
|
|
33
|
+
"align",
|
|
33
34
|
"backgroundColor",
|
|
34
35
|
"color",
|
|
35
36
|
"direction",
|
|
@@ -93,10 +94,12 @@ export default function parseTTMLString(str, timeOffset) {
|
|
|
93
94
|
var styleID = styleNode.getAttribute("xml:id");
|
|
94
95
|
if (styleID !== null) {
|
|
95
96
|
var subStyles = styleNode.getAttribute("style");
|
|
96
|
-
var extendsStyles = subStyles === null ? [] :
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
style: getStylingFromElement(styleNode),
|
|
97
|
+
var extendsStyles = subStyles === null ? [] : subStyles.split(" ");
|
|
98
|
+
idStyles.push({
|
|
99
|
+
id: styleID,
|
|
100
|
+
style: getStylingFromElement(styleNode),
|
|
101
|
+
extendsStyles: extendsStyles,
|
|
102
|
+
});
|
|
100
103
|
}
|
|
101
104
|
}
|
|
102
105
|
}
|
|
@@ -116,10 +119,12 @@ export default function parseTTMLString(str, timeOffset) {
|
|
|
116
119
|
regionStyle = objectAssign({}, style.style, regionStyle);
|
|
117
120
|
}
|
|
118
121
|
}
|
|
119
|
-
regionStyles.push({
|
|
122
|
+
regionStyles.push({
|
|
123
|
+
id: regionID,
|
|
120
124
|
style: regionStyle,
|
|
121
125
|
// already handled
|
|
122
|
-
extendsStyles: []
|
|
126
|
+
extendsStyles: [],
|
|
127
|
+
});
|
|
123
128
|
}
|
|
124
129
|
}
|
|
125
130
|
};
|
|
@@ -132,20 +137,27 @@ export default function parseTTMLString(str, timeOffset) {
|
|
|
132
137
|
// TODO Compute corresponding CSS style here (as soon as we now the TTML
|
|
133
138
|
// style) to speed up the process even more.
|
|
134
139
|
var bodyStyle = getStylingAttributes(STYLE_ATTRIBUTES, body !== null ? [body] : [], idStyles, regionStyles);
|
|
135
|
-
var bodySpaceAttribute = body !== null ? body.getAttribute("xml:space") :
|
|
136
|
-
|
|
137
|
-
var shouldTrimWhiteSpaceOnBody = bodySpaceAttribute === "default" ||
|
|
138
|
-
ttParams.spaceStyle === "default";
|
|
140
|
+
var bodySpaceAttribute = body !== null ? body.getAttribute("xml:space") : undefined;
|
|
141
|
+
var shouldTrimWhiteSpaceOnBody = bodySpaceAttribute === "default" || ttParams.spaceStyle === "default";
|
|
139
142
|
for (var i = 0; i < paragraphNodes.length; i++) {
|
|
140
143
|
var paragraph = paragraphNodes[i];
|
|
141
144
|
if (paragraph instanceof Element) {
|
|
142
145
|
var divs = getParentDivElements(paragraph);
|
|
143
146
|
var paragraphStyle = objectAssign({}, bodyStyle, getStylingAttributes(STYLE_ATTRIBUTES, __spreadArray([paragraph], divs, true), idStyles, regionStyles));
|
|
144
147
|
var paragraphSpaceAttribute = paragraph.getAttribute("xml:space");
|
|
145
|
-
var shouldTrimWhiteSpace = isNonEmptyString(paragraphSpaceAttribute)
|
|
146
|
-
paragraphSpaceAttribute === "default"
|
|
147
|
-
shouldTrimWhiteSpaceOnBody;
|
|
148
|
-
var cue = {
|
|
148
|
+
var shouldTrimWhiteSpace = isNonEmptyString(paragraphSpaceAttribute)
|
|
149
|
+
? paragraphSpaceAttribute === "default"
|
|
150
|
+
: shouldTrimWhiteSpaceOnBody;
|
|
151
|
+
var cue = {
|
|
152
|
+
paragraph: paragraph,
|
|
153
|
+
timeOffset: timeOffset,
|
|
154
|
+
idStyles: idStyles,
|
|
155
|
+
regionStyles: regionStyles,
|
|
156
|
+
body: body,
|
|
157
|
+
paragraphStyle: paragraphStyle,
|
|
158
|
+
ttParams: ttParams,
|
|
159
|
+
shouldTrimWhiteSpace: shouldTrimWhiteSpace,
|
|
160
|
+
};
|
|
149
161
|
if (cue !== null) {
|
|
150
162
|
cues.push(cue);
|
|
151
163
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { IStyleObject } from "./get_styling";
|
|
16
|
+
import type { IStyleObject } from "./get_styling";
|
|
17
17
|
/**
|
|
18
18
|
* Transform all styles inheriting from other styles to the same styles but with
|
|
19
19
|
* the inheritance removed (by resolving those inheritance here).
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* Largely inspired from what the shaka-player does for TTML time parsing.
|
|
20
20
|
* But rewritten to a more rx-player style.
|
|
21
21
|
*/
|
|
22
|
-
import { ITTParameters } from "./get_parameters";
|
|
22
|
+
import type { ITTParameters } from "./get_parameters";
|
|
23
23
|
/**
|
|
24
24
|
* Parses a TTML time into seconds.
|
|
25
25
|
* @param {string} text
|
|
@@ -86,7 +86,7 @@ function parseColonTimeWithFrames(ttParams, text) {
|
|
|
86
86
|
}
|
|
87
87
|
frames += subframes / ttParams.subFrameRate;
|
|
88
88
|
seconds += frames / ttParams.frameRate;
|
|
89
|
-
return seconds +
|
|
89
|
+
return seconds + minutes * 60 + hours * 3600;
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
92
92
|
* Parses a TTML time with a given regex. Expects regex to be some
|
|
@@ -119,6 +119,6 @@ function parseTimeFromRegExp(regex, text) {
|
|
|
119
119
|
if (isNaN(milliseconds)) {
|
|
120
120
|
milliseconds = 0;
|
|
121
121
|
}
|
|
122
|
-
return
|
|
122
|
+
return milliseconds / 1000 + seconds + minutes * 60 + hours * 3600;
|
|
123
123
|
}
|
|
124
124
|
export default parseTime;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ICompatVTTCue } from "../../compat";
|
|
16
|
+
import type { ICompatVTTCue } from "../../compat";
|
|
17
17
|
export interface IHTMLCue {
|
|
18
18
|
start: number;
|
|
19
19
|
end: number;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import isNonEmptyString from "../../../utils/is_non_empty_string";
|
|
17
|
-
import { findEndOfCueBlock, isStartOfCueBlock
|
|
17
|
+
import { findEndOfCueBlock, isStartOfCueBlock } from "./utils";
|
|
18
18
|
/**
|
|
19
19
|
* Get cue blocks from a WebVTT file.
|
|
20
20
|
* @param {Array.<string>} linified - Whole WebVTT file. Each new element in
|
|
@@ -25,7 +25,8 @@ import { isStartOfStyleBlock } from "./utils";
|
|
|
25
25
|
*/
|
|
26
26
|
export default function getStyleBlocks(linified, headerOffset) {
|
|
27
27
|
var styleBlocks = [];
|
|
28
|
-
for (var i = headerOffset; i < linified.length; i++) {
|
|
28
|
+
for (var i = headerOffset; i < linified.length; i++) {
|
|
29
|
+
//
|
|
29
30
|
if (isStartOfStyleBlock(linified, i)) {
|
|
30
31
|
var startOfStyleBlock = i;
|
|
31
32
|
i++;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { IStyleElements } from "./parse_style_block";
|
|
16
|
+
import type { IStyleElements } from "./parse_style_block";
|
|
17
17
|
/**
|
|
18
18
|
* @param {string} text
|
|
19
19
|
* @param {Array.<Object>} styleElements
|
package/dist/_esm5.processed/parsers/texttracks/webvtt/html/create_default_style_elements.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IStyleElements } from "./parse_style_block";
|
|
1
|
+
import type { IStyleElements } from "./parse_style_block";
|
|
2
2
|
export default function createDefaultStyleElements(): IStyleElements;
|
|
@@ -92,9 +92,7 @@ var getXOffsetPercentage = function (settings) {
|
|
|
92
92
|
_a[PositionAlignment.CENTER] = -50,
|
|
93
93
|
_a[PositionAlignment.LINE_RIGHT] = -100,
|
|
94
94
|
_a);
|
|
95
|
-
var positionAlignment = settings.position !== undefined ?
|
|
96
|
-
getPositionAlignment(settings.position) :
|
|
97
|
-
null;
|
|
95
|
+
var positionAlignment = settings.position !== undefined ? getPositionAlignment(settings.position) : null;
|
|
98
96
|
if (positionAlignment !== null) {
|
|
99
97
|
return positionAlignmentMap[positionAlignment];
|
|
100
98
|
}
|
|
@@ -103,9 +101,7 @@ var getXOffsetPercentage = function (settings) {
|
|
|
103
101
|
_b[Align.CENTER] = -50,
|
|
104
102
|
_b[Align.RIGHT] = -100,
|
|
105
103
|
_b);
|
|
106
|
-
var align = settings.align !== undefined ?
|
|
107
|
-
getAlignValue(settings.align)
|
|
108
|
-
: Align.CENTER;
|
|
104
|
+
var align = settings.align !== undefined ? getAlignValue(settings.align) : Align.CENTER;
|
|
109
105
|
return alignMap[align];
|
|
110
106
|
};
|
|
111
107
|
var getPositioningY = function (settings) {
|
|
@@ -136,9 +132,9 @@ var getYOffsetPercentage = function (lineSetting) {
|
|
|
136
132
|
return lineAlignmentMap[LineAlignment.START];
|
|
137
133
|
}
|
|
138
134
|
var lineAlignment = getLineAlignment(lineSetting);
|
|
139
|
-
return lineAlignment !== null
|
|
140
|
-
lineAlignmentMap[lineAlignment]
|
|
141
|
-
lineAlignmentMap[LineAlignment.START];
|
|
135
|
+
return lineAlignment !== null
|
|
136
|
+
? lineAlignmentMap[lineAlignment]
|
|
137
|
+
: lineAlignmentMap[LineAlignment.START];
|
|
142
138
|
};
|
|
143
139
|
var getAlignValue = function (alignSetting) {
|
|
144
140
|
switch (alignSetting) {
|
|
@@ -158,9 +154,7 @@ var getSizePercentage = function (sizeSetting) {
|
|
|
158
154
|
};
|
|
159
155
|
var getPercentageValueOrDefault = function (percentageString, defaultValue) {
|
|
160
156
|
var value = getPercentageValue(percentageString);
|
|
161
|
-
return value !== null ?
|
|
162
|
-
value :
|
|
163
|
-
defaultValue;
|
|
157
|
+
return value !== null ? value : defaultValue;
|
|
164
158
|
};
|
|
165
159
|
var getPercentageValue = function (percentageString) {
|
|
166
160
|
if (percentageString === undefined) {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { IStyleElements } from "./parse_style_block";
|
|
16
|
+
import type { IStyleElements } from "./parse_style_block";
|
|
17
17
|
/**
|
|
18
18
|
* Construct an HTMLElement/TextNode representing the given node and apply
|
|
19
19
|
* the right styling on it.
|
|
@@ -30,8 +30,7 @@ export default function createStyledElement(baseNode, styleElements) {
|
|
|
30
30
|
var nodeWithStyle;
|
|
31
31
|
if (arrayIncludes(authorizedNodeNames, mainNodeName)) {
|
|
32
32
|
if (mainNodeName === "#text") {
|
|
33
|
-
var linifiedText = baseNode.wholeText
|
|
34
|
-
.split("\n");
|
|
33
|
+
var linifiedText = baseNode.wholeText.split("\n");
|
|
35
34
|
nodeWithStyle = document.createElement("span");
|
|
36
35
|
for (var i = 0; i < linifiedText.length; i++) {
|
|
37
36
|
if (i > 0) {
|
|
@@ -51,19 +50,19 @@ export default function createStyledElement(baseNode, styleElements) {
|
|
|
51
50
|
styleContents_1.push(styleElements[nodeClass]);
|
|
52
51
|
}
|
|
53
52
|
});
|
|
54
|
-
if (styleContents_1.length !== 0) {
|
|
53
|
+
if (styleContents_1.length !== 0) {
|
|
54
|
+
// If style must be applied
|
|
55
55
|
var attr_1 = document.createAttribute("style");
|
|
56
56
|
styleContents_1.forEach(function (styleContent) {
|
|
57
57
|
attr_1.value += styleContent;
|
|
58
58
|
});
|
|
59
|
-
var nameClass = arrayIncludes(HTMLTags, mainNodeName) ?
|
|
60
|
-
mainNodeName : "span";
|
|
59
|
+
var nameClass = arrayIncludes(HTMLTags, mainNodeName) ? mainNodeName : "span";
|
|
61
60
|
nodeWithStyle = document.createElement(nameClass);
|
|
62
61
|
nodeWithStyle.setAttributeNode(attr_1);
|
|
63
62
|
}
|
|
64
|
-
else {
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
else {
|
|
64
|
+
// If style mustn't be applied. Rebuild element with tag name
|
|
65
|
+
var elementTag = !arrayIncludes(HTMLTags, mainNodeName) ? "span" : mainNodeName;
|
|
67
66
|
nodeWithStyle = document.createElement(elementTag);
|
|
68
67
|
}
|
|
69
68
|
for (var j = 0; j < baseNode.childNodes.length; j++) {
|
|
@@ -29,8 +29,8 @@ export default function parseStyleBlocks(styleBlocks) {
|
|
|
29
29
|
var line = styleBlock[index];
|
|
30
30
|
if (Array.isArray(/::cue {/.exec(line))) {
|
|
31
31
|
line = styleBlock[++index];
|
|
32
|
-
while (isNonEmptyString(line) &&
|
|
33
|
-
line.length === 0))
|
|
32
|
+
while (isNonEmptyString(line) &&
|
|
33
|
+
!(Array.isArray(/}/.exec(line)) || line.length === 0)) {
|
|
34
34
|
global += line;
|
|
35
35
|
line = styleBlock[++index];
|
|
36
36
|
}
|
|
@@ -44,8 +44,8 @@ export default function parseStyleBlocks(styleBlocks) {
|
|
|
44
44
|
cueClassLine = /::cue\(\.?(.*?)\)(?:,| {)/.exec(line);
|
|
45
45
|
}
|
|
46
46
|
var styleContent_1 = "";
|
|
47
|
-
while (isNonEmptyString(line) &&
|
|
48
|
-
line.length === 0))
|
|
47
|
+
while (isNonEmptyString(line) &&
|
|
48
|
+
!(Array.isArray(/}/.exec(line)) || line.length === 0)) {
|
|
49
49
|
styleContent_1 += line;
|
|
50
50
|
line = styleBlock[++index];
|
|
51
51
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { IVTTHTMLCue } from "./to_html";
|
|
16
|
+
import type { IVTTHTMLCue } from "./to_html";
|
|
17
17
|
/**
|
|
18
18
|
* Parse WebVTT from text. Returns an array with:
|
|
19
19
|
* - start : start of current cue, in seconds
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { IStyleElements } from "./parse_style_block";
|
|
16
|
+
import type { IStyleElements } from "./parse_style_block";
|
|
17
17
|
export interface IVTTHTMLCue {
|
|
18
18
|
start: number;
|
|
19
19
|
end: number;
|
|
@@ -48,20 +48,14 @@ export default function toHTML(cueObj, styling) {
|
|
|
48
48
|
var attr = document.createAttribute("style");
|
|
49
49
|
// set color and background-color default values, as indicated in:
|
|
50
50
|
// https://www.w3.org/TR/webvtt1/#applying-css-properties
|
|
51
|
-
attr.value =
|
|
52
|
-
"background-color:rgba(0,0,0,0.8);" +
|
|
53
|
-
"color:white;";
|
|
51
|
+
attr.value = "background-color:rgba(0,0,0,0.8);" + "color:white;";
|
|
54
52
|
spanElement.setAttributeNode(attr);
|
|
55
53
|
var global = styling.global, classes = styling.classes;
|
|
56
|
-
var localStyle = isNonEmptyString(header) ? classes[header] :
|
|
57
|
-
|
|
58
|
-
var styles = [global, localStyle]
|
|
59
|
-
.filter(function (s) { return s !== undefined; })
|
|
60
|
-
.join("");
|
|
54
|
+
var localStyle = isNonEmptyString(header) ? classes[header] : undefined;
|
|
55
|
+
var styles = [global, localStyle].filter(function (s) { return s !== undefined; }).join("");
|
|
61
56
|
attr.value += styles;
|
|
62
57
|
spanElement.setAttributeNode(attr);
|
|
63
|
-
convertPayloadToHTML(payload.join("\n"), classes)
|
|
64
|
-
.forEach(function (element) {
|
|
58
|
+
convertPayloadToHTML(payload.join("\n"), classes).forEach(function (element) {
|
|
65
59
|
spanElement.appendChild(element);
|
|
66
60
|
});
|
|
67
61
|
region.appendChild(pElement);
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* /!\ This file is feature-switchable.
|
|
18
18
|
* It always should be imported through the `features` object.
|
|
19
19
|
*/
|
|
20
|
-
import { ICompatVTTCue } from "../../../../compat/index";
|
|
20
|
+
import type { ICompatVTTCue } from "../../../../compat/index";
|
|
21
21
|
/**
|
|
22
22
|
* Parse whole WEBVTT file into an array of cues, to be inserted in a video's
|
|
23
23
|
* TrackElement.
|
|
@@ -13,11 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
* /!\ This file is feature-switchable.
|
|
18
|
-
* It always should be imported through the `features` object.
|
|
19
|
-
*/
|
|
20
|
-
import { isVTTCue, } from "../../../../compat/index";
|
|
16
|
+
import { isVTTCue } from "../../../../compat/index";
|
|
21
17
|
import getCueBlocks from "../get_cue_blocks";
|
|
22
18
|
import parseCueBlock from "../parse_cue_block";
|
|
23
19
|
import { getFirstLineAfterHeader } from "../utils";
|
|
@@ -36,7 +32,7 @@ import toNativeCue from "./to_native_cue";
|
|
|
36
32
|
export default function parseVTTStringToVTTCues(vttStr, timeOffset) {
|
|
37
33
|
// WEBVTT authorize CRLF, LF or CR as line terminators
|
|
38
34
|
var lines = vttStr.split(/\r\n|\n|\r/);
|
|
39
|
-
if (
|
|
35
|
+
if (!/^WEBVTT($| |\t)/.test(lines[0])) {
|
|
40
36
|
throw new Error("Can't parse WebVTT: Invalid file.");
|
|
41
37
|
}
|
|
42
38
|
var firstLineAfterHeader = getFirstLineAfterHeader(lines);
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ICompatVTTCue } from "../../../../compat/index";
|
|
16
|
+
import type { ICompatVTTCue } from "../../../../compat/index";
|
|
17
17
|
/**
|
|
18
18
|
* Add the corresponding settings on the given cue.
|
|
19
19
|
* /!\ Mutates the cue given.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ICompatVTTCue } from "../../../../compat/index";
|
|
16
|
+
import type { ICompatVTTCue } from "../../../../compat/index";
|
|
17
17
|
/**
|
|
18
18
|
* @param {Object} cue Object
|
|
19
19
|
* @returns {TextTrackCue|ICompatVTTCue|null}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { makeVTTCue
|
|
16
|
+
import { makeVTTCue } from "../../../../compat/index";
|
|
17
17
|
/**
|
|
18
18
|
* @param {Object} cue Object
|
|
19
19
|
* @returns {TextTrackCue|ICompatVTTCue|null}
|
|
@@ -21,8 +21,7 @@ import parseTimestamp from "./parse_timestamp";
|
|
|
21
21
|
*/
|
|
22
22
|
function parseSettings(settingsString) {
|
|
23
23
|
var splittedSettings = settingsString.split(/ |\t/);
|
|
24
|
-
return splittedSettings
|
|
25
|
-
.reduce(function (acc, setting) {
|
|
24
|
+
return splittedSettings.reduce(function (acc, setting) {
|
|
26
25
|
var splittedSetting = setting.split(":");
|
|
27
26
|
if (splittedSetting.length === 2) {
|
|
28
27
|
acc[splittedSetting[0]] = splittedSetting[1];
|
|
@@ -91,6 +90,5 @@ export default function parseCueBlock(cueLines, timeOffset) {
|
|
|
91
90
|
return null;
|
|
92
91
|
}
|
|
93
92
|
var start = timeAndSettings.start, end = timeAndSettings.end, settings = timeAndSettings.settings;
|
|
94
|
-
return { start: start + timeOffset,
|
|
95
|
-
end: end + timeOffset, settings: settings, payload: payload, header: header };
|
|
93
|
+
return { start: start + timeOffset, end: end + timeOffset, settings: settings, payload: payload, header: header };
|
|
96
94
|
}
|
|
@@ -22,8 +22,7 @@ import isNonEmptyString from "../../../utils/is_non_empty_string";
|
|
|
22
22
|
export default function parseTimestamp(timestampString) {
|
|
23
23
|
var splittedTS = timestampString.split(":").reverse();
|
|
24
24
|
if (isNonEmptyString(splittedTS[2]) || isNonEmptyString(splittedTS[1])) {
|
|
25
|
-
var hours = isNonEmptyString(splittedTS[2]) ? parseInt(splittedTS[2], 10) :
|
|
26
|
-
0;
|
|
25
|
+
var hours = isNonEmptyString(splittedTS[2]) ? parseInt(splittedTS[2], 10) : 0;
|
|
27
26
|
var minutes = parseInt(splittedTS[1], 10);
|
|
28
27
|
var seconds = parseFloat(splittedTS[0].replace(",", "."));
|
|
29
28
|
if (isNaN(hours) || isNaN(minutes) || isNaN(seconds)) {
|