rx-player 3.26.3-dev.2022021400 → 3.27.0-dev.20220317
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 +15 -1
- 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 +144 -36
- 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 +21 -22
- package/dist/_esm5.processed/compat/eme/custom_media_keys/old_webkit_media_keys.js +53 -34
- package/dist/_esm5.processed/compat/eme/custom_media_keys/webkit_media_keys.js +43 -41
- 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 +68 -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 +3 -1
- package/dist/_esm5.processed/core/api/option_utils.js +19 -6
- 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 +72 -33
- 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 +104 -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 +41 -0
- package/dist/_esm5.processed/core/decrypt/content_decryptor.d.ts +216 -0
- package/dist/_esm5.processed/core/decrypt/content_decryptor.js +866 -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 +174 -0
- package/dist/_esm5.processed/core/decrypt/dispose_decryption_resources.d.ts +21 -0
- 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 +300 -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 +85 -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 +303 -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 +2 -2
- 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/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 +4 -2
- 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/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.js +1 -1
- package/dist/_esm5.processed/core/stream/period/period_stream.d.ts +2 -1
- 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 +1 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.js +1 -2
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.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/smooth/create_parser.js +1 -0
- package/dist/_esm5.processed/public_types.d.ts +2 -2
- package/dist/_esm5.processed/transports/dash/image_pipelines.js +3 -0
- package/dist/_esm5.processed/transports/dash/segment_parser.js +6 -3
- package/dist/_esm5.processed/transports/dash/text_parser.js +8 -2
- 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/smooth/pipelines.js +68 -10
- package/dist/_esm5.processed/transports/types.d.ts +22 -0
- 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 +1 -1
- 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 +5002 -3033
- package/dist/rx-player.min.js +1 -1
- package/dummy +1 -0
- package/{dist/_esm5.processed/core/eme/dispose_eme.d.ts → experimental/index.d.ts} +1 -4
- package/{dist/_esm5.processed/core/eme/dispose_media_keys.d.ts → experimental/index.js} +1 -6
- package/package.json +32 -34
- package/scripts/build/templates/experimental/index.d.ts +16 -0
- package/scripts/build/templates/experimental/index.js +16 -0
- package/sonar-project.properties +1 -1
- package/src/README.md +6 -6
- 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 +90 -56
- package/src/compat/eme/custom_media_keys/index.ts +21 -38
- package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +63 -46
- package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +51 -49
- package/src/compat/eme/generate_key_request.ts +25 -33
- package/src/compat/eme/load_session.ts +29 -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 +17 -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 +37 -20
- package/src/core/api/playback_observer.ts +12 -8
- package/src/core/api/public_api.ts +151 -111
- 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 +49 -56
- package/src/core/decrypt/clear_on_stop.ts +48 -0
- package/src/core/decrypt/content_decryptor.ts +1158 -0
- package/src/core/decrypt/create_or_load_session.ts +130 -0
- package/src/core/decrypt/create_session.ts +175 -0
- package/src/core/decrypt/dispose_decryption_resources.ts +39 -0
- package/src/core/{eme → decrypt}/find_key_system.ts +112 -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} +20 -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 +318 -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 +4 -4
- package/src/core/fetchers/segment/segment_fetcher.ts +4 -4
- package/src/core/fetchers/segment/segment_fetcher_creator.ts +2 -2
- 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 +42 -105
- 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/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 +1 -1
- package/src/core/stream/period/period_stream.ts +5 -2
- 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 +2 -1
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +3 -10
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +4 -4
- package/src/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.ts +1 -2
- package/src/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.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/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 +5 -1
- package/src/transports/dash/image_pipelines.ts +3 -0
- package/src/transports/dash/segment_parser.ts +5 -0
- package/src/transports/dash/text_parser.ts +8 -0
- package/src/transports/local/segment_parser.ts +4 -0
- package/src/transports/local/text_parser.ts +8 -0
- package/src/transports/smooth/pipelines.ts +22 -9
- package/src/transports/types.ts +22 -0
- package/src/utils/__tests__/deep_merge.test.ts +48 -0
- 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 +2 -1
- package/src/utils/rx-from_cancellable_promise.ts +7 -2
- package/src/utils/task_canceller.ts +6 -4
- 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.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
|
@@ -33,7 +33,6 @@ import getMinimumAndMaximumPosition from "./get_minimum_and_maximum_positions";
|
|
|
33
33
|
import parseAvailabilityStartTime from "./parse_availability_start_time";
|
|
34
34
|
import parsePeriods from "./parse_periods";
|
|
35
35
|
import resolveBaseURLs from "./resolve_base_urls";
|
|
36
|
-
var DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0 = config.DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0;
|
|
37
36
|
/**
|
|
38
37
|
* Checks if xlinks needs to be loaded before actually parsing the manifest.
|
|
39
38
|
* @param {Object} mpdIR
|
|
@@ -157,7 +156,7 @@ function parseCompleteIntermediateRepresentation(mpdIR, args, warnings, xlinkInf
|
|
|
157
156
|
if (rootAttributes.minimumUpdatePeriod !== undefined &&
|
|
158
157
|
rootAttributes.minimumUpdatePeriod >= 0) {
|
|
159
158
|
lifetime = rootAttributes.minimumUpdatePeriod === 0 ?
|
|
160
|
-
DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0 :
|
|
159
|
+
config.getCurrent().DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0 :
|
|
161
160
|
rootAttributes.minimumUpdatePeriod;
|
|
162
161
|
}
|
|
163
162
|
var _d = getMinimumAndMaximumPosition(parsedPeriods), contentStart = _d[0], contentEnd = _d[1];
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
* This file exports types we want to expose to library users.
|
|
18
18
|
* Those types are considered as part of the API.
|
|
19
19
|
*/
|
|
20
|
-
export { IConstructorOptions, ILoadVideoOptions, ITransportOptions, IKeySystemOption, ISupplementaryTextTrackOption, ISupplementaryImageTrackOption, IDefaultAudioTrackOption, IDefaultTextTrackOption, INetworkConfigOption, IStartAtOption, ITMAudioTrackListItem as IAvailableAudioTrack, ITMTextTrackListItem as IAvailableTextTrack, ITMVideoTrackListItem as IAvailableVideoTrack, ITMAudioTrack as IAudioTrack, ITMTextTrack as ITextTrack, ITMVideoTrack as IVideoTrack, IAudioTrackPreference, ITextTrackPreference, IVideoTrackPreference, IStreamEvent, IStreamEventData, } from "./core/api";
|
|
21
|
-
export { IPersistentSessionInfo, IPersistentSessionStorage, } from "./core/
|
|
20
|
+
export { IConstructorOptions, ILoadVideoOptions, ITransportOptions, IKeySystemOption, ISupplementaryTextTrackOption, ISupplementaryImageTrackOption, IDefaultAudioTrackOption, IDefaultTextTrackOption, INetworkConfigOption, IStartAtOption, ITMAudioTrackListItem as IAvailableAudioTrack, ITMTextTrackListItem as IAvailableTextTrack, ITMVideoTrackListItem as IAvailableVideoTrack, ITMAudioTrack as IAudioTrack, ITMTextTrack as ITextTrack, ITMVideoTrack as IVideoTrack, IAudioTrackPreference, ITextTrackPreference, IVideoTrackPreference, IBitrateEstimate, IPositionUpdateItem as IPositionUpdate, IPlayerState, IStreamEvent, IStreamEventData, } from "./core/api";
|
|
21
|
+
export { IPersistentSessionInfo, IPersistentSessionStorage, } from "./core/decrypt";
|
|
22
22
|
export { ICustomError as IPlayerError } from "./errors";
|
|
23
23
|
export { IExposedAdaptation as IAdaptation, IExposedManifest as IManifest, IExposedPeriod as IPeriod, IExposedRepresentation as IRepresentation, IExposedSegment as ISegment, IRepresentationFilter, IRepresentationInfos, } from "./manifest";
|
|
24
24
|
export { ICustomSegmentLoader as ISegmentLoader, ICustomManifestLoader as IManifestLoader, } from "./transports";
|
|
@@ -47,6 +47,7 @@ export function imageParser(loadedSegment, content) {
|
|
|
47
47
|
if (content.segment.isInit) { // image init segment has no use
|
|
48
48
|
return { segmentType: "init",
|
|
49
49
|
initializationData: null,
|
|
50
|
+
initializationDataSize: 0,
|
|
50
51
|
protectionDataUpdate: false,
|
|
51
52
|
initTimescale: undefined };
|
|
52
53
|
}
|
|
@@ -58,6 +59,7 @@ export function imageParser(loadedSegment, content) {
|
|
|
58
59
|
if (data === null || features.imageParser === null) {
|
|
59
60
|
return { segmentType: "media",
|
|
60
61
|
chunkData: null,
|
|
62
|
+
chunkSize: 0,
|
|
61
63
|
chunkInfos: { duration: segment.duration,
|
|
62
64
|
time: segment.time }, chunkOffset: chunkOffset, protectionDataUpdate: false,
|
|
63
65
|
appendWindow: [period.start, period.end] };
|
|
@@ -70,6 +72,7 @@ export function imageParser(loadedSegment, content) {
|
|
|
70
72
|
end: Number.MAX_VALUE,
|
|
71
73
|
timescale: 1,
|
|
72
74
|
type: "bif" },
|
|
75
|
+
chunkSize: undefined,
|
|
73
76
|
chunkInfos: { time: 0,
|
|
74
77
|
duration: Number.MAX_VALUE }, chunkOffset: chunkOffset, protectionDataUpdate: false,
|
|
75
78
|
appendWindow: [period.start, period.end] };
|
|
@@ -36,11 +36,13 @@ export default function generateAudioVideoSegmentParser(_a) {
|
|
|
36
36
|
if (segment.isInit) {
|
|
37
37
|
return { segmentType: "init",
|
|
38
38
|
initializationData: null,
|
|
39
|
+
initializationDataSize: 0,
|
|
39
40
|
protectionDataUpdate: false,
|
|
40
41
|
initTimescale: undefined };
|
|
41
42
|
}
|
|
42
43
|
return { segmentType: "media",
|
|
43
44
|
chunkData: null,
|
|
45
|
+
chunkSize: 0,
|
|
44
46
|
chunkInfos: null,
|
|
45
47
|
chunkOffset: 0,
|
|
46
48
|
protectionDataUpdate: false, appendWindow: appendWindow };
|
|
@@ -74,11 +76,11 @@ export default function generateAudioVideoSegmentParser(_a) {
|
|
|
74
76
|
var events = getEventsOutOfEMSGs(whitelistedEMSGs, manifest.publishTime);
|
|
75
77
|
if (events !== undefined) {
|
|
76
78
|
var needsManifestRefresh = events.needsManifestRefresh, inbandEvents = events.inbandEvents;
|
|
77
|
-
return { segmentType: "media", chunkData: chunkData, chunkInfos: chunkInfos, chunkOffset: chunkOffset, appendWindow: appendWindow, inbandEvents: inbandEvents, protectionDataUpdate: protectionDataUpdate, needsManifestRefresh: needsManifestRefresh };
|
|
79
|
+
return { segmentType: "media", chunkData: chunkData, chunkSize: chunkData.length, chunkInfos: chunkInfos, chunkOffset: chunkOffset, appendWindow: appendWindow, inbandEvents: inbandEvents, protectionDataUpdate: protectionDataUpdate, needsManifestRefresh: needsManifestRefresh };
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
|
-
return { segmentType: "media", chunkData: chunkData, chunkInfos: chunkInfos, chunkOffset: chunkOffset, protectionDataUpdate: protectionDataUpdate, appendWindow: appendWindow };
|
|
83
|
+
return { segmentType: "media", chunkData: chunkData, chunkSize: chunkData.length, chunkInfos: chunkInfos, chunkOffset: chunkOffset, protectionDataUpdate: protectionDataUpdate, appendWindow: appendWindow };
|
|
82
84
|
}
|
|
83
85
|
// we're handling an initialization segment
|
|
84
86
|
var indexRange = segment.indexRange;
|
|
@@ -117,6 +119,7 @@ export default function generateAudioVideoSegmentParser(_a) {
|
|
|
117
119
|
var parsedTimescale = isNullOrUndefined(timescale) ? undefined :
|
|
118
120
|
timescale;
|
|
119
121
|
return { segmentType: "init",
|
|
120
|
-
initializationData: chunkData,
|
|
122
|
+
initializationData: chunkData,
|
|
123
|
+
initializationDataSize: chunkData.length, protectionDataUpdate: protectionDataUpdate, initTimescale: parsedTimescale };
|
|
121
124
|
};
|
|
122
125
|
}
|
|
@@ -71,13 +71,14 @@ function parseISOBMFFEmbeddedTextTrack(data, isChunked, content, initTimescale,
|
|
|
71
71
|
}
|
|
72
72
|
return { segmentType: "init",
|
|
73
73
|
initializationData: null,
|
|
74
|
+
initializationDataSize: 0,
|
|
74
75
|
protectionDataUpdate: false,
|
|
75
76
|
initTimescale: mdhdTimescale };
|
|
76
77
|
}
|
|
77
78
|
var chunkInfos = getISOBMFFTimingInfos(chunkBytes, isChunked, segment, initTimescale);
|
|
78
79
|
var chunkData = getISOBMFFEmbeddedTextTrackData(content, chunkBytes, chunkInfos, isChunked);
|
|
79
80
|
var chunkOffset = takeFirstSet(segment.timestampOffset, 0);
|
|
80
|
-
return { segmentType: "media", chunkData: chunkData, chunkInfos: chunkInfos, chunkOffset: chunkOffset, protectionDataUpdate: false,
|
|
81
|
+
return { segmentType: "media", chunkData: chunkData, chunkSize: chunkBytes.length, chunkInfos: chunkInfos, chunkOffset: chunkOffset, protectionDataUpdate: false,
|
|
81
82
|
appendWindow: [period.start, period.end] };
|
|
82
83
|
}
|
|
83
84
|
/**
|
|
@@ -97,20 +98,23 @@ function parsePlainTextTrack(data, isChunked, content) {
|
|
|
97
98
|
if (segment.isInit) {
|
|
98
99
|
return { segmentType: "init",
|
|
99
100
|
initializationData: null,
|
|
101
|
+
initializationDataSize: 0,
|
|
100
102
|
protectionDataUpdate: false,
|
|
101
103
|
initTimescale: undefined };
|
|
102
104
|
}
|
|
103
105
|
var textTrackData;
|
|
106
|
+
var chunkSize;
|
|
104
107
|
if (typeof data !== "string") {
|
|
105
108
|
var bytesData = data instanceof Uint8Array ? data :
|
|
106
109
|
new Uint8Array(data);
|
|
107
110
|
textTrackData = utf8ToStr(bytesData);
|
|
111
|
+
chunkSize = bytesData.length;
|
|
108
112
|
}
|
|
109
113
|
else {
|
|
110
114
|
textTrackData = data;
|
|
111
115
|
}
|
|
112
116
|
var chunkData = getPlainTextTrackData(content, textTrackData, isChunked);
|
|
113
|
-
return { segmentType: "media", chunkData: chunkData, chunkInfos: null,
|
|
117
|
+
return { segmentType: "media", chunkData: chunkData, chunkSize: chunkSize, chunkInfos: null,
|
|
114
118
|
chunkOffset: timestampOffset,
|
|
115
119
|
protectionDataUpdate: false,
|
|
116
120
|
appendWindow: [period.start, period.end] };
|
|
@@ -136,10 +140,12 @@ export default function generateTextTrackParser(_a) {
|
|
|
136
140
|
// No data, just return an empty placeholder object
|
|
137
141
|
return segment.isInit ? { segmentType: "init",
|
|
138
142
|
initializationData: null,
|
|
143
|
+
initializationDataSize: 0,
|
|
139
144
|
protectionDataUpdate: false,
|
|
140
145
|
initTimescale: undefined } :
|
|
141
146
|
{ segmentType: "media",
|
|
142
147
|
chunkData: null,
|
|
148
|
+
chunkSize: 0,
|
|
143
149
|
chunkInfos: null,
|
|
144
150
|
chunkOffset: (_a = segment.timestampOffset) !== null && _a !== void 0 ? _a : 0,
|
|
145
151
|
protectionDataUpdate: false,
|
|
@@ -26,11 +26,13 @@ export default function segmentParser(loadedSegment, content, initTimescale) {
|
|
|
26
26
|
if (segment.isInit) {
|
|
27
27
|
return { segmentType: "init",
|
|
28
28
|
initializationData: null,
|
|
29
|
+
initializationDataSize: 0,
|
|
29
30
|
protectionDataUpdate: false,
|
|
30
31
|
initTimescale: undefined };
|
|
31
32
|
}
|
|
32
33
|
return { segmentType: "media",
|
|
33
34
|
chunkData: null,
|
|
35
|
+
chunkSize: 0,
|
|
34
36
|
chunkInfos: null,
|
|
35
37
|
chunkOffset: 0,
|
|
36
38
|
protectionDataUpdate: false, appendWindow: appendWindow };
|
|
@@ -52,10 +54,11 @@ export default function segmentParser(loadedSegment, content, initTimescale) {
|
|
|
52
54
|
getMDHDTimescale(chunkData);
|
|
53
55
|
return { segmentType: "init",
|
|
54
56
|
initializationData: chunkData,
|
|
57
|
+
initializationDataSize: 0,
|
|
55
58
|
initTimescale: timescale !== null && timescale !== void 0 ? timescale : undefined, protectionDataUpdate: protectionDataUpdate };
|
|
56
59
|
}
|
|
57
60
|
var chunkInfos = seemsToBeMP4 ? getISOBMFFTimingInfos(chunkData, false, segment, initTimescale) :
|
|
58
61
|
null; // TODO extract time info from webm
|
|
59
62
|
var chunkOffset = takeFirstSet(segment.timestampOffset, 0);
|
|
60
|
-
return { segmentType: "media", chunkData: chunkData, chunkInfos: chunkInfos, chunkOffset: chunkOffset, protectionDataUpdate: false, appendWindow: appendWindow };
|
|
63
|
+
return { segmentType: "media", chunkData: chunkData, chunkSize: chunkData.length, chunkInfos: chunkInfos, chunkOffset: chunkOffset, protectionDataUpdate: false, appendWindow: appendWindow };
|
|
61
64
|
}
|
|
@@ -43,13 +43,14 @@ function parseISOBMFFEmbeddedTextTrack(data, isChunked, content, initTimescale)
|
|
|
43
43
|
var mdhdTimescale = getMDHDTimescale(chunkBytes);
|
|
44
44
|
return { segmentType: "init",
|
|
45
45
|
initializationData: null,
|
|
46
|
+
initializationDataSize: 0,
|
|
46
47
|
initTimescale: mdhdTimescale,
|
|
47
48
|
protectionDataUpdate: false };
|
|
48
49
|
}
|
|
49
50
|
var chunkInfos = getISOBMFFTimingInfos(chunkBytes, isChunked, segment, initTimescale);
|
|
50
51
|
var chunkData = getISOBMFFEmbeddedTextTrackData(content, chunkBytes, chunkInfos, isChunked);
|
|
51
52
|
var chunkOffset = takeFirstSet(segment.timestampOffset, 0);
|
|
52
|
-
return { segmentType: "media", chunkData: chunkData, chunkInfos: chunkInfos, chunkOffset: chunkOffset, protectionDataUpdate: false,
|
|
53
|
+
return { segmentType: "media", chunkData: chunkData, chunkSize: chunkBytes.length, chunkInfos: chunkInfos, chunkOffset: chunkOffset, protectionDataUpdate: false,
|
|
53
54
|
appendWindow: [period.start, period.end] };
|
|
54
55
|
}
|
|
55
56
|
/**
|
|
@@ -67,21 +68,24 @@ function parsePlainTextTrack(data, isChunked, content) {
|
|
|
67
68
|
if (segment.isInit) {
|
|
68
69
|
return { segmentType: "init",
|
|
69
70
|
initializationData: null,
|
|
71
|
+
initializationDataSize: 0,
|
|
70
72
|
initTimescale: undefined,
|
|
71
73
|
protectionDataUpdate: false };
|
|
72
74
|
}
|
|
73
75
|
var textTrackData;
|
|
76
|
+
var chunkSize;
|
|
74
77
|
if (typeof data !== "string") {
|
|
75
78
|
var bytesData = data instanceof Uint8Array ? data :
|
|
76
79
|
new Uint8Array(data);
|
|
77
80
|
textTrackData = utf8ToStr(bytesData);
|
|
81
|
+
chunkSize = bytesData.length;
|
|
78
82
|
}
|
|
79
83
|
else {
|
|
80
84
|
textTrackData = data;
|
|
81
85
|
}
|
|
82
86
|
var chunkData = getPlainTextTrackData(content, textTrackData, isChunked);
|
|
83
87
|
var chunkOffset = takeFirstSet(segment.timestampOffset, 0);
|
|
84
|
-
return { segmentType: "media", chunkData: chunkData, chunkInfos: null, chunkOffset: chunkOffset, protectionDataUpdate: false,
|
|
88
|
+
return { segmentType: "media", chunkData: chunkData, chunkSize: chunkSize, chunkInfos: null, chunkOffset: chunkOffset, protectionDataUpdate: false,
|
|
85
89
|
appendWindow: [period.start, period.end] };
|
|
86
90
|
}
|
|
87
91
|
/**
|
|
@@ -100,12 +104,14 @@ export default function textTrackParser(loadedSegment, content, initTimescale) {
|
|
|
100
104
|
if (segment.isInit) {
|
|
101
105
|
return { segmentType: "init",
|
|
102
106
|
initializationData: null,
|
|
107
|
+
initializationDataSize: 0,
|
|
103
108
|
protectionDataUpdate: false,
|
|
104
109
|
initTimescale: undefined };
|
|
105
110
|
}
|
|
106
111
|
var chunkOffset = (_a = segment.timestampOffset) !== null && _a !== void 0 ? _a : 0;
|
|
107
112
|
return { segmentType: "media",
|
|
108
113
|
chunkData: null,
|
|
114
|
+
chunkSize: 0,
|
|
109
115
|
chunkInfos: null, chunkOffset: chunkOffset, protectionDataUpdate: false,
|
|
110
116
|
appendWindow: [period.start, period.end] };
|
|
111
117
|
}
|
|
@@ -24,6 +24,42 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
24
|
};
|
|
25
25
|
return __assign.apply(this, arguments);
|
|
26
26
|
};
|
|
27
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
28
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
29
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
30
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
31
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
32
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
33
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
37
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
38
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
39
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
40
|
+
function step(op) {
|
|
41
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
42
|
+
while (_) try {
|
|
43
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
44
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
45
|
+
switch (op[0]) {
|
|
46
|
+
case 0: case 1: t = op; break;
|
|
47
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
48
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
49
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
50
|
+
default:
|
|
51
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
52
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
53
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
54
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
55
|
+
if (t[2]) _.ops.pop();
|
|
56
|
+
_.trys.pop(); continue;
|
|
57
|
+
}
|
|
58
|
+
op = body.call(thisArg, _);
|
|
59
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
60
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
61
|
+
}
|
|
62
|
+
};
|
|
27
63
|
import features from "../../features";
|
|
28
64
|
import log from "../../log";
|
|
29
65
|
import Manifest from "../../manifest";
|
|
@@ -134,6 +170,7 @@ export default function (options) {
|
|
|
134
170
|
if (segment.isInit) {
|
|
135
171
|
return { segmentType: "init",
|
|
136
172
|
initializationData: null,
|
|
173
|
+
initializationDataSize: 0,
|
|
137
174
|
protectionDataUpdate: false,
|
|
138
175
|
initTimescale: undefined };
|
|
139
176
|
}
|
|
@@ -141,6 +178,7 @@ export default function (options) {
|
|
|
141
178
|
chunkData: null,
|
|
142
179
|
chunkInfos: null,
|
|
143
180
|
chunkOffset: 0,
|
|
181
|
+
chunkSize: 0,
|
|
144
182
|
protectionDataUpdate: false,
|
|
145
183
|
appendWindow: [undefined, undefined] };
|
|
146
184
|
}
|
|
@@ -150,6 +188,7 @@ export default function (options) {
|
|
|
150
188
|
var timescale = (_b = (_a = segment.privateInfos) === null || _a === void 0 ? void 0 : _a.smoothInitSegment) === null || _b === void 0 ? void 0 : _b.timescale;
|
|
151
189
|
return { segmentType: "init",
|
|
152
190
|
initializationData: data,
|
|
191
|
+
initializationDataSize: data.byteLength,
|
|
153
192
|
// smooth init segments are crafted by hand.
|
|
154
193
|
// Their timescale is the one from the manifest.
|
|
155
194
|
initTimescale: timescale,
|
|
@@ -169,6 +208,7 @@ export default function (options) {
|
|
|
169
208
|
addNextSegments(adaptation, nextSegments, segment);
|
|
170
209
|
}
|
|
171
210
|
return { segmentType: "media", chunkData: chunkData, chunkInfos: chunkInfos, chunkOffset: 0,
|
|
211
|
+
chunkSize: chunkData.length,
|
|
172
212
|
protectionDataUpdate: false,
|
|
173
213
|
appendWindow: [undefined, undefined] };
|
|
174
214
|
},
|
|
@@ -207,9 +247,11 @@ export default function (options) {
|
|
|
207
247
|
var isMP4 = isMP4EmbeddedTrack(representation);
|
|
208
248
|
var _b = representation.mimeType, mimeType = _b === void 0 ? "" : _b, _c = representation.codec, codec = _c === void 0 ? "" : _c;
|
|
209
249
|
var data = loadedSegment.data, isChunked = loadedSegment.isChunked;
|
|
250
|
+
var chunkSize;
|
|
210
251
|
if (segment.isInit) { // text init segment has no use in HSS
|
|
211
252
|
return { segmentType: "init",
|
|
212
253
|
initializationData: null,
|
|
254
|
+
initializationDataSize: 0,
|
|
213
255
|
protectionDataUpdate: false,
|
|
214
256
|
initTimescale: undefined };
|
|
215
257
|
}
|
|
@@ -218,6 +260,7 @@ export default function (options) {
|
|
|
218
260
|
chunkData: null,
|
|
219
261
|
chunkInfos: null,
|
|
220
262
|
chunkOffset: 0,
|
|
263
|
+
chunkSize: 0,
|
|
221
264
|
protectionDataUpdate: false,
|
|
222
265
|
appendWindow: [undefined, undefined] };
|
|
223
266
|
}
|
|
@@ -236,6 +279,7 @@ export default function (options) {
|
|
|
236
279
|
chunkBytes = data instanceof Uint8Array ? data :
|
|
237
280
|
new Uint8Array(data);
|
|
238
281
|
}
|
|
282
|
+
chunkSize = chunkBytes.length;
|
|
239
283
|
var timingInfos = initTimescale !== undefined ?
|
|
240
284
|
extractTimingsInfos(chunkBytes, isChunked, initTimescale, segment, manifest.isLive) :
|
|
241
285
|
null;
|
|
@@ -279,6 +323,7 @@ export default function (options) {
|
|
|
279
323
|
if (typeof data !== "string") {
|
|
280
324
|
var bytesData = data instanceof Uint8Array ? data :
|
|
281
325
|
new Uint8Array(data);
|
|
326
|
+
chunkSize = bytesData.length;
|
|
282
327
|
chunkString = utf8ToStr(bytesData);
|
|
283
328
|
}
|
|
284
329
|
else {
|
|
@@ -316,27 +361,38 @@ export default function (options) {
|
|
|
316
361
|
chunkData: { type: _sdType,
|
|
317
362
|
data: _sdData,
|
|
318
363
|
start: segmentStart,
|
|
319
|
-
end: segmentEnd, language: language }, chunkInfos: chunkInfos, chunkOffset: chunkOffset, protectionDataUpdate: false,
|
|
364
|
+
end: segmentEnd, language: language }, chunkSize: chunkSize, chunkInfos: chunkInfos, chunkOffset: chunkOffset, protectionDataUpdate: false,
|
|
320
365
|
appendWindow: [undefined, undefined] };
|
|
321
366
|
},
|
|
322
367
|
};
|
|
323
368
|
var imageTrackPipeline = {
|
|
324
369
|
loadSegment: function (url, content, cancelSignal, callbacks) {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
return
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
370
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
371
|
+
var data;
|
|
372
|
+
return __generator(this, function (_a) {
|
|
373
|
+
switch (_a.label) {
|
|
374
|
+
case 0:
|
|
375
|
+
if (content.segment.isInit || url === null) {
|
|
376
|
+
// image do not need an init segment. Passthrough directly to the parser
|
|
377
|
+
return [2 /*return*/, { resultType: "segment-created",
|
|
378
|
+
resultData: null }];
|
|
379
|
+
}
|
|
380
|
+
return [4 /*yield*/, request({ url: url, responseType: "arraybuffer",
|
|
381
|
+
onProgress: callbacks.onProgress, cancelSignal: cancelSignal })];
|
|
382
|
+
case 1:
|
|
383
|
+
data = _a.sent();
|
|
384
|
+
return [2 /*return*/, { resultType: "segment-loaded",
|
|
385
|
+
resultData: data }];
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
});
|
|
334
389
|
},
|
|
335
390
|
parseSegment: function (loadedSegment, content, _initTimescale) {
|
|
336
391
|
var data = loadedSegment.data, isChunked = loadedSegment.isChunked;
|
|
337
392
|
if (content.segment.isInit) { // image init segment has no use
|
|
338
393
|
return { segmentType: "init",
|
|
339
394
|
initializationData: null,
|
|
395
|
+
initializationDataSize: 0,
|
|
340
396
|
protectionDataUpdate: false,
|
|
341
397
|
initTimescale: undefined };
|
|
342
398
|
}
|
|
@@ -349,6 +405,7 @@ export default function (options) {
|
|
|
349
405
|
chunkData: null,
|
|
350
406
|
chunkInfos: null,
|
|
351
407
|
chunkOffset: 0,
|
|
408
|
+
chunkSize: 0,
|
|
352
409
|
protectionDataUpdate: false,
|
|
353
410
|
appendWindow: [undefined, undefined] };
|
|
354
411
|
}
|
|
@@ -362,6 +419,7 @@ export default function (options) {
|
|
|
362
419
|
type: "bif" },
|
|
363
420
|
chunkInfos: { time: 0,
|
|
364
421
|
duration: Number.MAX_VALUE },
|
|
422
|
+
chunkSize: undefined,
|
|
365
423
|
chunkOffset: 0,
|
|
366
424
|
protectionDataUpdate: false,
|
|
367
425
|
appendWindow: [undefined, undefined] };
|
|
@@ -589,6 +589,17 @@ export interface ISegmentParserParsedInitChunk<DataType> {
|
|
|
589
589
|
* protection initialization data to have been encountered.
|
|
590
590
|
*/
|
|
591
591
|
protectionDataUpdate: boolean;
|
|
592
|
+
/**
|
|
593
|
+
* Size in bytes of `initializationData`.
|
|
594
|
+
* `undefined` if unknown.
|
|
595
|
+
*
|
|
596
|
+
* Note: In some cases, such as when `initializationData` is under a format
|
|
597
|
+
* whose size is difficult to estimate (e.g. a JavaScript object), the
|
|
598
|
+
* `initializationDataSize` may either be set to `undefined` or, if available,
|
|
599
|
+
* to a sensible estimate (e.g. when a JavaScript object wraps large binary
|
|
600
|
+
* data, `initializationDataSize` may refer to that binary data only).
|
|
601
|
+
*/
|
|
602
|
+
initializationDataSize: number | undefined;
|
|
592
603
|
}
|
|
593
604
|
/**
|
|
594
605
|
* Result returned by a segment parser when it parsed a chunk from a media
|
|
@@ -606,6 +617,17 @@ export interface ISegmentParserParsedMediaChunk<DataType> {
|
|
|
606
617
|
* `null` if unknown.
|
|
607
618
|
*/
|
|
608
619
|
chunkInfos: IChunkTimeInfo | null;
|
|
620
|
+
/**
|
|
621
|
+
* Size in bytes of `chunkData`.
|
|
622
|
+
* `undefined` if unknown.
|
|
623
|
+
*
|
|
624
|
+
* Note: In some cases, such as when `chunkData` is under a format whose size
|
|
625
|
+
* is difficult to estimate (e.g. a JavaScript object), the `chunkSize` may
|
|
626
|
+
* either be set to `undefined` or, if available, to a sensible estimate (e.g.
|
|
627
|
+
* when a JavaScript object wraps large binary data, `chunkSize` may refer to
|
|
628
|
+
* that binary data only).
|
|
629
|
+
*/
|
|
630
|
+
chunkSize: number | undefined;
|
|
609
631
|
/**
|
|
610
632
|
* time offset, in seconds, to add to the absolute timed data defined in
|
|
611
633
|
* `chunkData` to obtain the "real" wanted effective time.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare type IDeepPartial<T> = {
|
|
2
|
+
[P in keyof T]?: IDeepPartial<T[P]>;
|
|
3
|
+
};
|
|
4
|
+
declare type ISourcesArgument<T> = Array<IDeepPartial<T> | unknown>;
|
|
5
|
+
/**
|
|
6
|
+
* Deeply merge nested objects
|
|
7
|
+
* @param target
|
|
8
|
+
* @param sources
|
|
9
|
+
* @returns output : merged object
|
|
10
|
+
*/
|
|
11
|
+
export default function deepMerge<T>(target: T, ...sources: ISourcesArgument<T>): T;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
import objectAssign from "./object_assign";
|
|
11
|
+
/**
|
|
12
|
+
* Check if an item is an object
|
|
13
|
+
* @param item
|
|
14
|
+
* @returns {boolean}
|
|
15
|
+
*/
|
|
16
|
+
function isObject(item) {
|
|
17
|
+
return (item !== null
|
|
18
|
+
&& item !== undefined
|
|
19
|
+
&& !Array.isArray(item)
|
|
20
|
+
&& typeof item === "object");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Deeply merge nested objects
|
|
24
|
+
* @param target
|
|
25
|
+
* @param sources
|
|
26
|
+
* @returns output : merged object
|
|
27
|
+
*/
|
|
28
|
+
export default function deepMerge(target) {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
var sources = [];
|
|
31
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
32
|
+
sources[_i - 1] = arguments[_i];
|
|
33
|
+
}
|
|
34
|
+
if (sources.length === 0) {
|
|
35
|
+
return target;
|
|
36
|
+
}
|
|
37
|
+
var source = sources.shift();
|
|
38
|
+
if (isObject(target) && isObject(source)) {
|
|
39
|
+
for (var key in source) {
|
|
40
|
+
if (isObject(source[key])) {
|
|
41
|
+
if (target[key] === undefined) {
|
|
42
|
+
objectAssign(target, (_a = {}, _a[key] = {}, _a));
|
|
43
|
+
}
|
|
44
|
+
var newTarget = target[key];
|
|
45
|
+
deepMerge(newTarget, source[key]);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
objectAssign(target, (_b = {}, _b[key] = source[key], _b));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return deepMerge.apply(void 0, __spreadArray([target], sources, false));
|
|
53
|
+
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Observable } from "rxjs";
|
|
17
|
+
import { CancellationSignal } from "./task_canceller";
|
|
17
18
|
/**
|
|
18
19
|
* A value behind a shared reference, meaning that any update to its value from
|
|
19
20
|
* anywhere can be retrieved from any other parts of the code in posession of
|
|
@@ -55,6 +56,7 @@ export interface ISharedReference<T> {
|
|
|
55
56
|
getValue(): T;
|
|
56
57
|
/** Update the value of this shared reference. */
|
|
57
58
|
setValue(newVal: T): void;
|
|
59
|
+
setValueIfChanged(newVal: T): void;
|
|
58
60
|
/**
|
|
59
61
|
* Returns an Observable which synchronously emits the current value (unless
|
|
60
62
|
* the `skipCurrentValue` argument has been set to `true`) and then each time
|
|
@@ -63,6 +65,21 @@ export interface ISharedReference<T> {
|
|
|
63
65
|
* @returns {Observable}
|
|
64
66
|
*/
|
|
65
67
|
asObservable(skipCurrentValue?: boolean): Observable<T>;
|
|
68
|
+
/**
|
|
69
|
+
* Allows to register a callback to be called each time the value inside the
|
|
70
|
+
* reference is updated.
|
|
71
|
+
* @param {Function} cb - Callback to be called each time the reference is
|
|
72
|
+
* updated. Takes the new value im argument.
|
|
73
|
+
* @param {Object} [options]
|
|
74
|
+
* @param {Object} [options.clearSignal] - Allows to provide a
|
|
75
|
+
* CancellationSignal which will unregister the callback when it emits.
|
|
76
|
+
* @param {boolean} [options.emitCurrentValue] - If `true`, the callback will
|
|
77
|
+
* also be immediately called with the current value.
|
|
78
|
+
*/
|
|
79
|
+
onUpdate(cb: (val: T) => void, options?: {
|
|
80
|
+
clearSignal?: CancellationSignal;
|
|
81
|
+
emitCurrentValue?: boolean;
|
|
82
|
+
}): void;
|
|
66
83
|
/**
|
|
67
84
|
* Indicate that no new values will be emitted.
|
|
68
85
|
* Allows to automatically close all Observables generated from this shared
|
|
@@ -93,8 +110,20 @@ export interface ISharedReference<T> {
|
|
|
93
110
|
* the code that some logic is not supposed to update the referenced value.
|
|
94
111
|
*/
|
|
95
112
|
export interface IReadOnlySharedReference<T> {
|
|
113
|
+
/** Get the last value set on that reference. */
|
|
96
114
|
getValue(): T;
|
|
115
|
+
/**
|
|
116
|
+
* Returns an Observable notifying this reference's value each time it is
|
|
117
|
+
* updated.
|
|
118
|
+
*
|
|
119
|
+
* Also emit its current value on subscription unless its argument is set to
|
|
120
|
+
* `true`.
|
|
121
|
+
*/
|
|
97
122
|
asObservable(skipCurrentValue?: boolean): Observable<T>;
|
|
123
|
+
onUpdate(cb: (val: T) => void, options?: {
|
|
124
|
+
clearSignal?: CancellationSignal;
|
|
125
|
+
emitCurrentValue?: boolean;
|
|
126
|
+
}): void;
|
|
98
127
|
}
|
|
99
128
|
/**
|
|
100
129
|
* Create an `ISharedReference` object encapsulating the mutable `initialValue`
|