rx-player 4.0.0-beta.2 → 4.0.0-worker.2023091900
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/.eslintrc.js +9 -0
- package/CHANGELOG.md +25 -1
- package/CONTRIBUTING.md +41 -13
- package/FILES.md +15 -0
- package/VERSION +1 -1
- package/dist/_esm5.processed/compat/browser_compatibility_types.d.ts +0 -1
- package/dist/_esm5.processed/compat/browser_compatibility_types.js +9 -8
- package/dist/_esm5.processed/compat/browser_detection.js +4 -3
- package/dist/_esm5.processed/compat/eme/custom_media_keys/ie11_media_keys.d.ts +2 -2
- package/dist/_esm5.processed/compat/eme/custom_media_keys/ie11_media_keys.js +9 -5
- package/dist/_esm5.processed/compat/eme/custom_media_keys/index.d.ts +6 -27
- package/dist/_esm5.processed/compat/eme/custom_media_keys/index.js +1 -154
- 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/moz_media_keys_constructor.js +19 -17
- package/dist/_esm5.processed/compat/eme/custom_media_keys/ms_media_keys_constructor.js +10 -12
- package/dist/_esm5.processed/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts +3 -3
- package/dist/_esm5.processed/compat/eme/custom_media_keys/old_webkit_media_keys.js +10 -7
- package/dist/_esm5.processed/compat/eme/custom_media_keys/types.d.ts +1 -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 +10 -6
- package/dist/_esm5.processed/compat/eme/custom_media_keys/webkit_media_keys_constructor.js +12 -14
- package/dist/_esm5.processed/compat/eme/eme-api-implementation.d.ts +78 -0
- package/dist/_esm5.processed/compat/eme/eme-api-implementation.js +200 -0
- package/dist/_esm5.processed/compat/eme/index.d.ts +5 -3
- package/dist/_esm5.processed/compat/eme/index.js +3 -3
- package/dist/_esm5.processed/compat/event_listeners.d.ts +13 -5
- package/dist/_esm5.processed/compat/event_listeners.js +16 -20
- package/dist/_esm5.processed/compat/global_scope.d.ts +9 -0
- package/dist/_esm5.processed/compat/global_scope.js +13 -0
- package/dist/_esm5.processed/compat/has_mse_in_worker.d.ts +2 -0
- package/dist/_esm5.processed/compat/has_mse_in_worker.js +4 -0
- package/dist/_esm5.processed/compat/has_webassembly.d.ts +6 -0
- package/dist/_esm5.processed/compat/has_webassembly.js +7 -0
- package/dist/_esm5.processed/compat/index.d.ts +2 -3
- package/dist/_esm5.processed/compat/index.js +2 -3
- package/dist/_esm5.processed/compat/is_codec_supported.js +5 -0
- package/dist/_esm5.processed/compat/is_debug_mode_enabled.d.ts +7 -0
- package/dist/_esm5.processed/compat/is_debug_mode_enabled.js +9 -0
- package/dist/_esm5.processed/compat/is_node.d.ts +1 -0
- package/dist/_esm5.processed/compat/is_node.js +3 -1
- package/dist/_esm5.processed/compat/is_vtt_cue.js +2 -1
- package/dist/_esm5.processed/compat/is_worker.d.ts +5 -0
- package/dist/_esm5.processed/compat/is_worker.js +5 -0
- package/dist/_esm5.processed/compat/make_vtt_cue.js +3 -2
- package/dist/_esm5.processed/compat/on_height_width_change.js +2 -7
- package/dist/_esm5.processed/compat/patch_webkit_source_buffer.js +4 -3
- package/dist/_esm5.processed/compat/should_wait_for_have_enough_data.d.ts +13 -0
- package/dist/_esm5.processed/compat/should_wait_for_have_enough_data.js +16 -0
- package/dist/_esm5.processed/config.d.ts +0 -4
- package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.d.ts +2 -1
- package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.js +12 -9
- package/dist/_esm5.processed/core/adaptive/buffer_based_chooser.d.ts +19 -3
- package/dist/_esm5.processed/core/adaptive/buffer_based_chooser.js +28 -9
- package/dist/_esm5.processed/core/adaptive/guess_based_chooser.js +4 -3
- package/dist/_esm5.processed/core/adaptive/network_analyzer.js +3 -2
- package/dist/_esm5.processed/core/adaptive/utils/pending_requests_store.d.ts +13 -3
- package/dist/_esm5.processed/core/api/debug/buffer_size_graph.js +2 -1
- package/dist/_esm5.processed/core/api/debug/modules/general_info.js +22 -10
- package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_content.js +2 -1
- package/dist/_esm5.processed/core/api/option_utils.d.ts +3 -2
- package/dist/_esm5.processed/core/api/option_utils.js +14 -4
- package/dist/_esm5.processed/core/api/playback_observer.d.ts +39 -10
- package/dist/_esm5.processed/core/api/playback_observer.js +6 -5
- package/dist/_esm5.processed/core/api/public_api.d.ts +34 -5
- package/dist/_esm5.processed/core/api/public_api.js +256 -111
- package/dist/_esm5.processed/core/api/track_management/track_dispatcher.d.ts +10 -8
- package/dist/_esm5.processed/core/api/track_management/track_dispatcher.js +26 -19
- package/dist/_esm5.processed/core/api/track_management/tracks_store.d.ts +65 -35
- package/dist/_esm5.processed/core/api/track_management/tracks_store.js +103 -82
- package/dist/_esm5.processed/core/decrypt/__tests__/__global__/utils.d.ts +3 -3
- package/dist/_esm5.processed/core/decrypt/__tests__/__global__/utils.js +21 -14
- package/dist/_esm5.processed/core/decrypt/attach_media_keys.d.ts +8 -2
- package/dist/_esm5.processed/core/decrypt/attach_media_keys.js +17 -6
- package/dist/_esm5.processed/core/decrypt/clear_on_stop.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/content_decryptor.d.ts +9 -67
- package/dist/_esm5.processed/core/decrypt/content_decryptor.js +73 -167
- package/dist/_esm5.processed/core/decrypt/create_or_load_session.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/create_session.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/dispose_decryption_resources.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/dispose_decryption_resources.js +11 -4
- package/dist/_esm5.processed/core/decrypt/find_key_system.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/find_key_system.js +17 -14
- package/dist/_esm5.processed/core/decrypt/get_media_keys.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/get_media_keys.js +1 -1
- package/dist/_esm5.processed/core/decrypt/index.d.ts +2 -2
- package/dist/_esm5.processed/core/decrypt/index.js +2 -2
- package/dist/_esm5.processed/core/decrypt/session_events_listener.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/session_events_listener.js +1 -1
- package/dist/_esm5.processed/core/decrypt/set_server_certificate.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/types.d.ts +72 -5
- package/dist/_esm5.processed/core/decrypt/types.js +40 -1
- package/dist/_esm5.processed/core/decrypt/utils/check_key_statuses.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/utils/is_session_usable.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/utils/key_id_comparison.js +1 -1
- package/dist/_esm5.processed/core/decrypt/utils/loaded_sessions_store.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/utils/loaded_sessions_store.js +1 -1
- package/dist/_esm5.processed/core/decrypt/utils/media_keys_infos_store.d.ts +2 -1
- package/dist/_esm5.processed/core/decrypt/utils/persistent_sessions_store.d.ts +1 -1
- package/dist/_esm5.processed/core/decrypt/utils/server_certificate_store.d.ts +1 -1
- package/dist/_esm5.processed/core/fetchers/cdn_prioritizer.js +1 -1
- package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +19 -18
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +3 -2
- package/dist/_esm5.processed/core/fetchers/utils/schedule_request.js +4 -3
- package/dist/_esm5.processed/core/init/directfile_content_initializer.d.ts +60 -1
- package/dist/_esm5.processed/core/init/directfile_content_initializer.js +56 -8
- package/dist/_esm5.processed/core/init/index.d.ts +0 -3
- package/dist/_esm5.processed/core/init/index.js +0 -2
- package/dist/_esm5.processed/core/init/media_source_content_initializer.d.ts +7 -22
- package/dist/_esm5.processed/core/init/media_source_content_initializer.js +272 -107
- package/dist/_esm5.processed/core/init/multithread/main_thread/multi_thread_content_initializer.d.ts +131 -0
- package/dist/_esm5.processed/core/init/multithread/main_thread/multi_thread_content_initializer.js +1295 -0
- package/dist/_esm5.processed/core/init/multithread/main_thread/send_message.d.ts +2 -0
- package/dist/_esm5.processed/core/init/multithread/main_thread/send_message.js +10 -0
- package/dist/_esm5.processed/core/init/multithread/worker/content_preparer.d.ts +92 -0
- package/dist/_esm5.processed/core/init/multithread/worker/content_preparer.js +241 -0
- package/dist/_esm5.processed/core/init/multithread/worker/globals.d.ts +14 -0
- package/dist/_esm5.processed/core/init/multithread/worker/globals.js +20 -0
- package/dist/_esm5.processed/core/init/multithread/worker/index.d.ts +2 -0
- package/dist/_esm5.processed/core/init/multithread/worker/index.js +2 -0
- package/dist/_esm5.processed/core/init/multithread/worker/send_message.d.ts +3 -0
- package/dist/_esm5.processed/core/init/multithread/worker/send_message.js +20 -0
- package/dist/_esm5.processed/core/init/multithread/worker/stream_playback_observer.d.ts +23 -0
- package/dist/_esm5.processed/core/init/multithread/worker/stream_playback_observer.js +60 -0
- package/dist/_esm5.processed/core/init/multithread/worker/track_choice_setter.d.ts +13 -0
- package/dist/_esm5.processed/core/init/multithread/worker/track_choice_setter.js +74 -0
- package/dist/_esm5.processed/core/init/multithread/worker/worker_playback_observer.d.ts +21 -0
- package/dist/_esm5.processed/core/init/multithread/worker/worker_playback_observer.js +45 -0
- package/dist/_esm5.processed/core/init/multithread/worker/worker_portal.d.ts +1 -0
- package/dist/_esm5.processed/core/init/multithread/worker/worker_portal.js +645 -0
- package/dist/_esm5.processed/core/init/multithread/worker/worker_text_displayer_interface.d.ts +64 -0
- package/dist/_esm5.processed/core/init/multithread/worker/worker_text_displayer_interface.js +125 -0
- package/dist/_esm5.processed/core/init/types.d.ts +21 -26
- package/dist/_esm5.processed/core/init/types.js +0 -1
- package/dist/_esm5.processed/core/init/utils/DecipherabilityFreezeDetector.d.ts +54 -0
- package/dist/_esm5.processed/core/init/utils/DecipherabilityFreezeDetector.js +97 -0
- package/dist/_esm5.processed/core/init/utils/create_content_time_boundaries_observer.d.ts +28 -0
- package/dist/_esm5.processed/core/init/utils/create_content_time_boundaries_observer.js +45 -0
- package/dist/_esm5.processed/core/init/utils/create_media_source.d.ts +3 -3
- package/dist/_esm5.processed/core/init/utils/create_media_source.js +29 -35
- package/dist/_esm5.processed/core/init/utils/create_stream_playback_observer.d.ts +16 -5
- package/dist/_esm5.processed/core/init/utils/create_stream_playback_observer.js +30 -8
- package/dist/_esm5.processed/core/init/utils/end_of_stream.js +1 -0
- package/dist/_esm5.processed/core/init/utils/get_initial_time.d.ts +2 -2
- package/dist/_esm5.processed/core/init/utils/get_initial_time.js +8 -6
- package/dist/_esm5.processed/core/init/utils/get_loaded_reference.js +4 -2
- package/dist/_esm5.processed/core/init/utils/initial_seek_and_play.js +3 -3
- package/dist/_esm5.processed/core/init/utils/initialize_content_decryption.d.ts +7 -1
- package/dist/_esm5.processed/core/init/utils/initialize_content_decryption.js +31 -33
- package/dist/_esm5.processed/core/init/utils/main_thread_text_displayer_interface.d.ts +35 -0
- package/dist/_esm5.processed/core/init/utils/main_thread_text_displayer_interface.js +52 -0
- package/dist/_esm5.processed/core/init/utils/media_source_duration_updater.js +6 -1
- package/dist/_esm5.processed/core/init/utils/rebuffering_controller.d.ts +5 -38
- package/dist/_esm5.processed/core/init/utils/rebuffering_controller.js +9 -87
- 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 +41 -2
- package/dist/_esm5.processed/core/init/utils/stream_events_emitter/stream_events_emitter.d.ts +33 -10
- package/dist/_esm5.processed/core/init/utils/stream_events_emitter/stream_events_emitter.js +98 -55
- package/dist/_esm5.processed/core/segment_buffers/garbage_collector.d.ts +3 -1
- package/dist/_esm5.processed/core/segment_buffers/garbage_collector.js +14 -5
- package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.d.ts +26 -74
- package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +174 -283
- package/dist/_esm5.processed/core/segment_buffers/implementations/index.d.ts +2 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/index.js +1 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/index.d.ts +3 -0
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/index.js +2 -0
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/text_segment_buffer.d.ts +89 -0
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/text_segment_buffer.js +250 -0
- package/dist/_esm5.processed/core/segment_buffers/implementations/types.d.ts +46 -57
- package/dist/_esm5.processed/core/segment_buffers/implementations/types.js +22 -29
- package/dist/_esm5.processed/core/segment_buffers/index.d.ts +3 -3
- package/dist/_esm5.processed/core/segment_buffers/inventory/buffered_history.d.ts +2 -2
- package/dist/_esm5.processed/core/segment_buffers/inventory/buffered_history.js +3 -2
- package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.d.ts +9 -8
- package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.js +17 -17
- package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.d.ts +7 -16
- package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.js +14 -24
- package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.d.ts +1 -1
- package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +45 -31
- package/dist/_esm5.processed/core/stream/adaptation/get_representations_switch_strategy.d.ts +20 -6
- package/dist/_esm5.processed/core/stream/adaptation/get_representations_switch_strategy.js +33 -54
- package/dist/_esm5.processed/core/stream/adaptation/types.d.ts +20 -37
- package/dist/_esm5.processed/core/stream/index.d.ts +2 -2
- package/dist/_esm5.processed/core/stream/orchestrator/get_time_ranges_for_content.d.ts +4 -4
- package/dist/_esm5.processed/core/stream/orchestrator/get_time_ranges_for_content.js +2 -8
- package/dist/_esm5.processed/core/stream/orchestrator/index.d.ts +2 -2
- package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.d.ts +15 -29
- package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +29 -24
- package/dist/_esm5.processed/core/stream/period/period_stream.js +70 -38
- package/dist/_esm5.processed/core/stream/period/types.d.ts +11 -6
- package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +21 -10
- package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.js +46 -73
- package/dist/_esm5.processed/core/stream/representation/representation_stream.d.ts +1 -1
- package/dist/_esm5.processed/core/stream/representation/representation_stream.js +5 -4
- package/dist/_esm5.processed/core/stream/representation/types.d.ts +33 -7
- package/dist/_esm5.processed/core/stream/representation/utils/append_segment_to_buffer.d.ts +5 -2
- package/dist/_esm5.processed/core/stream/representation/utils/append_segment_to_buffer.js +28 -18
- package/dist/_esm5.processed/core/stream/representation/utils/downloading_queue.d.ts +1 -1
- package/dist/_esm5.processed/core/stream/representation/utils/get_buffer_status.d.ts +2 -2
- package/dist/_esm5.processed/core/stream/representation/utils/get_buffer_status.js +22 -12
- package/dist/_esm5.processed/core/stream/representation/utils/get_needed_segments.d.ts +2 -2
- package/dist/_esm5.processed/core/stream/representation/utils/push_init_segment.d.ts +4 -2
- package/dist/_esm5.processed/core/stream/representation/utils/push_init_segment.js +4 -5
- package/dist/_esm5.processed/core/stream/representation/utils/push_media_segment.d.ts +4 -2
- package/dist/_esm5.processed/core/stream/representation/utils/push_media_segment.js +4 -5
- package/dist/_esm5.processed/default_config.d.ts +0 -26
- package/dist/_esm5.processed/default_config.js +1 -27
- package/dist/_esm5.processed/errors/encrypted_media_error.d.ts +17 -0
- package/dist/_esm5.processed/errors/encrypted_media_error.js +14 -1
- package/dist/_esm5.processed/errors/error_message.d.ts +1 -2
- package/dist/_esm5.processed/errors/error_message.js +2 -3
- package/dist/_esm5.processed/errors/index.d.ts +7 -6
- package/dist/_esm5.processed/errors/index.js +2 -1
- package/dist/_esm5.processed/errors/media_error.d.ts +21 -18
- package/dist/_esm5.processed/errors/media_error.js +16 -17
- package/dist/_esm5.processed/errors/network_error.d.ts +15 -1
- package/dist/_esm5.processed/errors/network_error.js +13 -1
- package/dist/_esm5.processed/errors/other_error.d.ts +14 -0
- package/dist/_esm5.processed/errors/other_error.js +13 -1
- package/dist/_esm5.processed/errors/request_error.d.ts +7 -0
- package/dist/_esm5.processed/errors/request_error.js +18 -1
- package/dist/_esm5.processed/errors/source_buffer_error.d.ts +40 -0
- package/dist/_esm5.processed/errors/source_buffer_error.js +60 -0
- package/dist/_esm5.processed/experimental/features/dash_wasm.js +3 -0
- package/dist/_esm5.processed/experimental/features/index.d.ts +1 -0
- package/dist/_esm5.processed/experimental/features/index.js +1 -0
- package/dist/_esm5.processed/experimental/features/local.js +5 -0
- package/dist/_esm5.processed/experimental/features/metaplaylist.js +5 -0
- package/dist/_esm5.processed/experimental/features/multi_thread.d.ts +8 -0
- package/dist/_esm5.processed/experimental/features/multi_thread.js +11 -0
- 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 +13 -14
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.d.ts +3 -3
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +25 -18
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.d.ts +3 -5
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.js +4 -5
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +17 -12
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/index.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/index.js +1 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.js +4 -3
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.js +5 -4
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.js +4 -3
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +4 -3
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +3 -2
- package/dist/_esm5.processed/features/features_object.js +6 -3
- package/dist/_esm5.processed/features/initialize_features.js +14 -5
- package/dist/_esm5.processed/features/list/dash.js +5 -0
- package/dist/_esm5.processed/features/list/eme.js +1 -1
- package/dist/_esm5.processed/features/list/html_sami_parser.js +2 -0
- package/dist/_esm5.processed/features/list/html_srt_parser.js +2 -0
- package/dist/_esm5.processed/features/list/html_text_buffer.js +2 -2
- package/dist/_esm5.processed/features/list/html_ttml_parser.js +2 -0
- package/dist/_esm5.processed/features/list/html_vtt_parser.js +2 -0
- package/dist/_esm5.processed/features/list/index.d.ts +1 -0
- package/dist/_esm5.processed/features/list/index.js +1 -0
- package/dist/_esm5.processed/features/list/media_source_main.d.ts +8 -0
- package/dist/_esm5.processed/features/list/media_source_main.js +11 -0
- package/dist/_esm5.processed/features/list/native_sami_parser.js +2 -0
- package/dist/_esm5.processed/features/list/native_srt_parser.js +2 -0
- package/dist/_esm5.processed/features/list/native_text_buffer.js +2 -2
- package/dist/_esm5.processed/features/list/native_ttml_parser.js +2 -0
- package/dist/_esm5.processed/features/list/native_vtt_parser.js +2 -0
- package/dist/_esm5.processed/features/list/smooth.js +5 -0
- package/dist/_esm5.processed/features/types.d.ts +108 -7
- package/dist/_esm5.processed/index.d.ts +0 -4
- package/dist/_esm5.processed/index.js +2 -1
- package/dist/_esm5.processed/manifest/adaptation.d.ts +68 -44
- package/dist/_esm5.processed/manifest/adaptation.js +66 -76
- package/dist/_esm5.processed/manifest/index.d.ts +4 -3
- package/dist/_esm5.processed/manifest/index.js +2 -2
- package/dist/_esm5.processed/manifest/manifest.d.ts +139 -16
- package/dist/_esm5.processed/manifest/manifest.js +93 -57
- package/dist/_esm5.processed/manifest/period.d.ts +40 -9
- package/dist/_esm5.processed/manifest/period.js +87 -26
- package/dist/_esm5.processed/manifest/representation.d.ts +59 -64
- package/dist/_esm5.processed/manifest/representation.js +58 -31
- package/dist/_esm5.processed/manifest/types.d.ts +355 -0
- package/dist/_esm5.processed/manifest/types.js +0 -15
- package/dist/_esm5.processed/manifest/update_period_in_place.d.ts +12 -9
- package/dist/_esm5.processed/manifest/update_period_in_place.js +11 -7
- package/dist/_esm5.processed/manifest/update_periods.d.ts +7 -4
- package/dist/_esm5.processed/manifest/update_periods.js +48 -14
- package/dist/_esm5.processed/manifest/utils.d.ts +147 -0
- package/dist/_esm5.processed/manifest/utils.js +450 -0
- package/dist/_esm5.processed/minimal.d.ts +2 -15
- package/dist/_esm5.processed/minimal.js +7 -33
- package/dist/_esm5.processed/mse/index.d.ts +1 -0
- package/dist/_esm5.processed/mse/index.js +1 -0
- package/dist/_esm5.processed/mse/main_codec_support_prober.d.ts +26 -0
- package/dist/_esm5.processed/mse/main_codec_support_prober.js +42 -0
- package/dist/_esm5.processed/mse/main_media_source_interface.d.ts +112 -0
- package/dist/_esm5.processed/mse/main_media_source_interface.js +374 -0
- package/dist/_esm5.processed/mse/types.d.ts +301 -0
- package/dist/_esm5.processed/mse/types.js +1 -0
- package/dist/_esm5.processed/mse/worker_codec_support_prober.d.ts +42 -0
- package/dist/_esm5.processed/mse/worker_codec_support_prober.js +59 -0
- package/dist/_esm5.processed/mse/worker_media_source_interface.d.ts +57 -0
- package/dist/_esm5.processed/mse/worker_media_source_interface.js +243 -0
- package/dist/_esm5.processed/multithread/index.d.ts +1 -0
- package/dist/_esm5.processed/multithread/index.js +1 -0
- package/dist/_esm5.processed/multithread/types.d.ts +781 -0
- package/dist/_esm5.processed/multithread/types.js +1 -0
- package/dist/_esm5.processed/multithread/worker.d.ts +1 -0
- package/dist/_esm5.processed/multithread/worker.js +2 -0
- package/dist/_esm5.processed/parsers/manifest/dash/common/get_clock_offset.d.ts +3 -3
- package/dist/_esm5.processed/parsers/manifest/dash/common/get_clock_offset.js +5 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +5 -3
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +2 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +8 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/manifest_bounds_calculator.js +6 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +4 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.d.ts +6 -3
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.js +3 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.d.ts +4 -0
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.js +22 -22
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/parsers_types.d.ts +4 -4
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +4 -3
- package/dist/_esm5.processed/parsers/manifest/local/parse_local_manifest.js +2 -1
- package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.js +2 -1
- package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.js +3 -2
- package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.d.ts +3 -3
- package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.js +3 -2
- package/dist/_esm5.processed/parsers/manifest/smooth/shared_smooth_segment_timeline.d.ts +3 -3
- package/dist/_esm5.processed/parsers/manifest/smooth/shared_smooth_segment_timeline.js +3 -2
- package/dist/_esm5.processed/parsers/manifest/types.d.ts +12 -5
- package/dist/_esm5.processed/public_types.d.ts +25 -10
- package/dist/_esm5.processed/public_types.js +1 -0
- package/dist/_esm5.processed/{core/segment_buffers/implementations/text/html/parsers.d.ts → text_displayer/html/html_parsers.d.ts} +0 -15
- package/dist/_esm5.processed/{core/segment_buffers/implementations/text/html/parsers.js → text_displayer/html/html_parsers.js} +2 -17
- package/dist/_esm5.processed/text_displayer/html/html_text_displayer.d.ts +91 -0
- package/dist/_esm5.processed/{core/segment_buffers/implementations/text/html/html_text_segment_buffer.js → text_displayer/html/html_text_displayer.js} +84 -180
- package/dist/_esm5.processed/text_displayer/html/index.d.ts +2 -0
- package/dist/_esm5.processed/text_displayer/html/index.js +2 -0
- package/dist/_esm5.processed/{core/segment_buffers/implementations/text → text_displayer}/html/text_track_cues_store.d.ts +4 -18
- package/dist/_esm5.processed/{core/segment_buffers/implementations/text → text_displayer}/html/text_track_cues_store.js +6 -18
- package/dist/_esm5.processed/text_displayer/html/update_proportional_elements.d.ts +15 -0
- package/dist/_esm5.processed/{core/segment_buffers/implementations/text → text_displayer}/html/update_proportional_elements.js +0 -15
- package/dist/_esm5.processed/{core/segment_buffers/implementations/text → text_displayer}/html/utils.d.ts +10 -16
- package/dist/_esm5.processed/{core/segment_buffers/implementations/text → text_displayer}/html/utils.js +1 -17
- package/dist/_esm5.processed/text_displayer/index.d.ts +2 -0
- package/dist/_esm5.processed/text_displayer/index.js +1 -0
- package/dist/_esm5.processed/text_displayer/manual_time_ranges.d.ts +14 -0
- package/dist/_esm5.processed/text_displayer/manual_time_ranges.js +50 -0
- package/dist/_esm5.processed/text_displayer/native/index.d.ts +2 -0
- package/dist/_esm5.processed/text_displayer/native/index.js +2 -0
- package/dist/_esm5.processed/text_displayer/native/native_parsers.d.ts +11 -0
- package/dist/_esm5.processed/{core/segment_buffers/implementations/text/native/parsers.js → text_displayer/native/native_parsers.js} +2 -17
- package/dist/_esm5.processed/text_displayer/native/native_text_displayer.d.ts +56 -0
- package/dist/_esm5.processed/text_displayer/native/native_text_displayer.js +205 -0
- package/dist/_esm5.processed/text_displayer/types.d.ts +74 -0
- package/dist/_esm5.processed/text_displayer/types.js +1 -0
- package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.d.ts +1 -1
- package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.js +11 -15
- package/dist/_esm5.processed/transports/dash/manifest_parser.js +3 -2
- package/dist/_esm5.processed/transports/local/pipelines.js +3 -2
- package/dist/_esm5.processed/transports/metaplaylist/pipelines.js +4 -3
- package/dist/_esm5.processed/transports/smooth/pipelines.js +3 -2
- package/dist/_esm5.processed/transports/types.d.ts +16 -7
- package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +2 -1
- package/dist/_esm5.processed/utils/are_arrays_of_numbers_equal.js +3 -0
- package/dist/_esm5.processed/utils/assert.js +2 -1
- package/dist/_esm5.processed/utils/deep_merge.d.ts +2 -5
- package/dist/_esm5.processed/utils/event_emitter.js +8 -2
- package/dist/_esm5.processed/utils/logger.d.ts +12 -3
- package/dist/_esm5.processed/utils/logger.js +77 -21
- package/dist/_esm5.processed/utils/monotonic_timestamp.d.ts +24 -0
- package/dist/_esm5.processed/utils/monotonic_timestamp.js +28 -0
- package/dist/_esm5.processed/utils/ranges.d.ts +50 -8
- package/dist/_esm5.processed/utils/ranges.js +87 -11
- package/dist/_esm5.processed/utils/reference.d.ts +3 -2
- package/dist/_esm5.processed/utils/reference.js +42 -4
- package/dist/_esm5.processed/utils/request/fetch.d.ts +4 -4
- package/dist/_esm5.processed/utils/request/fetch.js +7 -5
- package/dist/_esm5.processed/utils/request/xhr.js +5 -4
- package/dist/_esm5.processed/utils/string_parsing.js +5 -4
- package/dist/_esm5.processed/utils/sync_or_async.d.ts +70 -0
- package/dist/_esm5.processed/utils/sync_or_async.js +45 -0
- package/dist/_esm5.processed/utils/wrapInPromise.d.ts +7 -0
- package/dist/_esm5.processed/utils/wrapInPromise.js +22 -0
- package/dist/mpd-parser.wasm +0 -0
- package/dist/rx-player.js +42496 -40652
- package/dist/rx-player.min.js +1 -1
- package/dist/worker.js +3 -0
- package/experimental/inline-mpd-parser.d.ts +2 -0
- package/experimental/inline-mpd-parser.js +2 -0
- package/experimental/inline-worker.d.ts +2 -0
- package/experimental/inline-worker.js +2 -0
- package/package.json +40 -34
- package/scripts/generate_inline_dash_wasm.mjs +74 -0
- package/scripts/generate_inline_worker.mjs +76 -0
- package/scripts/list-npm-scripts.js +146 -38
- package/scripts/update-version +1 -0
- package/sonar-project.properties +1 -1
- package/src/README.md +8 -1
- package/src/compat/README.md +7 -0
- package/src/compat/__tests__/browser_compatibility_types.test.ts +51 -72
- package/src/compat/__tests__/is_vtt_cue.test.ts +20 -16
- package/src/compat/__tests__/make_vtt_cue.test.ts +11 -9
- package/src/compat/__tests__/patch_webkit_source_buffer.test.ts +26 -25
- package/src/compat/__tests__/should_favour_custom_safari_EME.test.ts +11 -9
- package/src/compat/__tests__/should_wait_for_have_enough_data.test.ts +36 -0
- package/src/compat/browser_compatibility_types.ts +9 -16
- package/src/compat/browser_detection.ts +11 -8
- package/src/compat/eme/custom_media_keys/ie11_media_keys.ts +11 -8
- package/src/compat/eme/custom_media_keys/index.ts +8 -184
- package/src/compat/eme/custom_media_keys/moz_media_keys_constructor.ts +26 -22
- package/src/compat/eme/custom_media_keys/ms_media_keys_constructor.ts +13 -15
- package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +15 -11
- package/src/compat/eme/custom_media_keys/types.ts +1 -1
- package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +15 -11
- package/src/compat/eme/custom_media_keys/webkit_media_keys_constructor.ts +14 -16
- package/src/compat/eme/eme-api-implementation.ts +319 -0
- package/src/compat/eme/index.ts +8 -6
- package/src/compat/event_listeners.ts +17 -24
- package/src/compat/global_scope.ts +16 -0
- package/src/compat/has_mse_in_worker.ts +5 -0
- package/src/compat/has_webassembly.ts +7 -0
- package/src/compat/index.ts +2 -24
- package/src/compat/is_codec_supported.ts +5 -0
- package/src/compat/is_debug_mode_enabled.ts +12 -0
- package/src/compat/is_node.ts +4 -1
- package/src/compat/is_vtt_cue.ts +2 -1
- package/src/compat/is_worker.ts +9 -0
- package/src/compat/make_vtt_cue.ts +3 -2
- package/src/compat/on_height_width_change.ts +2 -7
- package/src/compat/patch_webkit_source_buffer.ts +4 -3
- package/src/compat/should_wait_for_have_enough_data.ts +17 -0
- package/src/core/README.md +7 -0
- package/src/core/adaptive/README.md +11 -0
- package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +242 -99
- package/src/core/adaptive/adaptive_representation_selector.ts +20 -15
- package/src/core/adaptive/buffer_based_chooser.ts +40 -12
- package/src/core/adaptive/guess_based_chooser.ts +4 -3
- package/src/core/adaptive/network_analyzer.ts +4 -2
- package/src/core/adaptive/utils/pending_requests_store.ts +15 -5
- package/src/core/api/README.md +7 -0
- package/src/core/api/debug/buffer_size_graph.ts +3 -1
- package/src/core/api/debug/modules/general_info.ts +10 -0
- package/src/core/api/debug/modules/segment_buffer_content.ts +8 -7
- package/src/core/api/option_utils.ts +20 -7
- package/src/core/api/playback_observer.ts +38 -16
- package/src/core/api/public_api.ts +348 -152
- package/src/core/api/track_management/README.md +7 -0
- package/src/core/api/track_management/track_dispatcher.ts +39 -31
- package/src/core/api/track_management/tracks_store.ts +197 -130
- package/src/core/decrypt/README.md +8 -0
- package/src/core/decrypt/__tests__/__global__/get_license.test.ts +3 -3
- package/src/core/decrypt/__tests__/__global__/init_data.test.ts +24 -14
- package/src/core/decrypt/__tests__/__global__/media_key_system_access.test.ts +74 -48
- package/src/core/decrypt/__tests__/__global__/media_keys.test.ts +21 -15
- package/src/core/decrypt/__tests__/__global__/server_certificate.test.ts +15 -12
- package/src/core/decrypt/__tests__/__global__/utils.ts +39 -24
- package/src/core/decrypt/attach_media_keys.ts +33 -8
- package/src/core/decrypt/clear_on_stop.ts +1 -1
- package/src/core/decrypt/content_decryptor.ts +238 -366
- package/src/core/decrypt/create_or_load_session.ts +1 -1
- package/src/core/decrypt/create_session.ts +1 -1
- package/src/core/decrypt/dispose_decryption_resources.ts +19 -4
- package/src/core/decrypt/find_key_system.ts +24 -19
- package/src/core/decrypt/get_media_keys.ts +2 -2
- package/src/core/decrypt/index.ts +1 -6
- package/src/core/decrypt/session_events_listener.ts +3 -4
- package/src/core/decrypt/set_server_certificate.ts +1 -1
- package/src/core/decrypt/types.ts +86 -8
- package/src/core/decrypt/utils/check_key_statuses.ts +1 -1
- package/src/core/decrypt/utils/is_session_usable.ts +1 -1
- package/src/core/decrypt/utils/key_id_comparison.ts +1 -1
- package/src/core/decrypt/utils/loaded_sessions_store.ts +2 -2
- package/src/core/decrypt/utils/media_keys_infos_store.ts +4 -1
- package/src/core/decrypt/utils/persistent_sessions_store.ts +1 -1
- package/src/core/decrypt/utils/server_certificate_store.ts +1 -1
- package/src/core/fetchers/README.md +11 -0
- package/src/core/fetchers/cdn_prioritizer.ts +2 -2
- package/src/core/fetchers/manifest/manifest_fetcher.ts +22 -18
- package/src/core/fetchers/segment/segment_fetcher.ts +3 -2
- package/src/core/fetchers/utils/schedule_request.ts +6 -5
- package/src/core/init/README.md +15 -0
- package/src/core/init/directfile_content_initializer.ts +79 -16
- package/src/core/init/index.ts +0 -6
- package/src/core/init/media_source_content_initializer.ts +286 -132
- package/src/core/init/multithread/main_thread/multi_thread_content_initializer.ts +1763 -0
- package/src/core/init/multithread/main_thread/send_message.ts +15 -0
- package/src/core/init/multithread/worker/content_preparer.ts +392 -0
- package/src/core/init/multithread/worker/globals.ts +40 -0
- package/src/core/init/multithread/worker/index.ts +2 -0
- package/src/core/init/multithread/worker/send_message.ts +29 -0
- package/src/core/init/multithread/worker/stream_playback_observer.ts +99 -0
- package/src/core/init/multithread/worker/track_choice_setter.ts +97 -0
- package/src/core/init/multithread/worker/worker_playback_observer.ts +78 -0
- package/src/core/init/multithread/worker/worker_portal.ts +850 -0
- package/src/core/init/multithread/worker/worker_text_displayer_interface.ts +162 -0
- package/src/core/init/types.ts +25 -29
- package/src/core/init/utils/DecipherabilityFreezeDetector.ts +133 -0
- package/src/core/init/utils/__tests__/refresh_scheduled_events_list.test.ts +22 -8
- package/src/core/init/utils/create_content_time_boundaries_observer.ts +71 -0
- package/src/core/init/utils/create_media_source.ts +32 -47
- package/src/core/init/utils/create_stream_playback_observer.ts +56 -13
- package/src/core/init/utils/end_of_stream.ts +1 -0
- package/src/core/init/utils/get_initial_time.ts +15 -8
- package/src/core/init/utils/get_loaded_reference.ts +4 -1
- package/src/core/init/utils/initial_seek_and_play.ts +4 -4
- package/src/core/init/utils/initialize_content_decryption.ts +45 -35
- package/src/core/init/utils/main_thread_text_displayer_interface.ts +59 -0
- package/src/core/init/utils/media_source_duration_updater.ts +6 -2
- package/src/core/init/utils/rebuffering_controller.ts +18 -125
- package/src/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.ts +33 -6
- package/src/core/init/utils/stream_events_emitter/stream_events_emitter.ts +116 -74
- package/src/core/segment_buffers/README.md +11 -0
- package/src/core/segment_buffers/garbage_collector.ts +15 -5
- package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +136 -413
- package/src/core/segment_buffers/implementations/index.ts +5 -1
- package/src/core/segment_buffers/implementations/text/index.ts +6 -0
- package/src/core/segment_buffers/implementations/text/text_segment_buffer.ts +246 -0
- package/src/core/segment_buffers/implementations/types.ts +50 -69
- package/src/core/segment_buffers/implementations/utils/manual_time_ranges.ts +2 -2
- package/src/core/segment_buffers/index.ts +8 -11
- package/src/core/segment_buffers/inventory/buffered_history.ts +4 -3
- package/src/core/segment_buffers/inventory/segment_inventory.ts +18 -18
- package/src/core/segment_buffers/segment_buffers_store.ts +29 -39
- package/src/core/stream/README.md +10 -0
- package/src/core/stream/adaptation/adaptation_stream.ts +53 -25
- package/src/core/stream/adaptation/get_representations_switch_strategy.ts +62 -76
- package/src/core/stream/adaptation/types.ts +21 -39
- package/src/core/stream/index.ts +2 -0
- package/src/core/stream/orchestrator/README.md +10 -0
- package/src/core/stream/orchestrator/get_time_ranges_for_content.ts +8 -14
- package/src/core/stream/orchestrator/index.ts +2 -0
- package/src/core/stream/orchestrator/stream_orchestrator.ts +39 -43
- package/src/core/stream/period/period_stream.ts +87 -39
- package/src/core/stream/period/types.ts +12 -6
- package/src/core/stream/period/utils/get_adaptation_switch_strategy.ts +64 -92
- package/src/core/stream/representation/README.md +10 -0
- package/src/core/stream/representation/representation_stream.ts +8 -3
- package/src/core/stream/representation/types.ts +36 -8
- package/src/core/stream/representation/utils/append_segment_to_buffer.ts +31 -16
- package/src/core/stream/representation/utils/downloading_queue.ts +1 -1
- package/src/core/stream/representation/utils/get_buffer_status.ts +31 -16
- package/src/core/stream/representation/utils/get_needed_segments.ts +4 -4
- package/src/core/stream/representation/utils/push_init_segment.ts +10 -8
- package/src/core/stream/representation/utils/push_media_segment.ts +10 -7
- package/src/default_config.ts +1 -29
- package/src/errors/README.md +11 -0
- package/src/errors/__tests__/encrypted_media_error.test.ts +2 -2
- package/src/errors/__tests__/error_message.test.ts +1 -1
- package/src/errors/__tests__/format_error.test.ts +2 -2
- package/src/errors/__tests__/media_error.test.ts +3 -3
- package/src/errors/__tests__/network_error.test.ts +10 -9
- package/src/errors/__tests__/other_error.test.ts +3 -3
- package/src/errors/__tests__/request_error.test.ts +4 -4
- package/src/errors/custom_loader_error.ts +0 -1
- package/src/errors/encrypted_media_error.ts +29 -2
- package/src/errors/error_message.ts +1 -3
- package/src/errors/index.ts +22 -6
- package/src/errors/media_error.ts +33 -45
- package/src/errors/network_error.ts +25 -2
- package/src/errors/other_error.ts +22 -1
- package/src/errors/request_error.ts +27 -1
- package/src/errors/source_buffer_error.ts +63 -0
- package/src/experimental/features/__tests__/local.test.ts +16 -17
- package/src/experimental/features/__tests__/metaplaylist.test.ts +16 -15
- package/src/experimental/features/__tests__/multi_thread.test.ts +18 -0
- package/src/experimental/features/dash_wasm.ts +3 -0
- package/src/experimental/features/index.ts +1 -0
- package/src/experimental/features/local.ts +5 -0
- package/src/experimental/features/metaplaylist.ts +5 -0
- package/src/experimental/features/multi_thread.ts +16 -0
- package/src/experimental/tools/VideoThumbnailLoader/load_and_push_segment.ts +13 -19
- package/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts +29 -20
- package/src/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.ts +7 -12
- package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +23 -21
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +10 -9
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +26 -18
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +24 -23
- package/src/experimental/tools/mediaCapabilitiesProber/api/index.ts +2 -4
- package/src/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.ts +7 -4
- package/src/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.ts +5 -4
- package/src/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.ts +4 -3
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts +4 -3
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +3 -2
- package/src/features/__tests__/initialize_features.test.ts +228 -44
- package/src/features/features_object.ts +6 -3
- package/src/features/initialize_features.ts +38 -28
- package/src/features/list/__tests__/dash.test.ts +14 -11
- package/src/features/list/__tests__/eme.test.ts +2 -2
- package/src/features/list/__tests__/html_sami_parser.test.ts +2 -5
- package/src/features/list/__tests__/html_srt_parser.test.ts +2 -5
- package/src/features/list/__tests__/html_text_buffer.test.ts +3 -10
- package/src/features/list/__tests__/html_ttml_parser.test.ts +2 -5
- package/src/features/list/__tests__/html_vtt_parser.test.ts +2 -5
- package/src/features/list/__tests__/native_sami_parser.test.ts +2 -5
- package/src/features/list/__tests__/native_srt_parser.test.ts +2 -5
- package/src/features/list/__tests__/native_text_buffer.test.ts +3 -9
- package/src/features/list/__tests__/native_ttml_parser.test.ts +2 -5
- package/src/features/list/__tests__/native_vtt_parser.test.ts +2 -5
- package/src/features/list/__tests__/smooth.test.ts +8 -6
- package/src/features/list/dash.ts +5 -0
- package/src/features/list/eme.ts +1 -1
- package/src/features/list/html_sami_parser.ts +2 -0
- package/src/features/list/html_srt_parser.ts +2 -0
- package/src/features/list/html_text_buffer.ts +2 -2
- package/src/features/list/html_ttml_parser.ts +2 -0
- package/src/features/list/html_vtt_parser.ts +2 -0
- package/src/features/list/index.ts +1 -0
- package/src/features/list/media_source_main.ts +14 -0
- package/src/features/list/native_sami_parser.ts +2 -0
- package/src/features/list/native_srt_parser.ts +2 -0
- package/src/features/list/native_text_buffer.ts +2 -2
- package/src/features/list/native_ttml_parser.ts +2 -0
- package/src/features/list/native_vtt_parser.ts +2 -0
- package/src/features/list/smooth.ts +5 -0
- package/src/features/types.ts +114 -17
- package/src/index.ts +3 -2
- package/src/manifest/__tests__/adaptation.test.ts +3 -62
- package/src/manifest/__tests__/manifest.test.ts +144 -75
- package/src/manifest/__tests__/period.test.ts +82 -55
- package/src/manifest/__tests__/representation.test.ts +225 -133
- package/src/manifest/__tests__/update_period_in_place.test.ts +40 -20
- package/src/manifest/__tests__/update_periods.test.ts +4 -4
- package/src/manifest/adaptation.ts +116 -130
- package/src/manifest/index.ts +40 -2
- package/src/manifest/manifest.ts +157 -74
- package/src/manifest/period.ts +110 -38
- package/src/manifest/representation.ts +93 -113
- package/src/manifest/types.ts +380 -0
- package/src/manifest/update_period_in_place.ts +31 -18
- package/src/manifest/update_periods.ts +65 -18
- package/src/manifest/utils.ts +648 -0
- package/src/minimal.ts +9 -16
- package/src/mse/README.md +33 -0
- package/src/mse/index.ts +7 -0
- package/src/mse/main_codec_support_prober.ts +52 -0
- package/src/mse/main_media_source_interface.ts +501 -0
- package/src/mse/types.ts +318 -0
- package/src/mse/worker_codec_support_prober.ts +79 -0
- package/src/mse/worker_media_source_interface.ts +329 -0
- package/src/multithread/README.md +36 -0
- package/src/multithread/index.ts +1 -0
- package/src/multithread/types.ts +937 -0
- package/src/multithread/worker.ts +2 -0
- package/src/parsers/README.md +7 -0
- package/src/parsers/manifest/dash/common/__tests__/get_clock_offset.test.ts +2 -1
- package/src/parsers/manifest/dash/common/get_clock_offset.ts +5 -4
- package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +7 -4
- package/src/parsers/manifest/dash/common/manifest_bounds_calculator.ts +11 -5
- package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +1 -0
- package/src/parsers/manifest/dash/common/parse_mpd.ts +9 -5
- package/src/parsers/manifest/dash/common/parse_periods.ts +27 -24
- package/src/parsers/manifest/dash/common/parse_representation_index.ts +2 -2
- package/src/parsers/manifest/dash/parsers_types.ts +4 -4
- package/src/parsers/manifest/dash/wasm-parser/Cargo.lock +2 -2
- package/src/parsers/manifest/dash/wasm-parser/Cargo.toml +1 -1
- package/src/parsers/manifest/dash/wasm-parser/rs/errors.rs +3 -3
- package/src/parsers/manifest/dash/wasm-parser/rs/events.rs +37 -67
- package/src/parsers/manifest/dash/wasm-parser/rs/lib.rs +7 -7
- package/src/parsers/manifest/dash/wasm-parser/rs/processor/attributes.rs +94 -105
- package/src/parsers/manifest/dash/wasm-parser/rs/processor/mod.rs +119 -109
- package/src/parsers/manifest/dash/wasm-parser/rs/processor/s_element.rs +24 -26
- package/src/parsers/manifest/dash/wasm-parser/rs/reader.rs +2 -2
- package/src/parsers/manifest/dash/wasm-parser/rs/reportable.rs +42 -18
- package/src/parsers/manifest/dash/wasm-parser/rs/utils.rs +29 -29
- package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +4 -3
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/BaseURL.ts +1 -1
- package/src/parsers/manifest/local/parse_local_manifest.ts +2 -1
- package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +2 -1
- package/src/parsers/manifest/smooth/create_parser.ts +4 -3
- package/src/parsers/manifest/smooth/representation_index.ts +6 -5
- package/src/parsers/manifest/smooth/shared_smooth_segment_timeline.ts +6 -5
- package/src/parsers/manifest/types.ts +9 -5
- package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +1 -1
- package/src/parsers/texttracks/ttml/html/__tests__/__global__/html_ttml_parser.test.test.ts +2 -1
- package/src/parsers/texttracks/webvtt/html/__tests__/convert_payload_to_html.test.ts +9 -7
- package/src/public_types.ts +37 -10
- package/src/{core/segment_buffers/implementations/text/html/parsers.ts → text_displayer/html/html_parsers.ts} +2 -18
- package/src/{core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts → text_displayer/html/html_text_displayer.ts} +87 -186
- package/src/text_displayer/html/index.ts +2 -0
- package/src/{core/segment_buffers/implementations/text → text_displayer}/html/text_track_cues_store.ts +9 -23
- package/src/{core/segment_buffers/implementations/text → text_displayer}/html/update_proportional_elements.ts +0 -16
- package/src/{core/segment_buffers/implementations/text → text_displayer}/html/utils.ts +8 -21
- package/src/text_displayer/index.ts +9 -0
- package/src/text_displayer/manual_time_ranges.ts +64 -0
- package/src/text_displayer/native/index.ts +3 -0
- package/src/{core/segment_buffers/implementations/text/native/parsers.ts → text_displayer/native/native_parsers.ts} +4 -19
- package/src/text_displayer/native/native_text_displayer.ts +268 -0
- package/src/text_displayer/types.ts +76 -0
- package/src/tools/TextTrackRenderer/text_track_renderer.ts +13 -18
- package/src/transports/dash/manifest_parser.ts +8 -5
- package/src/transports/local/pipelines.ts +4 -3
- package/src/transports/metaplaylist/pipelines.ts +5 -3
- package/src/transports/smooth/pipelines.ts +4 -2
- package/src/transports/smooth/segment_loader.ts +1 -1
- package/src/transports/types.ts +16 -6
- package/src/transports/utils/__tests__/check_isobmff_integrity.test.ts +8 -8
- package/src/transports/utils/call_custom_manifest_loader.ts +2 -1
- package/src/typings/globals.d.ts +0 -2
- package/src/utils/README.md +7 -0
- package/src/utils/__tests__/base64.test.ts +4 -2
- package/src/utils/__tests__/event_emitter.test.ts +0 -24
- package/src/utils/__tests__/id_generator.test.ts +7 -4
- package/src/utils/__tests__/ranges.test.ts +68 -68
- package/src/utils/are_arrays_of_numbers_equal.ts +3 -0
- package/src/utils/assert.ts +4 -1
- package/src/utils/deep_merge.ts +2 -2
- package/src/utils/event_emitter.ts +8 -2
- package/src/utils/logger.ts +44 -15
- package/src/utils/monotonic_timestamp.ts +31 -0
- package/src/utils/ranges.ts +110 -14
- package/src/utils/reference.ts +49 -6
- package/src/utils/request/fetch.ts +12 -10
- package/src/utils/request/xhr.ts +7 -6
- package/src/utils/string_parsing.ts +5 -4
- package/src/utils/sync_or_async.ts +90 -0
- package/src/utils/wrapInPromise.ts +24 -0
- package/appveyor.yml +0 -24
- package/dist/_esm5.processed/compat/has_eme_apis.d.ts +0 -21
- package/dist/_esm5.processed/compat/has_eme_apis.js +0 -24
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.d.ts +0 -141
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/index.d.ts +0 -21
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/index.js +0 -21
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/types.d.ts +0 -25
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/types.js +0 -16
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/update_proportional_elements.d.ts +0 -30
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/index.d.ts +0 -17
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/index.js +0 -17
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +0 -83
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +0 -271
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/parsers.d.ts +0 -26
- package/dist/_esm5.processed/core/stream/adaptation/utils/create_representation_estimator.d.ts +0 -47
- package/dist/_esm5.processed/core/stream/adaptation/utils/create_representation_estimator.js +0 -70
- package/dist/_esm5.processed/core/stream/representation/utils/force_garbage_collection.d.ts +0 -29
- package/dist/_esm5.processed/core/stream/representation/utils/force_garbage_collection.js +0 -150
- package/dist/_esm5.processed/core/stream/utils/create_reload_request.d.ts +0 -32
- package/dist/_esm5.processed/core/stream/utils/create_reload_request.js +0 -54
- package/src/compat/__tests__/has_eme_apis.test.ts +0 -56
- package/src/compat/has_eme_apis.ts +0 -26
- package/src/core/segment_buffers/implementations/text/html/__tests__/utils.test.ts +0 -328
- package/src/core/segment_buffers/implementations/text/html/index.ts +0 -24
- package/src/core/segment_buffers/implementations/text/html/types.ts +0 -23
- package/src/core/segment_buffers/implementations/text/native/index.ts +0 -19
- package/src/core/segment_buffers/implementations/text/native/native_text_segment_buffer.ts +0 -335
- package/src/core/stream/adaptation/utils/create_representation_estimator.ts +0 -114
- package/src/core/stream/representation/utils/force_garbage_collection.ts +0 -113
- package/src/core/stream/utils/create_reload_request.ts +0 -69
package/.eslintrc.js
CHANGED
|
@@ -328,6 +328,15 @@ module.exports = {
|
|
|
328
328
|
"prefer-template": "off",
|
|
329
329
|
"no-restricted-properties": [
|
|
330
330
|
"error",
|
|
331
|
+
{
|
|
332
|
+
"object": "performance",
|
|
333
|
+
"property": "now",
|
|
334
|
+
"message": "Avoid using `performance.now` directly as timestamps may be different in the worker and the main thread. Please use the `getMonotonicTimeStamp` util instead.",
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"object": "window",
|
|
338
|
+
"message": "`window` doesn't work in Node.JS and only works when JavaScript is running in the main thread. Please import `globalScope` instead.",
|
|
339
|
+
},
|
|
331
340
|
{
|
|
332
341
|
"object": "Object",
|
|
333
342
|
"property": "assign",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## v4.0.0-
|
|
3
|
+
## v4.0.0-worker.2023091900 (2023-09-19)
|
|
4
|
+
|
|
5
|
+
### Changes
|
|
6
|
+
|
|
7
|
+
- On `MediaError` objects, replace `trackInfo` prop by `tracksInfo` to group similar errors
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- Add `MULTI_THREAD` experimental feature to be able to run the RxPlayer's main logic in a WebWorker for efficiency reasons
|
|
12
|
+
- `addFeatures` is now available in any build of the RxPlayer
|
|
13
|
+
- The `representationFilter` `loadVideo` option can now be defined as a string to be usable in the new "multithreading" mode
|
|
14
|
+
|
|
15
|
+
### Bug fixes
|
|
16
|
+
|
|
17
|
+
- DRM: Fix decipherability reporting by correcting seemsDecipherable to decipherable
|
|
18
|
+
|
|
19
|
+
### Other improvements
|
|
20
|
+
|
|
21
|
+
- `newAvailablePeriods` events are now lazily sent when the Period begins to be considered [#1265]
|
|
22
|
+
- TTML: put saner values for extent and origins when weird ones are found
|
|
23
|
+
- Fix small memory leak when going through the `"RELOADING"` state
|
|
24
|
+
- The `HTML_TEXT_BUFFER` and `NATIVE_TEXT_BUFFER` now do not need to be imported as it is explicitely done when importing respectively HTML and native text tracks parsers (both have been undocumented)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## v4.0.0-beta.2 (2023-06-27)
|
|
4
28
|
|
|
5
29
|
### Changes
|
|
6
30
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -12,23 +12,53 @@ Those have to follow the conventions defined below.
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Important code concepts
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
enough we can still admit that going blind into the codebase can be hard at
|
|
19
|
-
first as this is a pretty big technical project on a specific matter.
|
|
17
|
+
### Code documentation
|
|
20
18
|
|
|
21
|
-
We
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
We try to put `README.md` files inside every significant directories inside
|
|
20
|
+
`/src` to provide a global architecture documentation of that directory
|
|
21
|
+
specifically.
|
|
22
|
+
|
|
23
|
+
You can try to start understanding a piece of RxPlayer code by navigating
|
|
24
|
+
to that file. Understand that the documented behavior may be out of date
|
|
25
|
+
(in which case you're welcome to update it or open an issue) though even in
|
|
26
|
+
that case, it is a good starting point to understand the directory's role.
|
|
27
|
+
Likewise, don't forget to update it if a change you made to the code
|
|
28
|
+
necessitates a documentation change.
|
|
25
29
|
|
|
26
30
|
Also, for a more exhaustive approach to the documentation of the project's file
|
|
27
31
|
organization, you can look at [`FILES.md`](./FILES.md).
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
### When renaming or deleting functions, classes or variables
|
|
34
|
+
|
|
35
|
+
When Refactoring/Renaming, make sure to grep any of the renamed class / function
|
|
36
|
+
/ variable's name as they may also be referenced in documentation and code
|
|
37
|
+
comments. Same thing for a directory or file name.
|
|
38
|
+
|
|
39
|
+
If the name is hard to grep (e.g. the name is too generic and thus has too many
|
|
40
|
+
false positives), you can generally reduce the area to comments in the same file
|
|
41
|
+
and documentation files in the same directory.
|
|
42
|
+
|
|
43
|
+
### `features` object
|
|
44
|
+
|
|
45
|
+
Some files should not be imported directly but only be accessed by going through
|
|
46
|
+
the `features` object exported at `/src/features`. This is to reduce bundle size
|
|
47
|
+
when an application doesn't need all of the RxPlayer's features.
|
|
48
|
+
|
|
49
|
+
This import restriction should be enforced by our code linter, you may also know
|
|
50
|
+
which features are accessible through the `features` object by looking at that
|
|
51
|
+
type's documentation.
|
|
52
|
+
|
|
53
|
+
### Multithreading
|
|
54
|
+
|
|
55
|
+
Some parts of the code are intented to be runnable in a WebWorker. In that
|
|
56
|
+
environment some API, more specifically DOM-related API, are not available
|
|
57
|
+
directly (if some interaction with the DOM is needed, it will have to go through
|
|
58
|
+
an asynchronous `postMessage` round-trip).
|
|
59
|
+
|
|
60
|
+
Whether the code needs to be runnable or not in a WebWorker is generally
|
|
61
|
+
documented in the `README.md` of concerned directories.
|
|
32
62
|
|
|
33
63
|
|
|
34
64
|
|
|
@@ -53,8 +83,6 @@ directory) by calling `npm run lint:tests`.
|
|
|
53
83
|
|
|
54
84
|
### Types
|
|
55
85
|
|
|
56
|
-
#### General TypeScript rules
|
|
57
|
-
|
|
58
86
|
We try to be as strict as possible with types:
|
|
59
87
|
|
|
60
88
|
- the `any` type should be avoided
|
package/FILES.md
CHANGED
|
@@ -119,6 +119,21 @@ Defines a common `Manifest` class, regardless of the streaming technology (DASH,
|
|
|
119
119
|
HSS...). This class is then used by the rest of the RxPlayer, to allow
|
|
120
120
|
interaction with it without considering the underlying technology used.
|
|
121
121
|
|
|
122
|
+
### `src/mse/`: MSE abstractions
|
|
123
|
+
|
|
124
|
+
Abstraction over Media Source Extensions API, which are the browser API allowing
|
|
125
|
+
to buffer media.
|
|
126
|
+
|
|
127
|
+
This allows to provide a common API to the rest of the RxPlayer's code
|
|
128
|
+
regardless of the environment (e.g. in a WebWorker without MSE API or in an
|
|
129
|
+
environment with MSE API).
|
|
130
|
+
|
|
131
|
+
### `src/multithread/`: Multithread-specific code
|
|
132
|
+
|
|
133
|
+
Global code specific to the multithreaded "flavor" of the RxPlayer.
|
|
134
|
+
|
|
135
|
+
That is, an RxPlayer instance which can rely on a WebWorker to perform its main
|
|
136
|
+
operations allowing to compete less with the UI for CPU resources.
|
|
122
137
|
|
|
123
138
|
### `src/transports/`: Streaming protocols implementation
|
|
124
139
|
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.0.0-
|
|
1
|
+
4.0.0-worker.2023091900
|
|
@@ -143,7 +143,6 @@ export interface ICompatPictureInPictureWindow extends EventTarget {
|
|
|
143
143
|
width: number;
|
|
144
144
|
height: number;
|
|
145
145
|
}
|
|
146
|
-
/** MediaSource implementation, including vendored implementations. */
|
|
147
146
|
declare const MediaSource_: typeof MediaSource | undefined;
|
|
148
147
|
/** List an HTMLMediaElement's possible values for its readyState property. */
|
|
149
148
|
declare const READY_STATES: {
|
|
@@ -14,15 +14,16 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import isNullOrUndefined from "../utils/is_null_or_undefined";
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
window;
|
|
17
|
+
import globalScope from "./global_scope";
|
|
18
|
+
/* eslint-disable */
|
|
20
19
|
/** MediaSource implementation, including vendored implementations. */
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
var gs = globalScope;
|
|
21
|
+
var MediaSource_ = gs === undefined ? undefined :
|
|
22
|
+
!isNullOrUndefined(gs.MediaSource) ? gs.MediaSource :
|
|
23
|
+
!isNullOrUndefined(gs.MozMediaSource) ? gs.MozMediaSource :
|
|
24
|
+
!isNullOrUndefined(gs.WebKitMediaSource) ? gs.WebKitMediaSource :
|
|
25
|
+
gs.MSMediaSource;
|
|
26
|
+
/* eslint-enable */
|
|
26
27
|
/** List an HTMLMediaElement's possible values for its readyState property. */
|
|
27
28
|
var READY_STATES = { HAVE_NOTHING: 0,
|
|
28
29
|
HAVE_METADATA: 1,
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import globalScope from "./global_scope";
|
|
16
17
|
import isNode from "./is_node";
|
|
17
18
|
/** Edge Chromium, regardless of the device */
|
|
18
19
|
var isEdgeChromium = false;
|
|
@@ -46,7 +47,7 @@ var isPlayStation5 = false;
|
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
48
49
|
// 1 - Find out browser between IE/Edge Legacy/Edge Chromium/Firefox/Safari
|
|
49
|
-
if (typeof
|
|
50
|
+
if (typeof globalScope.MSInputMethodContext !== "undefined" &&
|
|
50
51
|
typeof document.documentMode !== "undefined") {
|
|
51
52
|
isIE11 = true;
|
|
52
53
|
isIEOrEdge = true;
|
|
@@ -66,8 +67,8 @@ var isPlayStation5 = false;
|
|
|
66
67
|
/iPad|iPhone|iPod/.test(navigator.platform)) {
|
|
67
68
|
isSafariMobile = true;
|
|
68
69
|
}
|
|
69
|
-
else if (Object.prototype.toString.call(
|
|
70
|
-
((_b = (_a =
|
|
70
|
+
else if (Object.prototype.toString.call(globalScope.HTMLElement).indexOf("Constructor") >= 0 ||
|
|
71
|
+
((_b = (_a = globalScope.safari) === null || _a === void 0 ? void 0 : _a.pushNotification) === null || _b === void 0 ? void 0 : _b.toString()) ===
|
|
71
72
|
"[object SafariRemoteNotification]") {
|
|
72
73
|
isSafariDesktop = true;
|
|
73
74
|
}
|
|
@@ -19,13 +19,13 @@ declare class IE11CustomMediaKeys implements ICustomMediaKeys {
|
|
|
19
19
|
private _videoElement?;
|
|
20
20
|
private _mediaKeys?;
|
|
21
21
|
constructor(keyType: string);
|
|
22
|
-
_setVideo(videoElement: HTMLMediaElement):
|
|
22
|
+
_setVideo(videoElement: HTMLMediaElement): Promise<unknown>;
|
|
23
23
|
createSession(): ICustomMediaKeySession;
|
|
24
24
|
setServerCertificate(): Promise<void>;
|
|
25
25
|
}
|
|
26
26
|
export default function getIE11MediaKeysCallbacks(): {
|
|
27
27
|
isTypeSupported: (keyType: string) => boolean;
|
|
28
28
|
createCustomMediaKeys: (keyType: string) => IE11CustomMediaKeys;
|
|
29
|
-
setMediaKeys: (elt: HTMLMediaElement, mediaKeys: MediaKeys | ICustomMediaKeys | null) =>
|
|
29
|
+
setMediaKeys: (elt: HTMLMediaElement, mediaKeys: MediaKeys | ICustomMediaKeys | null) => Promise<unknown>;
|
|
30
30
|
};
|
|
31
31
|
export { MSMediaKeysConstructor };
|
|
@@ -30,6 +30,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
30
30
|
})();
|
|
31
31
|
import EventEmitter from "../../../utils/event_emitter";
|
|
32
32
|
import TaskCanceller from "../../../utils/task_canceller";
|
|
33
|
+
import wrapInPromise from "../../../utils/wrapInPromise";
|
|
33
34
|
import * as events from "../../event_listeners";
|
|
34
35
|
import { MSMediaKeysConstructor, } from "./ms_media_keys_constructor";
|
|
35
36
|
var IE11MediaKeySession = /** @class */ (function (_super) {
|
|
@@ -115,10 +116,13 @@ var IE11CustomMediaKeys = /** @class */ (function () {
|
|
|
115
116
|
this._mediaKeys = new MSMediaKeysConstructor(keyType);
|
|
116
117
|
}
|
|
117
118
|
IE11CustomMediaKeys.prototype._setVideo = function (videoElement) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
var _this = this;
|
|
120
|
+
return wrapInPromise(function () {
|
|
121
|
+
_this._videoElement = videoElement;
|
|
122
|
+
if (_this._videoElement.msSetMediaKeys !== undefined) {
|
|
123
|
+
_this._videoElement.msSetMediaKeys(_this._mediaKeys);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
122
126
|
};
|
|
123
127
|
IE11CustomMediaKeys.prototype.createSession = function ( /* sessionType */) {
|
|
124
128
|
if (this._videoElement === undefined || this._mediaKeys === undefined) {
|
|
@@ -149,7 +153,7 @@ export default function getIE11MediaKeysCallbacks() {
|
|
|
149
153
|
// msSetMediaKeys only accepts native MSMediaKeys as argument.
|
|
150
154
|
// Calling it with null or undefined will raise an exception.
|
|
151
155
|
// There is no way to unset the mediakeys in that case, so return here.
|
|
152
|
-
return;
|
|
156
|
+
return Promise.resolve(undefined);
|
|
153
157
|
}
|
|
154
158
|
if (!(mediaKeys instanceof IE11CustomMediaKeys)) {
|
|
155
159
|
throw new Error("Custom setMediaKeys is supposed to be called " +
|
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import CustomMediaKeySystemAccess from "./../custom_key_system_access";
|
|
1
|
+
import getIE11MediaKeysCallbacks, { MSMediaKeysConstructor } from "./ie11_media_keys";
|
|
2
|
+
import getMozMediaKeysCallbacks, { MozMediaKeysConstructor } from "./moz_media_keys_constructor";
|
|
3
|
+
import getOldKitWebKitMediaKeyCallbacks, { isOldWebkitMediaElement } from "./old_webkit_media_keys";
|
|
17
4
|
import { ICustomMediaKeys, ICustomMediaKeySession } from "./types";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Set the given MediaKeys on the given HTMLMediaElement.
|
|
23
|
-
* Emits null when done then complete.
|
|
24
|
-
* @param {HTMLMediaElement} elt
|
|
25
|
-
* @param {Object} mediaKeys
|
|
26
|
-
*/
|
|
27
|
-
declare let setMediaKeys: ((elt: HTMLMediaElement, mediaKeys: MediaKeys | ICustomMediaKeys | null) => unknown);
|
|
28
|
-
export { requestMediaKeySystemAccess, setMediaKeys, ICustomMediaKeys, ICustomMediaKeySession, };
|
|
5
|
+
import getWebKitMediaKeysCallbacks from "./webkit_media_keys";
|
|
6
|
+
import { WebKitMediaKeysConstructor } from "./webkit_media_keys_constructor";
|
|
7
|
+
export { getIE11MediaKeysCallbacks, MSMediaKeysConstructor, getMozMediaKeysCallbacks, MozMediaKeysConstructor, getOldKitWebKitMediaKeyCallbacks, isOldWebkitMediaElement, ICustomMediaKeys, ICustomMediaKeySession, getWebKitMediaKeysCallbacks, WebKitMediaKeysConstructor, };
|
|
@@ -1,159 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2015 CANAL+ Group
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { MediaError } from "../../../errors";
|
|
17
|
-
import assert from "../../../utils/assert";
|
|
18
|
-
import { isIE11 } from "../../browser_detection";
|
|
19
|
-
import isNode from "../../is_node";
|
|
20
|
-
import shouldFavourCustomSafariEME from "../../should_favour_custom_safari_EME";
|
|
21
|
-
import CustomMediaKeySystemAccess from "./../custom_key_system_access";
|
|
22
1
|
import getIE11MediaKeysCallbacks, { MSMediaKeysConstructor, } from "./ie11_media_keys";
|
|
23
2
|
import getMozMediaKeysCallbacks, { MozMediaKeysConstructor, } from "./moz_media_keys_constructor";
|
|
24
3
|
import getOldKitWebKitMediaKeyCallbacks, { isOldWebkitMediaElement, } from "./old_webkit_media_keys";
|
|
25
4
|
import getWebKitMediaKeysCallbacks from "./webkit_media_keys";
|
|
26
5
|
import { WebKitMediaKeysConstructor } from "./webkit_media_keys_constructor";
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Set the given MediaKeys on the given HTMLMediaElement.
|
|
30
|
-
* Emits null when done then complete.
|
|
31
|
-
* @param {HTMLMediaElement} elt
|
|
32
|
-
* @param {Object} mediaKeys
|
|
33
|
-
*/
|
|
34
|
-
var setMediaKeys = function defaultSetMediaKeys(mediaElement, mediaKeys) {
|
|
35
|
-
var elt = mediaElement;
|
|
36
|
-
/* eslint-disable @typescript-eslint/unbound-method */
|
|
37
|
-
if (typeof elt.setMediaKeys === "function") {
|
|
38
|
-
return elt.setMediaKeys(mediaKeys);
|
|
39
|
-
}
|
|
40
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
41
|
-
// If we get in the following code, it means that no compat case has been
|
|
42
|
-
// found and no standard setMediaKeys API exists. This case is particulary
|
|
43
|
-
// rare. We will try to call each API with native media keys.
|
|
44
|
-
if (typeof elt.webkitSetMediaKeys === "function") {
|
|
45
|
-
return elt.webkitSetMediaKeys(mediaKeys);
|
|
46
|
-
}
|
|
47
|
-
if (typeof elt.mozSetMediaKeys === "function") {
|
|
48
|
-
return elt.mozSetMediaKeys(mediaKeys);
|
|
49
|
-
}
|
|
50
|
-
if (typeof elt.msSetMediaKeys === "function" && mediaKeys !== null) {
|
|
51
|
-
return elt.msSetMediaKeys(mediaKeys);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Since Safari 12.1, EME APIs are available without webkit prefix.
|
|
56
|
-
* However, it seems that since fairplay CDM implementation within the browser is not
|
|
57
|
-
* standard with EME w3c current spec, the requestMediaKeySystemAccess API doesn't resolve
|
|
58
|
-
* positively, even if the drm (fairplay in most cases) is supported.
|
|
59
|
-
*
|
|
60
|
-
* Therefore, we prefer not to use requestMediaKeySystemAccess on Safari when webkit API
|
|
61
|
-
* is available.
|
|
62
|
-
*/
|
|
63
|
-
if (isNode ||
|
|
64
|
-
(navigator.requestMediaKeySystemAccess != null && !shouldFavourCustomSafariEME())) {
|
|
65
|
-
requestMediaKeySystemAccess = function () {
|
|
66
|
-
var args = [];
|
|
67
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
68
|
-
args[_i] = arguments[_i];
|
|
69
|
-
}
|
|
70
|
-
return navigator.requestMediaKeySystemAccess.apply(navigator, args);
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
var isTypeSupported_1;
|
|
75
|
-
var createCustomMediaKeys_1;
|
|
76
|
-
// This is for Chrome with unprefixed EME api
|
|
77
|
-
if (isOldWebkitMediaElement(HTMLVideoElement.prototype)) {
|
|
78
|
-
var callbacks = getOldKitWebKitMediaKeyCallbacks();
|
|
79
|
-
isTypeSupported_1 = callbacks.isTypeSupported;
|
|
80
|
-
createCustomMediaKeys_1 = callbacks.createCustomMediaKeys;
|
|
81
|
-
setMediaKeys = callbacks.setMediaKeys;
|
|
82
|
-
// This is for WebKit with prefixed EME api
|
|
83
|
-
}
|
|
84
|
-
else if (WebKitMediaKeysConstructor !== undefined) {
|
|
85
|
-
var callbacks = getWebKitMediaKeysCallbacks();
|
|
86
|
-
isTypeSupported_1 = callbacks.isTypeSupported;
|
|
87
|
-
createCustomMediaKeys_1 = callbacks.createCustomMediaKeys;
|
|
88
|
-
setMediaKeys = callbacks.setMediaKeys;
|
|
89
|
-
}
|
|
90
|
-
else if (isIE11 && MSMediaKeysConstructor !== undefined) {
|
|
91
|
-
var callbacks = getIE11MediaKeysCallbacks();
|
|
92
|
-
isTypeSupported_1 = callbacks.isTypeSupported;
|
|
93
|
-
createCustomMediaKeys_1 = callbacks.createCustomMediaKeys;
|
|
94
|
-
setMediaKeys = callbacks.setMediaKeys;
|
|
95
|
-
}
|
|
96
|
-
else if (MozMediaKeysConstructor !== undefined) {
|
|
97
|
-
var callbacks = getMozMediaKeysCallbacks();
|
|
98
|
-
isTypeSupported_1 = callbacks.isTypeSupported;
|
|
99
|
-
createCustomMediaKeys_1 = callbacks.createCustomMediaKeys;
|
|
100
|
-
setMediaKeys = callbacks.setMediaKeys;
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
var MK_1 = window.MediaKeys;
|
|
104
|
-
var checkForStandardMediaKeys_1 = function () {
|
|
105
|
-
if (MK_1 === undefined) {
|
|
106
|
-
throw new MediaError("MEDIA_KEYS_NOT_SUPPORTED", "No `MediaKeys` implementation found " +
|
|
107
|
-
"in the current browser.");
|
|
108
|
-
}
|
|
109
|
-
if (typeof MK_1.isTypeSupported === "undefined") {
|
|
110
|
-
var message = "This browser seems to be unable to play encrypted contents " +
|
|
111
|
-
"currently. Note: Some browsers do not allow decryption " +
|
|
112
|
-
"in some situations, like when not using HTTPS.";
|
|
113
|
-
throw new Error(message);
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
isTypeSupported_1 = function (keyType) {
|
|
117
|
-
checkForStandardMediaKeys_1();
|
|
118
|
-
assert(typeof MK_1.isTypeSupported === "function");
|
|
119
|
-
return MK_1.isTypeSupported(keyType);
|
|
120
|
-
};
|
|
121
|
-
createCustomMediaKeys_1 = function (keyType) {
|
|
122
|
-
checkForStandardMediaKeys_1();
|
|
123
|
-
return new MK_1(keyType);
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
requestMediaKeySystemAccess = function (keyType, keySystemConfigurations) {
|
|
127
|
-
if (!isTypeSupported_1(keyType)) {
|
|
128
|
-
return Promise.reject(new Error("Unsupported key type"));
|
|
129
|
-
}
|
|
130
|
-
for (var i = 0; i < keySystemConfigurations.length; i++) {
|
|
131
|
-
var keySystemConfiguration = keySystemConfigurations[i];
|
|
132
|
-
var videoCapabilities = keySystemConfiguration.videoCapabilities, audioCapabilities = keySystemConfiguration.audioCapabilities, initDataTypes = keySystemConfiguration.initDataTypes, distinctiveIdentifier = keySystemConfiguration.distinctiveIdentifier;
|
|
133
|
-
var supported = true;
|
|
134
|
-
supported = supported &&
|
|
135
|
-
(initDataTypes == null ||
|
|
136
|
-
initDataTypes.some(function (idt) { return idt === "cenc"; }));
|
|
137
|
-
supported = supported && (distinctiveIdentifier !== "required");
|
|
138
|
-
if (supported) {
|
|
139
|
-
var keySystemConfigurationResponse = {
|
|
140
|
-
initDataTypes: ["cenc"],
|
|
141
|
-
distinctiveIdentifier: "not-allowed",
|
|
142
|
-
persistentState: "required",
|
|
143
|
-
sessionTypes: ["temporary", "persistent-license"],
|
|
144
|
-
};
|
|
145
|
-
if (videoCapabilities !== undefined) {
|
|
146
|
-
keySystemConfigurationResponse.videoCapabilities = videoCapabilities;
|
|
147
|
-
}
|
|
148
|
-
if (audioCapabilities !== undefined) {
|
|
149
|
-
keySystemConfigurationResponse.audioCapabilities = audioCapabilities;
|
|
150
|
-
}
|
|
151
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
152
|
-
var customMediaKeys = createCustomMediaKeys_1(keyType);
|
|
153
|
-
return Promise.resolve(new CustomMediaKeySystemAccess(keyType, customMediaKeys, keySystemConfigurationResponse));
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return Promise.reject(new Error("Unsupported configuration"));
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
export { requestMediaKeySystemAccess, setMediaKeys, };
|
|
6
|
+
export { getIE11MediaKeysCallbacks, MSMediaKeysConstructor, getMozMediaKeysCallbacks, MozMediaKeysConstructor, getOldKitWebKitMediaKeyCallbacks, isOldWebkitMediaElement, getWebKitMediaKeysCallbacks, WebKitMediaKeysConstructor, };
|
|
@@ -23,5 +23,5 @@ export { MozMediaKeysConstructor };
|
|
|
23
23
|
export default function getMozMediaKeysCallbacks(): {
|
|
24
24
|
isTypeSupported: (keyType: string) => boolean;
|
|
25
25
|
createCustomMediaKeys: (keyType: string) => ICustomMediaKeys;
|
|
26
|
-
setMediaKeys: (elt: HTMLMediaElement, mediaKeys: MediaKeys | ICustomMediaKeys | null) =>
|
|
26
|
+
setMediaKeys: (elt: HTMLMediaElement, mediaKeys: MediaKeys | ICustomMediaKeys | null) => Promise<unknown>;
|
|
27
27
|
};
|
|
@@ -13,19 +13,18 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import
|
|
16
|
+
import wrapInPromise from "../../../utils/wrapInPromise";
|
|
17
|
+
import globalScope from "../../global_scope";
|
|
17
18
|
var MozMediaKeysConstructor;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
MozMediaKeysConstructor = MozMediaKeys;
|
|
28
|
-
}
|
|
19
|
+
var MozMediaKeys = globalScope.MozMediaKeys;
|
|
20
|
+
if (MozMediaKeys !== undefined &&
|
|
21
|
+
MozMediaKeys.prototype !== undefined &&
|
|
22
|
+
typeof MozMediaKeys.isTypeSupported === "function" &&
|
|
23
|
+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
24
|
+
typeof MozMediaKeys.prototype.createSession === "function"
|
|
25
|
+
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
|
|
26
|
+
) {
|
|
27
|
+
MozMediaKeysConstructor = MozMediaKeys;
|
|
29
28
|
}
|
|
30
29
|
export { MozMediaKeysConstructor };
|
|
31
30
|
export default function getMozMediaKeysCallbacks() {
|
|
@@ -45,11 +44,14 @@ export default function getMozMediaKeysCallbacks() {
|
|
|
45
44
|
return new MozMediaKeysConstructor(keyType);
|
|
46
45
|
};
|
|
47
46
|
var setMediaKeys = function (mediaElement, mediaKeys) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
return wrapInPromise(function () {
|
|
48
|
+
var elt = mediaElement;
|
|
49
|
+
if (elt.mozSetMediaKeys === undefined ||
|
|
50
|
+
typeof elt.mozSetMediaKeys !== "function") {
|
|
51
|
+
throw new Error("Can't set video on MozMediaKeys.");
|
|
52
|
+
}
|
|
53
|
+
return elt.mozSetMediaKeys(mediaKeys);
|
|
54
|
+
});
|
|
53
55
|
};
|
|
54
56
|
return {
|
|
55
57
|
isTypeSupported: isTypeSupported,
|
|
@@ -13,18 +13,16 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import
|
|
16
|
+
import globalScope from "../../global_scope";
|
|
17
17
|
var MSMediaKeysConstructor;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
MSMediaKeysConstructor = MSMediaKeys;
|
|
28
|
-
}
|
|
18
|
+
var MSMediaKeys = globalScope.MSMediaKeys;
|
|
19
|
+
if (MSMediaKeys !== undefined &&
|
|
20
|
+
MSMediaKeys.prototype !== undefined &&
|
|
21
|
+
typeof MSMediaKeys.isTypeSupported === "function" &&
|
|
22
|
+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
23
|
+
typeof MSMediaKeys.prototype.createSession === "function"
|
|
24
|
+
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
|
|
25
|
+
) {
|
|
26
|
+
MSMediaKeysConstructor = MSMediaKeys;
|
|
29
27
|
}
|
|
30
28
|
export { MSMediaKeysConstructor };
|
|
@@ -24,18 +24,18 @@ export interface IOldWebkitHTMLMediaElement extends HTMLVideoElement {
|
|
|
24
24
|
* @param {HTMLMediaElement} element
|
|
25
25
|
* @returns {Boolean}
|
|
26
26
|
*/
|
|
27
|
-
export declare function isOldWebkitMediaElement(element:
|
|
27
|
+
export declare function isOldWebkitMediaElement(element: unknown): element is IOldWebkitHTMLMediaElement;
|
|
28
28
|
declare class OldWebKitCustomMediaKeys implements ICustomMediaKeys {
|
|
29
29
|
private readonly _keySystem;
|
|
30
30
|
private _videoElement?;
|
|
31
31
|
constructor(keySystem: string);
|
|
32
|
-
_setVideo(videoElement: IOldWebkitHTMLMediaElement | HTMLMediaElement):
|
|
32
|
+
_setVideo(videoElement: IOldWebkitHTMLMediaElement | HTMLMediaElement): Promise<unknown>;
|
|
33
33
|
createSession(): ICustomMediaKeySession;
|
|
34
34
|
setServerCertificate(): Promise<void>;
|
|
35
35
|
}
|
|
36
36
|
export default function getOldWebKitMediaKeysCallbacks(): {
|
|
37
37
|
isTypeSupported: (keyType: string) => boolean;
|
|
38
38
|
createCustomMediaKeys: (keyType: string) => OldWebKitCustomMediaKeys;
|
|
39
|
-
setMediaKeys: (elt: HTMLMediaElement, mediaKeys: MediaKeys | ICustomMediaKeys | null) =>
|
|
39
|
+
setMediaKeys: (elt: HTMLMediaElement, mediaKeys: MediaKeys | ICustomMediaKeys | null) => Promise<unknown>;
|
|
40
40
|
};
|
|
41
41
|
export {};
|
|
@@ -32,6 +32,7 @@ import { base64ToBytes } from "../../../utils/base64";
|
|
|
32
32
|
import EventEmitter from "../../../utils/event_emitter";
|
|
33
33
|
import noop from "../../../utils/noop";
|
|
34
34
|
import { utf8ToStr } from "../../../utils/string_parsing";
|
|
35
|
+
import wrapInPromise from "../../../utils/wrapInPromise";
|
|
35
36
|
/**
|
|
36
37
|
* Returns true if the given media element has old webkit methods
|
|
37
38
|
* corresponding to the IOldWebkitHTMLMediaElement interface.
|
|
@@ -39,8 +40,7 @@ import { utf8ToStr } from "../../../utils/string_parsing";
|
|
|
39
40
|
* @returns {Boolean}
|
|
40
41
|
*/
|
|
41
42
|
export function isOldWebkitMediaElement(element) {
|
|
42
|
-
return typeof element
|
|
43
|
-
.webkitGenerateKeyRequest === "function";
|
|
43
|
+
return typeof (element === null || element === void 0 ? void 0 : element.webkitGenerateKeyRequest) === "function";
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* MediaKeySession implementation for older versions of WebKit relying on APIs
|
|
@@ -138,10 +138,13 @@ var OldWebKitCustomMediaKeys = /** @class */ (function () {
|
|
|
138
138
|
this._keySystem = keySystem;
|
|
139
139
|
}
|
|
140
140
|
OldWebKitCustomMediaKeys.prototype._setVideo = function (videoElement) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
var _this = this;
|
|
142
|
+
return wrapInPromise(function () {
|
|
143
|
+
if (!isOldWebkitMediaElement(videoElement)) {
|
|
144
|
+
throw new Error("Video not attached to the MediaKeys");
|
|
145
|
+
}
|
|
146
|
+
_this._videoElement = videoElement;
|
|
147
|
+
});
|
|
145
148
|
};
|
|
146
149
|
OldWebKitCustomMediaKeys.prototype.createSession = function ( /* sessionType */) {
|
|
147
150
|
if (this._videoElement == null) {
|
|
@@ -172,7 +175,7 @@ export default function getOldWebKitMediaKeysCallbacks() {
|
|
|
172
175
|
var createCustomMediaKeys = function (keyType) { return new OldWebKitCustomMediaKeys(keyType); };
|
|
173
176
|
var setMediaKeys = function (elt, mediaKeys) {
|
|
174
177
|
if (mediaKeys === null) {
|
|
175
|
-
return;
|
|
178
|
+
return Promise.resolve(undefined);
|
|
176
179
|
}
|
|
177
180
|
if (!(mediaKeys instanceof OldWebKitCustomMediaKeys)) {
|
|
178
181
|
throw new Error("Custom setMediaKeys is supposed to be called " +
|
|
@@ -28,7 +28,7 @@ export interface ICustomMediaKeySession extends IEventEmitter<IMediaKeySessionEv
|
|
|
28
28
|
remove(): Promise<void>;
|
|
29
29
|
}
|
|
30
30
|
export interface ICustomMediaKeys {
|
|
31
|
-
_setVideo: (vid: HTMLMediaElement) =>
|
|
31
|
+
_setVideo: (vid: HTMLMediaElement) => Promise<unknown>;
|
|
32
32
|
createSession(sessionType?: MediaKeySessionType): ICustomMediaKeySession;
|
|
33
33
|
setServerCertificate(setServerCertificate: BufferSource): Promise<void>;
|
|
34
34
|
}
|