rx-player 3.33.0 → 3.33.2
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 +13 -0
- package/VERSION +1 -1
- package/dist/_esm5.processed/core/api/public_api.js +2 -2
- package/dist/_esm5.processed/manifest/manifest.js +1 -0
- package/dist/_esm5.processed/utils/retry_promise_with_backoff.d.ts +11 -0
- package/dist/_esm5.processed/utils/retry_promise_with_backoff.js +18 -4
- package/dist/mpd-parser.wasm +0 -0
- package/dist/rx-player.d.ts +1 -1
- package/dist/rx-player.js +24 -9
- package/dist/rx-player.min.d.ts +1 -1
- package/dist/rx-player.min.js +1 -1
- package/package.json +6 -6
- package/.editorconfig +0 -22
- package/.eslintrc.js +0 -406
- package/.github/workflows/checks.yml +0 -101
- package/.github/workflows/perfs.yml +0 -22
- package/.github/workflows/sonarcloud_analysis.yml +0 -20
- package/CONTRIBUTING.md +0 -272
- package/FILES.md +0 -283
- package/jest.config.js +0 -73
- package/manifest.mpd +0 -149
- package/scripts/README.md +0 -11
- package/scripts/build/constants.d.ts +0 -53
- package/scripts/build/generate_build.js +0 -190
- package/scripts/build/templates/experimental/features/index.d.ts +0 -16
- package/scripts/build/templates/experimental/features/index.js +0 -16
- package/scripts/build/templates/experimental/index.d.ts +0 -16
- package/scripts/build/templates/experimental/index.js +0 -16
- package/scripts/build/templates/experimental/tools/VideoThumbnailLoader/index.d.ts +0 -18
- package/scripts/build/templates/experimental/tools/VideoThumbnailLoader/index.js +0 -18
- package/scripts/build/templates/experimental/tools/index.d.ts +0 -16
- package/scripts/build/templates/experimental/tools/index.js +0 -16
- package/scripts/build/templates/features/index.d.ts +0 -16
- package/scripts/build/templates/features/index.js +0 -16
- package/scripts/build/templates/logger/index.d.ts +0 -17
- package/scripts/build/templates/logger/index.js +0 -17
- package/scripts/build/templates/minimal/index.d.ts +0 -17
- package/scripts/build/templates/minimal/index.js +0 -17
- package/scripts/build/templates/tools/TextTrackRenderer.d.ts +0 -18
- package/scripts/build/templates/tools/TextTrackRenderer.js +0 -18
- package/scripts/build/templates/tools/index.d.ts +0 -16
- package/scripts/build/templates/tools/index.js +0 -16
- package/scripts/build/templates/tools/string-utils.d.ts +0 -18
- package/scripts/build/templates/tools/string-utils.js +0 -18
- package/scripts/build/templates/types/index.d.ts +0 -16
- package/scripts/build/templates/types/index.js +0 -15
- package/scripts/canal-release.patch +0 -316
- package/scripts/check_nodejs_import_compatibility.js +0 -60
- package/scripts/deploy_new_demo +0 -123
- package/scripts/fast_demo_build.js +0 -129
- package/scripts/generate_certificate +0 -19
- package/scripts/generate_demo_list.js +0 -105
- package/scripts/generate_documentation_list.js +0 -109
- package/scripts/generate_full_demo.js +0 -201
- package/scripts/generate_standalone_demo.js +0 -82
- package/scripts/launch_static_server.js +0 -163
- package/scripts/list-npm-scripts.js +0 -207
- package/scripts/make-dev-releases +0 -90
- package/scripts/report_build_sizes +0 -96
- package/scripts/run_standalone_demo.js +0 -27
- package/scripts/start_demo_web_server.js +0 -44
- package/scripts/update-version +0 -48
- package/scripts/update_gh-pages_demo +0 -132
- package/scripts/update_gh-pages_doc +0 -106
- package/scripts/utils/display_webpack_errors.js +0 -33
- package/scripts/utils/get_human_readable_hours.js +0 -14
- package/scripts/wasm-strip.js +0 -359
- package/sonar-project.properties +0 -7
- package/src/README.md +0 -136
- package/src/compat/README.md +0 -29
- package/src/compat/__tests__/add_text_track.test.ts +0 -176
- package/src/compat/__tests__/browser_compatibility_types.test.ts +0 -152
- package/src/compat/__tests__/browser_version.test.ts +0 -84
- package/src/compat/__tests__/can_patch_isobmff.test.ts +0 -50
- package/src/compat/__tests__/can_rely_on_video_visibility_and_size.test.ts +0 -78
- package/src/compat/__tests__/can_reuse_media_keys.test.ts +0 -31
- package/src/compat/__tests__/change_source_buffer_type.test.ts +0 -60
- package/src/compat/__tests__/clear_element_src.test.ts +0 -252
- package/src/compat/__tests__/enable_audio_track.test.ts +0 -341
- package/src/compat/__tests__/fullscreen.test.ts +0 -286
- package/src/compat/__tests__/is_codec_supported.test.ts +0 -78
- package/src/compat/__tests__/is_offline.test.ts +0 -65
- package/src/compat/__tests__/is_seeking_approximate.test.ts +0 -48
- package/src/compat/__tests__/is_vtt_cue.test.ts +0 -71
- package/src/compat/__tests__/make_vtt_cue.test.ts +0 -97
- package/src/compat/__tests__/patch_webkit_source_buffer.test.ts +0 -144
- package/src/compat/__tests__/remove_cue.test.ts +0 -229
- package/src/compat/__tests__/should_favour_custom_safari_EME.test.ts +0 -128
- package/src/compat/__tests__/should_reload_media_source_on_decipherability_update.test.ts +0 -50
- package/src/compat/__tests__/should_renew_media_key_system_access.test.ts +0 -55
- package/src/compat/__tests__/should_unset_media_keys.test.ts +0 -53
- package/src/compat/__tests__/should_validate_metadata.test.ts +0 -53
- package/src/compat/__tests__/should_wait_for_data_before_loaded.test.ts +0 -121
- package/src/compat/__tests__/should_wait_for_have_enough_data.test.ts +0 -36
- package/src/compat/add_class_name.ts +0 -41
- package/src/compat/add_text_track.ts +0 -58
- package/src/compat/browser_compatibility_types.ts +0 -222
- package/src/compat/browser_detection.ts +0 -172
- package/src/compat/browser_version.ts +0 -44
- package/src/compat/can_patch_isobmff.ts +0 -30
- package/src/compat/can_rely_on_video_visibility_and_size.ts +0 -52
- package/src/compat/can_reuse_media_keys.ts +0 -20
- package/src/compat/change_source_buffer_type.ts +0 -66
- package/src/compat/clear_element_src.ts +0 -55
- package/src/compat/eme/close_session.ts +0 -111
- package/src/compat/eme/constants.ts +0 -21
- package/src/compat/eme/custom_key_system_access.ts +0 -67
- package/src/compat/eme/custom_media_keys/ie11_media_keys.ts +0 -186
- package/src/compat/eme/custom_media_keys/index.ts +0 -28
- package/src/compat/eme/custom_media_keys/moz_media_keys_constructor.ts +0 -88
- package/src/compat/eme/custom_media_keys/ms_media_keys_constructor.ts +0 -69
- package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +0 -235
- package/src/compat/eme/custom_media_keys/types.ts +0 -67
- package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +0 -308
- package/src/compat/eme/custom_media_keys/webkit_media_keys_constructor.ts +0 -50
- package/src/compat/eme/eme-api-implementation.ts +0 -318
- package/src/compat/eme/generate_key_request.ts +0 -162
- package/src/compat/eme/get_init_data.ts +0 -159
- package/src/compat/eme/get_uuid_kid_from_keystatus_kid.ts +0 -37
- package/src/compat/eme/get_webkit_fairplay_initdata.ts +0 -75
- package/src/compat/eme/index.ts +0 -47
- package/src/compat/eme/load_session.ts +0 -67
- package/src/compat/enable_audio_track.ts +0 -33
- package/src/compat/event_listeners.ts +0 -566
- package/src/compat/fullscreen.ts +0 -87
- package/src/compat/get_start_date.ts +0 -48
- package/src/compat/has_issues_with_high_media_source_duration.ts +0 -27
- package/src/compat/index.ts +0 -87
- package/src/compat/is_codec_supported.ts +0 -40
- package/src/compat/is_debug_mode_enabled.ts +0 -12
- package/src/compat/is_node.ts +0 -18
- package/src/compat/is_offline.ts +0 -44
- package/src/compat/is_seeking_approximate.ts +0 -32
- package/src/compat/is_vtt_cue.ts +0 -30
- package/src/compat/make_vtt_cue.ts +0 -51
- package/src/compat/on_height_width_change.ts +0 -119
- package/src/compat/patch_webkit_source_buffer.ts +0 -89
- package/src/compat/remove_cue.ts +0 -64
- package/src/compat/should_favour_custom_safari_EME.ts +0 -34
- package/src/compat/should_prevent_seeking_at_0_initially.ts +0 -19
- package/src/compat/should_reload_media_source_on_decipherability_update.ts +0 -32
- package/src/compat/should_renew_media_key_system_access.ts +0 -26
- package/src/compat/should_unset_media_keys.ts +0 -27
- package/src/compat/should_validate_metadata.ts +0 -27
- package/src/compat/should_wait_for_data_before_loaded.ts +0 -35
- package/src/compat/should_wait_for_have_enough_data.ts +0 -17
- package/src/config.ts +0 -32
- package/src/core/README.md +0 -56
- package/src/core/adaptive/README.md +0 -147
- package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +0 -548
- package/src/core/adaptive/adaptive_representation_selector.ts +0 -916
- package/src/core/adaptive/buffer_based_chooser.ts +0 -264
- package/src/core/adaptive/guess_based_chooser.ts +0 -309
- package/src/core/adaptive/index.ts +0 -45
- package/src/core/adaptive/network_analyzer.ts +0 -419
- package/src/core/adaptive/utils/__tests__/bandwith_estimator.test.ts +0 -134
- package/src/core/adaptive/utils/__tests__/ewma.test.ts +0 -79
- package/src/core/adaptive/utils/__tests__/filter_by_bitrate.test.ts +0 -56
- package/src/core/adaptive/utils/__tests__/filter_by_width.test.ts +0 -60
- package/src/core/adaptive/utils/__tests__/get_buffer_levels.test.ts +0 -48
- package/src/core/adaptive/utils/__tests__/select_optimal_representation.test.ts +0 -243
- package/src/core/adaptive/utils/bandwidth_estimator.ts +0 -88
- package/src/core/adaptive/utils/ewma.ts +0 -59
- package/src/core/adaptive/utils/filter_by_bitrate.ts +0 -46
- package/src/core/adaptive/utils/filter_by_width.ts +0 -49
- package/src/core/adaptive/utils/get_buffer_levels.ts +0 -50
- package/src/core/adaptive/utils/last_estimate_storage.ts +0 -79
- package/src/core/adaptive/utils/pending_requests_store.ts +0 -147
- package/src/core/adaptive/utils/representation_score_calculator.ts +0 -168
- package/src/core/adaptive/utils/select_optimal_representation.ts +0 -54
- package/src/core/api/README.md +0 -36
- package/src/core/api/__tests__/option_utils.test.ts +0 -1668
- package/src/core/api/__tests__/public_api.test.ts +0 -857
- package/src/core/api/__tests__/utils.test.ts +0 -195
- package/src/core/api/debug/buffer_graph.ts +0 -244
- package/src/core/api/debug/buffer_size_graph.ts +0 -130
- package/src/core/api/debug/constants.ts +0 -2
- package/src/core/api/debug/index.ts +0 -3
- package/src/core/api/debug/modules/general_info.ts +0 -213
- package/src/core/api/debug/modules/segment_buffer_content.ts +0 -155
- package/src/core/api/debug/modules/segment_buffer_size.ts +0 -48
- package/src/core/api/debug/render.ts +0 -40
- package/src/core/api/debug/utils.ts +0 -103
- package/src/core/api/index.ts +0 -27
- package/src/core/api/option_utils.ts +0 -700
- package/src/core/api/playback_observer.ts +0 -994
- package/src/core/api/public_api.ts +0 -3247
- package/src/core/api/tracks_management/__tests__/media_element_track_choice_manager.test.ts +0 -184
- package/src/core/api/tracks_management/media_element_track_choice_manager.ts +0 -975
- package/src/core/api/tracks_management/track_choice_manager.ts +0 -1280
- package/src/core/api/utils.ts +0 -216
- package/src/core/decrypt/README.md +0 -22
- package/src/core/decrypt/__tests__/__global__/get_license.test.ts +0 -422
- package/src/core/decrypt/__tests__/__global__/init_data.test.ts +0 -677
- package/src/core/decrypt/__tests__/__global__/media_key_system_access.test.ts +0 -528
- package/src/core/decrypt/__tests__/__global__/media_keys.test.ts +0 -343
- package/src/core/decrypt/__tests__/__global__/server_certificate.test.ts +0 -264
- package/src/core/decrypt/__tests__/__global__/utils.ts +0 -491
- package/src/core/decrypt/attach_media_keys.ts +0 -121
- package/src/core/decrypt/clear_on_stop.ts +0 -47
- package/src/core/decrypt/content_decryptor.ts +0 -1246
- package/src/core/decrypt/create_or_load_session.ts +0 -133
- package/src/core/decrypt/create_session.ts +0 -214
- package/src/core/decrypt/dispose_decryption_resources.ts +0 -54
- package/src/core/decrypt/find_key_system.ts +0 -376
- package/src/core/decrypt/get_key_system_configuration.ts +0 -51
- package/src/core/decrypt/get_media_keys.ts +0 -147
- package/src/core/decrypt/index.ts +0 -36
- package/src/core/decrypt/init_media_keys.ts +0 -60
- package/src/core/decrypt/session_events_listener.ts +0 -386
- package/src/core/decrypt/set_server_certificate.ts +0 -105
- package/src/core/decrypt/types.ts +0 -404
- package/src/core/decrypt/utils/__tests__/are_init_values_compatible.test.ts +0 -261
- package/src/core/decrypt/utils/__tests__/clean_old_loaded_sessions.test.ts +0 -158
- package/src/core/decrypt/utils/__tests__/clean_old_stored_persistent_info.test.ts +0 -133
- package/src/core/decrypt/utils/are_init_values_compatible.ts +0 -140
- package/src/core/decrypt/utils/check_key_statuses.ts +0 -193
- package/src/core/decrypt/utils/clean_old_loaded_sessions.ts +0 -45
- package/src/core/decrypt/utils/clean_old_stored_persistent_info.ts +0 -48
- package/src/core/decrypt/utils/get_drm_system_id.ts +0 -42
- package/src/core/decrypt/utils/init_data_values_container.ts +0 -119
- package/src/core/decrypt/utils/is_session_usable.ts +0 -62
- package/src/core/decrypt/utils/key_id_comparison.ts +0 -57
- package/src/core/decrypt/utils/key_session_record.ts +0 -174
- package/src/core/decrypt/utils/loaded_sessions_store.ts +0 -505
- package/src/core/decrypt/utils/media_keys_infos_store.ts +0 -85
- package/src/core/decrypt/utils/persistent_sessions_store.ts +0 -358
- package/src/core/decrypt/utils/serializable_bytes.ts +0 -59
- package/src/core/decrypt/utils/server_certificate_store.ts +0 -133
- package/src/core/fetchers/README.md +0 -84
- package/src/core/fetchers/cdn_prioritizer.ts +0 -207
- package/src/core/fetchers/index.ts +0 -38
- package/src/core/fetchers/manifest/index.ts +0 -28
- package/src/core/fetchers/manifest/manifest_fetcher.ts +0 -798
- package/src/core/fetchers/segment/__tests__/task_prioritizer.test.ts +0 -763
- package/src/core/fetchers/segment/index.ts +0 -28
- package/src/core/fetchers/segment/prioritized_segment_fetcher.ts +0 -113
- package/src/core/fetchers/segment/segment_fetcher.ts +0 -482
- package/src/core/fetchers/segment/segment_fetcher_creator.ts +0 -129
- package/src/core/fetchers/segment/task_prioritizer.ts +0 -455
- package/src/core/fetchers/utils/error_selector.ts +0 -38
- package/src/core/fetchers/utils/schedule_request.ts +0 -493
- package/src/core/init/README.md +0 -81
- package/src/core/init/directfile_content_initializer.ts +0 -310
- package/src/core/init/index.ts +0 -22
- package/src/core/init/media_source_content_initializer.ts +0 -878
- package/src/core/init/types.ts +0 -266
- package/src/core/init/utils/__tests__/are_same_stream_events.test.ts +0 -84
- package/src/core/init/utils/__tests__/refresh_scheduled_events_list.test.ts +0 -94
- package/src/core/init/utils/content_time_boundaries_observer.ts +0 -646
- package/src/core/init/utils/create_media_source.ts +0 -139
- package/src/core/init/utils/create_stream_playback_observer.ts +0 -132
- package/src/core/init/utils/end_of_stream.ts +0 -108
- package/src/core/init/utils/get_initial_time.ts +0 -165
- package/src/core/init/utils/get_loaded_reference.ts +0 -82
- package/src/core/init/utils/initial_seek_and_play.ts +0 -237
- package/src/core/init/utils/initialize_content_decryption.ts +0 -172
- package/src/core/init/utils/media_source_duration_updater.ts +0 -349
- package/src/core/init/utils/rebuffering_controller.ts +0 -642
- package/src/core/init/utils/stream_events_emitter/are_same_stream_events.ts +0 -42
- package/src/core/init/utils/stream_events_emitter/index.ts +0 -22
- package/src/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.ts +0 -74
- package/src/core/init/utils/stream_events_emitter/stream_events_emitter.ts +0 -252
- package/src/core/init/utils/stream_events_emitter/types.ts +0 -46
- package/src/core/init/utils/throw_on_media_error.ts +0 -74
- package/src/core/segment_buffers/README.md +0 -219
- package/src/core/segment_buffers/garbage_collector.ts +0 -177
- package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +0 -650
- package/src/core/segment_buffers/implementations/audio_video/index.ts +0 -18
- package/src/core/segment_buffers/implementations/image/image_segment_buffer.ts +0 -152
- package/src/core/segment_buffers/implementations/image/index.ts +0 -18
- package/src/core/segment_buffers/implementations/index.ts +0 -20
- package/src/core/segment_buffers/implementations/text/html/__tests__/utils.test.ts +0 -343
- package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +0 -527
- package/src/core/segment_buffers/implementations/text/html/index.ts +0 -24
- package/src/core/segment_buffers/implementations/text/html/parsers.ts +0 -49
- package/src/core/segment_buffers/implementations/text/html/text_track_cues_store.ts +0 -391
- package/src/core/segment_buffers/implementations/text/html/types.ts +0 -23
- package/src/core/segment_buffers/implementations/text/html/update_proportional_elements.ts +0 -93
- package/src/core/segment_buffers/implementations/text/html/utils.ts +0 -139
- 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 -340
- package/src/core/segment_buffers/implementations/text/native/parsers.ts +0 -47
- package/src/core/segment_buffers/implementations/types.ts +0 -386
- package/src/core/segment_buffers/implementations/utils/manual_time_ranges.ts +0 -80
- package/src/core/segment_buffers/index.ts +0 -67
- package/src/core/segment_buffers/inventory/buffered_history.ts +0 -131
- package/src/core/segment_buffers/inventory/index.ts +0 -30
- package/src/core/segment_buffers/inventory/segment_inventory.ts +0 -1111
- package/src/core/segment_buffers/inventory/types.ts +0 -35
- package/src/core/segment_buffers/segment_buffers_store.ts +0 -383
- package/src/core/stream/README.md +0 -59
- package/src/core/stream/adaptation/adaptation_stream.ts +0 -378
- package/src/core/stream/adaptation/index.ts +0 -20
- package/src/core/stream/adaptation/types.ts +0 -199
- package/src/core/stream/adaptation/utils/create_representation_estimator.ts +0 -114
- package/src/core/stream/index.ts +0 -38
- package/src/core/stream/orchestrator/README.md +0 -349
- package/src/core/stream/orchestrator/get_time_ranges_for_content.ts +0 -70
- package/src/core/stream/orchestrator/index.ts +0 -30
- package/src/core/stream/orchestrator/stream_orchestrator.ts +0 -664
- package/src/core/stream/period/index.ts +0 -20
- package/src/core/stream/period/period_stream.ts +0 -469
- package/src/core/stream/period/types.ts +0 -132
- package/src/core/stream/period/utils/get_adaptation_switch_strategy.ts +0 -287
- package/src/core/stream/representation/README.md +0 -16
- package/src/core/stream/representation/index.ts +0 -20
- package/src/core/stream/representation/representation_stream.ts +0 -474
- package/src/core/stream/representation/types.ts +0 -292
- package/src/core/stream/representation/utils/append_segment_to_buffer.ts +0 -77
- package/src/core/stream/representation/utils/check_for_discontinuity.ts +0 -305
- package/src/core/stream/representation/utils/downloading_queue.ts +0 -603
- package/src/core/stream/representation/utils/force_garbage_collection.ts +0 -113
- package/src/core/stream/representation/utils/get_buffer_status.ts +0 -322
- package/src/core/stream/representation/utils/get_needed_segments.ts +0 -617
- package/src/core/stream/representation/utils/get_segment_priority.ts +0 -43
- package/src/core/stream/representation/utils/push_init_segment.ts +0 -85
- package/src/core/stream/representation/utils/push_media_segment.ts +0 -113
- package/src/default_config.ts +0 -1293
- package/src/errors/README.md +0 -6
- package/src/errors/__tests__/assertion_error.test.ts +0 -26
- package/src/errors/__tests__/encrypted_media_error.test.ts +0 -45
- package/src/errors/__tests__/error_message.test.ts +0 -23
- package/src/errors/__tests__/format_error.test.ts +0 -62
- package/src/errors/__tests__/is_known_error.test.ts +0 -65
- package/src/errors/__tests__/media_error.test.ts +0 -55
- package/src/errors/__tests__/network_error.test.ts +0 -84
- package/src/errors/__tests__/other_error.test.ts +0 -53
- package/src/errors/__tests__/request_error.test.ts +0 -45
- package/src/errors/assertion_error.ts +0 -40
- package/src/errors/custom_loader_error.ts +0 -57
- package/src/errors/encrypted_media_error.ts +0 -71
- package/src/errors/error_codes.ts +0 -149
- package/src/errors/error_message.ts +0 -30
- package/src/errors/format_error.ts +0 -39
- package/src/errors/index.ts +0 -52
- package/src/errors/is_known_error.ts +0 -35
- package/src/errors/media_error.ts +0 -118
- package/src/errors/network_error.ts +0 -74
- package/src/errors/other_error.ts +0 -50
- package/src/errors/request_error.ts +0 -76
- package/src/experimental/README.md +0 -16
- package/src/experimental/features/__tests__/dash_wasm.test.ts +0 -44
- package/src/experimental/features/__tests__/debug_element.test.ts +0 -12
- package/src/experimental/features/__tests__/index.test.ts +0 -19
- package/src/experimental/features/__tests__/local.test.ts +0 -35
- package/src/experimental/features/__tests__/metaplaylist.test.ts +0 -35
- package/src/experimental/features/dash_wasm.ts +0 -41
- package/src/experimental/features/debug_element.ts +0 -13
- package/src/experimental/features/index.ts +0 -20
- package/src/experimental/features/local.ts +0 -28
- package/src/experimental/features/metaplaylist.ts +0 -28
- package/src/experimental/index.ts +0 -5
- package/src/experimental/tools/VideoThumbnailLoader/features/dash.ts +0 -23
- package/src/experimental/tools/VideoThumbnailLoader/features/metaplaylist.ts +0 -23
- package/src/experimental/tools/VideoThumbnailLoader/index.ts +0 -25
- package/src/experimental/tools/VideoThumbnailLoader/load_and_push_segment.ts +0 -77
- package/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts +0 -75
- package/src/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.ts +0 -54
- package/src/experimental/tools/VideoThumbnailLoader/types.ts +0 -39
- package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +0 -423
- package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader_error.ts +0 -34
- package/src/experimental/tools/createMetaplaylist/get_duration_from_manifest.ts +0 -141
- package/src/experimental/tools/createMetaplaylist/index.ts +0 -72
- package/src/experimental/tools/index.ts +0 -27
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/capabilities.test.ts +0 -37
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +0 -140
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +0 -153
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/decodingInfos.test.ts +0 -405
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/defaultCodecFinder.test.ts +0 -136
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaContentType.test.ts +0 -294
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +0 -189
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/utils.test.ts +0 -361
- package/src/experimental/tools/mediaCapabilitiesProber/api/index.ts +0 -184
- package/src/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.ts +0 -136
- package/src/experimental/tools/mediaCapabilitiesProber/capabilities.ts +0 -169
- package/src/experimental/tools/mediaCapabilitiesProber/index.ts +0 -18
- package/src/experimental/tools/mediaCapabilitiesProber/log.ts +0 -21
- package/src/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.ts +0 -67
- package/src/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.ts +0 -89
- package/src/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.ts +0 -100
- package/src/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.ts +0 -66
- package/src/experimental/tools/mediaCapabilitiesProber/probers/index.ts +0 -44
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.ts +0 -66
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/format.ts +0 -100
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts +0 -105
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +0 -54
- package/src/experimental/tools/mediaCapabilitiesProber/types.ts +0 -75
- package/src/experimental/tools/mediaCapabilitiesProber/utils.ts +0 -107
- package/src/experimental/tools/parseBIFThumbnails.ts +0 -39
- package/src/features/README.md +0 -11
- package/src/features/__tests__/add_features.test.ts +0 -69
- package/src/features/__tests__/initialize_features.test.ts +0 -674
- package/src/features/add_features.ts +0 -37
- package/src/features/features_object.ts +0 -37
- package/src/features/index.ts +0 -40
- package/src/features/initialize_features.ts +0 -136
- package/src/features/list/__tests__/bif_parser.test.ts +0 -30
- package/src/features/list/__tests__/dash.test.ts +0 -41
- package/src/features/list/__tests__/directfile.test.ts +0 -35
- package/src/features/list/__tests__/eme.test.ts +0 -28
- package/src/features/list/__tests__/html_sami_parser.test.ts +0 -33
- package/src/features/list/__tests__/html_srt_parser.test.ts +0 -33
- package/src/features/list/__tests__/html_text_buffer.test.ts +0 -29
- package/src/features/list/__tests__/html_ttml_parser.test.ts +0 -33
- package/src/features/list/__tests__/html_vtt_parser.test.ts +0 -33
- package/src/features/list/__tests__/image_buffer.test.ts +0 -28
- package/src/features/list/__tests__/index.test.ts +0 -55
- package/src/features/list/__tests__/native_sami_parser.test.ts +0 -33
- package/src/features/list/__tests__/native_srt_parser.test.ts +0 -33
- package/src/features/list/__tests__/native_text_buffer.test.ts +0 -29
- package/src/features/list/__tests__/native_ttml_parser.test.ts +0 -33
- package/src/features/list/__tests__/native_vtt_parser.test.ts +0 -33
- package/src/features/list/__tests__/smooth.test.ts +0 -36
- package/src/features/list/bif_parser.ts +0 -31
- package/src/features/list/dash.ts +0 -36
- package/src/features/list/directfile.ts +0 -35
- package/src/features/list/eme.ts +0 -29
- package/src/features/list/html_sami_parser.ts +0 -31
- package/src/features/list/html_srt_parser.ts +0 -31
- package/src/features/list/html_text_buffer.ts +0 -29
- package/src/features/list/html_ttml_parser.ts +0 -31
- package/src/features/list/html_vtt_parser.ts +0 -31
- package/src/features/list/image_buffer.ts +0 -29
- package/src/features/list/index.ts +0 -32
- package/src/features/list/native_sami_parser.ts +0 -32
- package/src/features/list/native_srt_parser.ts +0 -32
- package/src/features/list/native_text_buffer.ts +0 -30
- package/src/features/list/native_ttml_parser.ts +0 -32
- package/src/features/list/native_vtt_parser.ts +0 -32
- package/src/features/list/smooth.ts +0 -32
- package/src/features/types.ts +0 -183
- package/src/index.ts +0 -38
- package/src/log.ts +0 -22
- package/src/manifest/README.md +0 -55
- package/src/manifest/__tests__/adaptation.test.ts +0 -485
- package/src/manifest/__tests__/manifest.test.ts +0 -428
- package/src/manifest/__tests__/period.test.ts +0 -769
- package/src/manifest/__tests__/representation.test.ts +0 -297
- package/src/manifest/__tests__/update_period_in_place.test.ts +0 -1074
- package/src/manifest/__tests__/update_periods.test.ts +0 -845
- package/src/manifest/adaptation.ts +0 -294
- package/src/manifest/index.ts +0 -67
- package/src/manifest/manifest.ts +0 -811
- package/src/manifest/period.ts +0 -211
- package/src/manifest/representation.ts +0 -451
- package/src/manifest/representation_index/__tests__/static.test.ts +0 -74
- package/src/manifest/representation_index/index.ts +0 -31
- package/src/manifest/representation_index/static.ts +0 -158
- package/src/manifest/representation_index/types.ts +0 -433
- package/src/manifest/types.ts +0 -33
- package/src/manifest/update_period_in_place.ts +0 -142
- package/src/manifest/update_periods.ts +0 -201
- package/src/manifest/utils.ts +0 -60
- package/src/minimal.ts +0 -34
- package/src/parsers/README.md +0 -12
- package/src/parsers/containers/isobmff/constants.ts +0 -24
- package/src/parsers/containers/isobmff/create_box.ts +0 -81
- package/src/parsers/containers/isobmff/drm/index.ts +0 -17
- package/src/parsers/containers/isobmff/drm/playready.ts +0 -45
- package/src/parsers/containers/isobmff/get_box.ts +0 -278
- package/src/parsers/containers/isobmff/index.ts +0 -51
- package/src/parsers/containers/isobmff/read.ts +0 -105
- package/src/parsers/containers/isobmff/take_pssh_out.ts +0 -101
- package/src/parsers/containers/isobmff/utils.ts +0 -555
- package/src/parsers/containers/matroska/index.ts +0 -21
- package/src/parsers/containers/matroska/utils.ts +0 -313
- package/src/parsers/images/bif.ts +0 -128
- package/src/parsers/manifest/dash/common/__tests__/attach_trickmode_track.test.ts +0 -65
- package/src/parsers/manifest/dash/common/__tests__/convert_supplemental_codecs.test.ts +0 -37
- package/src/parsers/manifest/dash/common/__tests__/flatten_overlapping_period.test.ts +0 -162
- package/src/parsers/manifest/dash/common/__tests__/get_clock_offset.test.ts +0 -65
- package/src/parsers/manifest/dash/common/__tests__/get_http_utc-timing_url.test.ts +0 -165
- package/src/parsers/manifest/dash/common/__tests__/get_periods_time_infos.test.ts +0 -118
- package/src/parsers/manifest/dash/common/__tests__/manifest_bounds_calculator.test.ts +0 -290
- package/src/parsers/manifest/dash/common/__tests__/parse_availability_start_time.test.ts +0 -63
- package/src/parsers/manifest/dash/common/attach_trickmode_track.ts +0 -55
- package/src/parsers/manifest/dash/common/convert_supplemental_codecs.ts +0 -32
- package/src/parsers/manifest/dash/common/flatten_overlapping_periods.ts +0 -87
- package/src/parsers/manifest/dash/common/get_clock_offset.ts +0 -41
- package/src/parsers/manifest/dash/common/get_hdr_information.ts +0 -94
- package/src/parsers/manifest/dash/common/get_http_utc-timing_url.ts +0 -46
- package/src/parsers/manifest/dash/common/get_minimum_and_maximum_positions.ts +0 -39
- package/src/parsers/manifest/dash/common/get_periods_time_infos.ts +0 -91
- package/src/parsers/manifest/dash/common/index.ts +0 -40
- package/src/parsers/manifest/dash/common/indexes/__tests__/tokens.test.ts +0 -60
- package/src/parsers/manifest/dash/common/indexes/base.ts +0 -444
- package/src/parsers/manifest/dash/common/indexes/get_init_segment.ts +0 -55
- package/src/parsers/manifest/dash/common/indexes/get_segments_from_timeline.ts +0 -148
- package/src/parsers/manifest/dash/common/indexes/index.ts +0 -39
- package/src/parsers/manifest/dash/common/indexes/list.ts +0 -338
- package/src/parsers/manifest/dash/common/indexes/template.ts +0 -652
- package/src/parsers/manifest/dash/common/indexes/timeline/__tests__/parse_s_element.test.ts +0 -115
- package/src/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.ts +0 -54
- package/src/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.ts +0 -102
- package/src/parsers/manifest/dash/common/indexes/timeline/convert_element_to_index_segment.ts +0 -66
- package/src/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.ts +0 -153
- package/src/parsers/manifest/dash/common/indexes/timeline/index.ts +0 -21
- package/src/parsers/manifest/dash/common/indexes/timeline/parse_s_element.ts +0 -72
- package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +0 -1049
- package/src/parsers/manifest/dash/common/indexes/tokens.ts +0 -127
- package/src/parsers/manifest/dash/common/indexes/utils.ts +0 -32
- package/src/parsers/manifest/dash/common/infer_adaptation_type.ts +0 -142
- package/src/parsers/manifest/dash/common/manifest_bounds_calculator.ts +0 -165
- package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +0 -569
- package/src/parsers/manifest/dash/common/parse_availability_start_time.ts +0 -35
- package/src/parsers/manifest/dash/common/parse_mpd.ts +0 -399
- package/src/parsers/manifest/dash/common/parse_periods.ts +0 -363
- package/src/parsers/manifest/dash/common/parse_representation_index.ts +0 -199
- package/src/parsers/manifest/dash/common/parse_representations.ts +0 -352
- package/src/parsers/manifest/dash/common/resolve_base_urls.ts +0 -58
- package/src/parsers/manifest/dash/index.ts +0 -22
- package/src/parsers/manifest/dash/js-parser/__tests__/parse_from_document.test.ts +0 -45
- package/src/parsers/manifest/dash/js-parser/index.ts +0 -18
- package/src/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.ts +0 -381
- package/src/parsers/manifest/dash/js-parser/node_parsers/BaseURL.ts +0 -35
- package/src/parsers/manifest/dash/js-parser/node_parsers/ContentComponent.ts +0 -49
- package/src/parsers/manifest/dash/js-parser/node_parsers/ContentProtection.ts +0 -94
- package/src/parsers/manifest/dash/js-parser/node_parsers/EventStream.ts +0 -117
- package/src/parsers/manifest/dash/js-parser/node_parsers/Initialization.ts +0 -48
- package/src/parsers/manifest/dash/js-parser/node_parsers/MPD.ts +0 -180
- package/src/parsers/manifest/dash/js-parser/node_parsers/Period.ts +0 -152
- package/src/parsers/manifest/dash/js-parser/node_parsers/Representation.ts +0 -234
- package/src/parsers/manifest/dash/js-parser/node_parsers/SegmentBase.ts +0 -112
- package/src/parsers/manifest/dash/js-parser/node_parsers/SegmentList.ts +0 -50
- package/src/parsers/manifest/dash/js-parser/node_parsers/SegmentTemplate.ts +0 -98
- package/src/parsers/manifest/dash/js-parser/node_parsers/SegmentTimeline.ts +0 -35
- package/src/parsers/manifest/dash/js-parser/node_parsers/SegmentURL.ts +0 -63
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/AdaptationSet.test.ts +0 -407
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/ContentComponent.test.ts +0 -67
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/ContentProtection.test.ts +0 -223
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/Initialization.test.ts +0 -139
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/SegmentTimeline.test.ts +0 -119
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/SegmentURL.test.ts +0 -205
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/utils.test.ts +0 -218
- package/src/parsers/manifest/dash/js-parser/node_parsers/utils.ts +0 -384
- package/src/parsers/manifest/dash/js-parser/parse_from_document.ts +0 -129
- package/src/parsers/manifest/dash/node_parser_types.ts +0 -431
- package/src/parsers/manifest/dash/parsers_types.ts +0 -91
- package/src/parsers/manifest/dash/wasm-parser/Cargo.lock +0 -25
- package/src/parsers/manifest/dash/wasm-parser/Cargo.toml +0 -16
- package/src/parsers/manifest/dash/wasm-parser/README.md +0 -267
- package/src/parsers/manifest/dash/wasm-parser/index.ts +0 -21
- package/src/parsers/manifest/dash/wasm-parser/rs/errors.rs +0 -28
- package/src/parsers/manifest/dash/wasm-parser/rs/events.rs +0 -373
- package/src/parsers/manifest/dash/wasm-parser/rs/lib.rs +0 -85
- package/src/parsers/manifest/dash/wasm-parser/rs/processor/attributes.rs +0 -414
- package/src/parsers/manifest/dash/wasm-parser/rs/processor/mod.rs +0 -472
- package/src/parsers/manifest/dash/wasm-parser/rs/processor/s_element.rs +0 -72
- package/src/parsers/manifest/dash/wasm-parser/rs/reader.rs +0 -17
- package/src/parsers/manifest/dash/wasm-parser/rs/reportable.rs +0 -147
- package/src/parsers/manifest/dash/wasm-parser/rs/utils.rs +0 -217
- package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +0 -477
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.ts +0 -343
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/BaseURL.ts +0 -38
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/ContentComponent.ts +0 -53
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.ts +0 -62
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.ts +0 -144
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/MPD.ts +0 -183
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/Period.ts +0 -180
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/Representation.ts +0 -215
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/Scheme.ts +0 -44
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/SegmentBase.ts +0 -115
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/SegmentList.ts +0 -61
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/SegmentTemplate.ts +0 -133
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/SegmentUrl.ts +0 -70
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/XLink.ts +0 -66
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/index.ts +0 -17
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/root.ts +0 -66
- package/src/parsers/manifest/dash/wasm-parser/ts/parsers_stack.ts +0 -80
- package/src/parsers/manifest/dash/wasm-parser/ts/types.ts +0 -298
- package/src/parsers/manifest/dash/wasm-parser/ts/utils.ts +0 -47
- package/src/parsers/manifest/index.ts +0 -17
- package/src/parsers/manifest/local/index.ts +0 -25
- package/src/parsers/manifest/local/parse_local_manifest.ts +0 -164
- package/src/parsers/manifest/local/representation_index.ts +0 -246
- package/src/parsers/manifest/local/types.ts +0 -291
- package/src/parsers/manifest/metaplaylist/index.ts +0 -28
- package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +0 -335
- package/src/parsers/manifest/metaplaylist/representation_index.ts +0 -251
- package/src/parsers/manifest/smooth/create_parser.ts +0 -699
- package/src/parsers/manifest/smooth/get_codecs.ts +0 -55
- package/src/parsers/manifest/smooth/index.ts +0 -26
- package/src/parsers/manifest/smooth/parse_C_nodes.ts +0 -69
- package/src/parsers/manifest/smooth/parse_protection_node.ts +0 -72
- package/src/parsers/manifest/smooth/representation_index.ts +0 -704
- package/src/parsers/manifest/smooth/utils/add_segment_infos.ts +0 -77
- package/src/parsers/manifest/smooth/utils/parseBoolean.ts +0 -31
- package/src/parsers/manifest/smooth/utils/reduceChildren.ts +0 -36
- package/src/parsers/manifest/smooth/utils/tokens.ts +0 -46
- package/src/parsers/manifest/types.ts +0 -395
- package/src/parsers/manifest/utils/__tests__/get_first_time_from_adaptations.test.ts +0 -161
- package/src/parsers/manifest/utils/__tests__/get_last_time_from_adaptation.test.ts +0 -161
- package/src/parsers/manifest/utils/__tests__/index_helpers.test.ts +0 -55
- package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +0 -546
- package/src/parsers/manifest/utils/check_manifest_ids.ts +0 -83
- package/src/parsers/manifest/utils/clear_timeline_from_position.ts +0 -74
- package/src/parsers/manifest/utils/get_first_time_from_adaptation.ts +0 -48
- package/src/parsers/manifest/utils/get_last_time_from_adaptation.ts +0 -50
- package/src/parsers/manifest/utils/get_maximum_positions.ts +0 -87
- package/src/parsers/manifest/utils/get_minimum_position.ts +0 -80
- package/src/parsers/manifest/utils/index_helpers.ts +0 -204
- package/src/parsers/manifest/utils/update_segment_timeline.ts +0 -141
- package/src/parsers/texttracks/index.ts +0 -21
- package/src/parsers/texttracks/sami/html.ts +0 -219
- package/src/parsers/texttracks/sami/native.ts +0 -192
- package/src/parsers/texttracks/srt/__tests__/find_end_of_cue_block.test.ts +0 -99
- package/src/parsers/texttracks/srt/__tests__/get_cue_blocks.test.ts +0 -119
- package/src/parsers/texttracks/srt/__tests__/parse_cue.test.ts +0 -123
- package/src/parsers/texttracks/srt/__tests__/parse_timestamp.test.ts +0 -36
- package/src/parsers/texttracks/srt/find_end_of_cue_block.ts +0 -46
- package/src/parsers/texttracks/srt/get_cue_blocks.ts +0 -49
- package/src/parsers/texttracks/srt/html.ts +0 -182
- package/src/parsers/texttracks/srt/native.ts +0 -74
- package/src/parsers/texttracks/srt/parse_cue.ts +0 -76
- package/src/parsers/texttracks/srt/parse_timestamp.ts +0 -37
- package/src/parsers/texttracks/ttml/__tests__/resolve_styles_inheritance.test.ts +0 -248
- package/src/parsers/texttracks/ttml/get_parameters.ts +0 -106
- package/src/parsers/texttracks/ttml/get_styling.ts +0 -146
- package/src/parsers/texttracks/ttml/get_time_delimiters.ts +0 -49
- package/src/parsers/texttracks/ttml/html/__tests__/__global__/html_ttml_parser.test.test.ts +0 -190
- package/src/parsers/texttracks/ttml/html/__tests__/generate_css_test_outline.test.ts +0 -32
- package/src/parsers/texttracks/ttml/html/__tests__/ttml_color_to_css_color.test.ts +0 -62
- package/src/parsers/texttracks/ttml/html/apply_default_ttml_paragraph_style.ts +0 -67
- package/src/parsers/texttracks/ttml/html/apply_extent.ts +0 -65
- package/src/parsers/texttracks/ttml/html/apply_font_size.ts +0 -62
- package/src/parsers/texttracks/ttml/html/apply_line_height.ts +0 -50
- package/src/parsers/texttracks/ttml/html/apply_origin.ts +0 -64
- package/src/parsers/texttracks/ttml/html/apply_padding.ts +0 -141
- package/src/parsers/texttracks/ttml/html/create_element.ts +0 -549
- package/src/parsers/texttracks/ttml/html/generate_css_test_outline.ts +0 -46
- package/src/parsers/texttracks/ttml/html/index.ts +0 -23
- package/src/parsers/texttracks/ttml/html/parse_cue.ts +0 -65
- package/src/parsers/texttracks/ttml/html/parse_ttml_to_div.ts +0 -58
- package/src/parsers/texttracks/ttml/html/ttml_color_to_css_color.ts +0 -68
- package/src/parsers/texttracks/ttml/native/index.ts +0 -23
- package/src/parsers/texttracks/ttml/native/parse_cue.ts +0 -245
- package/src/parsers/texttracks/ttml/native/parse_ttml_to_vtt.ts +0 -39
- package/src/parsers/texttracks/ttml/parse_ttml.ts +0 -206
- package/src/parsers/texttracks/ttml/regexps.ts +0 -65
- package/src/parsers/texttracks/ttml/resolve_styles_inheritance.ts +0 -84
- package/src/parsers/texttracks/ttml/time_parsing.ts +0 -156
- package/src/parsers/texttracks/ttml/xml_utils.ts +0 -166
- package/src/parsers/texttracks/types.ts +0 -34
- package/src/parsers/texttracks/webvtt/__tests__/get_cue_blocks.test.ts +0 -218
- package/src/parsers/texttracks/webvtt/__tests__/get_style_blocks.test.ts +0 -65
- package/src/parsers/texttracks/webvtt/__tests__/parse_cue_block.test.ts +0 -249
- package/src/parsers/texttracks/webvtt/__tests__/parse_timestamp.test.ts +0 -39
- package/src/parsers/texttracks/webvtt/__tests__/utils.test.ts +0 -401
- package/src/parsers/texttracks/webvtt/get_cue_blocks.ts +0 -51
- package/src/parsers/texttracks/webvtt/get_style_blocks.ts +0 -56
- package/src/parsers/texttracks/webvtt/html/__tests__/convert_payload_to_html.test.ts +0 -106
- package/src/parsers/texttracks/webvtt/html/__tests__/create_default_style_elements.test.ts +0 -44
- package/src/parsers/texttracks/webvtt/html/__tests__/create_style_attribute.test.ts +0 -139
- package/src/parsers/texttracks/webvtt/html/__tests__/create_styled_element.test.ts +0 -140
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_style_block.test.ts +0 -345
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_webvtt_to_div.test.ts +0 -181
- package/src/parsers/texttracks/webvtt/html/__tests__/to_html.test.ts +0 -234
- package/src/parsers/texttracks/webvtt/html/convert_payload_to_html.ts +0 -46
- package/src/parsers/texttracks/webvtt/html/create_default_style_elements.ts +0 -26
- package/src/parsers/texttracks/webvtt/html/create_style_attribute.ts +0 -222
- package/src/parsers/texttracks/webvtt/html/create_styled_element.ts +0 -95
- package/src/parsers/texttracks/webvtt/html/index.ts +0 -25
- package/src/parsers/texttracks/webvtt/html/parse_style_block.ts +0 -76
- package/src/parsers/texttracks/webvtt/html/parse_webvtt_to_div.ts +0 -67
- package/src/parsers/texttracks/webvtt/html/to_html.ts +0 -96
- package/src/parsers/texttracks/webvtt/native/index.ts +0 -23
- package/src/parsers/texttracks/webvtt/native/parse_vtt_to_cues.ts +0 -70
- package/src/parsers/texttracks/webvtt/native/set_settings_on_cue.ts +0 -95
- package/src/parsers/texttracks/webvtt/native/to_native_cue.ts +0 -34
- package/src/parsers/texttracks/webvtt/parse_cue_block.ts +0 -128
- package/src/parsers/texttracks/webvtt/parse_timestamp.ts +0 -40
- package/src/parsers/texttracks/webvtt/utils.ts +0 -135
- package/src/public_types.ts +0 -846
- package/src/tools/README.md +0 -4
- package/src/tools/TextTrackRenderer/index.ts +0 -28
- package/src/tools/TextTrackRenderer/text_track_renderer.ts +0 -107
- package/src/tools/index.ts +0 -20
- package/src/tools/string_utils.ts +0 -24
- package/src/transports/README.md +0 -276
- package/src/transports/dash/add_segment_integrity_checks_to_loader.ts +0 -98
- package/src/transports/dash/construct_segment_url.ts +0 -28
- package/src/transports/dash/extract_complete_chunks.ts +0 -66
- package/src/transports/dash/get_events_out_of_emsgs.ts +0 -105
- package/src/transports/dash/image_pipelines.ts +0 -122
- package/src/transports/dash/index.ts +0 -23
- package/src/transports/dash/init_segment_loader.ts +0 -114
- package/src/transports/dash/low_latency_segment_loader.ts +0 -87
- package/src/transports/dash/manifest_parser.ts +0 -325
- package/src/transports/dash/pipelines.ts +0 -72
- package/src/transports/dash/segment_loader.ts +0 -249
- package/src/transports/dash/segment_parser.ts +0 -194
- package/src/transports/dash/text_loader.ts +0 -120
- package/src/transports/dash/text_parser.ts +0 -234
- package/src/transports/index.ts +0 -17
- package/src/transports/local/index.ts +0 -18
- package/src/transports/local/pipelines.ts +0 -100
- package/src/transports/local/segment_loader.ts +0 -198
- package/src/transports/local/segment_parser.ts +0 -101
- package/src/transports/local/text_parser.ts +0 -185
- package/src/transports/metaplaylist/README.md +0 -94
- package/src/transports/metaplaylist/index.ts +0 -23
- package/src/transports/metaplaylist/manifest_loader.ts +0 -62
- package/src/transports/metaplaylist/pipelines.ts +0 -425
- package/src/transports/smooth/extract_timings_infos.ts +0 -142
- package/src/transports/smooth/index.ts +0 -23
- package/src/transports/smooth/isobmff/__tests__/create_boxes.test.ts +0 -231
- package/src/transports/smooth/isobmff/create_audio_init_segment.ts +0 -84
- package/src/transports/smooth/isobmff/create_boxes.ts +0 -481
- package/src/transports/smooth/isobmff/create_init_segment.ts +0 -100
- package/src/transports/smooth/isobmff/create_traf_box.ts +0 -40
- package/src/transports/smooth/isobmff/create_video_init_segment.ts +0 -78
- package/src/transports/smooth/isobmff/get_aaces_header.ts +0 -62
- package/src/transports/smooth/isobmff/index.ts +0 -32
- package/src/transports/smooth/isobmff/parse_tfrf.ts +0 -57
- package/src/transports/smooth/isobmff/parse_tfxd.ts +0 -38
- package/src/transports/smooth/isobmff/patch_segment.ts +0 -171
- package/src/transports/smooth/pipelines.ts +0 -533
- package/src/transports/smooth/segment_loader.ts +0 -288
- package/src/transports/smooth/utils.ts +0 -106
- package/src/transports/types.ts +0 -809
- package/src/transports/utils/__tests__/byte_range.test.ts +0 -35
- package/src/transports/utils/__tests__/check_isobmff_integrity.test.ts +0 -148
- package/src/transports/utils/__tests__/find_complete_box.test.ts +0 -138
- package/src/transports/utils/__tests__/infer_segment_container.test.ts +0 -227
- package/src/transports/utils/byte_range.ts +0 -25
- package/src/transports/utils/call_custom_manifest_loader.ts +0 -147
- package/src/transports/utils/check_isobmff_integrity.ts +0 -50
- package/src/transports/utils/find_complete_box.ts +0 -63
- package/src/transports/utils/generate_manifest_loader.ts +0 -97
- package/src/transports/utils/get_isobmff_timing_infos.ts +0 -86
- package/src/transports/utils/infer_segment_container.ts +0 -56
- package/src/transports/utils/parse_text_track.ts +0 -176
- package/src/typings/README.md +0 -7
- package/src/typings/globals.d.ts +0 -83
- package/src/typings/next-tick.d.ts +0 -23
- package/src/utils/README.md +0 -5
- package/src/utils/__tests__/are_arrays_of_numbers_equal.test.ts +0 -86
- package/src/utils/__tests__/are_codecs_compatible.test.ts +0 -88
- package/src/utils/__tests__/array_find.test.ts +0 -113
- package/src/utils/__tests__/array_find_index.test.ts +0 -113
- package/src/utils/__tests__/array_includes.test.ts +0 -151
- package/src/utils/__tests__/assert.test.ts +0 -237
- package/src/utils/__tests__/assert_unreachable.test.ts +0 -40
- package/src/utils/__tests__/base64.test.ts +0 -147
- package/src/utils/__tests__/byte_parsing.test.ts +0 -267
- package/src/utils/__tests__/deep_merge.test.ts +0 -48
- package/src/utils/__tests__/event_emitter.test.ts +0 -579
- package/src/utils/__tests__/flat_map.test.ts +0 -71
- package/src/utils/__tests__/get_fuzzed_delay.test.ts +0 -32
- package/src/utils/__tests__/hash_buffer.test.ts +0 -105
- package/src/utils/__tests__/id_generator.test.ts +0 -80
- package/src/utils/__tests__/initialization_segment_cache.test.ts +0 -245
- package/src/utils/__tests__/is_non_empty_string.test.ts +0 -41
- package/src/utils/__tests__/is_null_or_undefined.test.ts +0 -33
- package/src/utils/__tests__/list_to_map.test.ts +0 -46
- package/src/utils/__tests__/logger.test.ts +0 -214
- package/src/utils/__tests__/noop.test.ts +0 -23
- package/src/utils/__tests__/object_assign.test.ts +0 -56
- package/src/utils/__tests__/object_values.test.ts +0 -26
- package/src/utils/__tests__/ranges.test.ts +0 -907
- package/src/utils/__tests__/resolve_url.test.ts +0 -100
- package/src/utils/__tests__/simple_set.test.ts +0 -57
- package/src/utils/__tests__/sorted_list.test.ts +0 -335
- package/src/utils/__tests__/starts_with.test.ts +0 -65
- package/src/utils/__tests__/string_parsing.test.ts +0 -267
- package/src/utils/__tests__/uniq.test.ts +0 -134
- package/src/utils/__tests__/warn_once.test.ts +0 -38
- package/src/utils/__tests__/weak_map_memory.test.ts +0 -188
- package/src/utils/are_arrays_of_numbers_equal.ts +0 -39
- package/src/utils/are_codecs_compatible.ts +0 -51
- package/src/utils/array_find.ts +0 -55
- package/src/utils/array_find_index.ts +0 -54
- package/src/utils/array_includes.ts +0 -93
- package/src/utils/assert.ts +0 -65
- package/src/utils/assert_unreachable.ts +0 -45
- package/src/utils/base64.ts +0 -153
- package/src/utils/byte_parsing.ts +0 -256
- package/src/utils/cancellable_sleep.ts +0 -41
- package/src/utils/create_cancellable_promise.ts +0 -69
- package/src/utils/deep_merge.ts +0 -49
- package/src/utils/event_emitter.ts +0 -147
- package/src/utils/flat_map.ts +0 -50
- package/src/utils/get_fuzzed_delay.ts +0 -27
- package/src/utils/hash_buffer.ts +0 -42
- package/src/utils/id_generator.ts +0 -35
- package/src/utils/initialization_segment_cache.ts +0 -68
- package/src/utils/is_non_empty_string.ts +0 -23
- package/src/utils/is_null_or_undefined.ts +0 -27
- package/src/utils/languages/ISO_639-1_to_ISO_639-3.ts +0 -207
- package/src/utils/languages/ISO_639-2_to_ISO_639-3.ts +0 -43
- package/src/utils/languages/__tests__/normalize.test.ts +0 -290
- package/src/utils/languages/index.ts +0 -29
- package/src/utils/languages/normalize.ts +0 -152
- package/src/utils/list_to_map.ts +0 -32
- package/src/utils/logger.ts +0 -100
- package/src/utils/noop.ts +0 -26
- package/src/utils/object_assign.ts +0 -60
- package/src/utils/object_values.ts +0 -31
- package/src/utils/ranges.ts +0 -499
- package/src/utils/reference.ts +0 -390
- package/src/utils/request/fetch.ts +0 -250
- package/src/utils/request/index.ts +0 -38
- package/src/utils/request/xhr.ts +0 -287
- package/src/utils/resolve_url.ts +0 -126
- package/src/utils/retry_promise_with_backoff.ts +0 -95
- package/src/utils/simple_set.ts +0 -67
- package/src/utils/sleep.ts +0 -14
- package/src/utils/slice_uint8array.ts +0 -53
- package/src/utils/sorted_list.ts +0 -240
- package/src/utils/starts_with.ts +0 -42
- package/src/utils/string_parsing.ts +0 -414
- package/src/utils/task_canceller.ts +0 -367
- package/src/utils/uniq.ts +0 -49
- package/src/utils/warn_once.ts +0 -34
- package/src/utils/weak_map_memory.ts +0 -89
- package/src/utils/wrapInPromise.ts +0 -24
- package/tsconfig.json +0 -28
- package/tsconfig.modules.json +0 -36
package/src/default_config.ts
DELETED
|
@@ -1,1293 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration file for the whole player.
|
|
3
|
-
* Feel free to tweak those values if you know what you're doing.
|
|
4
|
-
*
|
|
5
|
-
* Please not that you will need to re-build the whole project to take these
|
|
6
|
-
* modifications into account.
|
|
7
|
-
*
|
|
8
|
-
* @type {Object}
|
|
9
|
-
*/
|
|
10
|
-
const DEFAULT_CONFIG = {
|
|
11
|
-
/**
|
|
12
|
-
* Volume set on unMute if the volume is set to 0 and either:
|
|
13
|
-
* - mute has never been called before
|
|
14
|
-
* - mute has last been called while the volume was already set to 0 (either
|
|
15
|
-
* via setVolume, or a previous mute call)
|
|
16
|
-
* @type {Number}
|
|
17
|
-
*/
|
|
18
|
-
DEFAULT_UNMUTED_VOLUME: 0.1,
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Default time interval after which a request will timeout, in ms.
|
|
22
|
-
* @type {Number}
|
|
23
|
-
*/
|
|
24
|
-
DEFAULT_REQUEST_TIMEOUT: 30 * 1000,
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Can be either:
|
|
28
|
-
* - "native": Subtitles are all displayed in a <track> element
|
|
29
|
-
* - "html": Subtitles are all displayed in a <div> separated from the video
|
|
30
|
-
* element. Can be useful to display richer TTML subtitles, for example.
|
|
31
|
-
* @type {Object|null}
|
|
32
|
-
*/
|
|
33
|
-
DEFAULT_TEXT_TRACK_MODE: "native" as "native" |
|
|
34
|
-
"html",
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Strategy to adopt when manually setting the current bitrate.
|
|
38
|
-
* Can be either:
|
|
39
|
-
* - "seamless": transitions are very smooth but not immediate.
|
|
40
|
-
* - "direct": the quality switch happens immediately but to achieve that,
|
|
41
|
-
* the player will need to set a new MediaSource on the media element in
|
|
42
|
-
* some cases. This often leads to a black screen + unavailable APIs
|
|
43
|
-
* during a short moment.
|
|
44
|
-
* @type {string}
|
|
45
|
-
*/
|
|
46
|
-
DEFAULT_MANUAL_BITRATE_SWITCHING_MODE: "seamless" as "seamless" |
|
|
47
|
-
"direct",
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Default behavior for the `enableFastSwitching` loadVideo options.
|
|
51
|
-
*
|
|
52
|
-
* Fast-switching allows to provide quicker transitions from lower quality
|
|
53
|
-
* segments to higher quality segments but might be badly supported on some
|
|
54
|
-
* devices.
|
|
55
|
-
* When enabled, the RxPlayer might replace segments of a lower-quality
|
|
56
|
-
* (with a lower bitrate) with segments of a higher quality (with a higher
|
|
57
|
-
* bitrate). This allows to have a fast transition when network conditions
|
|
58
|
-
* improve.
|
|
59
|
-
* When disabled, segments of a lower-quality will not be replaced.
|
|
60
|
-
*/
|
|
61
|
-
DEFAULT_ENABLE_FAST_SWITCHING: true,
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Strategy to adopt when manually switching of audio adaptation.
|
|
65
|
-
* Can be either:
|
|
66
|
-
* - "seamless": transitions are smooth but could be not immediate.
|
|
67
|
-
* - "direct": that strategy will perform a very small seek that result
|
|
68
|
-
* most of the time by a flush of the current buffered data, by doing
|
|
69
|
-
* that we allow quicker transition between audio track, but we could
|
|
70
|
-
* see appear a RELOADING or a SEEKING state.
|
|
71
|
-
*/
|
|
72
|
-
DEFAULT_AUDIO_TRACK_SWITCHING_MODE: "seamless" as "seamless" |
|
|
73
|
-
"direct",
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* In some cases after switching the current track or bitrate, the RxPlayer
|
|
77
|
-
* could be led to go into the `"RELOADING"` state, which corresponds to
|
|
78
|
-
* visually a black screen (with nothing audible) before restarting playback.
|
|
79
|
-
*
|
|
80
|
-
* We could want to seek back some milliseconds when doing that.
|
|
81
|
-
* For example, when switching the current audio track, it might make sense
|
|
82
|
-
* to restart some time before, so the beginning of the sentence can be heard
|
|
83
|
-
* again in the new language.
|
|
84
|
-
*
|
|
85
|
-
* This config property allows to set the relative position the RxPlayer will
|
|
86
|
-
* seek to after reloading, in seconds.
|
|
87
|
-
*
|
|
88
|
-
* For example: a value of `-0.7` means that will seek back 700 milliseconds
|
|
89
|
-
* when reloading due to a track or bitrate switch with necessitated a
|
|
90
|
-
* reloading.
|
|
91
|
-
*/
|
|
92
|
-
DELTA_POSITION_AFTER_RELOAD: {
|
|
93
|
-
/** Relative position when switching the bitrate */
|
|
94
|
-
bitrateSwitch: -0.1,
|
|
95
|
-
/**
|
|
96
|
-
* Relative position when switching the track.
|
|
97
|
-
*
|
|
98
|
-
* From tests, I noticed that seeking back was only really "pleasant" when
|
|
99
|
-
* switching the audio track.
|
|
100
|
-
*
|
|
101
|
-
* E.g. switching the video track often means changing the camera angle or
|
|
102
|
-
* even totally changing what is being seen and rely much less on temporal
|
|
103
|
-
* context than when an audio track is switched.
|
|
104
|
-
* As such, I decided to only set a sensible seek-back behavior when
|
|
105
|
-
* switching the audio track, and only a minimal one (to still ensure
|
|
106
|
-
* nothing was missed) for video.
|
|
107
|
-
*
|
|
108
|
-
* "Other" mainly concern text track, where seeking back could even be
|
|
109
|
-
* annoying, so that behavior has been disabled in that case.
|
|
110
|
-
*/
|
|
111
|
-
trackSwitch: { audio: -0.7,
|
|
112
|
-
video: -0.1,
|
|
113
|
-
other: 0 },
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Behavior of the RxPlayer when encountering a whole other codec on a already
|
|
118
|
-
* existing audio or video SourceBuffer.
|
|
119
|
-
*
|
|
120
|
-
* Can be either:
|
|
121
|
-
*
|
|
122
|
-
* - "continue": Segments linked to the new codec will continue to be
|
|
123
|
-
* pushed to that same SourceBuffer. The RxPlayer will still try to call
|
|
124
|
-
* the `changeType` API on the SourceBuffer before pushing those
|
|
125
|
-
* segments but continue even if this call failed.
|
|
126
|
-
*
|
|
127
|
-
* - "reload": Every time a new incompatible codec is encountered on a
|
|
128
|
-
* given SourceBuffer, we will reload the MediaSource.
|
|
129
|
-
*/
|
|
130
|
-
DEFAULT_CODEC_SWITCHING_BEHAVIOR: "continue" as "continue" |
|
|
131
|
-
"reload",
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* If set to true, video through loadVideo will auto play by default
|
|
135
|
-
* @type {Boolean}
|
|
136
|
-
*/
|
|
137
|
-
DEFAULT_AUTO_PLAY: false,
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* If set to false, "native" subtitles (in a <track> element) will be hidden
|
|
141
|
-
* by default.
|
|
142
|
-
* @type {Boolean}
|
|
143
|
-
*/
|
|
144
|
-
DEFAULT_SHOW_NATIVE_SUBTITLE: true,
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* If set to true, the player will by default stop immediately and unload the
|
|
148
|
-
* content on reaching the end of the media.
|
|
149
|
-
*
|
|
150
|
-
* If set to false, it will not unload nor stop by default, leaving the user
|
|
151
|
-
* free to seek in the already-loaded content.
|
|
152
|
-
*
|
|
153
|
-
* Set to `true` for legacy reasons.
|
|
154
|
-
* @type {Boolean}
|
|
155
|
-
*/
|
|
156
|
-
DEFAULT_STOP_AT_END: true,
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Default buffer goal in seconds.
|
|
160
|
-
* Once enough content has been downloaded to fill the buffer up to
|
|
161
|
-
* ``current position + DEFAULT_WANTED_BUFFER_AHEAD", we will stop downloading
|
|
162
|
-
* content.
|
|
163
|
-
* @type {Number}
|
|
164
|
-
*/
|
|
165
|
-
DEFAULT_WANTED_BUFFER_AHEAD: 30,
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Default max buffer size ahead of the current position in seconds.
|
|
169
|
-
* The buffer _after_ this limit will be garbage collected.
|
|
170
|
-
* Set to Infinity for no limit.
|
|
171
|
-
* @type {Number}
|
|
172
|
-
*/
|
|
173
|
-
DEFAULT_MAX_BUFFER_AHEAD: Infinity,
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Default max buffer size ahead of the current position in seconds.
|
|
177
|
-
* The buffer _before_ this limit will be garbage collected.
|
|
178
|
-
* Set to Infinity for no limit.
|
|
179
|
-
* @type {Number}
|
|
180
|
-
*/
|
|
181
|
-
DEFAULT_MAX_BUFFER_BEHIND: Infinity,
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Default video buffer memory limit in kilobytes.
|
|
185
|
-
* Once enough video content has been downloaded to fill the buffer up to
|
|
186
|
-
* DEFAULT_MAX_VIDEO_BUFFER_SIZE , we will stop downloading
|
|
187
|
-
* content.
|
|
188
|
-
* @type {Number}
|
|
189
|
-
*/
|
|
190
|
-
DEFAULT_MAX_VIDEO_BUFFER_SIZE: Infinity,
|
|
191
|
-
|
|
192
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
193
|
-
/**
|
|
194
|
-
* Maximum possible buffer ahead for each type of buffer, to avoid too much
|
|
195
|
-
* memory usage when playing for a long time.
|
|
196
|
-
* Equal to Infinity if not defined here.
|
|
197
|
-
* @type {Object}
|
|
198
|
-
*/
|
|
199
|
-
MAXIMUM_MAX_BUFFER_AHEAD: {
|
|
200
|
-
text: 5 * 60 * 60,
|
|
201
|
-
} as Partial<Record<"audio"|"video"|"image"|"text", number>>,
|
|
202
|
-
/* eslint-enable @typescript-eslint/consistent-type-assertions */
|
|
203
|
-
|
|
204
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
205
|
-
/**
|
|
206
|
-
* Minimum possible buffer ahead for each type of buffer, to avoid Garbage
|
|
207
|
-
* Collecting too much data when it would have adverse effects.
|
|
208
|
-
* Equal to `0` if not defined here.
|
|
209
|
-
* @type {Object}
|
|
210
|
-
*/
|
|
211
|
-
MINIMUM_MAX_BUFFER_AHEAD: {
|
|
212
|
-
// Text segments are both much lighter on resources and might
|
|
213
|
-
// actually be much larger than other types of segments in terms
|
|
214
|
-
// of duration. Let's make an exception here by authorizing a
|
|
215
|
-
// larger text buffer ahead, to avoid unnecesarily reloading the
|
|
216
|
-
// same text track.
|
|
217
|
-
text: 2 * 60,
|
|
218
|
-
} as Partial<Record<"audio"|"video"|"image"|"text", number>>,
|
|
219
|
-
/* eslint-enable @typescript-eslint/consistent-type-assertions */
|
|
220
|
-
|
|
221
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
222
|
-
/**
|
|
223
|
-
* Maximum possible buffer behind for each type of buffer, to avoid too much
|
|
224
|
-
* memory usage when playing for a long time.
|
|
225
|
-
* Equal to Infinity if not defined here.
|
|
226
|
-
* @type {Object}
|
|
227
|
-
*/
|
|
228
|
-
MAXIMUM_MAX_BUFFER_BEHIND: {
|
|
229
|
-
text: 5 * 60 * 60,
|
|
230
|
-
} as Partial<Record<"audio"|"video"|"image"|"text", number>>,
|
|
231
|
-
/* eslint-enable @typescript-eslint/consistent-type-assertions */
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Default bitrate ceils initially set as the first content begins.
|
|
235
|
-
*
|
|
236
|
-
* If no track is found with a bitrate inferior or equal to the
|
|
237
|
-
* bitrate there, the one with the lowest bitrate will be taken instead.
|
|
238
|
-
*
|
|
239
|
-
* Set to 0 for the lowest bitrate, Infinity for the highest.
|
|
240
|
-
*
|
|
241
|
-
* These values are only useful for the first content played, as consecutive
|
|
242
|
-
* play will always take the last set one.
|
|
243
|
-
* @type {Object}
|
|
244
|
-
*/
|
|
245
|
-
DEFAULT_INITIAL_BITRATES: {
|
|
246
|
-
audio: 0, // only "audio" segments
|
|
247
|
-
video: 0, // only "video" segments
|
|
248
|
-
other: 0, // tracks which are not audio/video (text images).
|
|
249
|
-
// Though those are generally at a single bitrate, so no adaptive
|
|
250
|
-
// mechanism is triggered for them.
|
|
251
|
-
},
|
|
252
|
-
|
|
253
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
254
|
-
/**
|
|
255
|
-
* Default bitrate floor initially set to dictate the minimum bitrate the
|
|
256
|
-
* adaptive logic can automatically switch to.
|
|
257
|
-
*
|
|
258
|
-
* If no track is found with a quality superior or equal to the
|
|
259
|
-
* bitrate there, the lowest bitrate will be taken instead.
|
|
260
|
-
*
|
|
261
|
-
* Set to Infinity to discard any limit in the ABR strategy.
|
|
262
|
-
* @type {Object}
|
|
263
|
-
*/
|
|
264
|
-
DEFAULT_MIN_BITRATES: {
|
|
265
|
-
audio: 0, // only "audio" segments
|
|
266
|
-
video: 0, // only "video" segments
|
|
267
|
-
other: 0, // tracks which are not audio/video
|
|
268
|
-
// Though those are generally at a single bitrate, so no
|
|
269
|
-
// adaptive mechanism is triggered for them.
|
|
270
|
-
} as Record<"audio"|"video"|"other", number>,
|
|
271
|
-
/* eslint-enable @typescript-eslint/consistent-type-assertions */
|
|
272
|
-
|
|
273
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
274
|
-
/**
|
|
275
|
-
* Default bitrate ceil initially set to dictate the maximum bitrate the
|
|
276
|
-
* adaptive logic can automatically switch to.
|
|
277
|
-
*
|
|
278
|
-
* If no track is found with a quality inferior or equal to the
|
|
279
|
-
* bitrate there, the lowest bitrate will be taken instead.
|
|
280
|
-
*
|
|
281
|
-
* Set to Infinity to discard any limit in the ABR strategy.
|
|
282
|
-
* @type {Object}
|
|
283
|
-
*/
|
|
284
|
-
DEFAULT_MAX_BITRATES: {
|
|
285
|
-
audio: Infinity, // only "audio" segments
|
|
286
|
-
video: Infinity, // only "video" segments
|
|
287
|
-
other: Infinity, // tracks which are not audio/video
|
|
288
|
-
// Though those are generally at a single bitrate, so no
|
|
289
|
-
// adaptive mechanism is triggered for them.
|
|
290
|
-
} as Record<"audio"|"video"|"other", number>,
|
|
291
|
-
/* eslint-enable @typescript-eslint/consistent-type-assertions */
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Delay after which, if the page is hidden, the user is considered inactive
|
|
295
|
-
* on the current video.
|
|
296
|
-
*
|
|
297
|
-
* Allow to enforce specific optimizations when the page is not shown.
|
|
298
|
-
* @see DEFAULT_THROTTLE_WHEN_HIDDEN
|
|
299
|
-
* @type {Number}
|
|
300
|
-
*/
|
|
301
|
-
INACTIVITY_DELAY: 60 * 1000,
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* If true, if the player is in a "hidden" state for a delay specified by the
|
|
305
|
-
* INACTIVITY DELAY config property, we throttle automatically to the video
|
|
306
|
-
* representation with the lowest bitrate.
|
|
307
|
-
* @type {Boolean}
|
|
308
|
-
*/
|
|
309
|
-
DEFAULT_THROTTLE_WHEN_HIDDEN: false,
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* If true, if the video is considered in a "hidden" state for a delay specified by
|
|
313
|
-
* the INACTIVITY DELAY config property, we throttle automatically to the video
|
|
314
|
-
* representation with the lowest bitrate.
|
|
315
|
-
* @type {Boolean}
|
|
316
|
-
*/
|
|
317
|
-
DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN: false,
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* If true, the video representations you can switch to in adaptive mode
|
|
321
|
-
* are limited by the video element's width.
|
|
322
|
-
*
|
|
323
|
-
* Basically in that case, we won't switch to a video Representation with
|
|
324
|
-
* a width higher than the current width of the video HTMLElement.
|
|
325
|
-
* @type {Boolean}
|
|
326
|
-
*/
|
|
327
|
-
DEFAULT_LIMIT_VIDEO_WIDTH: false,
|
|
328
|
-
|
|
329
|
-
/**
|
|
330
|
-
* Default initial live gap considered if no presentation delay has been
|
|
331
|
-
* suggested, in seconds.
|
|
332
|
-
* @type {Number}
|
|
333
|
-
*/
|
|
334
|
-
DEFAULT_LIVE_GAP: {
|
|
335
|
-
DEFAULT: 10,
|
|
336
|
-
LOW_LATENCY: 3.5,
|
|
337
|
-
},
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* Maximum time, in seconds, the player should automatically skip when stalled
|
|
341
|
-
* because of a current hole in the buffer.
|
|
342
|
-
* Bear in mind that this might seek over not-yet-downloaded/pushed segments.
|
|
343
|
-
* @type {Number}
|
|
344
|
-
*/
|
|
345
|
-
BUFFER_DISCONTINUITY_THRESHOLD: 0.2,
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* When encountering small discontinuities, the RxPlayer may want, in specific
|
|
349
|
-
* conditions, ignore those and let the browser seek over them iself (this
|
|
350
|
-
* allows for example to avoid conflicts when both the browser and the
|
|
351
|
-
* RxPlayer want to seek at a different position, sometimes leading to a
|
|
352
|
-
* seeking loop).
|
|
353
|
-
* In this case, we however still want to seek it ourselves if the browser
|
|
354
|
-
* doesn't take the opportunity soon enough.
|
|
355
|
-
*
|
|
356
|
-
* This value specifies a delay after which a discontinuity ignored by the
|
|
357
|
-
* RxPlayer is finally considered.
|
|
358
|
-
* We want to maintain high enough to be sure the browser will not seek yet
|
|
359
|
-
* small enough so this (arguably rare) situation won't lead to too much
|
|
360
|
-
* waiting time.
|
|
361
|
-
*/
|
|
362
|
-
FORCE_DISCONTINUITY_SEEK_DELAY: 5000,
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* Ratio used to know if an already loaded segment should be re-buffered.
|
|
366
|
-
* We re-load the given segment if the current one times that ratio is
|
|
367
|
-
* inferior to the new one.
|
|
368
|
-
* @type {Number}
|
|
369
|
-
*/
|
|
370
|
-
BITRATE_REBUFFERING_RATIO: 1.5,
|
|
371
|
-
|
|
372
|
-
/**
|
|
373
|
-
* Those are used when a "QuotaExceededError" error is received after
|
|
374
|
-
* appending a new segment in the SourceBuffer.
|
|
375
|
-
*
|
|
376
|
-
* This error can arise when the browser's buffer is considered full.
|
|
377
|
-
* In this case, the player goes into manual garbage collection (GC) mode.
|
|
378
|
-
* @type {Object}
|
|
379
|
-
*/
|
|
380
|
-
BUFFER_GC_GAPS: {
|
|
381
|
-
/**
|
|
382
|
-
* _Low_ gap (from current position) from which the buffer will be _garbage
|
|
383
|
-
* collected_ (read removed from the buffer) when a QuotaExceededError is
|
|
384
|
-
* received.
|
|
385
|
-
* In seconds.
|
|
386
|
-
* @type {Number}
|
|
387
|
-
*/
|
|
388
|
-
CALM: 240,
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* _High_ gap (from current position) from which the buffer will be _garbage
|
|
392
|
-
* collected_ (read removed from the buffer) when a QuotaExceededError is
|
|
393
|
-
* received, if the low one does not clean up any buffer.
|
|
394
|
-
* In seconds.
|
|
395
|
-
* @type {Number}
|
|
396
|
-
*/
|
|
397
|
-
BEEFY: 30,
|
|
398
|
-
},
|
|
399
|
-
|
|
400
|
-
/**
|
|
401
|
-
* The default number of times a manifest request will be re-performed
|
|
402
|
-
* when loaded/refreshed if the request finishes on an error which
|
|
403
|
-
* justify an retry.
|
|
404
|
-
*
|
|
405
|
-
* Note that some errors do not use this counter:
|
|
406
|
-
* - if the error is not due to the xhr, no retry will be peformed
|
|
407
|
-
* - if the error is an HTTP error code, but not a 500-smthg or a 404, no
|
|
408
|
-
* retry will be performed.
|
|
409
|
-
* - if it has a high chance of being due to the user being offline, a
|
|
410
|
-
* separate counter is used (see DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE).
|
|
411
|
-
* @type Number
|
|
412
|
-
*/
|
|
413
|
-
DEFAULT_MAX_MANIFEST_REQUEST_RETRY: 4,
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
* Default delay, in seconds, during which a CDN will be "downgraded".
|
|
417
|
-
*
|
|
418
|
-
* For example in case of media content being available on multiple CDNs, the
|
|
419
|
-
* RxPlayer may decide that a CDN is less reliable (for example, it returned a
|
|
420
|
-
* server error) and should thus be avoided, at least for some time
|
|
421
|
-
*
|
|
422
|
-
* This value is the amount of time this CDN will be "less considered" than the
|
|
423
|
-
* alternatives.
|
|
424
|
-
*/
|
|
425
|
-
DEFAULT_CDN_DOWNGRADE_TIME: 60,
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* The default number of times a segment request will be re-performed when
|
|
429
|
-
* on error which justify a retry.
|
|
430
|
-
*
|
|
431
|
-
* Note that some errors do not use this counter:
|
|
432
|
-
* - if the error is not due to the xhr, no retry will be peformed
|
|
433
|
-
* - if the error is an HTTP error code, but not a 500-smthg or a 404, no
|
|
434
|
-
* retry will be performed.
|
|
435
|
-
* - if it has a high chance of being due to the user being offline, a
|
|
436
|
-
* separate counter is used (see DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE).
|
|
437
|
-
* @type Number
|
|
438
|
-
*/
|
|
439
|
-
DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR: 4,
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* Under some circonstances, we're able to tell that the user is offline (see
|
|
443
|
-
* the compat files).
|
|
444
|
-
* When this happens, and xhr requests fails due to an error event (you might
|
|
445
|
-
* still be able to perform xhr offline, e.g. on localhost), you might want to
|
|
446
|
-
* retry indefinitely or with a higher number of retry than if the error is
|
|
447
|
-
* due to a CDN problem.
|
|
448
|
-
*
|
|
449
|
-
* A capped exponential backoff will still be used (like for an error code).
|
|
450
|
-
* @type {Number}
|
|
451
|
-
*/
|
|
452
|
-
DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE: Infinity,
|
|
453
|
-
|
|
454
|
-
/**
|
|
455
|
-
* Initial backoff delay when a segment / manifest download fails, in
|
|
456
|
-
* milliseconds.
|
|
457
|
-
*
|
|
458
|
-
* This delay will then grow exponentally by power of twos (200, 400, 800
|
|
459
|
-
* etc.)
|
|
460
|
-
*
|
|
461
|
-
* Please note that this delay is not exact, as it will be fuzzed.
|
|
462
|
-
* @type {Number}
|
|
463
|
-
*/
|
|
464
|
-
INITIAL_BACKOFF_DELAY_BASE: {
|
|
465
|
-
REGULAR: 200,
|
|
466
|
-
LOW_LATENCY: 50,
|
|
467
|
-
},
|
|
468
|
-
|
|
469
|
-
/**
|
|
470
|
-
* Maximum backoff delay when a segment / manifest download fails, in
|
|
471
|
-
* milliseconds.
|
|
472
|
-
*
|
|
473
|
-
* Please note that this delay is not exact, as it will be fuzzed.
|
|
474
|
-
* @type {Number}
|
|
475
|
-
*/
|
|
476
|
-
MAX_BACKOFF_DELAY_BASE: {
|
|
477
|
-
REGULAR: 3000,
|
|
478
|
-
LOW_LATENCY: 1000,
|
|
479
|
-
},
|
|
480
|
-
|
|
481
|
-
/**
|
|
482
|
-
* Minimum interval at which playback information samples will be taken. This
|
|
483
|
-
* variable is for the "regular" mediasource strategy (that is, not for the
|
|
484
|
-
* directfile API.
|
|
485
|
-
*
|
|
486
|
-
* At each of these interval, various different modules in the RxPlayer will
|
|
487
|
-
* run based on the information communicated.
|
|
488
|
-
*
|
|
489
|
-
* Keep in mind this is the minimum interval. This logic will also be
|
|
490
|
-
* triggered when various events of the media element are received.
|
|
491
|
-
* @type {Number}
|
|
492
|
-
*/
|
|
493
|
-
SAMPLING_INTERVAL_MEDIASOURCE: 1000,
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* Same than SAMPLING_INTERVAL_MEDIASOURCE but for lowLatency mode.
|
|
497
|
-
* @type {Number}
|
|
498
|
-
*/
|
|
499
|
-
SAMPLING_INTERVAL_LOW_LATENCY: 250,
|
|
500
|
-
|
|
501
|
-
/**
|
|
502
|
-
* Same than SAMPLING_INTERVAL_MEDIASOURCE but for the directfile API.
|
|
503
|
-
* @type {Number}
|
|
504
|
-
*/
|
|
505
|
-
SAMPLING_INTERVAL_NO_MEDIASOURCE: 500,
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* Amount of buffer to have ahead of the current position before we may
|
|
509
|
-
* consider buffer-based adaptive estimates, in seconds.
|
|
510
|
-
*
|
|
511
|
-
* For example setting it to `10` means that we need to have ten seconds of
|
|
512
|
-
* buffer ahead of the current position before relying on buffer-based
|
|
513
|
-
* adaptive estimates.
|
|
514
|
-
*
|
|
515
|
-
* To avoid getting in-and-out of the buffer-based logic all the time, it
|
|
516
|
-
* should be set higher than `ABR_EXIT_BUFFER_BASED_ALGO`.
|
|
517
|
-
*/
|
|
518
|
-
ABR_ENTER_BUFFER_BASED_ALGO: 10,
|
|
519
|
-
|
|
520
|
-
/**
|
|
521
|
-
* Below this amount of buffer ahead of the current position, in seconds, we
|
|
522
|
-
* will stop using buffer-based estimate in our adaptive logic to select a
|
|
523
|
-
* quality.
|
|
524
|
-
*
|
|
525
|
-
* For example setting it to `5` means that if we have less than 5 seconds of
|
|
526
|
-
* buffer ahead of the current position, we should stop relying on
|
|
527
|
-
* buffer-based estimates to choose a quality.
|
|
528
|
-
*
|
|
529
|
-
* To avoid getting in-and-out of the buffer-based logic all the time, it
|
|
530
|
-
* should be set lower than `ABR_ENTER_BUFFER_BASED_ALGO`.
|
|
531
|
-
*/
|
|
532
|
-
ABR_EXIT_BUFFER_BASED_ALGO: 5,
|
|
533
|
-
|
|
534
|
-
/**
|
|
535
|
-
* Minimum number of bytes sampled before we trust the estimate.
|
|
536
|
-
* If we have not sampled much data, our estimate may not be accurate
|
|
537
|
-
* enough to trust.
|
|
538
|
-
* If the total of bytes sampled is less than this value, we use a
|
|
539
|
-
* default estimate.
|
|
540
|
-
* This specific value is based on experimentations.
|
|
541
|
-
* @type {Number}
|
|
542
|
-
*/
|
|
543
|
-
ABR_MINIMUM_TOTAL_BYTES: 150e3,
|
|
544
|
-
|
|
545
|
-
/**
|
|
546
|
-
* Minimum number of bytes, under which samples are discarded.
|
|
547
|
-
* Our models do not include latency information, so connection startup time
|
|
548
|
-
* (time to first byte) is considered part of the download time.
|
|
549
|
-
* Because of this, we should ignore very small downloads which would cause
|
|
550
|
-
* our estimate to be too low.
|
|
551
|
-
* This specific value is based on experimentation.
|
|
552
|
-
* @type {Number}
|
|
553
|
-
*/
|
|
554
|
-
ABR_MINIMUM_CHUNK_SIZE: 16e3,
|
|
555
|
-
|
|
556
|
-
/**
|
|
557
|
-
* Factor with which is multiplied the bandwidth estimate when the ABR is in
|
|
558
|
-
* starvation mode.
|
|
559
|
-
* @type {Object}
|
|
560
|
-
*/
|
|
561
|
-
ABR_STARVATION_FACTOR: {
|
|
562
|
-
DEFAULT: 0.72,
|
|
563
|
-
LOW_LATENCY: 0.72,
|
|
564
|
-
},
|
|
565
|
-
|
|
566
|
-
/**
|
|
567
|
-
* Factor with which is multiplied the bandwidth estimate when the ABR is not
|
|
568
|
-
* in starvation mode.
|
|
569
|
-
* @type {Object}
|
|
570
|
-
*/
|
|
571
|
-
ABR_REGULAR_FACTOR: {
|
|
572
|
-
DEFAULT: 0.72,
|
|
573
|
-
LOW_LATENCY: 0.72,
|
|
574
|
-
},
|
|
575
|
-
|
|
576
|
-
/**
|
|
577
|
-
* If a media buffer has less than ABR_STARVATION_GAP in seconds ahead of the
|
|
578
|
-
* current position in its buffer, the adaptive logic will go into starvation
|
|
579
|
-
* mode.
|
|
580
|
-
*
|
|
581
|
-
* It gets out of starvation mode when the OUT_OF_STARVATION_GAP value is
|
|
582
|
-
* reached.
|
|
583
|
-
*
|
|
584
|
-
* Under this starvation mode:
|
|
585
|
-
*
|
|
586
|
-
* - the bandwidth considered will be a little lower than the one estimated
|
|
587
|
-
*
|
|
588
|
-
* - the time the next important request take will be checked
|
|
589
|
-
* multiple times to detect when/if it takes too much time.
|
|
590
|
-
* If the request is considered too long, the bitrate will be hastily
|
|
591
|
-
* re-calculated from this single request.
|
|
592
|
-
*
|
|
593
|
-
* @type {Object}
|
|
594
|
-
*/
|
|
595
|
-
ABR_STARVATION_GAP: {
|
|
596
|
-
DEFAULT: 5,
|
|
597
|
-
LOW_LATENCY: 5,
|
|
598
|
-
},
|
|
599
|
-
OUT_OF_STARVATION_GAP: {
|
|
600
|
-
DEFAULT: 7,
|
|
601
|
-
LOW_LATENCY: 7,
|
|
602
|
-
},
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
* This is a security to avoid going into starvation mode when the content is
|
|
606
|
-
* ending (@see ABR_STARVATION_GAP).
|
|
607
|
-
* Basically, we subtract that value from the global duration of the content
|
|
608
|
-
* and we never enter "starvation mode" if the currently available buffer
|
|
609
|
-
* (which equals to the current position + the available buffer ahead of it)
|
|
610
|
-
* is equal or higher than this value.
|
|
611
|
-
* @type {Number}
|
|
612
|
-
*/
|
|
613
|
-
ABR_STARVATION_DURATION_DELTA: 0.1,
|
|
614
|
-
|
|
615
|
-
/**
|
|
616
|
-
* Half-life, in seconds for a fastly-evolving exponential weighted moving
|
|
617
|
-
* average.
|
|
618
|
-
* The lower it is, the faster the ABR logic will react to the bandwidth
|
|
619
|
-
* falling quickly.
|
|
620
|
-
* Should be kept to a lower number than ABR_SLOW_EMA for coherency reasons.
|
|
621
|
-
* @type {Number}
|
|
622
|
-
*/
|
|
623
|
-
ABR_FAST_EMA: 2,
|
|
624
|
-
|
|
625
|
-
/**
|
|
626
|
-
* Half-life, in seconds for a slowly-evolving exponential weighted moving
|
|
627
|
-
* average.
|
|
628
|
-
* The lower it is, the faster the ABR logic is going to react to recent
|
|
629
|
-
* bandwidth variation, on the higher and on the lower side.
|
|
630
|
-
* Should be kept to a higher number than ABR_FAST_EMA for coherency reasons.
|
|
631
|
-
* @type {Number}
|
|
632
|
-
*/
|
|
633
|
-
ABR_SLOW_EMA: 10,
|
|
634
|
-
|
|
635
|
-
/**
|
|
636
|
-
* Number of seconds ahead in the buffer after which playback will resume when
|
|
637
|
-
* seeking on an unbuffered part of the content.
|
|
638
|
-
* @type {Number}
|
|
639
|
-
*/
|
|
640
|
-
RESUME_GAP_AFTER_SEEKING: {
|
|
641
|
-
DEFAULT: 1.5,
|
|
642
|
-
LOW_LATENCY: 0.5,
|
|
643
|
-
},
|
|
644
|
-
|
|
645
|
-
/**
|
|
646
|
-
* Number of seconds ahead in the buffer after which playback will resume when
|
|
647
|
-
* the player was rebuffering due to a low readyState.
|
|
648
|
-
* @type {Number}
|
|
649
|
-
*/
|
|
650
|
-
RESUME_GAP_AFTER_NOT_ENOUGH_DATA: {
|
|
651
|
-
DEFAULT: 0.5,
|
|
652
|
-
LOW_LATENCY: 0.5,
|
|
653
|
-
},
|
|
654
|
-
|
|
655
|
-
/**
|
|
656
|
-
* Number of seconds ahead in the buffer after which playback will resume
|
|
657
|
-
* after the player went through a buffering step.
|
|
658
|
-
* @type {Number}
|
|
659
|
-
*/
|
|
660
|
-
RESUME_GAP_AFTER_BUFFERING: {
|
|
661
|
-
DEFAULT: 5,
|
|
662
|
-
LOW_LATENCY: 0.5,
|
|
663
|
-
},
|
|
664
|
-
|
|
665
|
-
/**
|
|
666
|
-
* Maximum number of seconds in the buffer based on which a "rebuffering"
|
|
667
|
-
* strategy will be considered:
|
|
668
|
-
* The player will pause playback to get enough time building a sufficient
|
|
669
|
-
* buffer. This mostly happen when seeking in an unbuffered part or when not
|
|
670
|
-
* enough buffer is ahead of the current position.
|
|
671
|
-
* @type {Number}
|
|
672
|
-
*/
|
|
673
|
-
REBUFFERING_GAP: {
|
|
674
|
-
DEFAULT: 0.5,
|
|
675
|
-
LOW_LATENCY: 0.2,
|
|
676
|
-
},
|
|
677
|
-
|
|
678
|
-
/**
|
|
679
|
-
* Amount of time (in seconds) with data ahead of the current position, at
|
|
680
|
-
* which we always consider the browser to be able to play.
|
|
681
|
-
*
|
|
682
|
-
* If the media element has this amount of data in advance or more but
|
|
683
|
-
* playback cannot begin, the player will consider it "freezing".
|
|
684
|
-
*/
|
|
685
|
-
MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING: 2,
|
|
686
|
-
|
|
687
|
-
/**
|
|
688
|
-
* A media whose position inexplicably does not increment despite playing is
|
|
689
|
-
* called as "freezing" in the RxPlayer.
|
|
690
|
-
*
|
|
691
|
-
* If the media is still "freezing" after waiting for `UNFREEZING_SEEK_DELAY`
|
|
692
|
-
* milliseconds, the RxPlayer will try to un-freeze the situation by interacting
|
|
693
|
-
* with the media element.
|
|
694
|
-
*
|
|
695
|
-
* Those interactions can be costly in time before playback continue, so it
|
|
696
|
-
* should be set at a sufficiently high value to avoid false positives.
|
|
697
|
-
*/
|
|
698
|
-
UNFREEZING_SEEK_DELAY: 6000,
|
|
699
|
-
|
|
700
|
-
/**
|
|
701
|
-
* A media whose position inexplicably does not increment despite playing is
|
|
702
|
-
* called as "freezing" in the RxPlayer.
|
|
703
|
-
*
|
|
704
|
-
* A small freezing interval may be normal as the browser may take time before
|
|
705
|
-
* playing, e.g. after a seek.
|
|
706
|
-
*
|
|
707
|
-
* If the media is still "freezing" after waiting for `FREEZING_STALLED_DELAY`
|
|
708
|
-
* milliseconds, the RxPlayer will emit a BUFFERING state through its API to
|
|
709
|
-
* notify that the player cannot currently advance.
|
|
710
|
-
*/
|
|
711
|
-
FREEZING_STALLED_DELAY: 600,
|
|
712
|
-
|
|
713
|
-
/**
|
|
714
|
-
* A media whose position inexplicably does not increment despite playing is
|
|
715
|
-
* called as "freezing" in the RxPlayer.
|
|
716
|
-
*
|
|
717
|
-
* If the media is frozen for a sufficiently large time
|
|
718
|
-
* (@see UNFREEZING_SEEK_DELAY), the RxPlayer will perform a seek corresponding
|
|
719
|
-
* to its current position plus `UNFREEZING_DELTA_POSITION` seconds.
|
|
720
|
-
*
|
|
721
|
-
* This should be kept short enough as the goal is just to un-freeze lower-level
|
|
722
|
-
* buffers.
|
|
723
|
-
*/
|
|
724
|
-
UNFREEZING_DELTA_POSITION: 0.001,
|
|
725
|
-
|
|
726
|
-
/**
|
|
727
|
-
* Maximum authorized difference between what we calculated to be the
|
|
728
|
-
* beginning or end of the segment in a media buffer and what we
|
|
729
|
-
* actually are noticing now.
|
|
730
|
-
*
|
|
731
|
-
* If the segment seems to have removed more than this size in seconds, we
|
|
732
|
-
* will infer that the segment has been garbage collected and we might try to
|
|
733
|
-
* re-download it.
|
|
734
|
-
* @type {Number}
|
|
735
|
-
*/
|
|
736
|
-
MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT: 0.15,
|
|
737
|
-
|
|
738
|
-
/**
|
|
739
|
-
* The maximum authorized difference, in seconds, between the real buffered
|
|
740
|
-
* time of a given chunk and what the segment information of the Manifest
|
|
741
|
-
* tells us.
|
|
742
|
-
*
|
|
743
|
-
* Setting a value too high can lead to parts of the media buffer being
|
|
744
|
-
* linked to the wrong segments and to segments wrongly believed to be still
|
|
745
|
-
* complete (instead of garbage collected).
|
|
746
|
-
*
|
|
747
|
-
* Setting a value too low can lead to parts of the media buffer not being
|
|
748
|
-
* linked to the concerned segment and to segments wrongly believed to be
|
|
749
|
-
* partly garbage collected (instead of complete segments).
|
|
750
|
-
* @type {Number}
|
|
751
|
-
*/
|
|
752
|
-
MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE: 0.4,
|
|
753
|
-
|
|
754
|
-
/**
|
|
755
|
-
* The maximum authorized difference, in seconds, between the duration a
|
|
756
|
-
* segment should have according to the Manifest and the actual duration it
|
|
757
|
-
* seems to have once pushed to the media buffer.
|
|
758
|
-
*
|
|
759
|
-
* Setting a value too high can lead to parts of the media buffer being
|
|
760
|
-
* linked to the wrong segments and to segments wrongly believed to be still
|
|
761
|
-
* complete (instead of garbage collected).
|
|
762
|
-
*
|
|
763
|
-
* Setting a value too low can lead to parts of the media buffer not being
|
|
764
|
-
* linked to the concerned segment and to segments wrongly believed to be
|
|
765
|
-
* partly garbage collected (instead of complete segments). This last point
|
|
766
|
-
* could lead to unnecessary segment re-downloading.
|
|
767
|
-
* @type {Number}
|
|
768
|
-
*/
|
|
769
|
-
MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE: 0.3,
|
|
770
|
-
|
|
771
|
-
/**
|
|
772
|
-
* Minimum duration in seconds a segment should be into a buffered range to be
|
|
773
|
-
* considered as part of that range.
|
|
774
|
-
* Segments which have less than this amount of time "linked" to a buffered
|
|
775
|
-
* range will be deleted.
|
|
776
|
-
*
|
|
777
|
-
* Setting a value too low can lead in worst-case scenarios to segments being
|
|
778
|
-
* wrongly linked to the next or previous range it is truly linked too (if
|
|
779
|
-
* those ranges are too close).
|
|
780
|
-
*
|
|
781
|
-
* Setting a value too high can lead to part of the buffer not being assigned
|
|
782
|
-
* any segment. It also limits the minimum duration a segment can be.
|
|
783
|
-
*
|
|
784
|
-
* TODO As of now, this limits the minimum size a complete segment can be. A
|
|
785
|
-
* better logic would be to also consider the duration of a segment. Though
|
|
786
|
-
* this logic could lead to bugs with the current code.
|
|
787
|
-
* @type {Number}
|
|
788
|
-
*/
|
|
789
|
-
MINIMUM_SEGMENT_SIZE: 0.005,
|
|
790
|
-
|
|
791
|
-
/**
|
|
792
|
-
* Append windows allow to filter media data from segments if they are outside
|
|
793
|
-
* a given limit.
|
|
794
|
-
* Coded frames with presentation timestamp within this range are allowed to
|
|
795
|
-
* be appended to the media buffer while coded frames outside this range are
|
|
796
|
-
* filtered out.
|
|
797
|
-
*
|
|
798
|
-
* Those are often set to be the start and end of the "Period" the segment is
|
|
799
|
-
* in.
|
|
800
|
-
* However, we noticed that some browsers were too aggressive when the exact
|
|
801
|
-
* limits were set: more data than needed was removed, often leading to
|
|
802
|
-
* discontinuities.
|
|
803
|
-
*
|
|
804
|
-
* Those securities are added to the set windows (substracted from the window
|
|
805
|
-
* start and added to the window end) to avoid those problems.
|
|
806
|
-
* @type {Object}
|
|
807
|
-
*/
|
|
808
|
-
APPEND_WINDOW_SECURITIES: {
|
|
809
|
-
START: 0.2,
|
|
810
|
-
END: 0.1,
|
|
811
|
-
},
|
|
812
|
-
|
|
813
|
-
/**
|
|
814
|
-
* Maximum interval at which text tracks are refreshed in an "html"
|
|
815
|
-
* textTrackMode.
|
|
816
|
-
*
|
|
817
|
-
* The text tracks are also refreshed on various video events, this interval
|
|
818
|
-
* will only trigger a refresh if none of those events was received during
|
|
819
|
-
* that timespan.
|
|
820
|
-
*
|
|
821
|
-
* Note that if the TextTrack cue did not change between two intervals or
|
|
822
|
-
* events, the DOM won't be refreshed.
|
|
823
|
-
* The TextTrack cues structure is also optimized for fast retrieval.
|
|
824
|
-
* We should thus not have much of a performance impact here if we set a low
|
|
825
|
-
* interval.
|
|
826
|
-
*
|
|
827
|
-
* @type {Number}
|
|
828
|
-
*/
|
|
829
|
-
MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL: 50,
|
|
830
|
-
|
|
831
|
-
/**
|
|
832
|
-
* On browsers with no ResizeObserver API, this will be the interval in
|
|
833
|
-
* milliseconds at which we should check if the text track element has
|
|
834
|
-
* changed its size, and updates proportional text-track data accordingly
|
|
835
|
-
* (like a proportional font-size).
|
|
836
|
-
*
|
|
837
|
-
* This is only used:
|
|
838
|
-
* - in an "html" textTrackMode
|
|
839
|
-
* - when some styling is proportional in the text track data
|
|
840
|
-
*
|
|
841
|
-
* Putting a value too low will render faster but might use to much proc time.
|
|
842
|
-
* Putting a value too high might provoke a re-render too late after the user
|
|
843
|
-
* changed the element's size (e.g. when going to fullscreen mode).
|
|
844
|
-
*
|
|
845
|
-
* @type {Number}
|
|
846
|
-
*/
|
|
847
|
-
TEXT_TRACK_SIZE_CHECKS_INTERVAL: 250,
|
|
848
|
-
|
|
849
|
-
/**
|
|
850
|
-
* The Buffer padding is a time offset from the current time that affects
|
|
851
|
-
* the buffer.
|
|
852
|
-
*
|
|
853
|
-
* Basically, from a given time, if the current buffer gap number (time
|
|
854
|
-
* between the current time and the end of the downloaded buffer) is above
|
|
855
|
-
* the padding described here (of the corresponding type), we won't
|
|
856
|
-
* reschedule segments for that range.
|
|
857
|
-
*
|
|
858
|
-
* This is to avoid excessive re-buffering.
|
|
859
|
-
*
|
|
860
|
-
* Keeping the padding too low would increase the risk of re-bufferings.
|
|
861
|
-
*
|
|
862
|
-
* Keeping the padding too high would delay visible quality increase.
|
|
863
|
-
*
|
|
864
|
-
* @type {Object}
|
|
865
|
-
*/
|
|
866
|
-
BUFFER_PADDING: {
|
|
867
|
-
audio: 1, // only "audio" segments
|
|
868
|
-
video: 3, // only "video" segments
|
|
869
|
-
other: 1, // tracks which are not audio/video (text images).
|
|
870
|
-
},
|
|
871
|
-
|
|
872
|
-
/**
|
|
873
|
-
* Segments of different types are downloaded by steps:
|
|
874
|
-
*
|
|
875
|
-
* - first the audio/video/text Segments which are immediately needed
|
|
876
|
-
*
|
|
877
|
-
* - then once every of those Segments have been downloaded, less-needed
|
|
878
|
-
* Segments
|
|
879
|
-
*
|
|
880
|
-
* - then once every of those less-needed Segments have been downloaded,
|
|
881
|
-
* even less-needed Segments
|
|
882
|
-
*
|
|
883
|
-
* - etc.
|
|
884
|
-
*
|
|
885
|
-
* This stepped download strategy allows to make a better use of network
|
|
886
|
-
* ressources.
|
|
887
|
-
*
|
|
888
|
-
* For example, if more than sufficient audio buffer has been downloaded but
|
|
889
|
-
* the immediately-needed video Segment is still pending its request, we might
|
|
890
|
-
* be in a situation of rebuffering.
|
|
891
|
-
* In that case, a better strategy would be to make sure every network
|
|
892
|
-
* ressource is allocated for this video Segment before rebuffering happens.
|
|
893
|
-
*
|
|
894
|
-
* This is where those steps become useful.
|
|
895
|
-
*
|
|
896
|
-
* --
|
|
897
|
-
*
|
|
898
|
-
* The numbers defined in this Array describe what the steps are.
|
|
899
|
-
*
|
|
900
|
-
* Each number is linked to a distance from the current playing position, in
|
|
901
|
-
* seconds.
|
|
902
|
-
* Distances which will be used as limit points, from which a new step is
|
|
903
|
-
* reached (see example).
|
|
904
|
-
*
|
|
905
|
-
* In the RxPlayer's code, each step is then translated in to a priority
|
|
906
|
-
* number.
|
|
907
|
-
* The lower is that number, the lower is the step and the lower is the step,
|
|
908
|
-
* the higher is the priority.
|
|
909
|
-
*
|
|
910
|
-
* Note: You can set an empty array to deactivate the steps feature (every
|
|
911
|
-
* Segments have the same priority).
|
|
912
|
-
*
|
|
913
|
-
* @example
|
|
914
|
-
*
|
|
915
|
-
* let's imagine the following SEGMENT_PRIORITIES_STEPS array:
|
|
916
|
-
* [5, 11, 17, 25]
|
|
917
|
-
*
|
|
918
|
-
* To link each Segments to a corresponding priority number (and thus to a
|
|
919
|
-
* specific step), we have to consider the distance between the current
|
|
920
|
-
* position and the start time of the Segment.
|
|
921
|
-
*
|
|
922
|
-
* We have in our example 5 groups, which correspond to the following possible
|
|
923
|
-
* distances:
|
|
924
|
-
* 1. inferior to 5 => first step (priority number = 0)
|
|
925
|
-
* 2. between 5 and 11 => second step (priority number = 1)
|
|
926
|
-
* 3. between 11 and 17 => third step (priority number = 2)
|
|
927
|
-
* 4. between 17 and 25 => fourth step (priority number = 3)
|
|
928
|
-
* 5. superior to 25 => fifth step (priority number = 4)
|
|
929
|
-
*
|
|
930
|
-
* Segments corresponding to a lower-step will need to all be downloaded
|
|
931
|
-
* before Segments of a newer step begin.
|
|
932
|
-
*
|
|
933
|
-
* @type {Array.<Number>}
|
|
934
|
-
*/
|
|
935
|
-
SEGMENT_PRIORITIES_STEPS : [ 2, // 1st Step (priority number = 0): < 2
|
|
936
|
-
4, // 2nd Step (priority number = 1): 2-4
|
|
937
|
-
8, // 3rd Step (priority number = 2): 4-8
|
|
938
|
-
12, // 4th Step (priority number = 3): 8-12
|
|
939
|
-
18, // 5th Step (priority number = 4): 12-18
|
|
940
|
-
25], // 6th Step (priority number = 5): 18-25
|
|
941
|
-
// 7th Step (priority number = 6): >= 25
|
|
942
|
-
|
|
943
|
-
/**
|
|
944
|
-
* Some segment requests are said to be "high priority".
|
|
945
|
-
*
|
|
946
|
-
* Requests in that category once done will cancel any segment request that
|
|
947
|
-
* has a low priority number (see `SEGMENT_PRIORITIES_STEPS`) - meaning a
|
|
948
|
-
* priority number equal to `MIN_CANCELABLE_PRIORITY` or more.
|
|
949
|
-
*
|
|
950
|
-
* Enter here the last priority number that is considered high priority
|
|
951
|
-
* (beginning by the first step, which has the priority number `0`).
|
|
952
|
-
* @type {number}
|
|
953
|
-
*/
|
|
954
|
-
MAX_HIGH_PRIORITY_LEVEL: 1, // priority number 1 and lower is high priority
|
|
955
|
-
|
|
956
|
-
/**
|
|
957
|
-
* Enter here the first priority step (see `SEGMENT_PRIORITIES_STEPS`) that
|
|
958
|
-
* will be considered as low priority.
|
|
959
|
-
*
|
|
960
|
-
* Segment requests with a low priority will be cancelled if a high priority
|
|
961
|
-
* segment request (see MAX_HIGH_PRIORITY_LEVEL) is scheduled while they are
|
|
962
|
-
* pending.
|
|
963
|
-
*
|
|
964
|
-
* This number should be strictly superior to the value indicated in
|
|
965
|
-
* `MAX_HIGH_PRIORITY_LEVEL`.
|
|
966
|
-
* @type {number}
|
|
967
|
-
*/
|
|
968
|
-
MIN_CANCELABLE_PRIORITY: 3, // priority number 3 onward can be cancelled
|
|
969
|
-
|
|
970
|
-
/**
|
|
971
|
-
* Codecs used in the videoCapabilities of the MediaKeySystemConfiguration
|
|
972
|
-
* (DRM).
|
|
973
|
-
*
|
|
974
|
-
* Defined in order of importance (first will be tested first etc.)
|
|
975
|
-
* @type {Array.<string>}
|
|
976
|
-
*/
|
|
977
|
-
EME_DEFAULT_VIDEO_CODECS: [ "video/mp4;codecs=\"avc1.4d401e\"",
|
|
978
|
-
"video/mp4;codecs=\"avc1.42e01e\"",
|
|
979
|
-
"video/webm;codecs=\"vp8\"" ],
|
|
980
|
-
|
|
981
|
-
/**
|
|
982
|
-
* Codecs used in the audioCapabilities of the MediaKeySystemConfiguration
|
|
983
|
-
* (DRM).
|
|
984
|
-
*
|
|
985
|
-
* Defined in order of importance (first will be tested first etc.)
|
|
986
|
-
* @type {Array.<string>}
|
|
987
|
-
*/
|
|
988
|
-
EME_DEFAULT_AUDIO_CODECS: [ "audio/mp4;codecs=\"mp4a.40.2\"",
|
|
989
|
-
"audio/webm;codecs=opus" ],
|
|
990
|
-
|
|
991
|
-
/**
|
|
992
|
-
* Robustnesses used in the {audio,video}Capabilities of the
|
|
993
|
-
* MediaKeySystemConfiguration (DRM).
|
|
994
|
-
*
|
|
995
|
-
* Only used for widevine keysystems.
|
|
996
|
-
*
|
|
997
|
-
* Defined in order of importance (first will be tested first etc.)
|
|
998
|
-
* @type {Array.<string>}
|
|
999
|
-
*/
|
|
1000
|
-
EME_DEFAULT_WIDEVINE_ROBUSTNESSES: [ "HW_SECURE_ALL",
|
|
1001
|
-
"HW_SECURE_DECODE",
|
|
1002
|
-
"HW_SECURE_CRYPTO",
|
|
1003
|
-
"SW_SECURE_DECODE",
|
|
1004
|
-
"SW_SECURE_CRYPTO" ],
|
|
1005
|
-
|
|
1006
|
-
/**
|
|
1007
|
-
* Robustnesses used in the {audio,video}Capabilities of the
|
|
1008
|
-
* MediaKeySystemConfiguration (DRM).
|
|
1009
|
-
*
|
|
1010
|
-
* Only used for "com.microsoft.playready.recommendation" key system.
|
|
1011
|
-
*
|
|
1012
|
-
* Defined in order of importance (first will be tested first etc.)
|
|
1013
|
-
* @type {Array.<string>}
|
|
1014
|
-
*/
|
|
1015
|
-
EME_DEFAULT_PLAYREADY_ROBUSTNESSES: [ "3000", "2000" ],
|
|
1016
|
-
|
|
1017
|
-
/**
|
|
1018
|
-
* Link canonical key systems names to their respective reverse domain name,
|
|
1019
|
-
* used in the EME APIs.
|
|
1020
|
-
* This allows to have a simpler API, where users just need to set "widevine"
|
|
1021
|
-
* or "playready" as a keySystem.
|
|
1022
|
-
* @type {Object}
|
|
1023
|
-
*/
|
|
1024
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
1025
|
-
EME_KEY_SYSTEMS: {
|
|
1026
|
-
clearkey: [ "webkit-org.w3.clearkey",
|
|
1027
|
-
"org.w3.clearkey" ],
|
|
1028
|
-
widevine: [ "com.widevine.alpha" ],
|
|
1029
|
-
playready: [ "com.microsoft.playready.recommendation",
|
|
1030
|
-
"com.microsoft.playready",
|
|
1031
|
-
"com.chromecast.playready",
|
|
1032
|
-
"com.youtube.playready" ],
|
|
1033
|
-
fairplay: [ "com.apple.fps.1_0" ],
|
|
1034
|
-
} as Partial<Record<string, string[]>>,
|
|
1035
|
-
/* eslint-enable @typescript-eslint/consistent-type-assertions */
|
|
1036
|
-
|
|
1037
|
-
/**
|
|
1038
|
-
* The Manifest parsing logic has a notion of "unsafeMode" which allows to
|
|
1039
|
-
* speed-up this process a lot with a small risk of de-synchronization with
|
|
1040
|
-
* what actually is on the server.
|
|
1041
|
-
* Because using that mode is risky, and can lead to all sort of problems, we
|
|
1042
|
-
* regularly should fall back to a regular "safe" parsing every once in a
|
|
1043
|
-
* while.
|
|
1044
|
-
* This value defines how many consecutive time maximum the "unsafeMode"
|
|
1045
|
-
* parsing can be done.
|
|
1046
|
-
*/
|
|
1047
|
-
MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE: 10,
|
|
1048
|
-
|
|
1049
|
-
/**
|
|
1050
|
-
* Minimum time spent parsing the Manifest before we can authorize parsing
|
|
1051
|
-
* it in an "unsafeMode", to speed-up the process with a little risk.
|
|
1052
|
-
* Please note that this parsing time also sometimes includes idle time such
|
|
1053
|
-
* as when the parser is waiting for a request to finish.
|
|
1054
|
-
*/
|
|
1055
|
-
MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE: 200,
|
|
1056
|
-
|
|
1057
|
-
/**
|
|
1058
|
-
* Minimum amount of <S> elements in a DASH MPD's <SegmentTimeline> element
|
|
1059
|
-
* necessary to begin parsing the current SegmentTimeline element in an
|
|
1060
|
-
* unsafe manner (meaning: with risks of de-synchronization).
|
|
1061
|
-
* This is only done when the "unsafeMode" parsing mode is enabled.
|
|
1062
|
-
*/
|
|
1063
|
-
MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY: 300,
|
|
1064
|
-
|
|
1065
|
-
/**
|
|
1066
|
-
* When we detect that the local Manifest might be out-of-sync with the
|
|
1067
|
-
* server's one, we schedule a Manifest refresh.
|
|
1068
|
-
* However, as this "unsynchronization" is only a theory and as we do not want
|
|
1069
|
-
* to send too many Manifest requests, we keep a delay between the last
|
|
1070
|
-
* Manifest refresh done and that one.
|
|
1071
|
-
* This value indicates which delay we want. Note that the Manifest could
|
|
1072
|
-
* still be refreshed before this delay for other reasons.
|
|
1073
|
-
* @type {Number}
|
|
1074
|
-
*/
|
|
1075
|
-
OUT_OF_SYNC_MANIFEST_REFRESH_DELAY: 3000,
|
|
1076
|
-
|
|
1077
|
-
/**
|
|
1078
|
-
* When a partial Manifest update (that is an update with a partial sub-set
|
|
1079
|
-
* of the Manifest) fails, we will perform an update with the whole Manifest
|
|
1080
|
-
* instead.
|
|
1081
|
-
* To not overload the client - as parsing a Manifest can be resource heavy -
|
|
1082
|
-
* we set a minimum delay to wait before doing the corresponding request.
|
|
1083
|
-
* @type {Number}
|
|
1084
|
-
*/
|
|
1085
|
-
FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY: 3000,
|
|
1086
|
-
|
|
1087
|
-
/**
|
|
1088
|
-
* DASH Manifest based on a SegmentTimeline should normally have an
|
|
1089
|
-
* MPD@minimumUpdatePeriod attribute which should be sufficient to
|
|
1090
|
-
* know when to refresh it.
|
|
1091
|
-
* However, there is a specific case, for when it is equal to 0.
|
|
1092
|
-
* As of DASH-IF IOP (valid in v4.3), when a DASH's MPD set a
|
|
1093
|
-
* MPD@minimumUpdatePeriod to `0`, a client should not refresh the MPD
|
|
1094
|
-
* unless told to do so through inband events, in the stream.
|
|
1095
|
-
* In reality however, we found it to not always be the case (even with
|
|
1096
|
-
* DASH-IF own streams) and moreover to not always be the best thing to do.
|
|
1097
|
-
* We prefer to refresh in average at a regular interval when we do not have
|
|
1098
|
-
* this information.
|
|
1099
|
-
* /!\ This value is expressed in seconds.
|
|
1100
|
-
*/
|
|
1101
|
-
DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0: 3,
|
|
1102
|
-
|
|
1103
|
-
/**
|
|
1104
|
-
* Default value for the maximum number of simultaneous MediaKeySessions that
|
|
1105
|
-
* will be kept in a cache (linked to the MediaKeys instance) to avoid doing
|
|
1106
|
-
* superfluous license requests.
|
|
1107
|
-
*
|
|
1108
|
-
* If this number is reached, any new session creation will close the oldest
|
|
1109
|
-
* one.
|
|
1110
|
-
* Another value can be configured through the API, in which case this default
|
|
1111
|
-
* will be overwritten.
|
|
1112
|
-
* @type {Number}
|
|
1113
|
-
*/
|
|
1114
|
-
EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS: 15,
|
|
1115
|
-
|
|
1116
|
-
/**
|
|
1117
|
-
* When playing contents with a persistent license, we will usually store some
|
|
1118
|
-
* information related to that MediaKeySession, to be able to play it at a
|
|
1119
|
-
* later time.
|
|
1120
|
-
*
|
|
1121
|
-
* Those information are removed once a MediaKeySession is not considered
|
|
1122
|
-
* as "usable" anymore. But to know that, the RxPlayer has to load it.
|
|
1123
|
-
*
|
|
1124
|
-
* But the RxPlayer does not re-load every persisted MediaKeySession every
|
|
1125
|
-
* time to check each one of them one by one, as this would not be a
|
|
1126
|
-
* performant thing to do.
|
|
1127
|
-
*
|
|
1128
|
-
* So this is only done when and if the corresponding content is encountered
|
|
1129
|
-
* again and only if it contains the same initialization data.
|
|
1130
|
-
*
|
|
1131
|
-
* We have to consider that those "information" contain binary data which can
|
|
1132
|
-
* be of arbitrary length. Size taken by an array of them can relatively
|
|
1133
|
-
* rapidly take a lot of space in JS memory.
|
|
1134
|
-
*
|
|
1135
|
-
* So to avoid this storage to take too much space (would it be in the chosen
|
|
1136
|
-
* browser's storage or in JS memory), we now set a higher bound for the
|
|
1137
|
-
* amount of MediaKeySession information that can be stored at the same time.
|
|
1138
|
-
*
|
|
1139
|
-
* I set the value of 1000 here, as it seems big enough to not be considered a
|
|
1140
|
-
* problem (though it can become one, when contents have a lot of keys per
|
|
1141
|
-
* content), and still low enough so it should not cause much problem (my
|
|
1142
|
-
* method to choose that number was to work with power of 10s and choosing the
|
|
1143
|
-
* amount which seemed the most sensible one).
|
|
1144
|
-
*
|
|
1145
|
-
* This wasn't battle-tested however.
|
|
1146
|
-
*/
|
|
1147
|
-
EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION: 1000,
|
|
1148
|
-
|
|
1149
|
-
/**
|
|
1150
|
-
* After loading a persistent MediaKeySession, the RxPlayer needs to ensure
|
|
1151
|
-
* that its keys still allow to decrypt a content.
|
|
1152
|
-
*
|
|
1153
|
-
* However on some browsers, the `keyStatuses` property that we used to check
|
|
1154
|
-
* the keys' satuses linked to that session can be empty for some time after
|
|
1155
|
-
* the loading operation is done.
|
|
1156
|
-
*
|
|
1157
|
-
* This value allows to configure a delay in milliseconds that will be the
|
|
1158
|
-
* maximum time we will wait after a persistent session is loaded.
|
|
1159
|
-
* If after that time, the `keyStatuses` property is still empty, we will
|
|
1160
|
-
* consider that session as not usable.
|
|
1161
|
-
*/
|
|
1162
|
-
EME_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES: 100,
|
|
1163
|
-
|
|
1164
|
-
/**
|
|
1165
|
-
* The player relies on browser events and properties to update its status to
|
|
1166
|
-
* "ENDED".
|
|
1167
|
-
*
|
|
1168
|
-
* Sadly in some cases, like in Chrome 54, this event is never triggered on
|
|
1169
|
-
* some contents probably due to a browser bug.
|
|
1170
|
-
*
|
|
1171
|
-
* This threshold resolves this issue by forcing the status to "ENDED" when:
|
|
1172
|
-
* 1. the player is stalling
|
|
1173
|
-
* 2. the absolute difference between current playback time and duration is
|
|
1174
|
-
* under this value
|
|
1175
|
-
*
|
|
1176
|
-
* If set to null, this workaround is disabled and the player only relies on
|
|
1177
|
-
* browser events.
|
|
1178
|
-
*
|
|
1179
|
-
* @type {Number|null}
|
|
1180
|
-
*/
|
|
1181
|
-
FORCED_ENDED_THRESHOLD: 0.0008,
|
|
1182
|
-
|
|
1183
|
-
/**
|
|
1184
|
-
* Maximum duration from the current position we will let in the buffer when
|
|
1185
|
-
* switching an Adaptation of a given type.
|
|
1186
|
-
*
|
|
1187
|
-
* For example, if we have ``text: { before: 1, after: 4 }``, it means that
|
|
1188
|
-
* when switching subtitles, we will let 1 second before and 4 second after
|
|
1189
|
-
* the current position in the previous language (until the new segments
|
|
1190
|
-
* overwrite it).
|
|
1191
|
-
* This is to allow smooth transitions and avoid de-synchronization that
|
|
1192
|
-
* can happen when removing the content being decoded.
|
|
1193
|
-
* @type {Object}
|
|
1194
|
-
*/
|
|
1195
|
-
ADAPTATION_SWITCH_BUFFER_PADDINGS: {
|
|
1196
|
-
video: { before: 5, after: 5 },
|
|
1197
|
-
audio: { before: 2, after: 2.5 },
|
|
1198
|
-
text: { before: 0, after: 0 }, // not managed natively, so no problem here
|
|
1199
|
-
image: { before: 0, after: 0 }, // not managed natively, so no problem here
|
|
1200
|
-
},
|
|
1201
|
-
|
|
1202
|
-
/**
|
|
1203
|
-
* Interval, in milliseconds, at which we should manually flush
|
|
1204
|
-
* SourceBuffers.
|
|
1205
|
-
* Some browsers (happened with firefox 66) sometimes "forget" to send us
|
|
1206
|
-
* `update` or `updateend` events.
|
|
1207
|
-
* In that case, we're completely unable to continue the queue here and
|
|
1208
|
-
* stay locked in a waiting state.
|
|
1209
|
-
* This interval is here to check at regular intervals if the underlying
|
|
1210
|
-
* SourceBuffer is currently updating.
|
|
1211
|
-
* @type {Number}
|
|
1212
|
-
*/
|
|
1213
|
-
SOURCE_BUFFER_FLUSHING_INTERVAL: 500,
|
|
1214
|
-
|
|
1215
|
-
/**
|
|
1216
|
-
* Any already-pushed segment starting before or at the current position +
|
|
1217
|
-
* CONTENT_REPLACEMENT_PADDING won't be replaced by new segments.
|
|
1218
|
-
*
|
|
1219
|
-
* This allows to avoid overwriting segments that are currently being decoded
|
|
1220
|
-
* as we encountered many decoding issues when doing so.
|
|
1221
|
-
* @type {Number} - in seconds
|
|
1222
|
-
*/
|
|
1223
|
-
CONTENT_REPLACEMENT_PADDING: 1.2,
|
|
1224
|
-
|
|
1225
|
-
/**
|
|
1226
|
-
* For video and audio segments, determines two thresholds below which :
|
|
1227
|
-
* - The segment is considered as loaded from cache
|
|
1228
|
-
* - The segment may be loaded from cache depending on the previous request
|
|
1229
|
-
*/
|
|
1230
|
-
CACHE_LOAD_DURATION_THRESHOLDS: {
|
|
1231
|
-
video: 50,
|
|
1232
|
-
audio: 10,
|
|
1233
|
-
},
|
|
1234
|
-
|
|
1235
|
-
/** Interval we will use to poll for checking if an event shall be emitted */
|
|
1236
|
-
STREAM_EVENT_EMITTER_POLL_INTERVAL: 250,
|
|
1237
|
-
|
|
1238
|
-
/**
|
|
1239
|
-
* In Javascript, numbers are encoded in a way that a floating number may be
|
|
1240
|
-
* represented internally with a rounding error. When multiplying times in
|
|
1241
|
-
* seconds by the timescale, we've encoutered cases were the rounding error
|
|
1242
|
-
* was amplified by a factor which is about the timescale.
|
|
1243
|
-
* Example :
|
|
1244
|
-
* (192797480.641122).toFixed(20) = 192797480.64112201333045959473
|
|
1245
|
-
* (error is 0.0000000133...)
|
|
1246
|
-
* 192797480.641122 * 10000000 = 1927974806411220.2 (error is 0.2)
|
|
1247
|
-
* 192797480.641122 * 10000000 * 4 = 7711899225644881 (error is 1)
|
|
1248
|
-
* The error is much more significant here, once the timescale has been
|
|
1249
|
-
* applied.
|
|
1250
|
-
* Thus, we consider that our max tolerable rounding error is 1ms.
|
|
1251
|
-
* It is much more than max rounding errors when seen into practice,
|
|
1252
|
-
* and not significant from the media loss perspective.
|
|
1253
|
-
*/
|
|
1254
|
-
DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR: 1 / 1000,
|
|
1255
|
-
|
|
1256
|
-
/**
|
|
1257
|
-
* RxPlayer's media buffers have a linked history registering recent events
|
|
1258
|
-
* that happened on those.
|
|
1259
|
-
* The reason is to implement various heuristics in case of weird browser
|
|
1260
|
-
* behavior.
|
|
1261
|
-
*
|
|
1262
|
-
* The `BUFFERED_HISTORY_RETENTION_TIME` is the minimum age an entry of
|
|
1263
|
-
* that history can have before being removed from the history.
|
|
1264
|
-
*/
|
|
1265
|
-
BUFFERED_HISTORY_RETENTION_TIME: 60000,
|
|
1266
|
-
|
|
1267
|
-
/**
|
|
1268
|
-
* RxPlayer's media buffers have a linked history registering recent events
|
|
1269
|
-
* that happened on those.
|
|
1270
|
-
* The reason is to implement various heuristics in case of weird browser
|
|
1271
|
-
* behavior.
|
|
1272
|
-
*
|
|
1273
|
-
* The `BUFFERED_HISTORY_RETENTION_TIME` is the maximum number of entries
|
|
1274
|
-
* there can be in that history.
|
|
1275
|
-
*/
|
|
1276
|
-
BUFFERED_HISTORY_MAXIMUM_ENTRIES: 200,
|
|
1277
|
-
|
|
1278
|
-
/**
|
|
1279
|
-
* Minimum buffer in seconds ahead relative to current time
|
|
1280
|
-
* we should be able to download, even in cases of saturated memory.
|
|
1281
|
-
*/
|
|
1282
|
-
MIN_BUFFER_AHEAD: 5,
|
|
1283
|
-
|
|
1284
|
-
/**
|
|
1285
|
-
* Distance in seconds behind the current position
|
|
1286
|
-
* the player will free up to in the case we agressively free up memory
|
|
1287
|
-
* It is set to avoid playback issues
|
|
1288
|
-
*/
|
|
1289
|
-
UPTO_CURRENT_POSITION_CLEANUP : 5,
|
|
1290
|
-
};
|
|
1291
|
-
|
|
1292
|
-
export type IDefaultConfig = typeof DEFAULT_CONFIG;
|
|
1293
|
-
export default DEFAULT_CONFIG;
|