rx-player 3.26.3-dev.2022021400 → 3.27.0-dev.2022032100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +0 -4
- package/CHANGELOG.md +17 -2
- package/FILES.md +5 -4
- package/VERSION +1 -1
- package/dist/_esm5.processed/compat/browser_detection.d.ts +4 -2
- package/dist/_esm5.processed/compat/browser_detection.js +4 -2
- package/dist/_esm5.processed/compat/eme/close_session.d.ts +11 -5
- package/dist/_esm5.processed/compat/eme/close_session.js +143 -36
- package/dist/_esm5.processed/compat/eme/custom_key_system_access.d.ts +15 -0
- package/dist/_esm5.processed/compat/eme/custom_key_system_access.js +1 -17
- package/dist/_esm5.processed/compat/eme/custom_media_keys/ie11_media_keys.js +6 -7
- package/dist/_esm5.processed/compat/eme/custom_media_keys/index.d.ts +3 -5
- package/dist/_esm5.processed/compat/eme/custom_media_keys/index.js +20 -22
- package/dist/_esm5.processed/compat/eme/custom_media_keys/old_webkit_media_keys.js +58 -40
- package/dist/_esm5.processed/compat/eme/custom_media_keys/webkit_media_keys.js +49 -48
- package/dist/_esm5.processed/compat/eme/generate_key_request.d.ts +2 -3
- package/dist/_esm5.processed/compat/eme/generate_key_request.js +22 -26
- package/dist/_esm5.processed/compat/eme/load_session.d.ts +1 -2
- package/dist/_esm5.processed/compat/eme/load_session.js +67 -17
- package/dist/_esm5.processed/compat/event_listeners.js +2 -1
- package/dist/_esm5.processed/compat/should_favour_custom_safari_EME.js +2 -2
- package/dist/_esm5.processed/config.d.ts +166 -1080
- package/dist/_esm5.processed/config.js +17 -1119
- package/dist/_esm5.processed/core/abr/bandwidth_estimator.js +4 -1
- package/dist/_esm5.processed/core/abr/network_analyzer.js +2 -1
- package/dist/_esm5.processed/core/api/get_player_state.js +1 -1
- package/dist/_esm5.processed/core/api/index.d.ts +2 -1
- package/dist/_esm5.processed/core/api/media_element_track_choice_manager.js +2 -1
- package/dist/_esm5.processed/core/api/option_utils.d.ts +6 -3
- package/dist/_esm5.processed/core/api/option_utils.js +21 -7
- package/dist/_esm5.processed/core/api/playback_observer.js +5 -1
- package/dist/_esm5.processed/core/api/public_api.d.ts +82 -71
- package/dist/_esm5.processed/core/api/public_api.js +73 -35
- package/dist/_esm5.processed/core/{eme → decrypt}/__tests__/__global__/utils.d.ts +7 -49
- package/dist/_esm5.processed/core/{eme → decrypt}/__tests__/__global__/utils.js +25 -65
- package/dist/_esm5.processed/core/{eme → decrypt}/attach_media_keys.d.ts +12 -12
- package/dist/_esm5.processed/core/decrypt/attach_media_keys.js +103 -0
- package/dist/_esm5.processed/core/{eme/clear_eme_session.d.ts → decrypt/clear_on_stop.d.ts} +3 -4
- package/dist/_esm5.processed/core/decrypt/clear_on_stop.js +40 -0
- package/dist/_esm5.processed/core/decrypt/content_decryptor.d.ts +216 -0
- package/dist/_esm5.processed/core/decrypt/content_decryptor.js +865 -0
- package/dist/_esm5.processed/core/{eme/get_session.d.ts → decrypt/create_or_load_session.d.ts} +28 -26
- package/dist/_esm5.processed/core/decrypt/create_or_load_session.js +124 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/create_session.d.ts +22 -19
- package/dist/_esm5.processed/core/decrypt/create_session.js +173 -0
- package/dist/_esm5.processed/core/{eme/dispose_media_keys.d.ts → decrypt/dispose_decryption_resources.d.ts} +4 -4
- package/dist/_esm5.processed/core/decrypt/dispose_decryption_resources.js +81 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/find_key_system.d.ts +11 -14
- package/dist/_esm5.processed/core/decrypt/find_key_system.js +299 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/get_current_key_system.d.ts +0 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/get_current_key_system.js +1 -1
- package/dist/_esm5.processed/core/{eme → decrypt}/get_media_keys.d.ts +13 -5
- package/dist/_esm5.processed/core/decrypt/get_media_keys.js +153 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/index.d.ts +5 -6
- package/dist/_esm5.processed/core/{eme → decrypt}/index.js +5 -5
- package/dist/_esm5.processed/core/{eme → decrypt}/init_media_keys.d.ts +6 -4
- package/dist/_esm5.processed/core/decrypt/init_media_keys.js +82 -0
- package/dist/_esm5.processed/core/decrypt/session_events_listener.d.ts +77 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/session_events_listener.js +25 -24
- package/dist/_esm5.processed/core/{eme → decrypt}/set_server_certificate.d.ts +15 -6
- package/dist/_esm5.processed/core/decrypt/set_server_certificate.js +141 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/types.d.ts +119 -241
- package/dist/_esm5.processed/core/{eme → decrypt}/types.js +0 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/utils/are_init_values_compatible.d.ts +3 -3
- package/dist/_esm5.processed/core/{eme → decrypt}/utils/are_init_values_compatible.js +5 -5
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/check_key_statuses.d.ts +2 -2
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/check_key_statuses.js +4 -3
- package/dist/_esm5.processed/core/{eme/utils/close_session.d.ts → decrypt/utils/clean_old_loaded_sessions.d.ts} +8 -7
- package/dist/_esm5.processed/core/decrypt/utils/clean_old_loaded_sessions.js +84 -0
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/clean_old_stored_persistent_info.d.ts +1 -1
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/clean_old_stored_persistent_info.js +2 -2
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/get_drm_system_id.d.ts +0 -0
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/get_drm_system_id.js +1 -1
- package/dist/_esm5.processed/core/decrypt/utils/init_data_values_container.d.ts +69 -0
- package/dist/_esm5.processed/core/decrypt/utils/init_data_values_container.js +99 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/utils/is_session_usable.d.ts +0 -1
- package/dist/_esm5.processed/core/{eme → decrypt}/utils/is_session_usable.js +4 -5
- package/dist/_esm5.processed/core/decrypt/utils/key_id_comparison.d.ts +44 -0
- package/dist/_esm5.processed/core/decrypt/utils/key_id_comparison.js +77 -0
- package/dist/_esm5.processed/core/decrypt/utils/key_session_record.d.ts +104 -0
- package/dist/_esm5.processed/core/decrypt/utils/key_session_record.js +155 -0
- package/dist/_esm5.processed/core/decrypt/utils/loaded_sessions_store.d.ts +108 -0
- package/dist/_esm5.processed/core/decrypt/utils/loaded_sessions_store.js +302 -0
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/media_keys_infos_store.d.ts +4 -4
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/media_keys_infos_store.js +0 -0
- package/dist/_esm5.processed/core/{eme → decrypt}/utils/persistent_sessions_store.d.ts +8 -18
- package/dist/_esm5.processed/core/{eme → decrypt}/utils/persistent_sessions_store.js +119 -97
- package/dist/_esm5.processed/core/{eme/utils/init_data_container.d.ts → decrypt/utils/serializable_bytes.d.ts} +8 -5
- package/dist/_esm5.processed/core/{eme/utils/init_data_container.js → decrypt/utils/serializable_bytes.js} +9 -9
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/server_certificate_store.d.ts +1 -1
- package/dist/_esm5.processed/core/{eme → decrypt/utils}/server_certificate_store.js +1 -1
- package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +3 -5
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +1 -1
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.js +1 -1
- package/dist/_esm5.processed/core/fetchers/utils/try_urls_with_backoff.js +2 -3
- package/dist/_esm5.processed/core/init/get_initial_time.js +1 -1
- package/dist/_esm5.processed/core/init/initialize_directfile.d.ts +1 -1
- package/dist/_esm5.processed/core/init/initialize_directfile.js +11 -17
- package/dist/_esm5.processed/core/init/initialize_media_source.d.ts +6 -3
- package/dist/_esm5.processed/core/init/initialize_media_source.js +18 -69
- package/dist/_esm5.processed/core/init/link_drm_and_content.d.ts +61 -0
- package/dist/_esm5.processed/core/init/link_drm_and_content.js +94 -0
- package/dist/_esm5.processed/core/init/manifest_update_scheduler.js +2 -1
- package/dist/_esm5.processed/core/init/stall_avoider.js +1 -1
- package/dist/_esm5.processed/core/init/stream_events_emitter/stream_events_emitter.js +1 -1
- package/dist/_esm5.processed/core/init/types.d.ts +2 -4
- package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +1 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +3 -1
- package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.d.ts +17 -1
- package/dist/_esm5.processed/core/segment_buffers/inventory/segment_inventory.js +22 -5
- package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.d.ts +2 -1
- package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +6 -3
- package/dist/_esm5.processed/core/stream/events_generators.d.ts +8 -3
- package/dist/_esm5.processed/core/stream/events_generators.js +3 -2
- package/dist/_esm5.processed/core/stream/index.d.ts +1 -0
- package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.d.ts +1 -0
- package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +3 -3
- package/dist/_esm5.processed/core/stream/period/create_empty_adaptation_stream.js +2 -1
- package/dist/_esm5.processed/core/stream/period/get_adaptation_switch_strategy.d.ts +15 -11
- package/dist/_esm5.processed/core/stream/period/get_adaptation_switch_strategy.js +6 -3
- package/dist/_esm5.processed/core/stream/period/index.d.ts +1 -0
- package/dist/_esm5.processed/core/stream/period/period_stream.d.ts +5 -12
- package/dist/_esm5.processed/core/stream/period/period_stream.js +3 -3
- package/dist/_esm5.processed/core/stream/representation/force_garbage_collection.js +2 -2
- package/dist/_esm5.processed/core/stream/representation/get_buffer_status.d.ts +6 -1
- package/dist/_esm5.processed/core/stream/representation/get_buffer_status.js +12 -9
- package/dist/_esm5.processed/core/stream/representation/get_needed_segments.d.ts +19 -14
- package/dist/_esm5.processed/core/stream/representation/get_needed_segments.js +86 -10
- package/dist/_esm5.processed/core/stream/representation/get_segment_priority.js +1 -1
- package/dist/_esm5.processed/core/stream/representation/push_media_segment.js +3 -3
- package/dist/_esm5.processed/core/stream/representation/representation_stream.d.ts +6 -0
- package/dist/_esm5.processed/core/stream/representation/representation_stream.js +19 -8
- package/dist/_esm5.processed/core/stream/types.d.ts +1 -1
- package/dist/_esm5.processed/default_config.d.ts +1114 -0
- package/dist/_esm5.processed/default_config.js +1145 -0
- package/dist/_esm5.processed/experimental/index.d.ts +2 -0
- package/dist/_esm5.processed/experimental/index.js +2 -0
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/push_data.d.ts +1 -0
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/thumbnail_loader.js +6 -7
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/index.js +2 -3
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.d.ts +15 -0
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.js +1 -2
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.js +3 -5
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.js +3 -5
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +1 -2
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +1 -2
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
- package/dist/_esm5.processed/features/features_object.js +1 -1
- package/dist/_esm5.processed/features/initialize_features.js +1 -1
- package/dist/_esm5.processed/features/list/eme.d.ts +3 -3
- package/dist/_esm5.processed/features/list/eme.js +5 -5
- package/dist/_esm5.processed/features/types.d.ts +3 -3
- package/dist/_esm5.processed/manifest/manifest.d.ts +1 -14
- package/dist/_esm5.processed/manifest/manifest.js +10 -74
- package/dist/_esm5.processed/manifest/representation.d.ts +35 -3
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/is_period_fulfilled.js +1 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.js +1 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +87 -75
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.js +1 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +4 -5
- package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.js +1 -0
- package/dist/_esm5.processed/public_types.d.ts +3 -2
- package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +1 -2
- package/dist/_esm5.processed/transports/dash/image_pipelines.d.ts +4 -3
- package/dist/_esm5.processed/transports/dash/image_pipelines.js +60 -11
- package/dist/_esm5.processed/transports/dash/init_segment_loader.js +1 -2
- package/dist/_esm5.processed/transports/dash/manifest_parser.js +2 -3
- package/dist/_esm5.processed/transports/dash/segment_loader.d.ts +1 -1
- package/dist/_esm5.processed/transports/dash/segment_loader.js +3 -4
- package/dist/_esm5.processed/transports/dash/segment_parser.js +6 -3
- package/dist/_esm5.processed/transports/dash/text_loader.js +1 -2
- package/dist/_esm5.processed/transports/dash/text_parser.js +8 -2
- package/dist/_esm5.processed/transports/local/segment_loader.js +2 -3
- package/dist/_esm5.processed/transports/local/segment_parser.js +4 -1
- package/dist/_esm5.processed/transports/local/text_parser.js +8 -2
- package/dist/_esm5.processed/transports/metaplaylist/pipelines.js +2 -3
- package/dist/_esm5.processed/transports/smooth/pipelines.js +71 -14
- package/dist/_esm5.processed/transports/smooth/segment_loader.js +3 -4
- package/dist/_esm5.processed/transports/types.d.ts +22 -0
- package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +1 -2
- package/dist/_esm5.processed/utils/cancellable_sleep.js +1 -2
- package/dist/_esm5.processed/utils/cast_to_observable.js +1 -3
- package/dist/_esm5.processed/utils/deep_merge.d.ts +12 -0
- package/dist/_esm5.processed/utils/deep_merge.js +53 -0
- package/dist/_esm5.processed/utils/reference.d.ts +29 -0
- package/dist/_esm5.processed/utils/reference.js +72 -24
- package/dist/_esm5.processed/utils/request/fetch.js +1 -2
- package/dist/_esm5.processed/utils/request/xhr.js +2 -3
- package/dist/_esm5.processed/utils/rx-from_cancellable_promise.js +7 -2
- package/dist/_esm5.processed/utils/task_canceller.d.ts +5 -3
- package/dist/_esm5.processed/utils/task_canceller.js +3 -3
- package/dist/rx-player.js +4936 -3340
- package/dist/rx-player.min.js +1 -1
- package/dummy +1 -0
- package/{dist/_esm5.processed/utils/promise.d.ts → experimental/index.d.ts} +1 -2
- package/{dist/_esm5.processed/utils/promise.js → experimental/index.js} +1 -3
- package/package.json +32 -35
- package/{src/typings/pinkie.d.ts → scripts/build/templates/experimental/index.d.ts} +1 -4
- package/scripts/build/templates/experimental/index.js +16 -0
- package/scripts/update-version +2 -2
- package/sonar-project.properties +1 -1
- package/src/README.md +6 -6
- package/src/compat/__tests__/play.test.ts +2 -4
- package/src/compat/__tests__/should_favour_custom_safari_EME.test.ts +45 -5
- package/src/compat/browser_detection.ts +4 -2
- package/src/compat/eme/close_session.ts +89 -56
- package/src/compat/eme/custom_key_system_access.ts +1 -2
- package/src/compat/eme/custom_media_keys/ie11_media_keys.ts +6 -7
- package/src/compat/eme/custom_media_keys/index.ts +20 -38
- package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +68 -52
- package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +57 -56
- package/src/compat/eme/generate_key_request.ts +25 -33
- package/src/compat/eme/load_session.ts +28 -31
- package/src/compat/event_listeners.ts +2 -1
- package/src/compat/should_favour_custom_safari_EME.ts +5 -2
- package/src/config.ts +17 -1210
- package/src/core/README.md +1 -1
- package/src/core/abr/bandwidth_estimator.ts +4 -4
- package/src/core/abr/network_analyzer.ts +5 -6
- package/src/core/api/__tests__/get_player_state.test.ts +3 -3
- package/src/core/api/__tests__/option_utils.test.ts +29 -17
- package/src/core/api/get_player_state.ts +1 -1
- package/src/core/api/index.ts +3 -0
- package/src/core/api/option_utils.ts +42 -23
- package/src/core/api/playback_observer.ts +12 -8
- package/src/core/api/public_api.ts +152 -113
- package/src/core/decrypt/README.md +22 -0
- package/src/core/decrypt/__tests__/__global__/get_license.test.ts +418 -0
- package/src/core/decrypt/__tests__/__global__/init_data.test.ts +675 -0
- package/src/core/{eme → decrypt}/__tests__/__global__/media_key_system_access.test.ts +99 -92
- package/src/core/decrypt/__tests__/__global__/media_keys.test.ts +156 -0
- package/src/core/decrypt/__tests__/__global__/server_certificate.test.ts +262 -0
- package/src/core/{eme → decrypt}/__tests__/__global__/utils.ts +31 -93
- package/src/core/{eme → decrypt}/attach_media_keys.ts +48 -56
- package/src/core/decrypt/clear_on_stop.ts +47 -0
- package/src/core/decrypt/content_decryptor.ts +1157 -0
- package/src/core/decrypt/create_or_load_session.ts +130 -0
- package/src/core/decrypt/create_session.ts +174 -0
- package/src/core/decrypt/dispose_decryption_resources.ts +39 -0
- package/src/core/{eme → decrypt}/find_key_system.ts +111 -122
- package/src/core/{eme → decrypt}/get_current_key_system.ts +1 -1
- package/src/core/decrypt/get_media_keys.ts +145 -0
- package/src/core/{eme → decrypt}/index.ts +11 -8
- package/src/core/decrypt/init_media_keys.ts +51 -0
- package/src/core/{eme → decrypt}/session_events_listener.ts +93 -55
- package/src/core/decrypt/set_server_certificate.ts +104 -0
- package/src/core/{eme → decrypt}/types.ts +128 -258
- package/src/core/{eme → decrypt}/utils/__tests__/are_init_values_compatible.test.ts +1 -1
- package/src/core/{eme → decrypt/utils}/__tests__/clean_old_loaded_sessions.test.ts +29 -71
- package/src/core/{eme → decrypt/utils}/__tests__/clean_old_stored_persistent_info.test.ts +6 -6
- package/src/core/{eme → decrypt}/utils/are_init_values_compatible.ts +9 -9
- package/src/core/{eme → decrypt/utils}/check_key_statuses.ts +6 -5
- package/{dist/_esm5.processed/core/eme/clean_old_loaded_sessions.js → src/core/decrypt/utils/clean_old_loaded_sessions.ts} +19 -20
- package/src/core/{eme → decrypt/utils}/clean_old_stored_persistent_info.ts +3 -3
- package/src/core/{eme → decrypt/utils}/get_drm_system_id.ts +1 -1
- package/src/core/decrypt/utils/init_data_values_container.ts +119 -0
- package/src/core/{eme → decrypt}/utils/is_session_usable.ts +4 -5
- package/src/core/decrypt/utils/key_id_comparison.ts +82 -0
- package/src/core/decrypt/utils/key_session_record.ts +175 -0
- package/src/core/decrypt/utils/loaded_sessions_store.ts +317 -0
- package/src/core/{eme → decrypt/utils}/media_keys_infos_store.ts +4 -4
- package/src/core/{eme → decrypt}/utils/persistent_sessions_store.ts +122 -104
- package/src/core/{eme/utils/init_data_container.ts → decrypt/utils/serializable_bytes.ts} +8 -5
- package/src/core/{eme → decrypt/utils}/server_certificate_store.ts +2 -2
- package/src/core/fetchers/manifest/manifest_fetcher.ts +5 -7
- package/src/core/fetchers/segment/segment_fetcher.ts +4 -4
- package/src/core/fetchers/segment/segment_fetcher_creator.ts +2 -2
- package/src/core/fetchers/utils/try_urls_with_backoff.ts +2 -3
- package/src/core/init/.initialize_media_source.ts.un~ +0 -0
- package/src/core/init/get_initial_time.ts +2 -1
- package/src/core/init/initialize_directfile.ts +17 -20
- package/src/core/init/initialize_media_source.ts +44 -106
- package/src/core/init/link_drm_and_content.ts +176 -0
- package/src/core/init/manifest_update_scheduler.ts +5 -3
- package/src/core/init/stall_avoider.ts +6 -5
- package/src/core/init/stream_events_emitter/stream_events_emitter.ts +2 -1
- package/src/core/init/types.ts +1 -39
- package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +2 -1
- package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +3 -4
- package/src/core/segment_buffers/inventory/segment_inventory.ts +42 -8
- package/src/core/stream/adaptation/adaptation_stream.ts +7 -1
- package/src/core/stream/events_generators.ts +9 -4
- package/src/core/stream/index.ts +1 -0
- package/src/core/stream/orchestrator/stream_orchestrator.ts +9 -4
- package/src/core/stream/period/create_empty_adaptation_stream.ts +2 -1
- package/src/core/stream/period/get_adaptation_switch_strategy.ts +25 -15
- package/src/core/stream/period/index.ts +1 -0
- package/src/core/stream/period/period_stream.ts +10 -16
- package/src/core/stream/representation/force_garbage_collection.ts +2 -2
- package/src/core/stream/representation/get_buffer_status.ts +28 -16
- package/src/core/stream/representation/get_needed_segments.ts +124 -28
- package/src/core/stream/representation/get_segment_priority.ts +1 -2
- package/src/core/stream/representation/push_media_segment.ts +3 -2
- package/src/core/stream/representation/representation_stream.ts +30 -7
- package/src/core/stream/types.ts +1 -1
- package/src/default_config.ts +1241 -0
- package/src/experimental/index.ts +5 -0
- package/src/experimental/tools/VideoThumbnailLoader/push_data.ts +1 -0
- package/src/experimental/tools/VideoThumbnailLoader/thumbnail_loader.ts +7 -7
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +3 -10
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +9 -10
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/decodingInfos.test.ts +2 -4
- package/src/experimental/tools/mediaCapabilitiesProber/api/index.ts +2 -3
- package/src/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.ts +1 -2
- package/src/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.ts +3 -5
- package/src/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.ts +3 -5
- package/src/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.ts +1 -2
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.ts +1 -2
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts +1 -2
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +1 -2
- package/src/features/__tests__/initialize_features.test.ts +2 -2
- package/src/features/features_object.ts +1 -1
- package/src/features/initialize_features.ts +1 -1
- package/src/features/list/__tests__/eme.test.ts +5 -5
- package/src/features/list/eme.ts +5 -5
- package/src/features/types.ts +3 -10
- package/src/manifest/manifest.ts +6 -76
- package/src/manifest/representation.ts +36 -3
- package/src/parsers/manifest/dash/common/indexes/is_period_fulfilled.ts +1 -2
- package/src/parsers/manifest/dash/common/indexes/template.ts +1 -2
- package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +1 -1
- package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +109 -64
- package/src/parsers/manifest/dash/common/parse_mpd.ts +1 -2
- package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +4 -5
- package/src/parsers/manifest/smooth/create_parser.ts +1 -0
- package/src/parsers/texttracks/webvtt/html/__tests__/create_styled_element.test.ts +1 -0
- package/src/public_types.ts +6 -1
- package/src/transports/dash/add_segment_integrity_checks_to_loader.ts +1 -2
- package/src/transports/dash/image_pipelines.ts +15 -14
- package/src/transports/dash/init_segment_loader.ts +1 -2
- package/src/transports/dash/manifest_parser.ts +2 -3
- package/src/transports/dash/segment_loader.ts +4 -5
- package/src/transports/dash/segment_parser.ts +5 -0
- package/src/transports/dash/text_loader.ts +2 -3
- package/src/transports/dash/text_parser.ts +8 -0
- package/src/transports/local/segment_loader.ts +2 -3
- package/src/transports/local/segment_parser.ts +4 -0
- package/src/transports/local/text_parser.ts +8 -0
- package/src/transports/metaplaylist/pipelines.ts +2 -3
- package/src/transports/smooth/pipelines.ts +26 -14
- package/src/transports/smooth/segment_loader.ts +5 -6
- package/src/transports/types.ts +22 -0
- package/src/transports/utils/call_custom_manifest_loader.ts +1 -2
- package/src/utils/__tests__/deep_merge.test.ts +48 -0
- package/src/utils/cancellable_sleep.ts +1 -2
- package/src/utils/cast_to_observable.ts +0 -2
- package/src/utils/deep_merge.ts +46 -0
- package/src/utils/reference.ts +116 -23
- package/src/utils/request/fetch.ts +1 -2
- package/src/utils/request/xhr.ts +3 -3
- package/src/utils/rx-from_cancellable_promise.ts +7 -2
- package/src/utils/task_canceller.ts +6 -4
- package/tsconfig.json +0 -1
- package/tsconfig.modules.json +0 -1
- package/dist/_esm5.processed/core/eme/attach_media_keys.js +0 -57
- package/dist/_esm5.processed/core/eme/clean_old_loaded_sessions.d.ts +0 -59
- package/dist/_esm5.processed/core/eme/clear_eme_session.js +0 -50
- package/dist/_esm5.processed/core/eme/create_session.js +0 -126
- package/dist/_esm5.processed/core/eme/dispose_eme.d.ts +0 -19
- package/dist/_esm5.processed/core/eme/dispose_eme.js +0 -23
- package/dist/_esm5.processed/core/eme/dispose_media_keys.js +0 -36
- package/dist/_esm5.processed/core/eme/eme_manager.d.ts +0 -31
- package/dist/_esm5.processed/core/eme/eme_manager.js +0 -278
- package/dist/_esm5.processed/core/eme/find_key_system.js +0 -253
- package/dist/_esm5.processed/core/eme/get_media_keys.js +0 -85
- package/dist/_esm5.processed/core/eme/get_session.js +0 -68
- package/dist/_esm5.processed/core/eme/init_media_keys.js +0 -66
- package/dist/_esm5.processed/core/eme/session_events_listener.d.ts +0 -41
- package/dist/_esm5.processed/core/eme/set_server_certificate.js +0 -85
- package/dist/_esm5.processed/core/eme/utils/close_session.js +0 -81
- package/dist/_esm5.processed/core/eme/utils/init_data_store.d.ts +0 -115
- package/dist/_esm5.processed/core/eme/utils/init_data_store.js +0 -181
- package/dist/_esm5.processed/core/eme/utils/loaded_sessions_store.d.ts +0 -123
- package/dist/_esm5.processed/core/eme/utils/loaded_sessions_store.js +0 -173
- package/dist/_esm5.processed/core/init/create_eme_manager.d.ts +0 -34
- package/dist/_esm5.processed/core/init/create_eme_manager.js +0 -52
- package/src/core/eme/README.md +0 -26
- package/src/core/eme/__tests__/__global__/get_license.test.ts +0 -414
- package/src/core/eme/__tests__/__global__/init_data.test.ts +0 -908
- package/src/core/eme/__tests__/__global__/media_keys.test.ts +0 -266
- package/src/core/eme/__tests__/__global__/server_certificate.test.ts +0 -364
- package/src/core/eme/__tests__/init_media_keys.test.ts +0 -182
- package/src/core/eme/clean_old_loaded_sessions.ts +0 -96
- package/src/core/eme/clear_eme_session.ts +0 -62
- package/src/core/eme/create_session.ts +0 -187
- package/src/core/eme/dispose_eme.ts +0 -25
- package/src/core/eme/dispose_media_keys.ts +0 -46
- package/src/core/eme/eme_manager.ts +0 -387
- package/src/core/eme/get_media_keys.ts +0 -141
- package/src/core/eme/get_session.ts +0 -135
- package/src/core/eme/init_media_keys.ts +0 -106
- package/src/core/eme/set_server_certificate.ts +0 -115
- package/src/core/eme/utils/close_session.ts +0 -113
- package/src/core/eme/utils/init_data_store.ts +0 -234
- package/src/core/eme/utils/loaded_sessions_store.ts +0 -235
- package/src/core/init/create_eme_manager.ts +0 -95
- package/src/utils/__tests__/promise.test.ts +0 -23
- package/src/utils/promise.ts +0 -20
|
@@ -16,6 +16,7 @@ export default function pushData(inventoryInfos: {
|
|
|
16
16
|
adaptation: Adaptation;
|
|
17
17
|
representation: Representation;
|
|
18
18
|
segment: ISegment;
|
|
19
|
+
chunkSize: number | undefined;
|
|
19
20
|
start: number;
|
|
20
21
|
end: number;
|
|
21
22
|
}, parsed: ISegmentParserParsedMediaChunk<Uint8Array | ArrayBuffer>, videoSourceBuffer: AudioVideoSegmentBuffer): Observable<void>;
|
|
@@ -17,7 +17,6 @@ import { catchError, combineLatest, finalize, ignoreElements, lastValueFrom, map
|
|
|
17
17
|
import createSegmentFetcher from "../../../core/fetchers/segment/segment_fetcher";
|
|
18
18
|
import log from "../../../log";
|
|
19
19
|
import objectAssign from "../../../utils/object_assign";
|
|
20
|
-
import PPromise from "../../../utils/promise";
|
|
21
20
|
import { freeRequest } from "./create_request";
|
|
22
21
|
import getCompleteSegmentId from "./get_complete_segment_id";
|
|
23
22
|
import getContentInfos from "./get_content_infos";
|
|
@@ -68,16 +67,16 @@ var VideoThumbnailLoader = /** @class */ (function () {
|
|
|
68
67
|
}
|
|
69
68
|
var manifest = this._player.getManifest();
|
|
70
69
|
if (manifest === null) {
|
|
71
|
-
return
|
|
70
|
+
return Promise.reject(new VideoThumbnailLoaderError("NO_MANIFEST", "No manifest available."));
|
|
72
71
|
}
|
|
73
72
|
var contentInfos = getContentInfos(time, manifest);
|
|
74
73
|
if (contentInfos === null) {
|
|
75
|
-
return
|
|
74
|
+
return Promise.reject(new VideoThumbnailLoaderError("NO_TRACK", "Couldn't find track for this time."));
|
|
76
75
|
}
|
|
77
76
|
var segments = contentInfos
|
|
78
77
|
.representation.index.getSegments(time, MIN_NEEDED_DATA_AFTER_TIME);
|
|
79
78
|
if (segments.length === 0) {
|
|
80
|
-
return
|
|
79
|
+
return Promise.reject(new VideoThumbnailLoaderError("NO_THUMBNAIL", "Couldn't find thumbnail for the given time."));
|
|
81
80
|
}
|
|
82
81
|
for (var j = 0; j < segments.length; j++) {
|
|
83
82
|
var _a = segments[j], stime = _a.time, duration = _a.duration, timescale = _a.timescale;
|
|
@@ -95,7 +94,7 @@ var VideoThumbnailLoader = /** @class */ (function () {
|
|
|
95
94
|
if (segments.length === 0) {
|
|
96
95
|
this._videoElement.currentTime = time;
|
|
97
96
|
log.debug("VTL: Thumbnails already loaded.", time);
|
|
98
|
-
return
|
|
97
|
+
return Promise.resolve(time);
|
|
99
98
|
}
|
|
100
99
|
log.debug("VTL: Found thumbnail for time", time, segments);
|
|
101
100
|
if (this._currentTask !== undefined) {
|
|
@@ -132,7 +131,7 @@ var VideoThumbnailLoader = /** @class */ (function () {
|
|
|
132
131
|
var error = new VideoThumbnailLoaderError("NO_LOADER", "VideoThumbnailLoaderError: No " +
|
|
133
132
|
"imported loader for this transport type: " +
|
|
134
133
|
contentInfos.manifest.transport);
|
|
135
|
-
return
|
|
134
|
+
return Promise.reject(error);
|
|
136
135
|
}
|
|
137
136
|
var killTask$ = new Subject();
|
|
138
137
|
var abortError$ = killTask$.pipe(map(function () {
|
|
@@ -166,7 +165,7 @@ var VideoThumbnailLoader = /** @class */ (function () {
|
|
|
166
165
|
if (end === undefined) {
|
|
167
166
|
end = start + (segment.duration / segment.timescale);
|
|
168
167
|
}
|
|
169
|
-
var inventoryInfos = objectAssign({ segment: segment, start: start, end: end }, contentInfos);
|
|
168
|
+
var inventoryInfos = objectAssign({ chunkSize: data.chunkSize, segment: segment, start: start, end: end }, contentInfos);
|
|
170
169
|
return pushData(inventoryInfos, data, videoSourceBuffer)
|
|
171
170
|
.pipe(tap(function () {
|
|
172
171
|
freeRequest(getCompleteSegmentId(inventoryInfos, segment));
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import arrayFind from "../../../../utils/array_find";
|
|
17
|
-
import PPromise from "../../../../utils/promise";
|
|
18
17
|
import log from "../log";
|
|
19
18
|
import { ProberStatus, } from "../types";
|
|
20
19
|
import probeMediaConfiguration from "./probeMediaConfiguration";
|
|
@@ -65,7 +64,7 @@ var mediaCapabilitiesProber = {
|
|
|
65
64
|
*/
|
|
66
65
|
getStatusForHDCP: function (hdcp) {
|
|
67
66
|
if (hdcp === undefined || hdcp.length === 0) {
|
|
68
|
-
return
|
|
67
|
+
return Promise.reject("MediaCapabilitiesProbers >>> Bad Arguments: " +
|
|
69
68
|
"No HDCP Policy specified.");
|
|
70
69
|
}
|
|
71
70
|
var config = {
|
|
@@ -125,7 +124,7 @@ var mediaCapabilitiesProber = {
|
|
|
125
124
|
return { globalStatus: ProberStatus.NotSupported };
|
|
126
125
|
}));
|
|
127
126
|
});
|
|
128
|
-
return
|
|
127
|
+
return Promise.all(promises)
|
|
129
128
|
.then(function (configs) {
|
|
130
129
|
// TODO I added those lines to work-around a type issue but does it
|
|
131
130
|
// really correspond to the original intent? I find it hard to
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2015 CANAL+ Group
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
1
16
|
import { ICapabilitiesTypes } from "../capabilities";
|
|
2
17
|
import { IResultsFromAPI } from "../probers";
|
|
3
18
|
import { IMediaConfiguration, ProberStatus } from "../types";
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import PPromise from "../../../../utils/promise";
|
|
17
16
|
import getProbedConfiguration from "../capabilities";
|
|
18
17
|
import log from "../log";
|
|
19
18
|
import probers from "../probers";
|
|
@@ -79,7 +78,7 @@ function probeMediaConfiguration(config, browserAPIS) {
|
|
|
79
78
|
var browserAPI = browserAPIS_1[_i];
|
|
80
79
|
_loop_1(browserAPI);
|
|
81
80
|
}
|
|
82
|
-
return
|
|
81
|
+
return Promise.all(promises).then(function () {
|
|
83
82
|
if (globalStatus === undefined) {
|
|
84
83
|
globalStatus = ProberStatus.Unknown;
|
|
85
84
|
}
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { lastValueFrom } from "rxjs";
|
|
17
16
|
import { requestMediaKeySystemAccess } from "../../../../compat";
|
|
18
|
-
import PPromise from "../../../../utils/promise";
|
|
19
17
|
import log from "../log";
|
|
20
18
|
import { ProberStatus, } from "../types";
|
|
21
19
|
/**
|
|
@@ -25,7 +23,7 @@ import { ProberStatus, } from "../types";
|
|
|
25
23
|
export default function probeDRMInfos(mediaConfig) {
|
|
26
24
|
var keySystem = mediaConfig.keySystem;
|
|
27
25
|
if (keySystem == null || keySystem.type == null) {
|
|
28
|
-
return
|
|
26
|
+
return Promise.reject("MediaCapabilitiesProber >>> API_CALL: " +
|
|
29
27
|
"Missing a type argument to request a media key system access.");
|
|
30
28
|
}
|
|
31
29
|
var type = keySystem.type;
|
|
@@ -37,9 +35,9 @@ export default function probeDRMInfos(mediaConfig) {
|
|
|
37
35
|
"Your browser has no API to request a media key system access.");
|
|
38
36
|
// In that case, the API lack means that no EME workflow may be started.
|
|
39
37
|
// So, the DRM configuration is not supported.
|
|
40
|
-
return
|
|
38
|
+
return Promise.resolve([ProberStatus.NotSupported, result]);
|
|
41
39
|
}
|
|
42
|
-
return
|
|
40
|
+
return requestMediaKeySystemAccess(type, [configuration])
|
|
43
41
|
.then(function (keySystemAccess) {
|
|
44
42
|
result.compatibleConfiguration = keySystemAccess.getConfiguration();
|
|
45
43
|
var status = [ProberStatus.Supported, result];
|
package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.js
CHANGED
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { lastValueFrom } from "rxjs";
|
|
17
16
|
import { requestMediaKeySystemAccess } from "../../../../compat";
|
|
18
|
-
import PPromise from "../../../../utils/promise";
|
|
19
17
|
import { ProberStatus, } from "../types";
|
|
20
18
|
/**
|
|
21
19
|
* @param {Object} config
|
|
@@ -23,11 +21,11 @@ import { ProberStatus, } from "../types";
|
|
|
23
21
|
*/
|
|
24
22
|
export default function probeHDCPPolicy(config) {
|
|
25
23
|
if (requestMediaKeySystemAccess == null) {
|
|
26
|
-
return
|
|
24
|
+
return Promise.reject("MediaCapabilitiesProber >>> API_CALL: " +
|
|
27
25
|
"API not available");
|
|
28
26
|
}
|
|
29
27
|
if (config.hdcp == null) {
|
|
30
|
-
return
|
|
28
|
+
return Promise.reject("MediaCapabilitiesProber >>> API_CALL: " +
|
|
31
29
|
"Missing policy argument for calling getStatusForPolicy.");
|
|
32
30
|
}
|
|
33
31
|
var hdcp = "hdcp-" + config.hdcp;
|
|
@@ -42,7 +40,7 @@ export default function probeHDCPPolicy(config) {
|
|
|
42
40
|
contentType: "video/mp4;codecs=\"avc1.42E01E\"",
|
|
43
41
|
}],
|
|
44
42
|
};
|
|
45
|
-
return
|
|
43
|
+
return requestMediaKeySystemAccess(keySystem, [drmConfig])
|
|
46
44
|
.then(function (mediaKeysSystemAccess) {
|
|
47
45
|
return mediaKeysSystemAccess.createMediaKeys().then(function (mediaKeys) {
|
|
48
46
|
if (!("getStatusForPolicy" in mediaKeys)) {
|
package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js
CHANGED
|
@@ -13,14 +13,13 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import PPromise from "../../../../utils/promise";
|
|
17
16
|
import { ProberStatus, } from "../types";
|
|
18
17
|
/**
|
|
19
18
|
* Check if the required APIs are available.
|
|
20
19
|
* @returns {Promise}
|
|
21
20
|
*/
|
|
22
21
|
function isMediaCapabilitiesAPIAvailable() {
|
|
23
|
-
return new
|
|
22
|
+
return new Promise(function (resolve) {
|
|
24
23
|
if (!("mediaCapabilities" in navigator)) {
|
|
25
24
|
throw new Error("MediaCapabilitiesProber >>> API_CALL: " +
|
|
26
25
|
"MediaCapabilities API not available");
|
package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js
CHANGED
|
@@ -14,14 +14,13 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { MediaSource_ } from "../../../../compat";
|
|
17
|
-
import PPromise from "../../../../utils/promise";
|
|
18
17
|
import { ProberStatus, } from "../types";
|
|
19
18
|
/**
|
|
20
19
|
* @param {Object} config
|
|
21
20
|
* @returns {Promise}
|
|
22
21
|
*/
|
|
23
22
|
export default function probeContentType(config) {
|
|
24
|
-
return new
|
|
23
|
+
return new Promise(function (resolve) {
|
|
25
24
|
if (MediaSource_ == null) {
|
|
26
25
|
throw new Error("MediaCapabilitiesProber >>> API_CALL: " +
|
|
27
26
|
"MediaSource API not available");
|
|
@@ -13,14 +13,13 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import PPromise from "../../../../../utils/promise";
|
|
17
16
|
import { ProberStatus, } from "../../types";
|
|
18
17
|
import formatConfig from "./format";
|
|
19
18
|
/**
|
|
20
19
|
* @returns {Promise}
|
|
21
20
|
*/
|
|
22
21
|
function isTypeSupportedWithFeaturesAPIAvailable() {
|
|
23
|
-
return new
|
|
22
|
+
return new Promise(function (resolve) {
|
|
24
23
|
if (!("MSMediaKeys" in window)) {
|
|
25
24
|
throw new Error("MediaCapabilitiesProber >>> API_CALL: " +
|
|
26
25
|
"MSMediaKeys API not available");
|
package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js
CHANGED
|
@@ -13,14 +13,13 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import PPromise from "../../../../utils/promise";
|
|
17
16
|
import { ProberStatus, } from "../types";
|
|
18
17
|
/**
|
|
19
18
|
* @param {Object} config
|
|
20
19
|
* @returns {Promise}
|
|
21
20
|
*/
|
|
22
21
|
export default function probeMatchMedia(config) {
|
|
23
|
-
return new
|
|
22
|
+
return new Promise(function (resolve) {
|
|
24
23
|
/* eslint-disable @typescript-eslint/unbound-method */
|
|
25
24
|
if (typeof window.matchMedia !== "function") {
|
|
26
25
|
/* eslint-enable @typescript-eslint/unbound-method */
|
|
@@ -24,7 +24,7 @@ import features from "./features_object";
|
|
|
24
24
|
*/
|
|
25
25
|
export default function initializeFeaturesObject() {
|
|
26
26
|
if (0 /* EME */ === 1 /* IS_ENABLED */) {
|
|
27
|
-
features.
|
|
27
|
+
features.ContentDecryptor = require("../core/decrypt/index.ts").default;
|
|
28
28
|
}
|
|
29
29
|
if (0 /* BIF_PARSER */ === 1 /* IS_ENABLED */) {
|
|
30
30
|
features.imageBuffer =
|
|
@@ -18,6 +18,6 @@ import { IFeaturesObject } from "../types";
|
|
|
18
18
|
* Add ability to play encrypted contents
|
|
19
19
|
* @param {Object} features
|
|
20
20
|
*/
|
|
21
|
-
declare function
|
|
22
|
-
export {
|
|
23
|
-
export default
|
|
21
|
+
declare function addEMEFeature(features: IFeaturesObject): void;
|
|
22
|
+
export { addEMEFeature as EME };
|
|
23
|
+
export default addEMEFeature;
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import
|
|
16
|
+
import ContentDecryptor from "../../core/decrypt";
|
|
17
17
|
/**
|
|
18
18
|
* Add ability to play encrypted contents
|
|
19
19
|
* @param {Object} features
|
|
20
20
|
*/
|
|
21
|
-
function
|
|
22
|
-
features.
|
|
21
|
+
function addEMEFeature(features) {
|
|
22
|
+
features.ContentDecryptor = ContentDecryptor;
|
|
23
23
|
}
|
|
24
|
-
export {
|
|
25
|
-
export default
|
|
24
|
+
export { addEMEFeature as EME };
|
|
25
|
+
export default addEMEFeature;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Observable } from "rxjs";
|
|
17
17
|
import MediaElementTrackChoiceManager from "../core/api/media_element_track_choice_manager";
|
|
18
|
-
import
|
|
18
|
+
import type ContentDecryptor from "../core/decrypt";
|
|
19
19
|
import { IDirectfileEvent, IDirectFileOptions } from "../core/init/initialize_directfile";
|
|
20
20
|
import { SegmentBuffer } from "../core/segment_buffers";
|
|
21
21
|
import { IDashParserResponse, IMPDParserArguments } from "../parsers/manifest/dash/parsers_types";
|
|
@@ -23,7 +23,7 @@ import DashWasmParser from "../parsers/manifest/dash/wasm-parser";
|
|
|
23
23
|
import { IHTMLTextTracksParserFn, INativeTextTracksParserFn } from "../parsers/texttracks";
|
|
24
24
|
import { ITransportFunction } from "../transports";
|
|
25
25
|
export declare type IDirectFileInit = (args: IDirectFileOptions) => Observable<IDirectfileEvent>;
|
|
26
|
-
export declare type
|
|
26
|
+
export declare type IContentDecryptorClass = typeof ContentDecryptor;
|
|
27
27
|
export declare type IHTMLTextTracksBuffer = new (mediaElement: HTMLMediaElement, textTrackElement: HTMLElement) => SegmentBuffer;
|
|
28
28
|
export declare type INativeTextTracksBuffer = new (mediaElement: HTMLMediaElement, hideNativeSubtitle: boolean) => SegmentBuffer;
|
|
29
29
|
export declare type IMediaElementTrackChoiceManager = typeof MediaElementTrackChoiceManager;
|
|
@@ -53,7 +53,7 @@ export interface IFeaturesObject {
|
|
|
53
53
|
initDirectFile: IDirectFileInit;
|
|
54
54
|
mediaElementTrackChoiceManager: IMediaElementTrackChoiceManager;
|
|
55
55
|
} | null;
|
|
56
|
-
|
|
56
|
+
ContentDecryptor: IContentDecryptorClass | null;
|
|
57
57
|
htmlTextTracksBuffer: IHTMLTextTracksBuffer | null;
|
|
58
58
|
htmlTextTracksParsers: Partial<Record<string, IHTMLTextTracksParserFn>>;
|
|
59
59
|
imageBuffer: IImageBuffer | null;
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { IInitializationDataInfo } from "../core/eme";
|
|
17
16
|
import { ICustomError } from "../errors";
|
|
18
17
|
import { IParsedManifest } from "../parsers/manifest";
|
|
19
18
|
import EventEmitter from "../utils/event_emitter";
|
|
@@ -271,19 +270,7 @@ export default class Manifest extends EventEmitter<IManifestEvents> {
|
|
|
271
270
|
* changes performed.
|
|
272
271
|
* @param {Object} keyUpdates
|
|
273
272
|
*/
|
|
274
|
-
|
|
275
|
-
whitelistedKeyIds: Uint8Array[];
|
|
276
|
-
blacklistedKeyIDs: Uint8Array[];
|
|
277
|
-
}): void;
|
|
278
|
-
/**
|
|
279
|
-
* Look in the Manifest for Representations linked to the given content
|
|
280
|
-
* protection initialization data and mark them as being impossible to
|
|
281
|
-
* decrypt.
|
|
282
|
-
* Then trigger a "decipherabilityUpdate" event to notify everyone of the
|
|
283
|
-
* changes performed.
|
|
284
|
-
* @param {Object} initData
|
|
285
|
-
*/
|
|
286
|
-
addUndecipherableProtectionData(initData: IInitializationDataInfo): void;
|
|
273
|
+
updateRepresentationsDeciperability(isDecipherableCb: (rep: Representation) => boolean | undefined): void;
|
|
287
274
|
/**
|
|
288
275
|
* @deprecated only returns adaptations for the first period
|
|
289
276
|
* @returns {Array.<Object>}
|
|
@@ -29,7 +29,6 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
29
29
|
};
|
|
30
30
|
})();
|
|
31
31
|
import { MediaError, } from "../errors";
|
|
32
|
-
import areArraysOfNumbersEqual from "../utils/are_arrays_of_numbers_equal";
|
|
33
32
|
import arrayFind from "../utils/array_find";
|
|
34
33
|
import EventEmitter from "../utils/event_emitter";
|
|
35
34
|
import idGenerator from "../utils/id_generator";
|
|
@@ -72,8 +71,9 @@ var Manifest = /** @class */ (function (_super) {
|
|
|
72
71
|
* @param {Object} options
|
|
73
72
|
*/
|
|
74
73
|
function Manifest(parsedManifest, options) {
|
|
74
|
+
var _this = this;
|
|
75
75
|
var _a;
|
|
76
|
-
|
|
76
|
+
_this = _super.call(this) || this;
|
|
77
77
|
var _b = options.supplementaryTextTracks, supplementaryTextTracks = _b === void 0 ? [] : _b, _c = options.supplementaryImageTracks, supplementaryImageTracks = _c === void 0 ? [] : _c, representationFilter = options.representationFilter, manifestUpdateUrl = options.manifestUpdateUrl;
|
|
78
78
|
_this.contentWarnings = [];
|
|
79
79
|
_this.id = generateNewManifestId();
|
|
@@ -234,70 +234,8 @@ var Manifest = /** @class */ (function (_super) {
|
|
|
234
234
|
* changes performed.
|
|
235
235
|
* @param {Object} keyUpdates
|
|
236
236
|
*/
|
|
237
|
-
Manifest.prototype.
|
|
238
|
-
var
|
|
239
|
-
var updates = updateDeciperability(this, function (representation) {
|
|
240
|
-
if (representation.decipherable === false ||
|
|
241
|
-
representation.contentProtections === undefined) {
|
|
242
|
-
return representation.decipherable;
|
|
243
|
-
}
|
|
244
|
-
var contentKIDs = representation.contentProtections.keyIds;
|
|
245
|
-
for (var i = 0; i < contentKIDs.length; i++) {
|
|
246
|
-
var elt = contentKIDs[i];
|
|
247
|
-
for (var j = 0; j < blacklistedKeyIDs.length; j++) {
|
|
248
|
-
if (areArraysOfNumbersEqual(blacklistedKeyIDs[j], elt.keyId)) {
|
|
249
|
-
return false;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
for (var j = 0; j < whitelistedKeyIds.length; j++) {
|
|
253
|
-
if (areArraysOfNumbersEqual(whitelistedKeyIds[j], elt.keyId)) {
|
|
254
|
-
return true;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
return representation.decipherable;
|
|
259
|
-
});
|
|
260
|
-
if (updates.length > 0) {
|
|
261
|
-
this.trigger("decipherabilityUpdate", updates);
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
/**
|
|
265
|
-
* Look in the Manifest for Representations linked to the given content
|
|
266
|
-
* protection initialization data and mark them as being impossible to
|
|
267
|
-
* decrypt.
|
|
268
|
-
* Then trigger a "decipherabilityUpdate" event to notify everyone of the
|
|
269
|
-
* changes performed.
|
|
270
|
-
* @param {Object} initData
|
|
271
|
-
*/
|
|
272
|
-
Manifest.prototype.addUndecipherableProtectionData = function (initData) {
|
|
273
|
-
var updates = updateDeciperability(this, function (representation) {
|
|
274
|
-
var _a, _b;
|
|
275
|
-
if (representation.decipherable === false) {
|
|
276
|
-
return false;
|
|
277
|
-
}
|
|
278
|
-
var segmentProtections = (_b = (_a = representation.contentProtections) === null || _a === void 0 ? void 0 : _a.initData) !== null && _b !== void 0 ? _b : [];
|
|
279
|
-
var _loop_1 = function (i) {
|
|
280
|
-
if (initData.type === undefined ||
|
|
281
|
-
segmentProtections[i].type === initData.type) {
|
|
282
|
-
var containedInitData = initData.values.every(function (undecipherableVal) {
|
|
283
|
-
return segmentProtections[i].values.some(function (currVal) {
|
|
284
|
-
return (undecipherableVal.systemId === undefined ||
|
|
285
|
-
currVal.systemId === undecipherableVal.systemId) &&
|
|
286
|
-
areArraysOfNumbersEqual(currVal.data, undecipherableVal.data);
|
|
287
|
-
});
|
|
288
|
-
});
|
|
289
|
-
if (containedInitData) {
|
|
290
|
-
return { value: false };
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
};
|
|
294
|
-
for (var i = 0; i < segmentProtections.length; i++) {
|
|
295
|
-
var state_1 = _loop_1(i);
|
|
296
|
-
if (typeof state_1 === "object")
|
|
297
|
-
return state_1.value;
|
|
298
|
-
}
|
|
299
|
-
return representation.decipherable;
|
|
300
|
-
});
|
|
237
|
+
Manifest.prototype.updateRepresentationsDeciperability = function (isDecipherableCb) {
|
|
238
|
+
var updates = updateDeciperability(this, isDecipherableCb);
|
|
301
239
|
if (updates.length > 0) {
|
|
302
240
|
this.trigger("decipherabilityUpdate", updates);
|
|
303
241
|
}
|
|
@@ -501,14 +439,12 @@ export default Manifest;
|
|
|
501
439
|
*/
|
|
502
440
|
function updateDeciperability(manifest, isDecipherable) {
|
|
503
441
|
var updates = [];
|
|
504
|
-
for (var
|
|
505
|
-
var period =
|
|
506
|
-
var
|
|
507
|
-
|
|
508
|
-
var
|
|
509
|
-
|
|
510
|
-
for (var k = 0; k < representations.length; k++) {
|
|
511
|
-
var representation = representations[k];
|
|
442
|
+
for (var _i = 0, _a = manifest.periods; _i < _a.length; _i++) {
|
|
443
|
+
var period = _a[_i];
|
|
444
|
+
for (var _b = 0, _c = period.getAdaptations(); _b < _c.length; _b++) {
|
|
445
|
+
var adaptation = _c[_b];
|
|
446
|
+
for (var _d = 0, _e = adaptation.representations; _d < _e.length; _d++) {
|
|
447
|
+
var representation = _e[_d];
|
|
512
448
|
var result = isDecipherable(representation);
|
|
513
449
|
if (result !== representation.decipherable) {
|
|
514
450
|
updates.push({ manifest: manifest, period: period, adaptation: adaptation, representation: representation });
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { IContentProtection } from "../core/eme";
|
|
17
16
|
import { IContentProtections, IParsedRepresentation } from "../parsers/manifest";
|
|
18
17
|
import { IRepresentationIndex } from "./representation_index";
|
|
19
18
|
import { IAdaptationType, IHDRInformation } from "./types";
|
|
@@ -107,7 +106,7 @@ declare class Representation {
|
|
|
107
106
|
* @param {string} drmSystemId - The hexa-encoded DRM system ID
|
|
108
107
|
* @returns {Array.<Object>}
|
|
109
108
|
*/
|
|
110
|
-
getEncryptionData(drmSystemId: string):
|
|
109
|
+
getEncryptionData(drmSystemId: string): IRepresentationProtectionData[];
|
|
111
110
|
/**
|
|
112
111
|
* Returns all currently-known encryption initialization data linked to this
|
|
113
112
|
* Representation.
|
|
@@ -134,7 +133,7 @@ declare class Representation {
|
|
|
134
133
|
* after parsing this Representation's initialization segment, if one exists.
|
|
135
134
|
* @returns {Array.<Object>}
|
|
136
135
|
*/
|
|
137
|
-
getAllEncryptionData():
|
|
136
|
+
getAllEncryptionData(): IRepresentationProtectionData[];
|
|
138
137
|
/**
|
|
139
138
|
* Add new encryption initialization data to this Representation if it was not
|
|
140
139
|
* already included.
|
|
@@ -156,4 +155,37 @@ declare class Representation {
|
|
|
156
155
|
data: Uint8Array;
|
|
157
156
|
}>): boolean;
|
|
158
157
|
}
|
|
158
|
+
/** Protection data as returned by a Representation. */
|
|
159
|
+
export interface IRepresentationProtectionData {
|
|
160
|
+
/**
|
|
161
|
+
* Initialization data type.
|
|
162
|
+
* String describing the format of the initialization data sent through this
|
|
163
|
+
* event.
|
|
164
|
+
* https://www.w3.org/TR/eme-initdata-registry/
|
|
165
|
+
*/
|
|
166
|
+
type: string;
|
|
167
|
+
/**
|
|
168
|
+
* The key ids linked to those initialization data.
|
|
169
|
+
* This should be the key ids for the key concerned by the media which have
|
|
170
|
+
* the present initialization data.
|
|
171
|
+
*
|
|
172
|
+
* `undefined` when not known (different from an empty array - which would
|
|
173
|
+
* just mean that there's no key id involved).
|
|
174
|
+
*/
|
|
175
|
+
keyIds: Uint8Array[] | undefined;
|
|
176
|
+
/** Every initialization data for that type. */
|
|
177
|
+
values: Array<{
|
|
178
|
+
/**
|
|
179
|
+
* Hex encoded system id, which identifies the key system.
|
|
180
|
+
* https://dashif.org/identifiers/content_protection/
|
|
181
|
+
*/
|
|
182
|
+
systemId: string;
|
|
183
|
+
/**
|
|
184
|
+
* The initialization data itself for that type and systemId.
|
|
185
|
+
* For example, with "cenc" initialization data found in an ISOBMFF file,
|
|
186
|
+
* this will be the whole PSSH box.
|
|
187
|
+
*/
|
|
188
|
+
data: Uint8Array;
|
|
189
|
+
}>;
|
|
190
|
+
}
|
|
159
191
|
export default Representation;
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import config from "../../../../../config";
|
|
17
|
-
var DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR = config.DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR;
|
|
18
17
|
/**
|
|
19
18
|
* In Javascript, numbers are encoded in a way that a floating number may be
|
|
20
19
|
* represented internally with a rounding error.
|
|
@@ -28,6 +27,6 @@ var DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR = config.DEFAULT_MAXIMUM_TIME_ROUNDING_E
|
|
|
28
27
|
* @returns {boolean}
|
|
29
28
|
*/
|
|
30
29
|
export default function isPeriodFulfilled(timescale, lastSegmentEnd, periodEnd) {
|
|
31
|
-
var scaledRoundingError = DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR * timescale;
|
|
30
|
+
var scaledRoundingError = config.getCurrent().DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR * timescale;
|
|
32
31
|
return (lastSegmentEnd + scaledRoundingError) >= periodEnd;
|
|
33
32
|
}
|
|
@@ -17,7 +17,6 @@ import config from "../../../../../config";
|
|
|
17
17
|
import getInitSegment from "./get_init_segment";
|
|
18
18
|
import isPeriodFulfilled from "./is_period_fulfilled";
|
|
19
19
|
import { createDashUrlDetokenizer, createIndexURLs, } from "./tokens";
|
|
20
|
-
var MINIMUM_SEGMENT_SIZE = config.MINIMUM_SEGMENT_SIZE;
|
|
21
20
|
/**
|
|
22
21
|
* IRepresentationIndex implementation for DASH' SegmentTemplate without a
|
|
23
22
|
* SegmentTimeline.
|
|
@@ -327,7 +326,7 @@ var TemplateRepresentationIndex = /** @class */ (function () {
|
|
|
327
326
|
// segment that there actually is due to a very little difference between
|
|
328
327
|
// the period's duration and a multiple of a segment's duration.
|
|
329
328
|
// Check that we're within a good margin
|
|
330
|
-
var minimumDuration = MINIMUM_SEGMENT_SIZE * timescale;
|
|
329
|
+
var minimumDuration = config.getCurrent().MINIMUM_SEGMENT_SIZE * timescale;
|
|
331
330
|
if (maximumTime - regularLastSegmentStart > minimumDuration ||
|
|
332
331
|
numberIndexedToZero === 0) {
|
|
333
332
|
return regularLastSegmentStart;
|
|
@@ -27,7 +27,6 @@ import { createIndexURLs } from "../tokens";
|
|
|
27
27
|
import constructTimelineFromElements from "./construct_timeline_from_elements";
|
|
28
28
|
// eslint-disable-next-line max-len
|
|
29
29
|
import constructTimelineFromPreviousTimeline from "./construct_timeline_from_previous_timeline";
|
|
30
|
-
var MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY = config.MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY;
|
|
31
30
|
var TimelineRepresentationIndex = /** @class */ (function () {
|
|
32
31
|
/**
|
|
33
32
|
* @param {Object} index
|
|
@@ -328,6 +327,7 @@ var TimelineRepresentationIndex = /** @class */ (function () {
|
|
|
328
327
|
}
|
|
329
328
|
var newElements = this._parseTimeline();
|
|
330
329
|
this._parseTimeline = null; // Free memory
|
|
330
|
+
var MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY = config.getCurrent().MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY;
|
|
331
331
|
if (this._unsafelyBaseOnPreviousIndex === null ||
|
|
332
332
|
newElements.length < MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY) {
|
|
333
333
|
// Just completely parse the current timeline
|