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
|
@@ -24,7 +24,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
24
24
|
};
|
|
25
25
|
import { MediaError } from "../../../errors";
|
|
26
26
|
import log from "../../../log";
|
|
27
|
-
import { getIndexSegmentEnd
|
|
27
|
+
import { getIndexSegmentEnd } from "./index_helpers";
|
|
28
28
|
/**
|
|
29
29
|
* Update a complete array of segments in a given timeline with a [generally]
|
|
30
30
|
* smaller but [generally] newer set of segments.
|
|
@@ -64,7 +64,8 @@ export default function updateSegmentTimeline(oldTimeline, newTimeline) {
|
|
|
64
64
|
oldTimeline.splice.apply(oldTimeline, __spreadArray([i, nbEltsToRemove], newTimeline, false));
|
|
65
65
|
return false;
|
|
66
66
|
}
|
|
67
|
-
else if (currStart < newIndexStart) {
|
|
67
|
+
else if (currStart < newIndexStart) {
|
|
68
|
+
// first to be before
|
|
68
69
|
var currElt = oldTimeline[i];
|
|
69
70
|
if (currElt.start + currElt.duration > newIndexStart) {
|
|
70
71
|
// The new Manifest overlaps a previous segment (weird)
|
|
@@ -75,25 +76,25 @@ export default function updateSegmentTimeline(oldTimeline, newTimeline) {
|
|
|
75
76
|
}
|
|
76
77
|
else if (currElt.repeatCount === undefined || currElt.repeatCount <= 0) {
|
|
77
78
|
if (currElt.repeatCount < 0) {
|
|
78
|
-
currElt.repeatCount =
|
|
79
|
-
currElt.duration) - 1;
|
|
79
|
+
currElt.repeatCount =
|
|
80
|
+
Math.floor((newIndexStart - currElt.start) / currElt.duration) - 1;
|
|
80
81
|
}
|
|
81
82
|
oldTimeline.splice.apply(oldTimeline, __spreadArray([i + 1, prevTimelineLength - (i + 1)], newTimeline, false));
|
|
82
83
|
return false;
|
|
83
84
|
}
|
|
84
85
|
// else, there is a positive repeat we might want to update
|
|
85
86
|
var eltLastTime = currElt.start + currElt.duration * (currElt.repeatCount + 1);
|
|
86
|
-
if (eltLastTime <= newIndexStart) {
|
|
87
|
+
if (eltLastTime <= newIndexStart) {
|
|
88
|
+
// our new index comes directly after
|
|
87
89
|
// put it after this one
|
|
88
|
-
oldTimeline.splice.apply(
|
|
89
|
-
oldTimeline, __spreadArray([i + 1, prevTimelineLength - (i + 1)], newTimeline, false));
|
|
90
|
+
oldTimeline.splice.apply(oldTimeline, __spreadArray([i + 1, prevTimelineLength - (i + 1)], newTimeline, false));
|
|
90
91
|
return false;
|
|
91
92
|
}
|
|
92
|
-
var newCurrRepeat = (
|
|
93
|
+
var newCurrRepeat = (newIndexStart - currElt.start) / currElt.duration - 1;
|
|
93
94
|
if (newCurrRepeat % 1 === 0 && currElt.duration === newTimeline[0].duration) {
|
|
94
|
-
var newRepeatCount = newTimeline[0].repeatCount < 0
|
|
95
|
-
-1
|
|
96
|
-
newTimeline[0].repeatCount + newCurrRepeat + 1;
|
|
95
|
+
var newRepeatCount = newTimeline[0].repeatCount < 0
|
|
96
|
+
? -1 // === maximum possible repeat
|
|
97
|
+
: newTimeline[0].repeatCount + newCurrRepeat + 1;
|
|
97
98
|
// replace that one and those after it
|
|
98
99
|
oldTimeline.splice.apply(oldTimeline, __spreadArray([i, prevTimelineLength - i], newTimeline, false));
|
|
99
100
|
oldTimeline[i].start = currElt.start;
|
|
@@ -117,22 +118,21 @@ export default function updateSegmentTimeline(oldTimeline, newTimeline) {
|
|
|
117
118
|
log.warn("RepresentationIndex: The new index is older than the previous one");
|
|
118
119
|
return false;
|
|
119
120
|
}
|
|
120
|
-
else {
|
|
121
|
-
|
|
121
|
+
else {
|
|
122
|
+
// the new has more depth
|
|
123
|
+
log.warn('RepresentationIndex: The new index is "bigger" than the previous one');
|
|
122
124
|
oldTimeline.splice.apply(oldTimeline, __spreadArray([0, prevTimelineLength], newTimeline, false));
|
|
123
125
|
return true;
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
|
-
var prevLastTime = prevLastElt.start + prevLastElt.duration *
|
|
127
|
-
|
|
128
|
-
var newLastTime = newLastElt.start + newLastElt.duration *
|
|
129
|
-
(newLastElt.repeatCount + 1);
|
|
128
|
+
var prevLastTime = prevLastElt.start + prevLastElt.duration * (prevLastElt.repeatCount + 1);
|
|
129
|
+
var newLastTime = newLastElt.start + newLastElt.duration * (newLastElt.repeatCount + 1);
|
|
130
130
|
if (prevLastTime >= newLastTime) {
|
|
131
131
|
log.warn("RepresentationIndex: The new index is older than the previous one");
|
|
132
132
|
return false;
|
|
133
133
|
}
|
|
134
134
|
// the new one has more depth. full update
|
|
135
|
-
log.warn(
|
|
135
|
+
log.warn('RepresentationIndex: The new index is "bigger" than the previous one');
|
|
136
136
|
oldTimeline.splice.apply(oldTimeline, __spreadArray([0, prevTimelineLength], newTimeline, false));
|
|
137
137
|
return true;
|
|
138
138
|
}
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export { IHTMLCue, INativeTextTracksParserFn, IHTMLTextTracksParserFn, } from "./types";
|
|
16
|
+
export type { IHTMLCue, INativeTextTracksParserFn, IHTMLTextTracksParserFn, } from "./types";
|
|
@@ -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 { IHTMLCue } from "../types";
|
|
16
|
+
import type { IHTMLCue } from "../types";
|
|
17
17
|
/**
|
|
18
18
|
* Because sami is not really html... we have to use
|
|
19
19
|
* some kind of regular expressions to parse it...
|
|
@@ -70,17 +70,15 @@ function getPCSSRules(str) {
|
|
|
70
70
|
* @returns {string|null} - value of the property. Null if not found.
|
|
71
71
|
*/
|
|
72
72
|
function getCSSProperty(str, name) {
|
|
73
|
-
var matches =
|
|
74
|
-
return Array.isArray(matches) ? matches[1] :
|
|
75
|
-
null;
|
|
73
|
+
var matches = new RegExp("\\s*" + name + ":\\s*(\\S+);", "i").exec(str);
|
|
74
|
+
return Array.isArray(matches) ? matches[1] : null;
|
|
76
75
|
}
|
|
77
76
|
/**
|
|
78
77
|
* @param {string} text
|
|
79
78
|
* @returns {string}
|
|
80
79
|
*/
|
|
81
80
|
function decodeEntities(text) {
|
|
82
|
-
return text
|
|
83
|
-
.replace(HTML_ENTITIES, function (_, $1) { return String.fromCharCode(Number($1)); });
|
|
81
|
+
return text.replace(HTML_ENTITIES, function (_, $1) { return String.fromCharCode(Number($1)); });
|
|
84
82
|
}
|
|
85
83
|
/**
|
|
86
84
|
* Because sami is not really html... we have to use
|
|
@@ -94,12 +92,11 @@ function decodeEntities(text) {
|
|
|
94
92
|
* @param {string} lang
|
|
95
93
|
*/
|
|
96
94
|
function parseSami(smi, timeOffset, lang) {
|
|
97
|
-
var syncOpen = /<sync[ >]/
|
|
98
|
-
var syncClose = /<sync[ >]|<\/body>/
|
|
95
|
+
var syncOpen = /<sync[ >]/gi;
|
|
96
|
+
var syncClose = /<sync[ >]|<\/body>/gi;
|
|
99
97
|
var subs = [];
|
|
100
98
|
var styleMatches = STYLE.exec(smi);
|
|
101
|
-
var css = Array.isArray(styleMatches) ? styleMatches[1] :
|
|
102
|
-
"";
|
|
99
|
+
var css = Array.isArray(styleMatches) ? styleMatches[1] : "";
|
|
103
100
|
var up;
|
|
104
101
|
var to;
|
|
105
102
|
// FIXME Is that wanted?
|
|
@@ -158,10 +155,11 @@ function parseSami(smi, timeOffset, lang) {
|
|
|
158
155
|
divEl.style.bottom = "0";
|
|
159
156
|
divEl.style.width = "100%";
|
|
160
157
|
divEl.style.color = "#fff";
|
|
161
|
-
divEl.style.textShadow =
|
|
162
|
-
"1px -1px 0 #000," +
|
|
163
|
-
|
|
164
|
-
|
|
158
|
+
divEl.style.textShadow =
|
|
159
|
+
"-1px -1px 0 #000," +
|
|
160
|
+
"1px -1px 0 #000," +
|
|
161
|
+
"-1px 1px 0 #000," +
|
|
162
|
+
"1px 1px 0 #000";
|
|
165
163
|
var pEl = document.createElement("div");
|
|
166
164
|
pEl.className = "rxp-texttrack-p";
|
|
167
165
|
if (isNonEmptyString(pCSS)) {
|
|
@@ -179,9 +177,11 @@ function parseSami(smi, timeOffset, lang) {
|
|
|
179
177
|
}
|
|
180
178
|
divEl.appendChild(pEl);
|
|
181
179
|
wrapperEl.appendChild(divEl);
|
|
182
|
-
subs.push({
|
|
180
|
+
subs.push({
|
|
181
|
+
element: wrapperEl,
|
|
183
182
|
start: start + timeOffset,
|
|
184
|
-
end: -1 /* Will be updated on a following iteration
|
|
183
|
+
end: -1 /* Will be updated on a following iteration */,
|
|
184
|
+
});
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
}
|
|
@@ -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";
|
|
20
|
+
import type { ICompatVTTCue } from "../../../compat";
|
|
21
21
|
/**
|
|
22
22
|
* Because sami is not really html... we have to use
|
|
23
23
|
* some kind of regular expressions to parse it...
|
|
@@ -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 { makeVTTCue, } from "../../../compat";
|
|
16
|
+
import { makeVTTCue } from "../../../compat";
|
|
21
17
|
import isNonEmptyString from "../../../utils/is_non_empty_string";
|
|
22
18
|
var HTML_ENTITIES = /&#([0-9]+);/g;
|
|
23
19
|
var BR = /<br>/gi;
|
|
@@ -68,9 +64,8 @@ function getClassNameByLang(str) {
|
|
|
68
64
|
* @returns {string|null} - value of the property. Null if not found.
|
|
69
65
|
*/
|
|
70
66
|
function getCSSProperty(str, name) {
|
|
71
|
-
var matches =
|
|
72
|
-
return Array.isArray(matches) ? matches[1] :
|
|
73
|
-
null;
|
|
67
|
+
var matches = new RegExp("\\s*" + name + ":\\s*(\\S+);", "i").exec(str);
|
|
68
|
+
return Array.isArray(matches) ? matches[1] : null;
|
|
74
69
|
}
|
|
75
70
|
/**
|
|
76
71
|
* Decode HMTL formatting into a string.
|
|
@@ -95,12 +90,11 @@ function decodeEntities(text) {
|
|
|
95
90
|
* @returns {Array.<VTTCue|TextTrackCue>}
|
|
96
91
|
*/
|
|
97
92
|
function parseSami(smi, timeOffset, lang) {
|
|
98
|
-
var syncOpen = /<sync[ >]/
|
|
99
|
-
var syncClose = /<sync[ >]|<\/body>/
|
|
93
|
+
var syncOpen = /<sync[ >]/gi;
|
|
94
|
+
var syncClose = /<sync[ >]|<\/body>/gi;
|
|
100
95
|
var subs = [];
|
|
101
96
|
var styleMatches = STYLE.exec(smi);
|
|
102
|
-
var css = styleMatches !== null ? styleMatches[1] :
|
|
103
|
-
"";
|
|
97
|
+
var css = styleMatches !== null ? styleMatches[1] : "";
|
|
104
98
|
var up;
|
|
105
99
|
var to;
|
|
106
100
|
// FIXME Is that wanted?
|
|
@@ -151,8 +145,7 @@ function parseSami(smi, timeOffset, lang) {
|
|
|
151
145
|
subs[subs.length - 1].end = start;
|
|
152
146
|
}
|
|
153
147
|
else {
|
|
154
|
-
subs.push({ text: decodeEntities(txt),
|
|
155
|
-
start: start + timeOffset });
|
|
148
|
+
subs.push({ text: decodeEntities(txt), start: start + timeOffset });
|
|
156
149
|
}
|
|
157
150
|
}
|
|
158
151
|
}
|
|
@@ -59,10 +59,11 @@ function toHTML(cueObj) {
|
|
|
59
59
|
pEl.style.width = "100%";
|
|
60
60
|
pEl.style.textAlign = "center";
|
|
61
61
|
pEl.style.color = "#fff";
|
|
62
|
-
pEl.style.textShadow =
|
|
63
|
-
"1px -1px 2px #000," +
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
pEl.style.textShadow =
|
|
63
|
+
"-1px -1px 2px #000," +
|
|
64
|
+
"1px -1px 2px #000," +
|
|
65
|
+
"-1px 1px 2px #000," +
|
|
66
|
+
"1px 1px 2px #000";
|
|
66
67
|
for (var i = 0; i < payload.length; i++) {
|
|
67
68
|
if (i !== 0) {
|
|
68
69
|
pEl.appendChild(document.createElement("br"));
|
|
@@ -99,8 +100,7 @@ function generateSpansFromSRTText(text) {
|
|
|
99
100
|
for (var i = 0; i < childNodes.length; i++) {
|
|
100
101
|
var currentNode = childNodes[i];
|
|
101
102
|
if (currentNode.nodeName === "#text") {
|
|
102
|
-
var linifiedText = currentNode.wholeText
|
|
103
|
-
.split("\n");
|
|
103
|
+
var linifiedText = currentNode.wholeText.split("\n");
|
|
104
104
|
for (var line = 0; line < linifiedText.length; line++) {
|
|
105
105
|
if (line !== 0) {
|
|
106
106
|
span.appendChild(document.createElement("br"));
|
|
@@ -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 srt file into an array of cues, to be inserted in a video's
|
|
23
23
|
* TrackElement.
|
|
@@ -13,13 +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
|
-
// srt to VTTCue parser, Done for fun.
|
|
21
|
-
// Heavily inspired from the WebVTT implementation
|
|
22
|
-
import { makeVTTCue, } from "../../../compat/index";
|
|
16
|
+
import { makeVTTCue } from "../../../compat/index";
|
|
23
17
|
import getCueBlocks from "./get_cue_blocks";
|
|
24
18
|
import parseCueBlock from "./parse_cue";
|
|
25
19
|
/**
|
|
@@ -35,15 +35,12 @@ export default function parseCueBlock(cueLines, timeOffset) {
|
|
|
35
35
|
// normally in srt, the timing is at second position.
|
|
36
36
|
// We still authorize to put it in the first position for resilience
|
|
37
37
|
if (isNonEmptyString(cueLines[1]) && cueLines[1].indexOf("-->") !== -1) {
|
|
38
|
-
_a = cueLines[1].split("-->")
|
|
39
|
-
.map(function (s) { return s.trim(); }), startTimeString = _a[0], endTimeString = _a[1];
|
|
38
|
+
_a = cueLines[1].split("-->").map(function (s) { return s.trim(); }), startTimeString = _a[0], endTimeString = _a[1];
|
|
40
39
|
payload = cueLines.slice(2, cueLines.length);
|
|
41
40
|
}
|
|
42
|
-
if (!isNonEmptyString(startTimeString) ||
|
|
43
|
-
!isNonEmptyString(endTimeString)) {
|
|
41
|
+
if (!isNonEmptyString(startTimeString) || !isNonEmptyString(endTimeString)) {
|
|
44
42
|
// Try to see if we find them in the first position
|
|
45
|
-
_b = cueLines[0].split("-->")
|
|
46
|
-
.map(function (s) { return s.trim(); }), startTimeString = _b[0], endTimeString = _b[1];
|
|
43
|
+
_b = cueLines[0].split("-->").map(function (s) { return s.trim(); }), startTimeString = _b[0], endTimeString = _b[1];
|
|
47
44
|
payload = cueLines.slice(1, cueLines.length);
|
|
48
45
|
}
|
|
49
46
|
if (!isNonEmptyString(startTimeString) || !isNonEmptyString(endTimeString)) {
|
|
@@ -55,6 +52,5 @@ export default function parseCueBlock(cueLines, timeOffset) {
|
|
|
55
52
|
if (start === undefined || end === undefined) {
|
|
56
53
|
return null;
|
|
57
54
|
}
|
|
58
|
-
return { start: start + timeOffset,
|
|
59
|
-
end: end + timeOffset, payload: payload };
|
|
55
|
+
return { start: start + timeOffset, end: end + timeOffset, payload: payload };
|
|
60
56
|
}
|
|
@@ -29,8 +29,7 @@ export default function getParameters(tt) {
|
|
|
29
29
|
var parsedFrameRateMultiplier = tt.getAttribute("ttp:frameRateMultiplier");
|
|
30
30
|
var parsedSpaceStyle = tt.getAttribute("xml:space");
|
|
31
31
|
var parsedCellResolution = tt.getAttribute("ttp:cellResolution");
|
|
32
|
-
var cellResolution = { columns: 32,
|
|
33
|
-
rows: 15 };
|
|
32
|
+
var cellResolution = { columns: 32, rows: 15 };
|
|
34
33
|
if (parsedCellResolution !== null) {
|
|
35
34
|
var extractedData = CELL_RESOLUTION_REGEXP.exec(parsedCellResolution);
|
|
36
35
|
if (extractedData === null || extractedData.length < 3) {
|
|
@@ -65,12 +64,9 @@ export default function getParameters(tt) {
|
|
|
65
64
|
nbTickRate = undefined;
|
|
66
65
|
}
|
|
67
66
|
var frameRate = nbFrameRate;
|
|
68
|
-
var subFrameRate = nbSubFrameRate != null ? nbSubFrameRate :
|
|
69
|
-
|
|
70
|
-
var
|
|
71
|
-
"default";
|
|
72
|
-
var tickRate = nbTickRate !== undefined ? nbTickRate :
|
|
73
|
-
nbFrameRate * nbSubFrameRate;
|
|
67
|
+
var subFrameRate = nbSubFrameRate != null ? nbSubFrameRate : 1;
|
|
68
|
+
var spaceStyle = parsedSpaceStyle !== null ? parsedSpaceStyle : "default";
|
|
69
|
+
var tickRate = nbTickRate !== undefined ? nbTickRate : nbFrameRate * nbSubFrameRate;
|
|
74
70
|
if (parsedFrameRateMultiplier !== null) {
|
|
75
71
|
var multiplierResults = /^(\d+) (\d+)$/g.exec(parsedFrameRateMultiplier);
|
|
76
72
|
if (multiplierResults !== 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 { ITTParameters } from "./get_parameters";
|
|
16
|
+
import type { ITTParameters } from "./get_parameters";
|
|
17
17
|
/**
|
|
18
18
|
* Get start and end time of an element.
|
|
19
19
|
* @param {Element} element
|
|
@@ -25,17 +25,15 @@ export default function getTimeDelimiters(element, ttParams) {
|
|
|
25
25
|
var beginAttr = element.getAttribute("begin");
|
|
26
26
|
var durationAttr = element.getAttribute("dur");
|
|
27
27
|
var endAttr = element.getAttribute("end");
|
|
28
|
-
var start = isNonEmptyString(beginAttr) ? parseTime(beginAttr, ttParams) :
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
null;
|
|
32
|
-
var parsedEnd = isNonEmptyString(endAttr) ? parseTime(endAttr, ttParams) :
|
|
33
|
-
null;
|
|
28
|
+
var start = isNonEmptyString(beginAttr) ? parseTime(beginAttr, ttParams) : null;
|
|
29
|
+
var duration = isNonEmptyString(durationAttr)
|
|
30
|
+
? parseTime(durationAttr, ttParams)
|
|
31
|
+
: null;
|
|
32
|
+
var parsedEnd = isNonEmptyString(endAttr) ? parseTime(endAttr, ttParams) : null;
|
|
34
33
|
if (start == null || (parsedEnd == null && duration == null)) {
|
|
35
34
|
throw new Error("Invalid text cue");
|
|
36
35
|
}
|
|
37
36
|
// Huh? Is TypeScript that dumb here?
|
|
38
|
-
var end = parsedEnd == null ? start + duration :
|
|
39
|
-
parsedEnd;
|
|
37
|
+
var end = parsedEnd == null ? start + duration : parsedEnd;
|
|
40
38
|
return { start: start, end: end };
|
|
41
39
|
}
|
package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_default_ttml_paragraph_style.js
CHANGED
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
* @returns {boolean}
|
|
24
24
|
*/
|
|
25
25
|
export function shouldApplyDefaultTTMLStyle(paragraphStyle) {
|
|
26
|
-
return paragraphStyle.extent === undefined &&
|
|
26
|
+
return (paragraphStyle.extent === undefined &&
|
|
27
27
|
paragraphStyle.origin === undefined &&
|
|
28
28
|
paragraphStyle.displayAlign === undefined &&
|
|
29
29
|
paragraphStyle.display === undefined &&
|
|
30
30
|
paragraphStyle.textAlign === undefined &&
|
|
31
|
-
paragraphStyle.fontSize === undefined;
|
|
31
|
+
paragraphStyle.fontSize === undefined);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Apply a default style to TTML cue.
|
|
@@ -33,9 +33,7 @@ export default function applyExtent(element, extent) {
|
|
|
33
33
|
var firstExtent = REGXP_LENGTH.exec(splittedExtent[0]);
|
|
34
34
|
var secondExtent = REGXP_LENGTH.exec(splittedExtent[1]);
|
|
35
35
|
if (firstExtent !== null && secondExtent !== null) {
|
|
36
|
-
if (firstExtent[2] === "px" ||
|
|
37
|
-
firstExtent[2] === "%" ||
|
|
38
|
-
firstExtent[2] === "em") {
|
|
36
|
+
if (firstExtent[2] === "px" || firstExtent[2] === "%" || firstExtent[2] === "em") {
|
|
39
37
|
element.style.width = firstExtent[1] + firstExtent[2];
|
|
40
38
|
}
|
|
41
39
|
else if (firstExtent[2] === "c") {
|
|
@@ -45,9 +43,7 @@ export default function applyExtent(element, extent) {
|
|
|
45
43
|
else {
|
|
46
44
|
log.warn("TTML Parser: unhandled extent unit:", firstExtent[2]);
|
|
47
45
|
}
|
|
48
|
-
if (secondExtent[2] === "px" ||
|
|
49
|
-
secondExtent[2] === "%" ||
|
|
50
|
-
secondExtent[2] === "em") {
|
|
46
|
+
if (secondExtent[2] === "px" || secondExtent[2] === "%" || secondExtent[2] === "em") {
|
|
51
47
|
element.style.height = secondExtent[1] + secondExtent[2];
|
|
52
48
|
}
|
|
53
49
|
else if (secondExtent[2] === "c") {
|
|
@@ -31,8 +31,7 @@ export default function applyFontSize(element, fontSize) {
|
|
|
31
31
|
if (firstFontSize === null) {
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
if (firstFontSize[2] === "px" ||
|
|
35
|
-
firstFontSize[2] === "em") {
|
|
34
|
+
if (firstFontSize[2] === "px" || firstFontSize[2] === "em") {
|
|
36
35
|
element.style.fontSize = firstFontSize[1] + firstFontSize[2];
|
|
37
36
|
}
|
|
38
37
|
else if (firstFontSize[2] === "c") {
|
|
@@ -43,9 +42,9 @@ export default function applyFontSize(element, fontSize) {
|
|
|
43
42
|
else if (firstFontSize[2] === "%") {
|
|
44
43
|
var toNum = Number(firstFontSize[1]);
|
|
45
44
|
if (isNaN(toNum)) {
|
|
46
|
-
log.warn(
|
|
45
|
+
log.warn('TTML Parser: could not parse fontSize value "' +
|
|
47
46
|
firstFontSize[1] +
|
|
48
|
-
"
|
|
47
|
+
'" into a number');
|
|
49
48
|
}
|
|
50
49
|
else {
|
|
51
50
|
element.style.position = "relative";
|
|
@@ -32,9 +32,7 @@ export default function applyOrigin(element, origin) {
|
|
|
32
32
|
var firstOrigin = REGXP_LENGTH.exec(splittedOrigin[0]);
|
|
33
33
|
var secondOrigin = REGXP_LENGTH.exec(splittedOrigin[1]);
|
|
34
34
|
if (firstOrigin !== null && secondOrigin !== null) {
|
|
35
|
-
if (firstOrigin[2] === "px" ||
|
|
36
|
-
firstOrigin[2] === "%" ||
|
|
37
|
-
firstOrigin[2] === "em") {
|
|
35
|
+
if (firstOrigin[2] === "px" || firstOrigin[2] === "%" || firstOrigin[2] === "em") {
|
|
38
36
|
element.style.left = firstOrigin[1] + firstOrigin[2];
|
|
39
37
|
}
|
|
40
38
|
else if (firstOrigin[2] === "c") {
|
|
@@ -44,9 +42,7 @@ export default function applyOrigin(element, origin) {
|
|
|
44
42
|
else {
|
|
45
43
|
log.warn("TTML Parser: unhandled origin unit:", firstOrigin[2]);
|
|
46
44
|
}
|
|
47
|
-
if (secondOrigin[2] === "px" ||
|
|
48
|
-
secondOrigin[2] === "%" ||
|
|
49
|
-
secondOrigin[2] === "em") {
|
|
45
|
+
if (secondOrigin[2] === "px" || secondOrigin[2] === "%" || secondOrigin[2] === "em") {
|
|
50
46
|
element.style.top = secondOrigin[1] + secondOrigin[2];
|
|
51
47
|
}
|
|
52
48
|
else if (secondOrigin[2] === "c") {
|
|
@@ -30,9 +30,7 @@ export default function applyPadding(element, padding) {
|
|
|
30
30
|
if (firstPadding === null) {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
if (firstPadding[2] === "px" ||
|
|
34
|
-
firstPadding[2] === "%" ||
|
|
35
|
-
firstPadding[2] === "em") {
|
|
33
|
+
if (firstPadding[2] === "px" || firstPadding[2] === "%" || firstPadding[2] === "em") {
|
|
36
34
|
var firstPaddingValue = firstPadding[1] + firstPadding[2];
|
|
37
35
|
if (splittedPadding.length === 1) {
|
|
38
36
|
element.style.padding = firstPaddingValue;
|
|
@@ -103,9 +101,7 @@ export default function applyPadding(element, padding) {
|
|
|
103
101
|
if (thirdPadding === null) {
|
|
104
102
|
return;
|
|
105
103
|
}
|
|
106
|
-
if (thirdPadding[2] === "px" ||
|
|
107
|
-
thirdPadding[2] === "%" ||
|
|
108
|
-
thirdPadding[2] === "em") {
|
|
104
|
+
if (thirdPadding[2] === "px" || thirdPadding[2] === "%" || thirdPadding[2] === "em") {
|
|
109
105
|
var thirdPaddingValue = thirdPadding[1] + thirdPadding[2];
|
|
110
106
|
element.style.paddingBottom = thirdPaddingValue;
|
|
111
107
|
}
|
|
@@ -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 { IStyleList, IStyleObject } from "../get_styling";
|
|
16
|
+
import type { IStyleList, IStyleObject } from "../get_styling";
|
|
17
17
|
/**
|
|
18
18
|
* @param {Element} paragraph
|
|
19
19
|
* @param {Element} body
|
|
@@ -23,7 +23,7 @@ import { IStyleList, IStyleObject } from "../get_styling";
|
|
|
23
23
|
* @param {Object}
|
|
24
24
|
* @returns {HTMLElement}
|
|
25
25
|
*/
|
|
26
|
-
export default function createElement(paragraph: Element, body: Element | null, regions: IStyleObject[], styles: IStyleObject[], paragraphStyle: IStyleList, { cellResolution, shouldTrimWhiteSpace }: {
|
|
26
|
+
export default function createElement(paragraph: Element, body: Element | null, regions: IStyleObject[], styles: IStyleObject[], paragraphStyle: IStyleList, { cellResolution, shouldTrimWhiteSpace, }: {
|
|
27
27
|
shouldTrimWhiteSpace: boolean;
|
|
28
28
|
cellResolution: {
|
|
29
29
|
columns: number;
|
|
@@ -25,8 +25,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
25
25
|
import { addClassName } from "../../../../compat";
|
|
26
26
|
import isNonEmptyString from "../../../../utils/is_non_empty_string";
|
|
27
27
|
import objectAssign from "../../../../utils/object_assign";
|
|
28
|
-
import { getStylingAttributes
|
|
29
|
-
import { getParentDivElements, isLineBreakElement, isSpanElement
|
|
28
|
+
import { getStylingAttributes } from "../get_styling";
|
|
29
|
+
import { getParentDivElements, isLineBreakElement, isSpanElement } from "../xml_utils";
|
|
30
30
|
import applyExtent from "./apply_extent";
|
|
31
31
|
import applyFontSize from "./apply_font_size";
|
|
32
32
|
import applyLineHeight from "./apply_line_height";
|
|
@@ -36,7 +36,8 @@ import generateCSSTextOutline from "./generate_css_test_outline";
|
|
|
36
36
|
import ttmlColorToCSSColor from "./ttml_color_to_css_color";
|
|
37
37
|
// Styling which can be applied to <span> from any level upper.
|
|
38
38
|
// Added here as an optimization
|
|
39
|
-
var SPAN_LEVEL_ATTRIBUTES = [
|
|
39
|
+
var SPAN_LEVEL_ATTRIBUTES = [
|
|
40
|
+
"color",
|
|
40
41
|
"direction",
|
|
41
42
|
"display",
|
|
42
43
|
"fontFamily",
|
|
@@ -47,7 +48,8 @@ var SPAN_LEVEL_ATTRIBUTES = ["color",
|
|
|
47
48
|
"textOutline",
|
|
48
49
|
"unicodeBidi",
|
|
49
50
|
"visibility",
|
|
50
|
-
"wrapOption"
|
|
51
|
+
"wrapOption",
|
|
52
|
+
];
|
|
51
53
|
// TODO
|
|
52
54
|
// tts:showBackground (applies to region)
|
|
53
55
|
// tts:zIndex (applies to region)
|
|
@@ -70,16 +72,12 @@ function applyTextStyle(element, style, shouldTrimWhiteSpace) {
|
|
|
70
72
|
// applies to span
|
|
71
73
|
var textOutline = style.textOutline;
|
|
72
74
|
if (isNonEmptyString(textOutline)) {
|
|
73
|
-
var outlineData = textOutline
|
|
74
|
-
.trim()
|
|
75
|
-
.replace(/\s+/g, " ")
|
|
76
|
-
.split(" ");
|
|
75
|
+
var outlineData = textOutline.trim().replace(/\s+/g, " ").split(" ");
|
|
77
76
|
var len = outlineData.length;
|
|
78
77
|
if (len === 3) {
|
|
79
78
|
var outlineColor = ttmlColorToCSSColor(outlineData[0]);
|
|
80
79
|
var thickness = outlineData[1];
|
|
81
|
-
element.style.textShadow =
|
|
82
|
-
generateCSSTextOutline(outlineColor, thickness);
|
|
80
|
+
element.style.textShadow = generateCSSTextOutline(outlineColor, thickness);
|
|
83
81
|
}
|
|
84
82
|
else if (isNonEmptyString(color) && len === 1) {
|
|
85
83
|
var thickness = outlineData[0];
|
|
@@ -124,8 +122,7 @@ function applyTextStyle(element, style, shouldTrimWhiteSpace) {
|
|
|
124
122
|
if (isNonEmptyString(fontFamily)) {
|
|
125
123
|
switch (fontFamily) {
|
|
126
124
|
case "proportionalSansSerif":
|
|
127
|
-
element.style.fontFamily =
|
|
128
|
-
"Arial, Helvetica, Liberation Sans, sans-serif";
|
|
125
|
+
element.style.fontFamily = "Arial, Helvetica, Liberation Sans, sans-serif";
|
|
129
126
|
break;
|
|
130
127
|
// TODO monospace or sans-serif or font with both?
|
|
131
128
|
case "monospaceSansSerif":
|
|
@@ -194,9 +191,14 @@ function applyTextStyle(element, style, shouldTrimWhiteSpace) {
|
|
|
194
191
|
}
|
|
195
192
|
// applies to body, div, p, region, span
|
|
196
193
|
var wrapOption = style.wrapOption;
|
|
197
|
-
element.style.whiteSpace =
|
|
198
|
-
|
|
199
|
-
|
|
194
|
+
element.style.whiteSpace =
|
|
195
|
+
wrapOption === "noWrap"
|
|
196
|
+
? shouldTrimWhiteSpace
|
|
197
|
+
? "nowrap"
|
|
198
|
+
: "pre"
|
|
199
|
+
: shouldTrimWhiteSpace
|
|
200
|
+
? "normal"
|
|
201
|
+
: "pre-wrap";
|
|
200
202
|
}
|
|
201
203
|
/**
|
|
202
204
|
* Apply style for the general text track div.
|
|
@@ -219,8 +221,7 @@ function applyGeneralStyle(element, style) {
|
|
|
219
221
|
}
|
|
220
222
|
// applies to region
|
|
221
223
|
var overflow = style.overflow;
|
|
222
|
-
element.style.overflow = isNonEmptyString(overflow) ? overflow :
|
|
223
|
-
"hidden";
|
|
224
|
+
element.style.overflow = isNonEmptyString(overflow) ? overflow : "hidden";
|
|
224
225
|
// applies to region
|
|
225
226
|
var padding = style.padding;
|
|
226
227
|
if (isNonEmptyString(padding)) {
|
|
@@ -321,8 +322,7 @@ function applyPStyle(element, style) {
|
|
|
321
322
|
*/
|
|
322
323
|
function createTextElement(el, style, shouldTrimWhiteSpace) {
|
|
323
324
|
var textElement = document.createElement("span");
|
|
324
|
-
var textContent = el.textContent === null ? "" :
|
|
325
|
-
el.textContent;
|
|
325
|
+
var textContent = el.textContent === null ? "" : el.textContent;
|
|
326
326
|
if (shouldTrimWhiteSpace) {
|
|
327
327
|
// 1. Trim leading and trailing whitespace.
|
|
328
328
|
// 2. Collapse multiple spaces into one.
|
|
@@ -381,8 +381,9 @@ function generateTextContent(paragraph, regions, styles, paragraphStyle, shouldT
|
|
|
381
381
|
currentNode.nodeType === Node.ELEMENT_NODE &&
|
|
382
382
|
currentNode.childNodes.length > 0) {
|
|
383
383
|
var spaceAttribute = currentNode.getAttribute("xml:space");
|
|
384
|
-
var shouldTrimWhiteSpaceOnSpan = isNonEmptyString(spaceAttribute)
|
|
385
|
-
|
|
384
|
+
var shouldTrimWhiteSpaceOnSpan = isNonEmptyString(spaceAttribute)
|
|
385
|
+
? spaceAttribute === "default"
|
|
386
|
+
: shouldTrimWhiteSpaceFromParent;
|
|
386
387
|
// compute the new applyable style
|
|
387
388
|
var newStyle = objectAssign({}, style, getStylingAttributes(SPAN_LEVEL_ATTRIBUTES, [currentNode], styles, regions));
|
|
388
389
|
elements.push.apply(elements, loop(currentNode, newStyle, __spreadArray([currentNode], spans, true), shouldTrimWhiteSpaceOnSpan));
|
|
@@ -34,8 +34,8 @@ export default function generateCSSTextOutline(color, thickness) {
|
|
|
34
34
|
thick = thickness.trim().slice(0, -1);
|
|
35
35
|
thick = (parseInt(thick, 10) / 100).toString() + "em";
|
|
36
36
|
}
|
|
37
|
-
return "-1px -1px ".concat(thick, " ").concat(color, ",") +
|
|
37
|
+
return ("-1px -1px ".concat(thick, " ").concat(color, ",") +
|
|
38
38
|
"1px -1px ".concat(thick, " ").concat(color, ",") +
|
|
39
39
|
"-1px 1px ".concat(thick, " ").concat(color, ",") +
|
|
40
|
-
"1px 1px ".concat(thick, " ").concat(color);
|
|
40
|
+
"1px 1px ".concat(thick, " ").concat(color));
|
|
41
41
|
}
|
|
@@ -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 { IParsedTTMLCue } from "../parse_ttml";
|
|
16
|
+
import type { IParsedTTMLCue } from "../parse_ttml";
|
|
17
17
|
export interface ITTMLHTMLCue {
|
|
18
18
|
start: number;
|
|
19
19
|
end: number;
|
|
@@ -32,7 +32,9 @@ export default function parseCue(parsedCue) {
|
|
|
32
32
|
}
|
|
33
33
|
var cellResolution = ttParams.cellResolution;
|
|
34
34
|
var _a = getTimeDelimiters(paragraph, ttParams), start = _a.start, end = _a.end;
|
|
35
|
-
var element = createElement(paragraph, body, regionStyles, idStyles, paragraphStyle, {
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
var element = createElement(paragraph, body, regionStyles, idStyles, paragraphStyle, {
|
|
36
|
+
cellResolution: cellResolution,
|
|
37
|
+
shouldTrimWhiteSpace: shouldTrimWhiteSpace,
|
|
38
|
+
});
|
|
39
|
+
return { start: start + timeOffset, end: end + timeOffset, element: element };
|
|
38
40
|
}
|