rx-player 3.31.1-dev.2023070500 → 3.32.0-dev.2023092900
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -1
- package/CONTRIBUTING.md +27 -13
- package/VERSION +1 -1
- 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 +9 -5
- package/dist/_esm5.processed/compat/eme/custom_media_keys/old_webkit_media_keys.d.ts +2 -2
- package/dist/_esm5.processed/compat/eme/custom_media_keys/old_webkit_media_keys.js +9 -5
- 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/eme-api-implementation.d.ts +78 -0
- package/dist/_esm5.processed/compat/eme/eme-api-implementation.js +198 -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 +8 -14
- package/dist/_esm5.processed/compat/index.d.ts +1 -3
- package/dist/_esm5.processed/compat/index.js +1 -3
- 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/on_height_width_change.js +2 -2
- package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.js +40 -34
- package/dist/_esm5.processed/core/adaptive/buffer_based_chooser.d.ts +17 -1
- package/dist/_esm5.processed/core/adaptive/buffer_based_chooser.js +26 -8
- package/dist/_esm5.processed/core/api/option_utils.d.ts +1 -1
- package/dist/_esm5.processed/core/api/option_utils.js +12 -8
- package/dist/_esm5.processed/core/api/playback_observer.js +2 -2
- package/dist/_esm5.processed/core/api/public_api.d.ts +6 -0
- package/dist/_esm5.processed/core/api/public_api.js +28 -20
- package/dist/_esm5.processed/core/api/tracks_management/media_element_track_choice_manager.js +1 -2
- package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.d.ts +2 -2
- package/dist/_esm5.processed/core/api/utils.js +2 -2
- 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 +52 -76
- 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 +2 -2
- package/dist/_esm5.processed/core/decrypt/find_key_system.js +18 -15
- 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 +61 -0
- 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.d.ts +0 -13
- package/dist/_esm5.processed/core/decrypt/utils/key_id_comparison.js +2 -19
- package/dist/_esm5.processed/core/decrypt/utils/key_session_record.js +3 -2
- 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/persistent_sessions_store.js +1 -2
- package/dist/_esm5.processed/core/decrypt/utils/server_certificate_store.d.ts +1 -1
- package/dist/_esm5.processed/core/init/directfile_content_initializer.js +5 -6
- package/dist/_esm5.processed/core/init/index.d.ts +1 -4
- package/dist/_esm5.processed/core/init/index.js +1 -3
- package/dist/_esm5.processed/core/init/media_source_content_initializer.js +41 -14
- package/dist/_esm5.processed/core/init/types.d.ts +2 -2
- package/dist/_esm5.processed/core/init/utils/create_media_source.js +4 -1
- package/dist/_esm5.processed/core/init/utils/create_stream_playback_observer.d.ts +9 -4
- package/dist/_esm5.processed/core/init/utils/create_stream_playback_observer.js +16 -10
- package/dist/_esm5.processed/core/init/utils/end_of_stream.js +1 -0
- package/dist/_esm5.processed/core/init/utils/get_loaded_reference.js +2 -2
- package/dist/_esm5.processed/core/init/utils/initial_seek_and_play.js +6 -6
- package/dist/_esm5.processed/core/init/utils/initialize_content_decryption.d.ts +3 -3
- package/dist/_esm5.processed/core/init/utils/initialize_content_decryption.js +28 -36
- package/dist/_esm5.processed/core/init/utils/media_source_duration_updater.js +12 -7
- package/dist/_esm5.processed/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.js +18 -2
- package/dist/_esm5.processed/core/init/utils/stream_events_emitter/stream_events_emitter.d.ts +31 -9
- package/dist/_esm5.processed/core/init/utils/stream_events_emitter/stream_events_emitter.js +99 -56
- package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.d.ts +18 -7
- package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +40 -41
- package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.d.ts +8 -0
- package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.js +12 -0
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.d.ts +10 -2
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +15 -3
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +8 -0
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +12 -0
- package/dist/_esm5.processed/core/segment_buffers/implementations/types.d.ts +11 -4
- package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.js +1 -0
- package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +14 -19
- package/dist/_esm5.processed/core/stream/adaptation/types.d.ts +13 -7
- package/dist/_esm5.processed/core/stream/adaptation/utils/create_representation_estimator.js +2 -2
- package/dist/_esm5.processed/core/stream/index.d.ts +2 -2
- package/dist/_esm5.processed/core/stream/orchestrator/get_time_ranges_for_content.js +1 -6
- 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 +12 -8
- package/dist/_esm5.processed/core/stream/period/period_stream.js +20 -26
- package/dist/_esm5.processed/core/stream/period/types.d.ts +2 -2
- package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +18 -4
- package/dist/_esm5.processed/core/stream/representation/representation_stream.js +28 -15
- package/dist/_esm5.processed/core/stream/representation/utils/downloading_queue.d.ts +1 -1
- package/dist/_esm5.processed/core/stream/representation/utils/downloading_queue.js +2 -2
- package/dist/_esm5.processed/core/stream/representation/utils/push_init_segment.d.ts +3 -2
- package/dist/_esm5.processed/core/stream/representation/utils/push_init_segment.js +2 -6
- package/dist/_esm5.processed/core/stream/representation/utils/push_media_segment.d.ts +2 -2
- package/dist/_esm5.processed/core/stream/representation/utils/push_media_segment.js +2 -3
- package/dist/_esm5.processed/errors/request_error.js +15 -1
- package/dist/_esm5.processed/experimental/features/dash_wasm.js +3 -0
- package/dist/_esm5.processed/experimental/features/index.d.ts +0 -1
- package/dist/_esm5.processed/experimental/features/index.js +0 -1
- package/dist/_esm5.processed/experimental/features/local.js +3 -0
- package/dist/_esm5.processed/experimental/features/metaplaylist.js +3 -0
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/load_and_push_segment.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/load_and_push_segment.js +8 -7
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +17 -9
- 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/features/features_object.js +2 -1
- package/dist/_esm5.processed/features/initialize_features.d.ts +1 -3
- package/dist/_esm5.processed/features/initialize_features.js +10 -4
- package/dist/_esm5.processed/features/list/bif_parser.js +2 -0
- package/dist/_esm5.processed/features/list/dash.js +3 -0
- package/dist/_esm5.processed/features/list/directfile.js +5 -2
- 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/native_sami_parser.js +3 -0
- package/dist/_esm5.processed/features/list/native_srt_parser.js +3 -0
- package/dist/_esm5.processed/features/list/native_text_buffer.js +3 -2
- package/dist/_esm5.processed/features/list/native_ttml_parser.js +3 -0
- package/dist/_esm5.processed/features/list/native_vtt_parser.js +3 -0
- package/dist/_esm5.processed/features/list/smooth.js +3 -0
- package/dist/_esm5.processed/features/types.d.ts +83 -5
- package/dist/_esm5.processed/index.d.ts +0 -6
- package/dist/_esm5.processed/index.js +2 -1
- package/dist/_esm5.processed/manifest/manifest.js +1 -2
- package/dist/_esm5.processed/manifest/representation.d.ts +34 -1
- package/dist/_esm5.processed/manifest/representation.js +8 -2
- package/dist/_esm5.processed/manifest/utils.js +1 -3
- package/dist/_esm5.processed/minimal.d.ts +1 -17
- package/dist/_esm5.processed/minimal.js +3 -35
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +4 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.js +7 -0
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Representation.js +8 -0
- package/dist/_esm5.processed/parsers/manifest/dash/node_parser_types.d.ts +1 -0
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Representation.js +10 -0
- package/dist/_esm5.processed/parsers/manifest/local/parse_local_manifest.js +1 -0
- package/dist/_esm5.processed/parsers/manifest/local/types.d.ts +2 -0
- package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.js +1 -0
- package/dist/_esm5.processed/parsers/manifest/types.d.ts +2 -0
- package/dist/_esm5.processed/public_types.d.ts +3 -1
- package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.js +1 -1
- package/dist/_esm5.processed/transports/utils/get_isobmff_timing_infos.d.ts +0 -3
- package/dist/_esm5.processed/transports/utils/get_isobmff_timing_infos.js +0 -3
- 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/reference.d.ts +78 -37
- package/dist/_esm5.processed/utils/reference.js +237 -153
- 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 +42294 -41851
- package/dist/rx-player.min.js +1 -1
- package/package.json +36 -36
- package/scripts/list-npm-scripts.js +146 -38
- package/sonar-project.properties +1 -1
- 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 +13 -7
- package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +11 -8
- 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/eme-api-implementation.ts +318 -0
- package/src/compat/eme/index.ts +8 -6
- package/src/compat/event_listeners.ts +12 -20
- package/src/compat/index.ts +0 -24
- package/src/compat/is_debug_mode_enabled.ts +12 -0
- package/src/compat/on_height_width_change.ts +2 -2
- package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +242 -99
- package/src/core/adaptive/adaptive_representation_selector.ts +52 -49
- package/src/core/adaptive/buffer_based_chooser.ts +36 -9
- package/src/core/adaptive/utils/pending_requests_store.ts +2 -2
- package/src/core/api/option_utils.ts +6 -1
- package/src/core/api/playback_observer.ts +3 -3
- package/src/core/api/public_api.ts +53 -40
- package/src/core/api/tracks_management/track_choice_manager.ts +5 -5
- package/src/core/api/utils.ts +3 -3
- 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 +76 -48
- package/src/core/decrypt/__tests__/__global__/media_keys.test.ts +19 -13
- 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 +213 -262
- 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 +25 -20
- 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 +69 -0
- 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 +2 -27
- package/src/core/decrypt/utils/key_session_record.ts +3 -5
- 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 +2 -5
- package/src/core/decrypt/utils/server_certificate_store.ts +1 -1
- package/src/core/init/directfile_content_initializer.ts +10 -6
- package/src/core/init/index.ts +6 -7
- package/src/core/init/media_source_content_initializer.ts +56 -24
- package/src/core/init/types.ts +2 -2
- package/src/core/init/utils/__tests__/refresh_scheduled_events_list.test.ts +22 -8
- package/src/core/init/utils/create_media_source.ts +4 -1
- package/src/core/init/utils/create_stream_playback_observer.ts +24 -14
- package/src/core/init/utils/end_of_stream.ts +1 -0
- package/src/core/init/utils/get_loaded_reference.ts +2 -2
- package/src/core/init/utils/initial_seek_and_play.ts +7 -7
- package/src/core/init/utils/initialize_content_decryption.ts +32 -39
- package/src/core/init/utils/media_source_duration_updater.ts +13 -9
- package/src/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.ts +7 -4
- package/src/core/init/utils/stream_events_emitter/stream_events_emitter.ts +113 -73
- package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +66 -57
- package/src/core/segment_buffers/implementations/image/image_segment_buffer.ts +16 -0
- package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +33 -17
- package/src/core/segment_buffers/implementations/text/html/text_track_cues_store.ts +1 -1
- package/src/core/segment_buffers/implementations/text/native/native_text_segment_buffer.ts +18 -2
- package/src/core/segment_buffers/implementations/types.ts +16 -4
- package/src/core/segment_buffers/implementations/utils/manual_time_ranges.ts +2 -2
- package/src/core/segment_buffers/inventory/segment_inventory.ts +1 -0
- package/src/core/stream/adaptation/adaptation_stream.ts +17 -25
- package/src/core/stream/adaptation/types.ts +13 -7
- package/src/core/stream/adaptation/utils/create_representation_estimator.ts +2 -2
- package/src/core/stream/index.ts +2 -0
- package/src/core/stream/orchestrator/get_time_ranges_for_content.ts +1 -6
- package/src/core/stream/orchestrator/index.ts +2 -0
- package/src/core/stream/orchestrator/stream_orchestrator.ts +26 -37
- package/src/core/stream/period/period_stream.ts +27 -29
- package/src/core/stream/period/types.ts +2 -2
- package/src/core/stream/period/utils/get_adaptation_switch_strategy.ts +10 -1
- package/src/core/stream/representation/representation_stream.ts +42 -24
- package/src/core/stream/representation/utils/downloading_queue.ts +4 -5
- package/src/core/stream/representation/utils/push_init_segment.ts +4 -5
- package/src/core/stream/representation/utils/push_media_segment.ts +3 -3
- package/src/errors/__tests__/network_error.test.ts +10 -9
- package/src/errors/__tests__/request_error.test.ts +6 -4
- package/src/errors/request_error.ts +16 -1
- package/src/experimental/features/__tests__/dash_wasm.test.ts +4 -12
- package/src/experimental/features/__tests__/debug_element.test.ts +7 -21
- package/src/experimental/features/__tests__/local.test.ts +14 -23
- package/src/experimental/features/__tests__/metaplaylist.test.ts +14 -21
- package/src/experimental/features/dash_wasm.ts +3 -0
- package/src/experimental/features/index.ts +0 -1
- package/src/experimental/features/local.ts +3 -0
- package/src/experimental/features/metaplaylist.ts +3 -0
- package/src/experimental/tools/VideoThumbnailLoader/load_and_push_segment.ts +10 -7
- package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +17 -6
- 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/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/features/__tests__/initialize_features.test.ts +182 -3
- package/src/features/features_object.ts +2 -1
- package/src/features/initialize_features.ts +35 -28
- package/src/features/list/__tests__/bif_parser.test.ts +5 -11
- package/src/features/list/__tests__/dash.test.ts +15 -15
- package/src/features/list/__tests__/directfile.test.ts +7 -16
- package/src/features/list/__tests__/eme.test.ts +4 -12
- package/src/features/list/__tests__/html_sami_parser.test.ts +9 -14
- package/src/features/list/__tests__/html_srt_parser.test.ts +5 -10
- package/src/features/list/__tests__/html_text_buffer.test.ts +10 -19
- package/src/features/list/__tests__/html_ttml_parser.test.ts +5 -10
- package/src/features/list/__tests__/html_vtt_parser.test.ts +5 -10
- package/src/features/list/__tests__/image_buffer.test.ts +2 -9
- package/src/features/list/__tests__/native_sami_parser.test.ts +9 -14
- package/src/features/list/__tests__/native_srt_parser.test.ts +5 -10
- package/src/features/list/__tests__/native_text_buffer.test.ts +5 -13
- package/src/features/list/__tests__/native_ttml_parser.test.ts +5 -10
- package/src/features/list/__tests__/native_vtt_parser.test.ts +5 -10
- package/src/features/list/__tests__/smooth.test.ts +10 -10
- package/src/features/list/bif_parser.ts +2 -0
- package/src/features/list/dash.ts +3 -0
- package/src/features/list/directfile.ts +5 -3
- 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/native_sami_parser.ts +3 -0
- package/src/features/list/native_srt_parser.ts +3 -0
- package/src/features/list/native_text_buffer.ts +3 -2
- package/src/features/list/native_ttml_parser.ts +3 -0
- package/src/features/list/native_vtt_parser.ts +3 -0
- package/src/features/list/smooth.ts +3 -0
- package/src/features/types.ts +88 -15
- package/src/index.ts +3 -2
- package/src/manifest/__tests__/manifest.test.ts +7 -7
- package/src/manifest/representation.ts +46 -3
- package/src/manifest/utils.ts +1 -3
- package/src/minimal.ts +4 -18
- package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +1 -0
- package/src/parsers/manifest/dash/common/parse_representations.ts +10 -0
- package/src/parsers/manifest/dash/js-parser/node_parsers/Representation.ts +7 -0
- package/src/parsers/manifest/dash/node_parser_types.ts +1 -0
- 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/generators/BaseURL.ts +1 -1
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/Representation.ts +12 -0
- package/src/parsers/manifest/local/parse_local_manifest.ts +1 -0
- package/src/parsers/manifest/local/types.ts +2 -0
- package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +1 -0
- package/src/parsers/manifest/smooth/create_parser.ts +1 -1
- package/src/parsers/manifest/types.ts +2 -0
- package/src/public_types.ts +7 -1
- package/src/tools/TextTrackRenderer/text_track_renderer.ts +1 -1
- package/src/transports/dash/manifest_parser.ts +4 -3
- package/src/transports/smooth/segment_loader.ts +1 -1
- package/src/transports/utils/__tests__/check_isobmff_integrity.test.ts +4 -4
- package/src/transports/utils/get_isobmff_timing_infos.ts +0 -3
- package/src/typings/globals.d.ts +0 -2
- package/src/utils/are_arrays_of_numbers_equal.ts +5 -1
- package/src/utils/assert.ts +4 -1
- package/src/utils/deep_merge.ts +2 -2
- package/src/utils/reference.ts +235 -237
- package/src/utils/request/xhr.ts +1 -1
- 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/src/compat/__tests__/has_eme_apis.test.ts +0 -56
- package/src/compat/has_eme_apis.ts +0 -26
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { MediaError } from "../../errors";
|
|
2
|
+
import assert from "../../utils/assert";
|
|
3
|
+
import isNullOrUndefined from "../../utils/is_null_or_undefined";
|
|
4
|
+
import { isIE11 } from "../browser_detection";
|
|
5
|
+
import { createCompatibleEventListener } from "../event_listeners";
|
|
6
|
+
import isNode from "../is_node";
|
|
7
|
+
import shouldFavourCustomSafariEME from "../should_favour_custom_safari_EME";
|
|
8
|
+
import CustomMediaKeySystemAccess from "./custom_key_system_access";
|
|
9
|
+
import getIE11MediaKeysCallbacks, { MSMediaKeysConstructor, } from "./custom_media_keys/ie11_media_keys";
|
|
10
|
+
import getMozMediaKeysCallbacks, { MozMediaKeysConstructor, } from "./custom_media_keys/moz_media_keys_constructor";
|
|
11
|
+
import getOldKitWebKitMediaKeyCallbacks, { isOldWebkitMediaElement, } from "./custom_media_keys/old_webkit_media_keys";
|
|
12
|
+
import getWebKitMediaKeysCallbacks from "./custom_media_keys/webkit_media_keys";
|
|
13
|
+
import { WebKitMediaKeysConstructor, } from "./custom_media_keys/webkit_media_keys_constructor";
|
|
14
|
+
/**
|
|
15
|
+
* Automatically detect and set which EME implementation should be used in the
|
|
16
|
+
* current platform.
|
|
17
|
+
*
|
|
18
|
+
* You can call `getEmeApiImplementation` for a different implementation.
|
|
19
|
+
*/
|
|
20
|
+
var defaultEmeImplementation = getEmeApiImplementation("auto");
|
|
21
|
+
export default defaultEmeImplementation;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the current EME implementation based on what's present on the device
|
|
24
|
+
* and the given preference.
|
|
25
|
+
* @param {string} preferredApiType - EME API preference
|
|
26
|
+
* (@see IPreferredEmeApiType).
|
|
27
|
+
* @returns {Object}
|
|
28
|
+
*/
|
|
29
|
+
function getEmeApiImplementation(preferredApiType) {
|
|
30
|
+
var requestMediaKeySystemAccess;
|
|
31
|
+
var onEncrypted;
|
|
32
|
+
var setMediaKeys = defaultSetMediaKeys;
|
|
33
|
+
var implementation;
|
|
34
|
+
if ((preferredApiType === "standard" ||
|
|
35
|
+
(preferredApiType === "auto" && !shouldFavourCustomSafariEME())) &&
|
|
36
|
+
(
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
38
|
+
isNode || !isNullOrUndefined(navigator.requestMediaKeySystemAccess))) {
|
|
39
|
+
requestMediaKeySystemAccess = function () {
|
|
40
|
+
var args = [];
|
|
41
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
42
|
+
args[_i] = arguments[_i];
|
|
43
|
+
}
|
|
44
|
+
return navigator.requestMediaKeySystemAccess.apply(navigator, args);
|
|
45
|
+
};
|
|
46
|
+
onEncrypted = createCompatibleEventListener(["encrypted"]);
|
|
47
|
+
implementation = "standard";
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
var isTypeSupported_1;
|
|
51
|
+
var createCustomMediaKeys_1;
|
|
52
|
+
if (preferredApiType === "webkit" && WebKitMediaKeysConstructor !== undefined) {
|
|
53
|
+
onEncrypted = createCompatibleEventListener(["needkey"]);
|
|
54
|
+
var callbacks = getWebKitMediaKeysCallbacks();
|
|
55
|
+
isTypeSupported_1 = callbacks.isTypeSupported;
|
|
56
|
+
createCustomMediaKeys_1 = callbacks.createCustomMediaKeys;
|
|
57
|
+
setMediaKeys = callbacks.setMediaKeys;
|
|
58
|
+
implementation = "webkit";
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
// This is for Chrome with unprefixed EME api
|
|
62
|
+
if (isOldWebkitMediaElement(HTMLVideoElement.prototype)) {
|
|
63
|
+
onEncrypted = createCompatibleEventListener(["needkey"]);
|
|
64
|
+
var callbacks = getOldKitWebKitMediaKeyCallbacks();
|
|
65
|
+
isTypeSupported_1 = callbacks.isTypeSupported;
|
|
66
|
+
createCustomMediaKeys_1 = callbacks.createCustomMediaKeys;
|
|
67
|
+
setMediaKeys = callbacks.setMediaKeys;
|
|
68
|
+
implementation = "older-webkit";
|
|
69
|
+
// This is for WebKit with prefixed EME api
|
|
70
|
+
}
|
|
71
|
+
else if (WebKitMediaKeysConstructor !== undefined) {
|
|
72
|
+
onEncrypted = createCompatibleEventListener(["needkey"]);
|
|
73
|
+
var callbacks = getWebKitMediaKeysCallbacks();
|
|
74
|
+
isTypeSupported_1 = callbacks.isTypeSupported;
|
|
75
|
+
createCustomMediaKeys_1 = callbacks.createCustomMediaKeys;
|
|
76
|
+
setMediaKeys = callbacks.setMediaKeys;
|
|
77
|
+
implementation = "webkit";
|
|
78
|
+
}
|
|
79
|
+
else if (isIE11 && MSMediaKeysConstructor !== undefined) {
|
|
80
|
+
onEncrypted = createCompatibleEventListener(["encrypted", "needkey"]);
|
|
81
|
+
var callbacks = getIE11MediaKeysCallbacks();
|
|
82
|
+
isTypeSupported_1 = callbacks.isTypeSupported;
|
|
83
|
+
createCustomMediaKeys_1 = callbacks.createCustomMediaKeys;
|
|
84
|
+
setMediaKeys = callbacks.setMediaKeys;
|
|
85
|
+
implementation = "ms";
|
|
86
|
+
}
|
|
87
|
+
else if (MozMediaKeysConstructor !== undefined) {
|
|
88
|
+
onEncrypted = createCompatibleEventListener(["encrypted", "needkey"]);
|
|
89
|
+
var callbacks = getMozMediaKeysCallbacks();
|
|
90
|
+
isTypeSupported_1 = callbacks.isTypeSupported;
|
|
91
|
+
createCustomMediaKeys_1 = callbacks.createCustomMediaKeys;
|
|
92
|
+
setMediaKeys = callbacks.setMediaKeys;
|
|
93
|
+
implementation = "moz";
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
onEncrypted = createCompatibleEventListener(["encrypted", "needkey"]);
|
|
97
|
+
var MK_1 = window.MediaKeys;
|
|
98
|
+
var checkForStandardMediaKeys_1 = function () {
|
|
99
|
+
if (MK_1 === undefined) {
|
|
100
|
+
throw new MediaError("MEDIA_KEYS_NOT_SUPPORTED", "No `MediaKeys` implementation found " +
|
|
101
|
+
"in the current browser.");
|
|
102
|
+
}
|
|
103
|
+
if (typeof MK_1.isTypeSupported === "undefined") {
|
|
104
|
+
var message = "This browser seems to be unable to play encrypted " +
|
|
105
|
+
"contents currently." +
|
|
106
|
+
"Note: Some browsers do not allow decryption " +
|
|
107
|
+
"in some situations, like when not using HTTPS.";
|
|
108
|
+
throw new Error(message);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
isTypeSupported_1 = function (keyType) {
|
|
112
|
+
checkForStandardMediaKeys_1();
|
|
113
|
+
assert(typeof MK_1.isTypeSupported === "function");
|
|
114
|
+
return MK_1.isTypeSupported(keyType);
|
|
115
|
+
};
|
|
116
|
+
createCustomMediaKeys_1 = function (keyType) {
|
|
117
|
+
checkForStandardMediaKeys_1();
|
|
118
|
+
return new MK_1(keyType);
|
|
119
|
+
};
|
|
120
|
+
implementation = "unknown";
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
requestMediaKeySystemAccess = function (keyType, keySystemConfigurations) {
|
|
124
|
+
if (!isTypeSupported_1(keyType)) {
|
|
125
|
+
return Promise.reject(new Error("Unsupported key type"));
|
|
126
|
+
}
|
|
127
|
+
for (var i = 0; i < keySystemConfigurations.length; i++) {
|
|
128
|
+
var keySystemConfiguration = keySystemConfigurations[i];
|
|
129
|
+
var videoCapabilities = keySystemConfiguration.videoCapabilities, audioCapabilities = keySystemConfiguration.audioCapabilities, initDataTypes = keySystemConfiguration.initDataTypes, distinctiveIdentifier = keySystemConfiguration.distinctiveIdentifier;
|
|
130
|
+
var supported = true;
|
|
131
|
+
supported = supported &&
|
|
132
|
+
(initDataTypes == null ||
|
|
133
|
+
initDataTypes.some(function (idt) { return idt === "cenc"; }));
|
|
134
|
+
supported = supported && (distinctiveIdentifier !== "required");
|
|
135
|
+
if (supported) {
|
|
136
|
+
var keySystemConfigurationResponse = {
|
|
137
|
+
initDataTypes: ["cenc"],
|
|
138
|
+
distinctiveIdentifier: "not-allowed",
|
|
139
|
+
persistentState: "required",
|
|
140
|
+
sessionTypes: ["temporary", "persistent-license"],
|
|
141
|
+
};
|
|
142
|
+
if (videoCapabilities !== undefined) {
|
|
143
|
+
keySystemConfigurationResponse.videoCapabilities = videoCapabilities;
|
|
144
|
+
}
|
|
145
|
+
if (audioCapabilities !== undefined) {
|
|
146
|
+
keySystemConfigurationResponse.audioCapabilities = audioCapabilities;
|
|
147
|
+
}
|
|
148
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
149
|
+
var customMediaKeys = createCustomMediaKeys_1(keyType);
|
|
150
|
+
return Promise.resolve(new CustomMediaKeySystemAccess(keyType, customMediaKeys, keySystemConfigurationResponse));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return Promise.reject(new Error("Unsupported configuration"));
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
return { requestMediaKeySystemAccess: requestMediaKeySystemAccess, onEncrypted: onEncrypted, setMediaKeys: setMediaKeys, implementation: implementation };
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Set the given MediaKeys on the given HTMLMediaElement.
|
|
160
|
+
* Emits null when done then complete.
|
|
161
|
+
* @param {HTMLMediaElement} mediaElement
|
|
162
|
+
* @param {Object} mediaKeys
|
|
163
|
+
* @returns {Promise}
|
|
164
|
+
*/
|
|
165
|
+
function defaultSetMediaKeys(mediaElement, mediaKeys) {
|
|
166
|
+
try {
|
|
167
|
+
var ret = void 0;
|
|
168
|
+
var elt = mediaElement;
|
|
169
|
+
/* eslint-disable @typescript-eslint/unbound-method */
|
|
170
|
+
if (typeof elt.setMediaKeys === "function") {
|
|
171
|
+
ret = elt.setMediaKeys(mediaKeys);
|
|
172
|
+
}
|
|
173
|
+
/* eslint-enable @typescript-eslint/unbound-method */
|
|
174
|
+
// If we get in the following code, it means that no compat case has been
|
|
175
|
+
// found and no standard setMediaKeys API exists. This case is particulary
|
|
176
|
+
// rare. We will try to call each API with native media keys.
|
|
177
|
+
else if (typeof elt.webkitSetMediaKeys === "function") {
|
|
178
|
+
ret = elt.webkitSetMediaKeys(mediaKeys);
|
|
179
|
+
}
|
|
180
|
+
else if (typeof elt.mozSetMediaKeys === "function") {
|
|
181
|
+
ret = elt.mozSetMediaKeys(mediaKeys);
|
|
182
|
+
}
|
|
183
|
+
else if (typeof elt.msSetMediaKeys === "function" && mediaKeys !== null) {
|
|
184
|
+
ret = elt.msSetMediaKeys(mediaKeys);
|
|
185
|
+
}
|
|
186
|
+
if (typeof ret === "object" &&
|
|
187
|
+
ret !== null &&
|
|
188
|
+
typeof ret.then === "function") {
|
|
189
|
+
return ret;
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
return Promise.resolve(ret);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
catch (err) {
|
|
196
|
+
return Promise.reject(err);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -14,9 +14,11 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import closeSession from "./close_session";
|
|
17
|
-
import
|
|
18
|
-
import { ICustomMediaKeys, ICustomMediaKeySession
|
|
17
|
+
import { ICustomMediaKeySystemAccess } from "./custom_key_system_access";
|
|
18
|
+
import { ICustomMediaKeys, ICustomMediaKeySession } from "./custom_media_keys";
|
|
19
|
+
import defaultEmeImplementation, { IEmeApiImplementation, IPreferredEmeApiType } from "./eme-api-implementation";
|
|
19
20
|
import generateKeyRequest from "./generate_key_request";
|
|
20
21
|
import getInitData, { IEncryptedEventData } from "./get_init_data";
|
|
21
22
|
import loadSession from "./load_session";
|
|
22
|
-
export
|
|
23
|
+
export default defaultEmeImplementation;
|
|
24
|
+
export { closeSession, generateKeyRequest, getInitData, loadSession, IEmeApiImplementation, IPreferredEmeApiType, ICustomMediaKeySession, ICustomMediaKeySystemAccess, ICustomMediaKeys, IEncryptedEventData, };
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import closeSession from "./close_session";
|
|
17
|
-
import
|
|
18
|
-
import { requestMediaKeySystemAccess, setMediaKeys, } from "./custom_media_keys";
|
|
17
|
+
import defaultEmeImplementation from "./eme-api-implementation";
|
|
19
18
|
import generateKeyRequest from "./generate_key_request";
|
|
20
19
|
import getInitData from "./get_init_data";
|
|
21
20
|
import loadSession from "./load_session";
|
|
22
|
-
export
|
|
21
|
+
export default defaultEmeImplementation;
|
|
22
|
+
export { closeSession, generateKeyRequest, getInitData, loadSession, };
|
|
@@ -22,6 +22,18 @@ export interface IEventEmitterLike {
|
|
|
22
22
|
removeEventListener: (eventName: string, handler: () => void) => void;
|
|
23
23
|
}
|
|
24
24
|
export type IEventTargetLike = HTMLElement | IEventEmitterLike | IEventEmitter<unknown>;
|
|
25
|
+
/**
|
|
26
|
+
* Returns a function allowing to add event listeners for particular event(s)
|
|
27
|
+
* optionally automatically adding browser prefixes if needed.
|
|
28
|
+
* @param {Array.<string>} eventNames - The event(s) to listen to. If multiple
|
|
29
|
+
* events are set, the event listener will be triggered when any of them emits.
|
|
30
|
+
* @param {Array.<string>|undefined} [prefixes] - Optional vendor prefixes with
|
|
31
|
+
* which the event might also be sent. If not defined, default prefixes might be
|
|
32
|
+
* tested.
|
|
33
|
+
* @returns {Function} - Returns function allowing to easily add a callback to
|
|
34
|
+
* be triggered when that event is emitted on a given event target.
|
|
35
|
+
*/
|
|
36
|
+
declare function createCompatibleEventListener(eventNames: string[], prefixes?: string[]): (element: IEventTargetLike, listener: (event?: unknown) => void, cancelSignal: CancellationSignal) => void;
|
|
25
37
|
/**
|
|
26
38
|
* Returns a reference:
|
|
27
39
|
* - Set to `true` when the current page is considered visible and active.
|
|
@@ -112,10 +124,6 @@ declare const onSourceBufferUpdate: (element: IEventTargetLike, listener: (event
|
|
|
112
124
|
* @param {Object} cancelSignal
|
|
113
125
|
*/
|
|
114
126
|
declare const onRemoveSourceBuffers: (element: IEventTargetLike, listener: (event?: unknown) => void, cancelSignal: CancellationSignal) => void;
|
|
115
|
-
/**
|
|
116
|
-
* @param {HTMLMediaElement} mediaElement
|
|
117
|
-
*/
|
|
118
|
-
declare const onEncrypted: (element: IEventTargetLike, listener: (event?: unknown) => void, cancelSignal: CancellationSignal) => void;
|
|
119
127
|
/**
|
|
120
128
|
* @param {MediaKeySession} mediaKeySession
|
|
121
129
|
*/
|
|
@@ -155,4 +163,4 @@ declare const onEnded: (element: IEventTargetLike, listener: (event?: unknown) =
|
|
|
155
163
|
* emits
|
|
156
164
|
*/
|
|
157
165
|
declare function addEventListener(elt: IEventEmitterLike, evt: string, listener: (x?: unknown) => void, stopListening: CancellationSignal): void;
|
|
158
|
-
export { addEventListener, getPageActivityRef, getPictureOnPictureStateRef, getVideoVisibilityRef, getVideoWidthRef,
|
|
166
|
+
export { addEventListener, createCompatibleEventListener, getPageActivityRef, getPictureOnPictureStateRef, getVideoVisibilityRef, getVideoWidthRef, onEnded, onFullscreenChange, onKeyAdded, onKeyError, onKeyMessage, onKeyStatusesChange, onLoadedMetadata, onRemoveSourceBuffers, onSeeked, onSeeking, onSourceClose, onSourceEnded, onSourceOpen, onTimeUpdate, onSourceBufferUpdate, onTextTrackAdded, onTextTrackRemoved, };
|
|
@@ -18,9 +18,8 @@ import log from "../log";
|
|
|
18
18
|
import isNonEmptyString from "../utils/is_non_empty_string";
|
|
19
19
|
import isNullOrUndefined from "../utils/is_null_or_undefined";
|
|
20
20
|
import noop from "../utils/noop";
|
|
21
|
-
import
|
|
21
|
+
import SharedReference from "../utils/reference";
|
|
22
22
|
import isNode from "./is_node";
|
|
23
|
-
import shouldFavourCustomSafariEME from "./should_favour_custom_safari_EME";
|
|
24
23
|
var BROWSER_PREFIXES = ["", "webkit", "moz", "ms"];
|
|
25
24
|
var pixelRatio = isNode ||
|
|
26
25
|
window.devicePixelRatio == null ||
|
|
@@ -160,7 +159,7 @@ function getDocumentVisibilityRef(stopListening) {
|
|
|
160
159
|
var visibilityChangeEvent = isNonEmptyString(prefix) ? prefix + "visibilitychange" :
|
|
161
160
|
"visibilitychange";
|
|
162
161
|
var isHidden = document[hidden];
|
|
163
|
-
var ref =
|
|
162
|
+
var ref = new SharedReference(!isHidden, stopListening);
|
|
164
163
|
addEventListener(document, visibilityChangeEvent, function () {
|
|
165
164
|
var isVisible = !(document[hidden]);
|
|
166
165
|
ref.setValueIfChanged(isVisible);
|
|
@@ -178,7 +177,7 @@ function getDocumentVisibilityRef(stopListening) {
|
|
|
178
177
|
function getPageActivityRef(stopListening) {
|
|
179
178
|
var isDocVisibleRef = getDocumentVisibilityRef(stopListening);
|
|
180
179
|
var currentTimeout;
|
|
181
|
-
var ref =
|
|
180
|
+
var ref = new SharedReference(true, stopListening);
|
|
182
181
|
stopListening.register(function () {
|
|
183
182
|
clearTimeout(currentTimeout);
|
|
184
183
|
currentTimeout = undefined;
|
|
@@ -219,7 +218,7 @@ function getPictureOnPictureStateRef(elt, stopListening) {
|
|
|
219
218
|
if (mediaElement.webkitSupportsPresentationMode === true &&
|
|
220
219
|
typeof mediaElement.webkitSetPresentationMode === "function") {
|
|
221
220
|
var isWebKitPIPEnabled = mediaElement.webkitPresentationMode === "picture-in-picture";
|
|
222
|
-
var ref_1 =
|
|
221
|
+
var ref_1 = new SharedReference({
|
|
223
222
|
isEnabled: isWebKitPIPEnabled,
|
|
224
223
|
pipWindow: null,
|
|
225
224
|
}, stopListening);
|
|
@@ -230,7 +229,7 @@ function getPictureOnPictureStateRef(elt, stopListening) {
|
|
|
230
229
|
return ref_1;
|
|
231
230
|
}
|
|
232
231
|
var isPIPEnabled = (document.pictureInPictureElement === mediaElement);
|
|
233
|
-
var ref =
|
|
232
|
+
var ref = new SharedReference({ isEnabled: isPIPEnabled,
|
|
234
233
|
pipWindow: null }, stopListening);
|
|
235
234
|
addEventListener(mediaElement, "enterpictureinpicture", function (evt) {
|
|
236
235
|
var _a;
|
|
@@ -257,7 +256,7 @@ function getPictureOnPictureStateRef(elt, stopListening) {
|
|
|
257
256
|
function getVideoVisibilityRef(pipStatus, stopListening) {
|
|
258
257
|
var isDocVisibleRef = getDocumentVisibilityRef(stopListening);
|
|
259
258
|
var currentTimeout;
|
|
260
|
-
var ref =
|
|
259
|
+
var ref = new SharedReference(true, stopListening);
|
|
261
260
|
stopListening.register(function () {
|
|
262
261
|
clearTimeout(currentTimeout);
|
|
263
262
|
currentTimeout = undefined;
|
|
@@ -289,7 +288,7 @@ function getVideoVisibilityRef(pipStatus, stopListening) {
|
|
|
289
288
|
* @returns {Object}
|
|
290
289
|
*/
|
|
291
290
|
function getVideoWidthRef(mediaElement, pipStatusRef, stopListening) {
|
|
292
|
-
var ref =
|
|
291
|
+
var ref = new SharedReference(mediaElement.clientWidth * pixelRatio, stopListening);
|
|
293
292
|
var clearPreviousEventListener = noop;
|
|
294
293
|
pipStatusRef.onUpdate(checkVideoWidth, { clearSignal: stopListening });
|
|
295
294
|
addEventListener(window, "resize", checkVideoWidth, stopListening);
|
|
@@ -376,11 +375,6 @@ var onSourceBufferUpdate = createCompatibleEventListener(["update"]);
|
|
|
376
375
|
* @param {Object} cancelSignal
|
|
377
376
|
*/
|
|
378
377
|
var onRemoveSourceBuffers = createCompatibleEventListener(["removesourcebuffer"]);
|
|
379
|
-
/**
|
|
380
|
-
* @param {HTMLMediaElement} mediaElement
|
|
381
|
-
*/
|
|
382
|
-
var onEncrypted = createCompatibleEventListener(shouldFavourCustomSafariEME() ? ["needkey"] :
|
|
383
|
-
["encrypted", "needkey"]);
|
|
384
378
|
/**
|
|
385
379
|
* @param {MediaKeySession} mediaKeySession
|
|
386
380
|
*/
|
|
@@ -425,4 +419,4 @@ function addEventListener(elt, evt, listener, stopListening) {
|
|
|
425
419
|
elt.removeEventListener(evt, listener);
|
|
426
420
|
});
|
|
427
421
|
}
|
|
428
|
-
export { addEventListener, getPageActivityRef, getPictureOnPictureStateRef, getVideoVisibilityRef, getVideoWidthRef,
|
|
422
|
+
export { addEventListener, createCompatibleEventListener, getPageActivityRef, getPictureOnPictureStateRef, getVideoVisibilityRef, getVideoWidthRef, onEnded, onFullscreenChange, onKeyAdded, onKeyError, onKeyMessage, onKeyStatusesChange, onLoadedMetadata, onRemoveSourceBuffers, onSeeked, onSeeking, onSourceClose, onSourceEnded, onSourceOpen, onTimeUpdate, onSourceBufferUpdate, onTextTrackAdded, onTextTrackRemoved, };
|
|
@@ -20,12 +20,10 @@ import canPatchISOBMFFSegment from "./can_patch_isobmff";
|
|
|
20
20
|
import canReuseMediaKeys from "./can_reuse_media_keys";
|
|
21
21
|
import tryToChangeSourceBufferType, { ICompatSourceBuffer } from "./change_source_buffer_type";
|
|
22
22
|
import clearElementSrc from "./clear_element_src";
|
|
23
|
-
import { closeSession, CustomMediaKeySystemAccess, generateKeyRequest, getInitData, ICustomMediaKeys, ICustomMediaKeySession, ICustomMediaKeySystemAccess, loadSession, requestMediaKeySystemAccess, setMediaKeys } from "./eme";
|
|
24
23
|
import enableAudioTrack from "./enable_audio_track";
|
|
25
24
|
import * as events from "./event_listeners";
|
|
26
25
|
import { exitFullscreen, isFullscreen, requestFullscreen } from "./fullscreen";
|
|
27
26
|
import getStartDate from "./get_start_date";
|
|
28
|
-
import hasEMEAPIs from "./has_eme_apis";
|
|
29
27
|
import isCodecSupported from "./is_codec_supported";
|
|
30
28
|
import isNode from "./is_node";
|
|
31
29
|
import isOffline from "./is_offline";
|
|
@@ -38,4 +36,4 @@ import shouldUnsetMediaKeys from "./should_unset_media_keys";
|
|
|
38
36
|
import shouldValidateMetadata from "./should_validate_metadata";
|
|
39
37
|
import shouldWaitForDataBeforeLoaded from "./should_wait_for_data_before_loaded";
|
|
40
38
|
import shouldWaitForHaveEnoughData from "./should_wait_for_have_enough_data";
|
|
41
|
-
export { addClassName, addTextTrack, canPatchISOBMFFSegment, canReuseMediaKeys, clearElementSrc,
|
|
39
|
+
export { addClassName, addTextTrack, canPatchISOBMFFSegment, canReuseMediaKeys, clearElementSrc, enableAudioTrack, events, exitFullscreen, getStartDate, ICompatTextTrack, ICompatVTTCue, ICompatSourceBuffer, isCodecSupported, isFullscreen, isNode, isOffline, isVTTCue, makeVTTCue, MediaSource_, onHeightWidthChange, requestFullscreen, shouldReloadMediaSourceOnDecipherabilityUpdate, shouldRenewMediaKeySystemAccess, shouldUnsetMediaKeys, shouldValidateMetadata, shouldWaitForDataBeforeLoaded, shouldWaitForHaveEnoughData, tryToChangeSourceBufferType, };
|
|
@@ -20,12 +20,10 @@ import canPatchISOBMFFSegment from "./can_patch_isobmff";
|
|
|
20
20
|
import canReuseMediaKeys from "./can_reuse_media_keys";
|
|
21
21
|
import tryToChangeSourceBufferType from "./change_source_buffer_type";
|
|
22
22
|
import clearElementSrc from "./clear_element_src";
|
|
23
|
-
import { closeSession, CustomMediaKeySystemAccess, generateKeyRequest, getInitData, loadSession, requestMediaKeySystemAccess, setMediaKeys, } from "./eme";
|
|
24
23
|
import enableAudioTrack from "./enable_audio_track";
|
|
25
24
|
import * as events from "./event_listeners";
|
|
26
25
|
import { exitFullscreen, isFullscreen, requestFullscreen, } from "./fullscreen";
|
|
27
26
|
import getStartDate from "./get_start_date";
|
|
28
|
-
import hasEMEAPIs from "./has_eme_apis";
|
|
29
27
|
import isCodecSupported from "./is_codec_supported";
|
|
30
28
|
import isNode from "./is_node";
|
|
31
29
|
import isOffline from "./is_offline";
|
|
@@ -44,4 +42,4 @@ import shouldWaitForHaveEnoughData from "./should_wait_for_have_enough_data";
|
|
|
44
42
|
// we would prefer to disallow (both for the understandability of the code and
|
|
45
43
|
// to better exploit tree shaking.
|
|
46
44
|
patchWebkitSourceBuffer();
|
|
47
|
-
export { addClassName, addTextTrack, canPatchISOBMFFSegment, canReuseMediaKeys, clearElementSrc,
|
|
45
|
+
export { addClassName, addTextTrack, canPatchISOBMFFSegment, canReuseMediaKeys, clearElementSrc, enableAudioTrack, events, exitFullscreen, getStartDate, isCodecSupported, isFullscreen, isNode, isOffline, isVTTCue, makeVTTCue, MediaSource_, onHeightWidthChange, requestFullscreen, shouldReloadMediaSourceOnDecipherabilityUpdate, shouldRenewMediaKeySystemAccess, shouldUnsetMediaKeys, shouldValidateMetadata, shouldWaitForDataBeforeLoaded, shouldWaitForHaveEnoughData, tryToChangeSourceBufferType, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Some external tools set that boolean, in which case, we should enable DEBUG
|
|
3
|
+
* logs and various tricks to make as much logs as available to those tools.
|
|
4
|
+
*
|
|
5
|
+
* @returns {boolean}
|
|
6
|
+
*/
|
|
7
|
+
export default function isDebugModeEnabled() {
|
|
8
|
+
return typeof __RX_PLAYER_DEBUG_MODE__ === "boolean" && __RX_PLAYER_DEBUG_MODE__;
|
|
9
|
+
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import log from "../log";
|
|
17
|
-
import
|
|
17
|
+
import SharedReference from "../utils/reference";
|
|
18
18
|
import isNode from "./is_node";
|
|
19
19
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
20
20
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
@@ -35,7 +35,7 @@ var _ResizeObserver = isNode ? undefined :
|
|
|
35
35
|
*/
|
|
36
36
|
export default function onHeightWidthChange(element, interval, cancellationSignal) {
|
|
37
37
|
var _a = element.getBoundingClientRect(), initHeight = _a.height, initWidth = _a.width;
|
|
38
|
-
var ref =
|
|
38
|
+
var ref = new SharedReference({
|
|
39
39
|
height: initHeight,
|
|
40
40
|
width: initWidth,
|
|
41
41
|
}, cancellationSignal);
|
|
@@ -17,7 +17,7 @@ import config from "../../config";
|
|
|
17
17
|
import log from "../../log";
|
|
18
18
|
import noop from "../../utils/noop";
|
|
19
19
|
import { getLeftSizeOfRange } from "../../utils/ranges";
|
|
20
|
-
import
|
|
20
|
+
import SharedReference from "../../utils/reference";
|
|
21
21
|
import takeFirstSet from "../../utils/take_first_set";
|
|
22
22
|
import TaskCanceller from "../../utils/task_canceller";
|
|
23
23
|
import BufferBasedChooser from "./buffer_based_chooser";
|
|
@@ -31,15 +31,15 @@ import PendingRequestsStore from "./utils/pending_requests_store";
|
|
|
31
31
|
import RepresentationScoreCalculator from "./utils/representation_score_calculator";
|
|
32
32
|
import selectOptimalRepresentation from "./utils/select_optimal_representation";
|
|
33
33
|
// Create default shared references
|
|
34
|
-
var manualBitrateDefaultRef =
|
|
34
|
+
var manualBitrateDefaultRef = new SharedReference(-1);
|
|
35
35
|
manualBitrateDefaultRef.finish();
|
|
36
|
-
var minAutoBitrateDefaultRef =
|
|
36
|
+
var minAutoBitrateDefaultRef = new SharedReference(0);
|
|
37
37
|
minAutoBitrateDefaultRef.finish();
|
|
38
|
-
var maxAutoBitrateDefaultRef =
|
|
38
|
+
var maxAutoBitrateDefaultRef = new SharedReference(Infinity);
|
|
39
39
|
maxAutoBitrateDefaultRef.finish();
|
|
40
|
-
var limitWidthDefaultRef =
|
|
40
|
+
var limitWidthDefaultRef = new SharedReference(undefined);
|
|
41
41
|
limitWidthDefaultRef.finish();
|
|
42
|
-
var throttleBitrateDefaultRef =
|
|
42
|
+
var throttleBitrateDefaultRef = new SharedReference(Infinity);
|
|
43
43
|
throttleBitrateDefaultRef.finish();
|
|
44
44
|
/**
|
|
45
45
|
* Select the most adapted Representation according to the network and buffer
|
|
@@ -121,6 +121,10 @@ function getEstimateReference(_a, stopAllEstimates) {
|
|
|
121
121
|
var scoreCalculator = new RepresentationScoreCalculator();
|
|
122
122
|
var networkAnalyzer = new NetworkAnalyzer(initialBitrate !== null && initialBitrate !== void 0 ? initialBitrate : 0, lowLatencyMode);
|
|
123
123
|
var requestsStore = new PendingRequestsStore();
|
|
124
|
+
/**
|
|
125
|
+
* Callback called each time a new segment is pushed, with the information on the
|
|
126
|
+
* new pushed segment.
|
|
127
|
+
*/
|
|
124
128
|
var onAddedSegment = noop;
|
|
125
129
|
var callbacks = {
|
|
126
130
|
metrics: onMetric,
|
|
@@ -136,15 +140,14 @@ function getEstimateReference(_a, stopAllEstimates) {
|
|
|
136
140
|
*/
|
|
137
141
|
var currentEstimatesCanceller = new TaskCanceller();
|
|
138
142
|
currentEstimatesCanceller.linkToSignal(stopAllEstimates);
|
|
139
|
-
// Create `
|
|
140
|
-
var estimateRef = createEstimateReference(
|
|
141
|
-
manualBitrate.onUpdate(restartEstimatesProductionFromCurrentConditions, { clearSignal: stopAllEstimates });
|
|
143
|
+
// Create `SharedReference` on which estimates will be emitted.
|
|
144
|
+
var estimateRef = createEstimateReference(representationsRef.getValue(), currentEstimatesCanceller.signal);
|
|
142
145
|
representationsRef.onUpdate(restartEstimatesProductionFromCurrentConditions, { clearSignal: stopAllEstimates });
|
|
143
146
|
return { estimates: estimateRef, callbacks: callbacks };
|
|
144
|
-
function createEstimateReference(
|
|
147
|
+
function createEstimateReference(representations, innerCancellationSignal) {
|
|
145
148
|
if (representations.length === 0) {
|
|
146
149
|
// No Representation given, return `null` as documented
|
|
147
|
-
return
|
|
150
|
+
return new SharedReference({
|
|
148
151
|
representation: null,
|
|
149
152
|
bitrate: undefined,
|
|
150
153
|
knownStableBitrate: undefined,
|
|
@@ -152,20 +155,9 @@ function getEstimateReference(_a, stopAllEstimates) {
|
|
|
152
155
|
urgent: true,
|
|
153
156
|
});
|
|
154
157
|
}
|
|
155
|
-
if (manualBitrateVal >= 0) {
|
|
156
|
-
// A manual bitrate has been set. Just choose Representation according to it.
|
|
157
|
-
var manualRepresentation = selectOptimalRepresentation(representations, manualBitrateVal, 0, Infinity);
|
|
158
|
-
return createSharedReference({
|
|
159
|
-
representation: manualRepresentation,
|
|
160
|
-
bitrate: undefined,
|
|
161
|
-
knownStableBitrate: undefined,
|
|
162
|
-
manual: true,
|
|
163
|
-
urgent: true, // a manual bitrate switch should happen immediately
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
158
|
if (representations.length === 1) {
|
|
167
159
|
// There's only a single Representation. Just choose it.
|
|
168
|
-
return
|
|
160
|
+
return new SharedReference({ bitrate: undefined,
|
|
169
161
|
representation: representations[0],
|
|
170
162
|
manual: false,
|
|
171
163
|
urgent: true,
|
|
@@ -173,18 +165,12 @@ function getEstimateReference(_a, stopAllEstimates) {
|
|
|
173
165
|
}
|
|
174
166
|
/** If true, Representation estimates based on the buffer health might be used. */
|
|
175
167
|
var allowBufferBasedEstimates = false;
|
|
176
|
-
/**
|
|
177
|
-
* Current optimal Representation's bandwidth choosen by a buffer-based
|
|
178
|
-
* adaptive algorithm.
|
|
179
|
-
*/
|
|
180
|
-
var currentBufferBasedEstimate;
|
|
181
|
-
var bitrates = representations.map(function (r) { return r.bitrate; });
|
|
182
168
|
/**
|
|
183
169
|
* Module calculating the optimal Representation based on the current
|
|
184
170
|
* buffer's health (i.e. whether enough data is buffered, history of
|
|
185
171
|
* buffer size etc.).
|
|
186
172
|
*/
|
|
187
|
-
var bufferBasedChooser = new BufferBasedChooser(
|
|
173
|
+
var bufferBasedChooser = new BufferBasedChooser(representations.map(function (r) { return r.bitrate; }));
|
|
188
174
|
/** Store the previous estimate made here. */
|
|
189
175
|
var prevEstimate = new LastEstimateStorage();
|
|
190
176
|
/**
|
|
@@ -196,7 +182,7 @@ function getEstimateReference(_a, stopAllEstimates) {
|
|
|
196
182
|
// get initial observation for initial estimate
|
|
197
183
|
var lastPlaybackObservation = playbackObserver.getReference().getValue();
|
|
198
184
|
/** Reference through which estimates are emitted. */
|
|
199
|
-
var innerEstimateRef =
|
|
185
|
+
var innerEstimateRef = new SharedReference(getCurrentEstimate());
|
|
200
186
|
// Listen to playback observations
|
|
201
187
|
playbackObserver.listen(function (obs) {
|
|
202
188
|
lastPlaybackObservation = obs;
|
|
@@ -213,9 +199,13 @@ function getEstimateReference(_a, stopAllEstimates) {
|
|
|
213
199
|
var currentScore = scoreCalculator.getEstimate(representation);
|
|
214
200
|
var currentBitrate = representation.bitrate;
|
|
215
201
|
var observation = { bufferGap: bufferGap, currentBitrate: currentBitrate, currentScore: currentScore, speed: speed };
|
|
216
|
-
|
|
202
|
+
bufferBasedChooser.onAddedSegment(observation);
|
|
217
203
|
updateEstimate();
|
|
218
204
|
};
|
|
205
|
+
innerCancellationSignal.register(function () {
|
|
206
|
+
onAddedSegment = noop;
|
|
207
|
+
});
|
|
208
|
+
manualBitrate.onUpdate(updateEstimate, { clearSignal: innerCancellationSignal });
|
|
219
209
|
minAutoBitrate.onUpdate(updateEstimate, { clearSignal: innerCancellationSignal });
|
|
220
210
|
maxAutoBitrate.onUpdate(updateEstimate, { clearSignal: innerCancellationSignal });
|
|
221
211
|
filters.limitWidth.onUpdate(updateEstimate, { clearSignal: innerCancellationSignal });
|
|
@@ -226,6 +216,18 @@ function getEstimateReference(_a, stopAllEstimates) {
|
|
|
226
216
|
}
|
|
227
217
|
/** Returns the actual estimate based on all methods and algorithm available. */
|
|
228
218
|
function getCurrentEstimate() {
|
|
219
|
+
var manualBitrateVal = manualBitrate.getValue();
|
|
220
|
+
if (manualBitrateVal >= 0) {
|
|
221
|
+
// A manual bitrate has been set. Just choose Representation according to it.
|
|
222
|
+
var manualRepresentation = selectOptimalRepresentation(representations, manualBitrateVal, 0, Infinity);
|
|
223
|
+
return {
|
|
224
|
+
representation: manualRepresentation,
|
|
225
|
+
bitrate: undefined,
|
|
226
|
+
knownStableBitrate: undefined,
|
|
227
|
+
manual: true,
|
|
228
|
+
urgent: true, // a manual bitrate switch should happen immediately
|
|
229
|
+
};
|
|
230
|
+
}
|
|
229
231
|
var bufferGap = lastPlaybackObservation.bufferGap, position = lastPlaybackObservation.position, maximumPosition = lastPlaybackObservation.maximumPosition;
|
|
230
232
|
var widthLimit = filters.limitWidth.getValue();
|
|
231
233
|
var bitrateThrottle = filters.throttleBitrate.getValue();
|
|
@@ -258,6 +260,11 @@ function getEstimateReference(_a, stopAllEstimates) {
|
|
|
258
260
|
* could actually profit from.
|
|
259
261
|
*/
|
|
260
262
|
var chosenRepFromBandwidth = selectOptimalRepresentation(filteredReps, bitrateChosen, minAutoBitrateVal, maxAutoBitrateVal);
|
|
263
|
+
/**
|
|
264
|
+
* Current optimal Representation's bandwidth choosen by a buffer-based
|
|
265
|
+
* adaptive algorithm.
|
|
266
|
+
*/
|
|
267
|
+
var currentBufferBasedEstimate = bufferBasedChooser.getLastEstimate();
|
|
261
268
|
var currentBestBitrate = chosenRepFromBandwidth.bitrate;
|
|
262
269
|
/**
|
|
263
270
|
* Representation chosen when considering the current buffer size.
|
|
@@ -332,12 +339,11 @@ function getEstimateReference(_a, stopAllEstimates) {
|
|
|
332
339
|
* conditions (such as a manual bitrate and/or a new list of Representations).
|
|
333
340
|
*/
|
|
334
341
|
function restartEstimatesProductionFromCurrentConditions() {
|
|
335
|
-
var manualBitrateVal = manualBitrate.getValue();
|
|
336
342
|
var representations = representationsRef.getValue();
|
|
337
343
|
currentEstimatesCanceller.cancel();
|
|
338
344
|
currentEstimatesCanceller = new TaskCanceller();
|
|
339
345
|
currentEstimatesCanceller.linkToSignal(stopAllEstimates);
|
|
340
|
-
var newRef = createEstimateReference(
|
|
346
|
+
var newRef = createEstimateReference(representations, currentEstimatesCanceller.signal);
|
|
341
347
|
newRef.onUpdate(function onNewEstimate(newEstimate) {
|
|
342
348
|
estimateRef.setValue(newEstimate);
|
|
343
349
|
}, { clearSignal: currentEstimatesCanceller.signal,
|
|
@@ -32,6 +32,13 @@ import { IRepresentationMaintainabilityScore } from "./utils/representation_scor
|
|
|
32
32
|
export default class BufferBasedChooser {
|
|
33
33
|
private _levelsMap;
|
|
34
34
|
private _bitrates;
|
|
35
|
+
/**
|
|
36
|
+
* Current last best Representation's bitrate estimate made by the
|
|
37
|
+
* `BufferBasedChooser` or `undefined` if it has no such guess for now.
|
|
38
|
+
*
|
|
39
|
+
* Might be updated each time `onAddedSegment` is called.
|
|
40
|
+
*/
|
|
41
|
+
private _currentEstimate;
|
|
35
42
|
/**
|
|
36
43
|
* Laast timestamp, in terms of `performance.now`, at which the current
|
|
37
44
|
* quality was seen as too high by this algorithm.
|
|
@@ -54,7 +61,16 @@ export default class BufferBasedChooser {
|
|
|
54
61
|
* @param {Object} playbackObservation
|
|
55
62
|
* @returns {number|undefined}
|
|
56
63
|
*/
|
|
57
|
-
|
|
64
|
+
onAddedSegment(playbackObservation: IBufferBasedChooserPlaybackObservation): void;
|
|
65
|
+
/**
|
|
66
|
+
* Returns the last best Representation's bitrate estimate made by the
|
|
67
|
+
* `BufferBasedChooser` or `undefined` if it has no such guess for now.
|
|
68
|
+
*
|
|
69
|
+
* Might be updated after `onAddedSegment` is called.
|
|
70
|
+
*
|
|
71
|
+
* @returns {number|undefined}
|
|
72
|
+
*/
|
|
73
|
+
getLastEstimate(): number | undefined;
|
|
58
74
|
}
|
|
59
75
|
/** Playback observation needed by the `BufferBasedChooser`. */
|
|
60
76
|
export interface IBufferBasedChooserPlaybackObservation {
|