rx-player 4.0.0-dev.2023111400 → 4.0.0-dev.2023120600
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 +11 -227
- package/FILES.md +1 -1
- package/VERSION +1 -1
- package/dist/_esm5.processed/compat/add_text_track.d.ts +1 -3
- package/dist/_esm5.processed/compat/add_text_track.js +4 -7
- package/dist/_esm5.processed/compat/browser_compatibility_types.d.ts +0 -7
- package/dist/_esm5.processed/compat/event_listeners.d.ts +2 -15
- package/dist/_esm5.processed/compat/event_listeners.js +2 -37
- package/dist/_esm5.processed/compat/index.d.ts +1 -3
- package/dist/_esm5.processed/compat/index.js +1 -3
- package/dist/_esm5.processed/config.d.ts +9 -21
- package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.d.ts +0 -58
- package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.js +14 -54
- package/dist/_esm5.processed/core/adaptive/utils/select_optimal_representation.d.ts +2 -8
- package/dist/_esm5.processed/core/adaptive/utils/select_optimal_representation.js +2 -11
- package/dist/_esm5.processed/core/api/debug/buffer_graph.js +2 -6
- package/dist/_esm5.processed/core/api/debug/modules/general_info.js +13 -32
- package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_content.js +3 -3
- package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_size.js +1 -1
- package/dist/_esm5.processed/core/api/option_utils.d.ts +12 -35
- package/dist/_esm5.processed/core/api/option_utils.js +41 -230
- package/dist/_esm5.processed/core/api/public_api.d.ts +91 -266
- package/dist/_esm5.processed/core/api/public_api.js +439 -805
- package/dist/_esm5.processed/core/{segment_buffers/implementations/image → api/track_management}/index.d.ts +3 -2
- package/dist/_esm5.processed/core/{segment_buffers/implementations/image → api/track_management}/index.js +3 -2
- package/dist/_esm5.processed/core/api/{tracks_management/media_element_track_choice_manager.d.ts → track_management/media_element_tracks_store.d.ts} +15 -75
- package/dist/_esm5.processed/core/api/{tracks_management/media_element_track_choice_manager.js → track_management/media_element_tracks_store.js} +74 -193
- package/dist/_esm5.processed/core/api/track_management/track_dispatcher.d.ts +84 -0
- package/dist/_esm5.processed/core/api/track_management/track_dispatcher.js +158 -0
- package/dist/_esm5.processed/core/api/track_management/tracks_store.d.ts +406 -0
- package/dist/_esm5.processed/core/api/track_management/tracks_store.js +932 -0
- package/dist/_esm5.processed/core/api/utils.d.ts +1 -0
- package/dist/_esm5.processed/core/api/utils.js +28 -11
- package/dist/_esm5.processed/core/decrypt/content_decryptor.js +3 -3
- package/dist/_esm5.processed/core/decrypt/find_key_system.js +83 -71
- package/dist/_esm5.processed/core/decrypt/get_media_keys.js +6 -5
- package/dist/_esm5.processed/core/decrypt/session_events_listener.js +10 -72
- package/dist/_esm5.processed/core/decrypt/utils/persistent_sessions_store.d.ts +4 -4
- package/dist/_esm5.processed/core/decrypt/utils/persistent_sessions_store.js +6 -4
- package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.d.ts +1 -3
- package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +7 -26
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.d.ts +3 -9
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +16 -9
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.d.ts +1 -3
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher_creator.js +1 -1
- package/dist/_esm5.processed/core/fetchers/utils/schedule_request.d.ts +1 -6
- package/dist/_esm5.processed/core/fetchers/utils/schedule_request.js +4 -41
- package/dist/_esm5.processed/core/init/directfile_content_initializer.js +1 -1
- package/dist/_esm5.processed/core/init/media_source_content_initializer.d.ts +1 -8
- package/dist/_esm5.processed/core/init/media_source_content_initializer.js +5 -19
- package/dist/_esm5.processed/core/init/types.d.ts +5 -15
- package/dist/_esm5.processed/core/init/utils/rebuffering_controller.d.ts +2 -36
- package/dist/_esm5.processed/core/init/utils/rebuffering_controller.js +2 -82
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +1 -2
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.js +2 -3
- package/dist/_esm5.processed/core/segment_buffers/implementations/types.d.ts +2 -2
- package/dist/_esm5.processed/core/segment_buffers/index.d.ts +2 -2
- package/dist/_esm5.processed/core/segment_buffers/index.js +2 -1
- package/dist/_esm5.processed/core/segment_buffers/inventory/index.d.ts +1 -0
- package/dist/_esm5.processed/core/segment_buffers/inventory/index.js +1 -0
- package/dist/_esm5.processed/core/segment_buffers/inventory/utils.d.ts +33 -0
- package/dist/_esm5.processed/core/segment_buffers/inventory/utils.js +49 -0
- package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.d.ts +0 -1
- package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.js +2 -16
- package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.d.ts +0 -15
- package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +183 -93
- package/dist/_esm5.processed/core/stream/adaptation/get_representations_switch_strategy.d.ts +39 -0
- package/dist/_esm5.processed/core/stream/adaptation/get_representations_switch_strategy.js +133 -0
- package/dist/_esm5.processed/core/stream/adaptation/types.d.ts +27 -13
- package/dist/_esm5.processed/core/stream/index.d.ts +2 -3
- package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.d.ts +2 -0
- package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +5 -7
- package/dist/_esm5.processed/core/stream/period/period_stream.js +13 -12
- package/dist/_esm5.processed/core/stream/period/types.d.ts +5 -14
- package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.d.ts +2 -4
- package/dist/_esm5.processed/core/stream/period/utils/get_adaptation_switch_strategy.js +10 -46
- package/dist/_esm5.processed/core/stream/representation/representation_stream.js +29 -23
- package/dist/_esm5.processed/core/stream/representation/types.d.ts +11 -1
- package/dist/_esm5.processed/default_config.d.ts +35 -98
- package/dist/_esm5.processed/default_config.js +36 -113
- package/dist/_esm5.processed/errors/custom_loader_error.d.ts +1 -3
- package/dist/_esm5.processed/errors/custom_loader_error.js +1 -3
- package/dist/_esm5.processed/errors/media_error.js +2 -2
- package/dist/_esm5.processed/errors/network_error.d.ts +0 -1
- package/dist/_esm5.processed/errors/network_error.js +0 -1
- package/dist/_esm5.processed/errors/request_error.d.ts +2 -3
- package/dist/_esm5.processed/errors/request_error.js +2 -5
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -3
- package/dist/_esm5.processed/features/features_object.js +0 -2
- package/dist/_esm5.processed/features/list/directfile.js +2 -5
- package/dist/_esm5.processed/features/list/index.d.ts +0 -2
- package/dist/_esm5.processed/features/list/index.js +0 -2
- package/dist/_esm5.processed/features/types.d.ts +3 -27
- package/dist/_esm5.processed/manifest/adaptation.d.ts +9 -11
- package/dist/_esm5.processed/manifest/adaptation.js +41 -30
- package/dist/_esm5.processed/manifest/index.d.ts +3 -4
- package/dist/_esm5.processed/manifest/manifest.d.ts +5 -54
- package/dist/_esm5.processed/manifest/manifest.js +5 -110
- package/dist/_esm5.processed/manifest/period.d.ts +4 -5
- package/dist/_esm5.processed/manifest/representation.d.ts +10 -5
- package/dist/_esm5.processed/manifest/representation.js +15 -5
- package/dist/_esm5.processed/manifest/representation_index/index.d.ts +2 -2
- package/dist/_esm5.processed/manifest/representation_index/static.d.ts +2 -0
- package/dist/_esm5.processed/manifest/representation_index/static.js +6 -0
- package/dist/_esm5.processed/manifest/representation_index/types.d.ts +42 -21
- package/dist/_esm5.processed/manifest/types.d.ts +0 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.d.ts +17 -31
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.js +26 -19
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.d.ts +2 -0
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.js +7 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.d.ts +2 -6
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.js +11 -8
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +2 -0
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +6 -0
- package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.js +1 -6
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +3 -5
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.d.ts +0 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.js +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.js +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.d.ts +0 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.js +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.js +10 -6
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Representation.js +4 -2
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/utils.d.ts +10 -1
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/utils.js +18 -2
- package/dist/_esm5.processed/parsers/manifest/dash/node_parser_types.d.ts +4 -4
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +3 -6
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Representation.js +1 -2
- package/dist/_esm5.processed/parsers/manifest/local/representation_index.d.ts +2 -0
- package/dist/_esm5.processed/parsers/manifest/local/representation_index.js +6 -0
- package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.js +6 -6
- package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.d.ts +12 -3
- package/dist/_esm5.processed/parsers/manifest/metaplaylist/representation_index.js +11 -2
- package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.d.ts +0 -1
- package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.js +11 -17
- package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.d.ts +21 -83
- package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.js +53 -125
- package/dist/_esm5.processed/parsers/manifest/smooth/shared_smooth_segment_timeline.d.ts +119 -0
- package/dist/_esm5.processed/parsers/manifest/smooth/shared_smooth_segment_timeline.js +159 -0
- package/dist/_esm5.processed/parsers/manifest/smooth/utils/add_segment_infos.d.ts +3 -6
- package/dist/_esm5.processed/parsers/manifest/smooth/utils/add_segment_infos.js +4 -4
- package/dist/_esm5.processed/parsers/manifest/types.d.ts +3 -3
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_extent.js +1 -8
- package/dist/_esm5.processed/parsers/texttracks/ttml/html/apply_origin.js +1 -9
- package/dist/_esm5.processed/public_types.d.ts +396 -308
- package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.d.ts +5 -4
- package/dist/_esm5.processed/tools/TextTrackRenderer/text_track_renderer.js +5 -4
- package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +4 -4
- package/dist/_esm5.processed/transports/dash/manifest_parser.js +2 -3
- package/dist/_esm5.processed/transports/dash/pipelines.js +1 -4
- package/dist/_esm5.processed/transports/dash/segment_loader.d.ts +2 -2
- package/dist/_esm5.processed/transports/dash/segment_loader.js +26 -20
- package/dist/_esm5.processed/transports/dash/segment_parser.js +19 -24
- package/dist/_esm5.processed/transports/dash/text_loader.js +5 -5
- package/dist/_esm5.processed/transports/dash/text_parser.js +28 -33
- package/dist/_esm5.processed/transports/local/pipelines.js +1 -10
- package/dist/_esm5.processed/transports/local/segment_loader.js +2 -2
- package/dist/_esm5.processed/transports/local/segment_parser.d.ts +1 -1
- package/dist/_esm5.processed/transports/local/segment_parser.js +10 -10
- package/dist/_esm5.processed/transports/local/text_parser.d.ts +2 -2
- package/dist/_esm5.processed/transports/local/text_parser.js +23 -23
- package/dist/_esm5.processed/transports/metaplaylist/pipelines.js +34 -52
- package/dist/_esm5.processed/{utils/list_to_map.d.ts → transports/smooth/is_mp4_embedded_track.d.ts} +5 -5
- package/dist/_esm5.processed/{features/list/image_buffer.d.ts → transports/smooth/is_mp4_embedded_track.js} +7 -6
- package/dist/_esm5.processed/transports/smooth/pipelines.js +33 -190
- package/dist/_esm5.processed/transports/smooth/segment_loader.d.ts +1 -1
- package/dist/_esm5.processed/transports/smooth/segment_loader.js +28 -22
- package/dist/_esm5.processed/transports/smooth/utils.d.ts +1 -26
- package/dist/_esm5.processed/transports/smooth/utils.js +1 -55
- package/dist/_esm5.processed/transports/types.d.ts +94 -89
- package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +3 -3
- package/dist/_esm5.processed/transports/utils/infer_segment_container.d.ts +3 -3
- package/dist/_esm5.processed/transports/utils/infer_segment_container.js +5 -7
- package/dist/_esm5.processed/transports/utils/parse_text_track.d.ts +8 -12
- package/dist/_esm5.processed/transports/utils/parse_text_track.js +19 -21
- package/dist/_esm5.processed/utils/array_includes.d.ts +2 -1
- package/dist/_esm5.processed/utils/array_includes.js +30 -28
- package/dist/_esm5.processed/utils/request/xhr.js +5 -5
- package/dist/commonjs/compat/is_codec_supported.js +22 -1
- package/dist/commonjs/config.d.ts +1 -0
- package/dist/commonjs/core/api/debug/buffer_graph.js +2 -6
- package/dist/commonjs/core/api/debug/modules/general_info.js +17 -10
- package/dist/commonjs/core/api/option_utils.d.ts +2 -0
- package/dist/commonjs/core/api/option_utils.js +2 -3
- package/dist/commonjs/core/api/public_api.d.ts +9 -0
- package/dist/commonjs/core/api/public_api.js +34 -9
- package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.d.ts +6 -0
- package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.js +11 -3
- package/dist/commonjs/core/fetchers/segment/segment_fetcher.d.ts +8 -1
- package/dist/commonjs/core/fetchers/segment/segment_fetcher.js +8 -4
- package/dist/commonjs/core/fetchers/segment/segment_fetcher_creator.d.ts +1 -0
- package/dist/commonjs/core/fetchers/utils/schedule_request.js +1 -1
- package/dist/commonjs/core/init/directfile_content_initializer.js +24 -7
- package/dist/commonjs/core/init/media_source_content_initializer.d.ts +6 -0
- package/dist/commonjs/core/init/media_source_content_initializer.js +4 -6
- package/dist/commonjs/core/init/utils/content_time_boundaries_observer.d.ts +13 -12
- package/dist/commonjs/core/init/utils/content_time_boundaries_observer.js +16 -17
- package/dist/commonjs/core/init/utils/get_initial_time.d.ts +17 -3
- package/dist/commonjs/core/init/utils/get_initial_time.js +9 -7
- package/dist/commonjs/core/stream/representation/utils/get_buffer_status.js +3 -3
- package/dist/commonjs/core/stream/representation/utils/get_needed_segments.js +1 -1
- package/dist/commonjs/default_config.d.ts +5 -0
- package/dist/commonjs/default_config.js +5 -0
- package/dist/commonjs/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -1
- package/dist/commonjs/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +2 -0
- package/dist/commonjs/manifest/representation_index/static.d.ts +1 -1
- package/dist/commonjs/manifest/representation_index/static.js +2 -2
- package/dist/commonjs/manifest/representation_index/types.d.ts +4 -4
- package/dist/commonjs/parsers/manifest/dash/common/indexes/base.d.ts +6 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/base.js +4 -3
- package/dist/commonjs/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +5 -2
- package/dist/commonjs/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -4
- package/dist/commonjs/parsers/manifest/dash/common/indexes/index.d.ts +5 -5
- package/dist/commonjs/parsers/manifest/dash/common/indexes/list.d.ts +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/list.js +2 -2
- package/dist/commonjs/parsers/manifest/dash/common/indexes/template.d.ts +12 -5
- package/dist/commonjs/parsers/manifest/dash/common/indexes/template.js +42 -29
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/index.d.ts +2 -1
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +99 -6
- package/dist/commonjs/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +250 -51
- package/dist/commonjs/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +40 -17
- package/dist/commonjs/parsers/manifest/dash/common/manifest_bounds_calculator.js +38 -18
- package/dist/commonjs/parsers/manifest/dash/common/parse_adaptation_sets.js +13 -10
- package/dist/commonjs/parsers/manifest/dash/common/parse_mpd.js +27 -14
- package/dist/commonjs/parsers/manifest/dash/common/parse_periods.d.ts +1 -1
- package/dist/commonjs/parsers/manifest/dash/common/parse_periods.js +17 -18
- package/dist/commonjs/parsers/manifest/dash/common/parse_representation_index.d.ts +19 -6
- package/dist/commonjs/parsers/manifest/dash/common/parse_representation_index.js +21 -8
- package/dist/commonjs/parsers/manifest/dash/common/parse_representations.js +7 -3
- package/dist/commonjs/parsers/manifest/local/representation_index.d.ts +1 -1
- package/dist/commonjs/parsers/manifest/local/representation_index.js +3 -3
- package/dist/commonjs/parsers/manifest/metaplaylist/representation_index.d.ts +1 -1
- package/dist/commonjs/parsers/manifest/metaplaylist/representation_index.js +2 -2
- package/dist/commonjs/parsers/manifest/smooth/representation_index.d.ts +5 -5
- package/dist/commonjs/parsers/manifest/smooth/representation_index.js +25 -9
- package/dist/commonjs/parsers/manifest/utils/index_helpers.js +1 -1
- package/dist/commonjs/public_types.d.ts +78 -34
- package/dist/commonjs/transports/dash/init_segment_loader.js +10 -5
- package/dist/commonjs/transports/dash/manifest_parser.js +5 -2
- package/dist/commonjs/transports/dash/segment_loader.js +2 -1
- package/dist/commonjs/transports/dash/text_loader.js +2 -0
- package/dist/commonjs/transports/metaplaylist/manifest_loader.js +2 -1
- package/dist/commonjs/transports/metaplaylist/pipelines.js +4 -1
- package/dist/commonjs/transports/smooth/pipelines.js +4 -2
- package/dist/commonjs/transports/smooth/segment_loader.js +2 -1
- package/dist/commonjs/transports/types.d.ts +12 -0
- package/dist/commonjs/transports/utils/generate_manifest_loader.js +6 -3
- package/dist/commonjs/utils/request/fetch.d.ts +6 -0
- package/dist/commonjs/utils/request/fetch.js +29 -8
- package/dist/commonjs/utils/request/xhr.d.ts +11 -5
- package/dist/commonjs/utils/request/xhr.js +29 -8
- package/dist/es2017/compat/is_codec_supported.js +22 -1
- package/dist/es2017/config.d.ts +1 -0
- package/dist/es2017/core/api/debug/buffer_graph.js +2 -6
- package/dist/es2017/core/api/debug/modules/general_info.js +17 -10
- package/dist/es2017/core/api/option_utils.d.ts +2 -0
- package/dist/es2017/core/api/option_utils.js +2 -3
- package/dist/es2017/core/api/public_api.d.ts +9 -0
- package/dist/es2017/core/api/public_api.js +33 -8
- package/dist/es2017/core/fetchers/manifest/manifest_fetcher.d.ts +6 -0
- package/dist/es2017/core/fetchers/manifest/manifest_fetcher.js +11 -3
- package/dist/es2017/core/fetchers/segment/segment_fetcher.d.ts +8 -1
- package/dist/es2017/core/fetchers/segment/segment_fetcher.js +8 -4
- package/dist/es2017/core/fetchers/segment/segment_fetcher_creator.d.ts +1 -0
- package/dist/es2017/core/fetchers/utils/schedule_request.js +1 -1
- package/dist/es2017/core/init/directfile_content_initializer.js +24 -7
- package/dist/es2017/core/init/media_source_content_initializer.d.ts +6 -0
- package/dist/es2017/core/init/media_source_content_initializer.js +4 -6
- package/dist/es2017/core/init/utils/content_time_boundaries_observer.d.ts +13 -12
- package/dist/es2017/core/init/utils/content_time_boundaries_observer.js +16 -15
- package/dist/es2017/core/init/utils/get_initial_time.d.ts +17 -3
- package/dist/es2017/core/init/utils/get_initial_time.js +9 -7
- package/dist/es2017/core/stream/representation/utils/get_buffer_status.js +3 -3
- package/dist/es2017/core/stream/representation/utils/get_needed_segments.js +1 -1
- package/dist/es2017/default_config.d.ts +5 -0
- package/dist/es2017/default_config.js +5 -0
- package/dist/es2017/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +3 -1
- package/dist/es2017/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +2 -0
- package/dist/es2017/manifest/representation_index/static.d.ts +1 -1
- package/dist/es2017/manifest/representation_index/static.js +2 -2
- package/dist/es2017/manifest/representation_index/types.d.ts +4 -4
- package/dist/es2017/parsers/manifest/dash/common/indexes/base.d.ts +6 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/base.js +4 -3
- package/dist/es2017/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +5 -2
- package/dist/es2017/parsers/manifest/dash/common/indexes/get_segments_from_timeline.js +15 -4
- package/dist/es2017/parsers/manifest/dash/common/indexes/index.d.ts +5 -5
- package/dist/es2017/parsers/manifest/dash/common/indexes/list.d.ts +1 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/list.js +2 -2
- package/dist/es2017/parsers/manifest/dash/common/indexes/template.d.ts +12 -5
- package/dist/es2017/parsers/manifest/dash/common/indexes/template.js +40 -27
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/index.d.ts +2 -1
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +99 -6
- package/dist/es2017/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +246 -51
- package/dist/es2017/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +40 -17
- package/dist/es2017/parsers/manifest/dash/common/manifest_bounds_calculator.js +38 -18
- package/dist/es2017/parsers/manifest/dash/common/parse_adaptation_sets.js +11 -8
- package/dist/es2017/parsers/manifest/dash/common/parse_mpd.js +27 -13
- package/dist/es2017/parsers/manifest/dash/common/parse_periods.d.ts +1 -1
- package/dist/es2017/parsers/manifest/dash/common/parse_periods.js +13 -16
- package/dist/es2017/parsers/manifest/dash/common/parse_representation_index.d.ts +19 -6
- package/dist/es2017/parsers/manifest/dash/common/parse_representation_index.js +10 -8
- package/dist/es2017/parsers/manifest/dash/common/parse_representations.js +7 -3
- package/dist/es2017/parsers/manifest/local/representation_index.d.ts +1 -1
- package/dist/es2017/parsers/manifest/local/representation_index.js +3 -3
- package/dist/es2017/parsers/manifest/metaplaylist/representation_index.d.ts +1 -1
- package/dist/es2017/parsers/manifest/metaplaylist/representation_index.js +2 -2
- package/dist/es2017/parsers/manifest/smooth/representation_index.d.ts +5 -5
- package/dist/es2017/parsers/manifest/smooth/representation_index.js +25 -9
- package/dist/es2017/parsers/manifest/utils/index_helpers.js +1 -1
- package/dist/es2017/public_types.d.ts +78 -34
- package/dist/es2017/transports/dash/init_segment_loader.js +5 -0
- package/dist/es2017/transports/dash/manifest_parser.js +3 -0
- package/dist/es2017/transports/dash/segment_loader.js +1 -0
- package/dist/es2017/transports/dash/text_loader.js +2 -0
- package/dist/es2017/transports/metaplaylist/manifest_loader.js +1 -0
- package/dist/es2017/transports/metaplaylist/pipelines.js +4 -1
- package/dist/es2017/transports/smooth/pipelines.js +2 -0
- package/dist/es2017/transports/smooth/segment_loader.js +1 -0
- package/dist/es2017/transports/types.d.ts +12 -0
- package/dist/es2017/transports/utils/generate_manifest_loader.js +3 -0
- package/dist/es2017/utils/request/fetch.d.ts +6 -0
- package/dist/es2017/utils/request/fetch.js +29 -8
- package/dist/es2017/utils/request/xhr.d.ts +11 -5
- package/dist/es2017/utils/request/xhr.js +30 -9
- package/dist/rx-player.js +723 -376
- package/dist/rx-player.min.js +1 -1
- package/package.json +3 -4
- package/scripts/update-version +2 -0
- package/sonar-project.properties +1 -1
- package/src/compat/is_codec_supported.ts +23 -1
- package/src/core/api/debug/buffer_graph.ts +2 -5
- package/src/core/api/debug/modules/general_info.ts +15 -10
- package/src/core/api/option_utils.ts +3 -3
- package/src/core/api/public_api.ts +35 -7
- package/src/core/fetchers/manifest/manifest_fetcher.ts +21 -3
- package/src/core/fetchers/segment/segment_fetcher.ts +19 -5
- package/src/core/fetchers/segment/segment_fetcher_creator.ts +1 -0
- package/src/core/fetchers/utils/schedule_request.ts +1 -1
- package/src/core/init/directfile_content_initializer.ts +23 -7
- package/src/core/init/media_source_content_initializer.ts +13 -7
- package/src/core/init/utils/content_time_boundaries_observer.ts +23 -22
- package/src/core/init/utils/get_initial_time.ts +25 -12
- package/src/core/stream/representation/utils/get_buffer_status.ts +3 -3
- package/src/core/stream/representation/utils/get_needed_segments.ts +2 -2
- package/src/default_config.ts +5 -0
- package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +3 -1
- package/src/experimental/tools/createMetaplaylist/get_duration_from_manifest.ts +2 -0
- package/src/manifest/representation_index/static.ts +2 -2
- package/src/manifest/representation_index/types.ts +4 -4
- package/src/parsers/manifest/dash/common/__tests__/manifest_bounds_calculator.test.ts +182 -36
- package/src/parsers/manifest/dash/common/indexes/base.ts +12 -4
- package/src/parsers/manifest/dash/common/indexes/get_segments_from_timeline.ts +19 -5
- package/src/parsers/manifest/dash/common/indexes/index.ts +16 -4
- package/src/parsers/manifest/dash/common/indexes/list.ts +2 -2
- package/src/parsers/manifest/dash/common/indexes/template.ts +52 -31
- package/src/parsers/manifest/dash/common/indexes/timeline/index.ts +4 -1
- package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +366 -60
- package/src/parsers/manifest/dash/common/manifest_bounds_calculator.ts +63 -25
- package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +10 -4
- package/src/parsers/manifest/dash/common/parse_mpd.ts +28 -15
- package/src/parsers/manifest/dash/common/parse_periods.ts +12 -17
- package/src/parsers/manifest/dash/common/parse_representation_index.ts +50 -26
- package/src/parsers/manifest/dash/common/parse_representations.ts +9 -3
- package/src/parsers/manifest/local/representation_index.ts +3 -3
- package/src/parsers/manifest/metaplaylist/representation_index.ts +2 -2
- package/src/parsers/manifest/smooth/representation_index.ts +23 -9
- package/src/parsers/manifest/utils/__tests__/get_first_time_from_adaptations.test.ts +1 -1
- package/src/parsers/manifest/utils/__tests__/get_last_time_from_adaptation.test.ts +1 -1
- package/src/parsers/manifest/utils/index_helpers.ts +1 -1
- package/src/public_types.ts +79 -34
- package/src/transports/dash/init_segment_loader.ts +5 -0
- package/src/transports/dash/manifest_parser.ts +6 -0
- package/src/transports/dash/segment_loader.ts +1 -0
- package/src/transports/dash/text_loader.ts +2 -0
- package/src/transports/metaplaylist/manifest_loader.ts +1 -0
- package/src/transports/metaplaylist/pipelines.ts +4 -1
- package/src/transports/smooth/pipelines.ts +2 -0
- package/src/transports/smooth/segment_loader.ts +1 -0
- package/src/transports/types.ts +12 -0
- package/src/transports/utils/generate_manifest_loader.ts +3 -0
- package/src/utils/request/fetch.ts +35 -8
- package/src/utils/request/xhr.ts +45 -14
- package/dist/_esm5.processed/compat/fullscreen.d.ts +0 -32
- package/dist/_esm5.processed/compat/fullscreen.js +0 -78
- package/dist/_esm5.processed/compat/is_offline.d.ts +0 -39
- package/dist/_esm5.processed/compat/is_offline.js +0 -43
- package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.d.ts +0 -258
- package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.js +0 -989
- package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.d.ts +0 -75
- package/dist/_esm5.processed/core/segment_buffers/implementations/image/image_segment_buffer.js +0 -133
- package/dist/_esm5.processed/features/list/bif_parser.d.ts +0 -23
- package/dist/_esm5.processed/features/list/bif_parser.js +0 -27
- package/dist/_esm5.processed/features/list/image_buffer.js +0 -25
- package/dist/_esm5.processed/transports/dash/image_pipelines.d.ts +0 -38
- package/dist/_esm5.processed/transports/dash/image_pipelines.js +0 -129
- package/dist/_esm5.processed/utils/list_to_map.js +0 -28
- package/dist/_esm5.processed/utils/simple_set.d.ts +0 -51
- package/dist/_esm5.processed/utils/simple_set.js +0 -57
- package/dist/_esm5.processed/utils/uniq.d.ts +0 -36
- package/dist/_esm5.processed/utils/uniq.js +0 -43
- package/dist/commonjs/parsers/manifest/utils/is_segment_still_available.d.ts +0 -29
- package/dist/commonjs/parsers/manifest/utils/is_segment_still_available.js +0 -54
- package/dist/es2017/parsers/manifest/utils/is_segment_still_available.d.ts +0 -29
- package/dist/es2017/parsers/manifest/utils/is_segment_still_available.js +0 -51
- package/src/parsers/manifest/utils/is_segment_still_available.ts +0 -58
- package/src/typings/object-assign.d.ts +0 -48
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { IInbandEvent } from "../core/stream";
|
|
17
|
-
import Manifest, {
|
|
17
|
+
import Manifest, { ISegment } from "../manifest";
|
|
18
18
|
import { ICdnMetadata } from "../parsers/manifest";
|
|
19
|
-
import {
|
|
19
|
+
import { ITrackType, ILoadedManifestFormat, IManifestLoader, IRepresentationFilter, ISegmentLoader as ICustomSegmentLoader, IServerSyncInfos } from "../public_types";
|
|
20
20
|
import TaskCanceller, { CancellationSignal } from "../utils/task_canceller";
|
|
21
21
|
/**
|
|
22
22
|
* Interface returned by any transport implementation.
|
|
@@ -39,8 +39,6 @@ export interface ITransportPipelines {
|
|
|
39
39
|
video: ISegmentPipeline<ILoadedAudioVideoSegmentFormat, Uint8Array | ArrayBuffer | null>;
|
|
40
40
|
/** Functions allowing to load an parse text (e.g. subtitles) segments. */
|
|
41
41
|
text: ISegmentPipeline<ILoadedTextSegmentFormat, ITextTrackSegmentData | null>;
|
|
42
|
-
/** Functions allowing to load an parse image (e.g. thumbnails) segments. */
|
|
43
|
-
image: ISegmentPipeline<ILoadedImageSegmentFormat, IImageTrackSegmentData | null>;
|
|
44
42
|
}
|
|
45
43
|
/** Functions allowing to load and parse the Manifest. */
|
|
46
44
|
export interface ITransportManifestPipeline {
|
|
@@ -124,36 +122,6 @@ export interface ITransportManifestPipeline {
|
|
|
124
122
|
* `CancellationError` instance instead.
|
|
125
123
|
*/
|
|
126
124
|
parseManifest: (manifestData: IRequestedData<unknown>, parserOptions: IManifestParserOptions, onWarnings: (warnings: Error[]) => void, cancelSignal: CancellationSignal, scheduleRequest: IManifestParserRequestScheduler) => IManifestParserResult | Promise<IManifestParserResult>;
|
|
127
|
-
/**
|
|
128
|
-
* @deprecated
|
|
129
|
-
* "Resolves the Manifest's URL, to obtain its true URL.
|
|
130
|
-
* This is a deprecated function which corresponds to an old use case at
|
|
131
|
-
* Canal+ where the URL of the Manifest first need to be parsed from a .wsx
|
|
132
|
-
* file.
|
|
133
|
-
* Thankfully this API should not be used anymore, though to not break
|
|
134
|
-
* compatibility, we have to keep it until a v4.x.x release.
|
|
135
|
-
*
|
|
136
|
-
* @param {string | undefined} url - URL used to obtain the real URL of the
|
|
137
|
-
* Manifest.
|
|
138
|
-
* @param {CancellationSignal} cancelSignal - Cancellation signal which will
|
|
139
|
-
* allow to abort the resolving operation if you do not want the Manifest
|
|
140
|
-
* anymore.
|
|
141
|
-
* When cancelled, the promise returned by this function will reject with a
|
|
142
|
-
* `CancellationError`.
|
|
143
|
-
* @returns {Promise.<string|undefined>} - Promise emitting the "real" URL of
|
|
144
|
-
* the Manifest, that should be loaded by the `loadManifest` function.
|
|
145
|
-
* `undefined` if the URL is either unknown or inexistant.
|
|
146
|
-
*
|
|
147
|
-
* Rejects in two cases:
|
|
148
|
-
*
|
|
149
|
-
* 1. The resolving operation has been aborted through the `cancelSignal`
|
|
150
|
-
* given in argument.
|
|
151
|
-
* In that case, this Promise will reject a `CancellationError`.
|
|
152
|
-
*
|
|
153
|
-
* 2. The resolving operation failed, most likely due to a request error.
|
|
154
|
-
* In that case, this Promise will reject the corresponding Error.
|
|
155
|
-
*/
|
|
156
|
-
resolveManifestUrl?: (url: string | undefined, cancelSignal: CancellationSignal) => Promise<string | undefined>;
|
|
157
125
|
}
|
|
158
126
|
/**
|
|
159
127
|
* Options given to the `loadManifest` method of an
|
|
@@ -179,7 +147,7 @@ export interface ISegmentPipeline<TLoadedFormat, TParsedSegmentDataFormat> {
|
|
|
179
147
|
* segment should be downloaded.
|
|
180
148
|
* `null` if we do not have such CDN (in which case the segment should be loaded
|
|
181
149
|
* through other means, such as information taken from the segment's content).
|
|
182
|
-
* @param {Object}
|
|
150
|
+
* @param {Object} context - Context linked to the wanted segment.
|
|
183
151
|
* @param {CancellationSignal} cancelSignal - Cancellation signal which will
|
|
184
152
|
* allow to cancel the loading operation if the segment is not needed anymore.
|
|
185
153
|
*
|
|
@@ -190,7 +158,7 @@ export interface ISegmentPipeline<TLoadedFormat, TParsedSegmentDataFormat> {
|
|
|
190
158
|
* @returns {Promise.<Object>} - Promise resolving when it has finished loading
|
|
191
159
|
* the segment.
|
|
192
160
|
*/
|
|
193
|
-
export type ISegmentLoader<TLoadedFormat> = (wantedCdn: ICdnMetadata | null,
|
|
161
|
+
export type ISegmentLoader<TLoadedFormat> = (wantedCdn: ICdnMetadata | null, context: ISegmentContext, options: ISegmentLoaderOptions, cancelSignal: CancellationSignal, callbacks: ISegmentLoaderCallbacks<TLoadedFormat>) => Promise<ISegmentLoaderResultSegmentCreated<TLoadedFormat> | ISegmentLoaderResultSegmentLoaded<TLoadedFormat> | ISegmentLoaderResultChunkedComplete>;
|
|
194
162
|
/** Options given to an `ISegmentLoader` to configure its behavior. */
|
|
195
163
|
export interface ISegmentLoaderOptions {
|
|
196
164
|
/**
|
|
@@ -220,7 +188,7 @@ loadedSegment: {
|
|
|
220
188
|
isChunked: boolean;
|
|
221
189
|
},
|
|
222
190
|
/** Context about the wanted segment. */
|
|
223
|
-
|
|
191
|
+
context: ISegmentContext,
|
|
224
192
|
/**
|
|
225
193
|
* "Timescale" obtained from parsing the wanted representation's initialization
|
|
226
194
|
* segment.
|
|
@@ -369,14 +337,6 @@ export interface ITextTrackSegmentData {
|
|
|
369
337
|
/** end time until which the segment apply, in seconds. */
|
|
370
338
|
end?: number | undefined;
|
|
371
339
|
}
|
|
372
|
-
/** Format under which image data is decodable by the RxPlayer. */
|
|
373
|
-
export interface IImageTrackSegmentData {
|
|
374
|
-
data: IBifThumbnail[];
|
|
375
|
-
end: number;
|
|
376
|
-
start: number;
|
|
377
|
-
timescale: number;
|
|
378
|
-
type: string;
|
|
379
|
-
}
|
|
380
340
|
export type IManifestParserRequest1 = ((
|
|
381
341
|
/**
|
|
382
342
|
* Cancellation signal which will allow to cancel the request if the
|
|
@@ -405,23 +365,33 @@ export interface ITransportTextSegmentPipeline {
|
|
|
405
365
|
loadSegment: ISegmentLoader<ILoadedTextSegmentFormat>;
|
|
406
366
|
parseSegment: ISegmentParser<ILoadedTextSegmentFormat, ITextTrackSegmentData | null>;
|
|
407
367
|
}
|
|
408
|
-
export
|
|
409
|
-
loadSegment: ISegmentLoader<ILoadedImageSegmentFormat>;
|
|
410
|
-
parseSegment: ISegmentParser<ILoadedImageSegmentFormat, IImageTrackSegmentData | null>;
|
|
411
|
-
}
|
|
412
|
-
export type ITransportSegmentPipeline = ITransportAudioVideoSegmentPipeline | ITransportTextSegmentPipeline | ITransportImageSegmentPipeline;
|
|
368
|
+
export type ITransportSegmentPipeline = ITransportAudioVideoSegmentPipeline | ITransportTextSegmentPipeline;
|
|
413
369
|
export type ITransportPipeline = ITransportManifestPipeline | ITransportSegmentPipeline;
|
|
414
370
|
export interface ISegmentContext {
|
|
415
|
-
/**
|
|
416
|
-
manifest: Manifest;
|
|
417
|
-
/** Period object related to this segment. */
|
|
418
|
-
period: Period;
|
|
419
|
-
/** Adaptation object related to this segment. */
|
|
420
|
-
adaptation: Adaptation;
|
|
421
|
-
/** Representation Object related to this segment. */
|
|
422
|
-
representation: Representation;
|
|
423
|
-
/** Segment we want to load. */
|
|
371
|
+
/** Metadata about the wanted segment. */
|
|
424
372
|
segment: ISegment;
|
|
373
|
+
/** Type of the corresponding track. */
|
|
374
|
+
type: ITrackType;
|
|
375
|
+
/** Language of the corresponding track. */
|
|
376
|
+
language?: string | undefined;
|
|
377
|
+
/** If `true`, the corresponding `Manifest` if for a live content. */
|
|
378
|
+
isLive: boolean;
|
|
379
|
+
/** Start position in seconds of the Period in which that segment plays. */
|
|
380
|
+
periodStart: number;
|
|
381
|
+
/** End position in seconds of the Period in which that segment plays. */
|
|
382
|
+
periodEnd: number | undefined;
|
|
383
|
+
/** Mimetype of the corresponding Representation. */
|
|
384
|
+
mimeType?: string | undefined;
|
|
385
|
+
/** Codec(s) of the corresponding Representation. */
|
|
386
|
+
codecs?: string | undefined;
|
|
387
|
+
/**
|
|
388
|
+
* Last published time for the Manifest file in which this segment has been
|
|
389
|
+
* defined.
|
|
390
|
+
*
|
|
391
|
+
* This can be useful in cases where a loaded segment contains metadata that
|
|
392
|
+
* could indicate a newer version of the Manifest.
|
|
393
|
+
*/
|
|
394
|
+
manifestPublishTime?: number | undefined;
|
|
425
395
|
}
|
|
426
396
|
export interface ISegmentLoaderCallbacks<T> {
|
|
427
397
|
/**
|
|
@@ -527,8 +497,6 @@ export interface IChunkCompleteInformation {
|
|
|
527
497
|
export type ILoadedAudioVideoSegmentFormat = Uint8Array | ArrayBuffer | null;
|
|
528
498
|
/** Format of a loaded text segment before parsing. */
|
|
529
499
|
export type ILoadedTextSegmentFormat = Uint8Array | ArrayBuffer | string | null;
|
|
530
|
-
/** Format of a loaded image segment before parsing. */
|
|
531
|
-
export type ILoadedImageSegmentFormat = Uint8Array | ArrayBuffer | null;
|
|
532
500
|
/**
|
|
533
501
|
* Result returned by a segment parser when it parsed a chunk from an init
|
|
534
502
|
* segment (which does not contain media data).
|
|
@@ -546,17 +514,10 @@ export interface ISegmentParserParsedInitChunk<DataType> {
|
|
|
546
514
|
*/
|
|
547
515
|
initTimescale?: number | undefined;
|
|
548
516
|
/**
|
|
549
|
-
*
|
|
550
|
-
*
|
|
551
|
-
* object to be updated with that new information.
|
|
552
|
-
*
|
|
553
|
-
* In that case, you can re-check any encryption-related information with the
|
|
554
|
-
* `Representation` linked to that segment.
|
|
555
|
-
*
|
|
556
|
-
* In the great majority of cases, this is set to `true` when new content
|
|
557
|
-
* protection initialization data to have been encountered.
|
|
517
|
+
* Information on encryption that has been found in this segment.
|
|
518
|
+
* Empty array if no such information was found.
|
|
558
519
|
*/
|
|
559
|
-
|
|
520
|
+
protectionData: IProtectionDataInfo[];
|
|
560
521
|
/**
|
|
561
522
|
* Size in bytes of `initializationData`.
|
|
562
523
|
* `undefined` if unknown.
|
|
@@ -568,6 +529,15 @@ export interface ISegmentParserParsedInitChunk<DataType> {
|
|
|
568
529
|
* data, `initializationDataSize` may refer to that binary data only).
|
|
569
530
|
*/
|
|
570
531
|
initializationDataSize: number | undefined;
|
|
532
|
+
/**
|
|
533
|
+
* When this property is set, a list of segments linked to this
|
|
534
|
+
* `Representation` has been obtained when parsing this initialization
|
|
535
|
+
* segment.
|
|
536
|
+
*
|
|
537
|
+
* This might then be used to communicate it to the corresponding
|
|
538
|
+
* `RepresentationIndex`.
|
|
539
|
+
*/
|
|
540
|
+
segmentList?: ISegmentInformation[] | undefined;
|
|
571
541
|
}
|
|
572
542
|
/**
|
|
573
543
|
* Result returned by a segment parser when it parsed a chunk from a media
|
|
@@ -602,15 +572,15 @@ export interface ISegmentParserParsedMediaChunk<DataType> {
|
|
|
602
572
|
*
|
|
603
573
|
* For example:
|
|
604
574
|
* If `chunkData` announces (when parsed by the demuxer or decoder) that the
|
|
605
|
-
*
|
|
606
|
-
*
|
|
575
|
+
* chunk begins at 32 seconds, and `chunkOffset` equals to `4`, then the
|
|
576
|
+
* chunk should really begin at 36 seconds (32 + 4).
|
|
607
577
|
*
|
|
608
578
|
* Note that `chunkInfos` needs not to be offseted as it should already
|
|
609
579
|
* contain the correct time information.
|
|
610
580
|
*/
|
|
611
581
|
chunkOffset: number;
|
|
612
582
|
/**
|
|
613
|
-
* start and end windows for the
|
|
583
|
+
* start and end windows for the chunk (part of the chunk respectively
|
|
614
584
|
* before and after that time will be ignored).
|
|
615
585
|
* `undefined` when their is no such limitation.
|
|
616
586
|
*/
|
|
@@ -619,27 +589,65 @@ export interface ISegmentParserParsedMediaChunk<DataType> {
|
|
|
619
589
|
number | undefined
|
|
620
590
|
];
|
|
621
591
|
/**
|
|
622
|
-
* If set and not empty, then "events" have been
|
|
623
|
-
*
|
|
592
|
+
* If set and not empty, then this property contains "events" have been
|
|
593
|
+
* encountered in this parsed chunk.
|
|
624
594
|
*/
|
|
625
595
|
inbandEvents?: IInbandEvent[] | undefined;
|
|
626
596
|
/**
|
|
627
597
|
* If set to `true`, then parsing this chunk revealed that the current
|
|
628
598
|
* Manifest instance needs to be refreshed.
|
|
629
599
|
*/
|
|
630
|
-
needsManifestRefresh?: boolean;
|
|
600
|
+
needsManifestRefresh?: boolean | undefined;
|
|
631
601
|
/**
|
|
632
|
-
*
|
|
633
|
-
*
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
*
|
|
602
|
+
* Information on encryption that has been found in this chunk.
|
|
603
|
+
* Empty array if no such information was found.
|
|
604
|
+
*/
|
|
605
|
+
protectionData: IProtectionDataInfo[];
|
|
606
|
+
/**
|
|
607
|
+
* Some segments might contain information about segments coming after them.
|
|
608
|
+
* Those are called "predicted segments".
|
|
638
609
|
*
|
|
639
|
-
*
|
|
640
|
-
*
|
|
610
|
+
* If set, this array will contain the list of segment predicted to come just
|
|
611
|
+
* after this segment.
|
|
612
|
+
*/
|
|
613
|
+
predictedSegments?: ISegmentInformation[] | undefined;
|
|
614
|
+
}
|
|
615
|
+
/** Format of protection data found in a segment/chunk. */
|
|
616
|
+
export interface IProtectionDataInfo {
|
|
617
|
+
/**
|
|
618
|
+
* Format of the protection data.
|
|
619
|
+
* "cenc" is the standart format for ISOBMFF-embedded protection information -
|
|
620
|
+
* like in a PSSH box.
|
|
641
621
|
*/
|
|
642
|
-
|
|
622
|
+
initDataType: "cenc";
|
|
623
|
+
/** Optional key id found in the segment. */
|
|
624
|
+
keyId: Uint8Array | undefined;
|
|
625
|
+
/**
|
|
626
|
+
* The protection data.
|
|
627
|
+
*/
|
|
628
|
+
initData: Array<{
|
|
629
|
+
/** Hex string identifying the key system concerned by this protection data. */
|
|
630
|
+
systemId: string;
|
|
631
|
+
/** The protection data itself. */
|
|
632
|
+
data: Uint8Array;
|
|
633
|
+
}>;
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Some `RepresentationIndex` await the initialization segment to be parsed before
|
|
637
|
+
* knowing the list of media segments linked to it.
|
|
638
|
+
*
|
|
639
|
+
* This type describes the information obtained on a single segment when the
|
|
640
|
+
* initialization segment has been parsed.
|
|
641
|
+
*/
|
|
642
|
+
export interface ISegmentInformation {
|
|
643
|
+
/** This segment start time, timescaled. */
|
|
644
|
+
time: number;
|
|
645
|
+
/** This segment difference between its end and start time, timescaled. */
|
|
646
|
+
duration: number;
|
|
647
|
+
/** Dividing `time` or `duration` with this value allows to obtain seconds. */
|
|
648
|
+
timescale: number;
|
|
649
|
+
/** Optional byte-range at which the segment should be loaded. */
|
|
650
|
+
range?: [number, number];
|
|
643
651
|
}
|
|
644
652
|
/** Describe data loaded through a request. */
|
|
645
653
|
export interface IRequestedData<T> {
|
|
@@ -672,7 +680,6 @@ export interface IRequestedData<T> {
|
|
|
672
680
|
size: number | undefined;
|
|
673
681
|
}
|
|
674
682
|
export interface ITransportOptions {
|
|
675
|
-
aggressiveMode?: boolean | undefined;
|
|
676
683
|
checkMediaSegmentIntegrity?: boolean | undefined;
|
|
677
684
|
lowLatencyMode: boolean;
|
|
678
685
|
manifestLoader?: IManifestLoader | undefined;
|
|
@@ -681,7 +688,5 @@ export interface ITransportOptions {
|
|
|
681
688
|
representationFilter?: IRepresentationFilter | undefined;
|
|
682
689
|
segmentLoader?: ICustomSegmentLoader | undefined;
|
|
683
690
|
serverSyncInfos?: IServerSyncInfos | undefined;
|
|
684
|
-
supplementaryImageTracks?: ISupplementaryImageTrack[] | undefined;
|
|
685
|
-
supplementaryTextTracks?: ISupplementaryTextTrack[] | undefined;
|
|
686
691
|
__priv_patchLastSegmentInSidx?: boolean | undefined;
|
|
687
692
|
}
|
|
@@ -44,7 +44,7 @@ export default function callCustomManifestLoader(customManifestLoader, fallbackM
|
|
|
44
44
|
* @param {*} err - The corresponding error encountered
|
|
45
45
|
*/
|
|
46
46
|
var reject = function (err) {
|
|
47
|
-
var _a, _b
|
|
47
|
+
var _a, _b;
|
|
48
48
|
if (hasFinished || cancelSignal.isCancelled()) {
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
@@ -54,7 +54,7 @@ export default function callCustomManifestLoader(customManifestLoader, fallbackM
|
|
|
54
54
|
var castedErr = err;
|
|
55
55
|
var message = (_a = castedErr === null || castedErr === void 0 ? void 0 : castedErr.message) !== null && _a !== void 0 ? _a : "Unknown error when fetching the Manifest through a " +
|
|
56
56
|
"custom manifestLoader.";
|
|
57
|
-
var emittedErr = new CustomLoaderError(message, (_b = castedErr === null || castedErr === void 0 ? void 0 : castedErr.canRetry) !== null && _b !== void 0 ? _b : false,
|
|
57
|
+
var emittedErr = new CustomLoaderError(message, (_b = castedErr === null || castedErr === void 0 ? void 0 : castedErr.canRetry) !== null && _b !== void 0 ? _b : false, castedErr === null || castedErr === void 0 ? void 0 : castedErr.xhr);
|
|
58
58
|
rej(emittedErr);
|
|
59
59
|
};
|
|
60
60
|
/**
|
|
@@ -70,7 +70,7 @@ export default function callCustomManifestLoader(customManifestLoader, fallbackM
|
|
|
70
70
|
fallbackManifestLoader(url, loaderOptions, cancelSignal).then(res, rej);
|
|
71
71
|
};
|
|
72
72
|
var callbacks = { reject: reject, resolve: resolve, fallback: fallback };
|
|
73
|
-
var abort = customManifestLoader(url
|
|
73
|
+
var abort = customManifestLoader({ url: url, timeout: loaderOptions.timeout }, callbacks);
|
|
74
74
|
cancelSignal.register(abortCustomLoader);
|
|
75
75
|
/**
|
|
76
76
|
* The logic to run when the custom loader is cancelled while pending.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
16
|
+
import { ITrackType } from "../../public_types";
|
|
17
17
|
/**
|
|
18
18
|
* Guess the type of container a segment is in based on Manifest information.
|
|
19
19
|
*
|
|
@@ -23,7 +23,7 @@ import { IAdaptationType, Representation } from "../../manifest";
|
|
|
23
23
|
* - `undefined` if we cannot say with confidence in which container the
|
|
24
24
|
* segment will be in.
|
|
25
25
|
* @param {string} adaptationType
|
|
26
|
-
* @param {
|
|
26
|
+
* @param {string} mimeType
|
|
27
27
|
* @returns {string | undefined}
|
|
28
28
|
*/
|
|
29
|
-
export default function inferSegmentContainer(adaptationType:
|
|
29
|
+
export default function inferSegmentContainer(adaptationType: ITrackType, mimeType: string | undefined): "webm" | "mp4" | undefined;
|
|
@@ -22,23 +22,21 @@
|
|
|
22
22
|
* - `undefined` if we cannot say with confidence in which container the
|
|
23
23
|
* segment will be in.
|
|
24
24
|
* @param {string} adaptationType
|
|
25
|
-
* @param {
|
|
25
|
+
* @param {string} mimeType
|
|
26
26
|
* @returns {string | undefined}
|
|
27
27
|
*/
|
|
28
|
-
export default function inferSegmentContainer(adaptationType,
|
|
28
|
+
export default function inferSegmentContainer(adaptationType, mimeType) {
|
|
29
29
|
if (adaptationType === "audio" || adaptationType === "video") {
|
|
30
|
-
if (
|
|
31
|
-
representation.mimeType === "audio/mp4") {
|
|
30
|
+
if (mimeType === "video/mp4" || mimeType === "audio/mp4") {
|
|
32
31
|
return "mp4";
|
|
33
32
|
}
|
|
34
|
-
if (
|
|
35
|
-
representation.mimeType === "audio/webm") {
|
|
33
|
+
if (mimeType === "video/webm" || mimeType === "audio/webm") {
|
|
36
34
|
return "webm";
|
|
37
35
|
}
|
|
38
36
|
return undefined;
|
|
39
37
|
}
|
|
40
38
|
else if (adaptationType === "text") {
|
|
41
|
-
return
|
|
39
|
+
return mimeType === "application/mp4" ?
|
|
42
40
|
"mp4" :
|
|
43
41
|
undefined;
|
|
44
42
|
}
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
17
|
-
import { IChunkTimeInfo, ITextTrackSegmentData } from "../types";
|
|
16
|
+
import { ISegment } from "../../manifest";
|
|
17
|
+
import { IChunkTimeInfo, ISegmentContext, ITextTrackSegmentData } from "../types";
|
|
18
18
|
/**
|
|
19
19
|
* Return plain text text track from the given ISOBMFF.
|
|
20
20
|
* @param {Uint8Array} chunkBytes
|
|
@@ -27,13 +27,13 @@ export declare function extractTextTrackFromISOBMFF(chunkBytes: Uint8Array): str
|
|
|
27
27
|
* @param {Object} representation
|
|
28
28
|
* @returns {string}
|
|
29
29
|
*/
|
|
30
|
-
export declare function getISOBMFFTextTrackFormat(
|
|
30
|
+
export declare function getISOBMFFTextTrackFormat(codecs: string | undefined): "ttml" | "vtt";
|
|
31
31
|
/**
|
|
32
32
|
* Returns the a string expliciting the format of a text track in plain text.
|
|
33
33
|
* @param {Object} representation
|
|
34
34
|
* @returns {string}
|
|
35
35
|
*/
|
|
36
|
-
export declare function getPlainTextTrackFormat(
|
|
36
|
+
export declare function getPlainTextTrackFormat(codecs: string | undefined, mimeType: string | undefined): "ttml" | "sami" | "vtt" | "srt";
|
|
37
37
|
/**
|
|
38
38
|
* @param {Object} content
|
|
39
39
|
* @param {ArrayBuffer|UInt8Array|null} chunkData
|
|
@@ -41,10 +41,10 @@ export declare function getPlainTextTrackFormat(representation: Representation):
|
|
|
41
41
|
* @param {boolean} isChunked
|
|
42
42
|
* @returns {Object|null}
|
|
43
43
|
*/
|
|
44
|
-
export declare function getISOBMFFEmbeddedTextTrackData({ segment,
|
|
44
|
+
export declare function getISOBMFFEmbeddedTextTrackData({ segment, language, codecs }: {
|
|
45
45
|
segment: ISegment;
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
codecs?: string | undefined;
|
|
47
|
+
language?: string | undefined;
|
|
48
48
|
}, chunkBytes: Uint8Array, chunkInfos: IChunkTimeInfo | null, isChunked: boolean): ITextTrackSegmentData | null;
|
|
49
49
|
/**
|
|
50
50
|
* @param {Object} content
|
|
@@ -53,8 +53,4 @@ export declare function getISOBMFFEmbeddedTextTrackData({ segment, adaptation, r
|
|
|
53
53
|
* @param {boolean} isChunked
|
|
54
54
|
* @returns {Object|null}
|
|
55
55
|
*/
|
|
56
|
-
export declare function getPlainTextTrackData(
|
|
57
|
-
segment: ISegment;
|
|
58
|
-
adaptation: Adaptation;
|
|
59
|
-
representation: Representation;
|
|
60
|
-
}, textTrackData: string, isChunked: boolean): ITextTrackSegmentData | null;
|
|
56
|
+
export declare function getPlainTextTrackData(context: ISegmentContext, textTrackData: string, isChunked: boolean): ITextTrackSegmentData | null;
|
|
@@ -32,12 +32,11 @@ export function extractTextTrackFromISOBMFF(chunkBytes) {
|
|
|
32
32
|
* @param {Object} representation
|
|
33
33
|
* @returns {string}
|
|
34
34
|
*/
|
|
35
|
-
export function getISOBMFFTextTrackFormat(
|
|
36
|
-
|
|
37
|
-
if (codec === undefined) {
|
|
35
|
+
export function getISOBMFFTextTrackFormat(codecs) {
|
|
36
|
+
if (codecs === undefined) {
|
|
38
37
|
throw new Error("Cannot parse subtitles: unknown format");
|
|
39
38
|
}
|
|
40
|
-
switch (
|
|
39
|
+
switch (codecs.toLowerCase()) {
|
|
41
40
|
case "stpp": // stpp === TTML in MP4
|
|
42
41
|
case "stpp.ttml.im1t":
|
|
43
42
|
return "ttml";
|
|
@@ -45,16 +44,15 @@ export function getISOBMFFTextTrackFormat(representation) {
|
|
|
45
44
|
return "vtt";
|
|
46
45
|
}
|
|
47
46
|
throw new Error("The codec used for the subtitles " +
|
|
48
|
-
"\"".concat(
|
|
47
|
+
"\"".concat(codecs, "\" is not managed yet."));
|
|
49
48
|
}
|
|
50
49
|
/**
|
|
51
50
|
* Returns the a string expliciting the format of a text track in plain text.
|
|
52
51
|
* @param {Object} representation
|
|
53
52
|
* @returns {string}
|
|
54
53
|
*/
|
|
55
|
-
export function getPlainTextTrackFormat(
|
|
56
|
-
|
|
57
|
-
switch (representation.mimeType) {
|
|
54
|
+
export function getPlainTextTrackFormat(codecs, mimeType) {
|
|
55
|
+
switch (mimeType) {
|
|
58
56
|
case "application/ttml+xml":
|
|
59
57
|
return "ttml";
|
|
60
58
|
case "application/x-sami":
|
|
@@ -63,12 +61,13 @@ export function getPlainTextTrackFormat(representation) {
|
|
|
63
61
|
case "text/vtt":
|
|
64
62
|
return "vtt";
|
|
65
63
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
if (codecs !== undefined) {
|
|
65
|
+
var codeLC = codecs.toLowerCase();
|
|
66
|
+
if (codeLC === "srt") {
|
|
67
|
+
return "srt";
|
|
68
|
+
}
|
|
70
69
|
}
|
|
71
|
-
throw new Error("could not find a text-track parser for the type ".concat(mimeType));
|
|
70
|
+
throw new Error("could not find a text-track parser for the type ".concat(mimeType !== null && mimeType !== void 0 ? mimeType : ""));
|
|
72
71
|
}
|
|
73
72
|
/**
|
|
74
73
|
* @param {Object} content
|
|
@@ -78,7 +77,7 @@ export function getPlainTextTrackFormat(representation) {
|
|
|
78
77
|
* @returns {Object|null}
|
|
79
78
|
*/
|
|
80
79
|
export function getISOBMFFEmbeddedTextTrackData(_a, chunkBytes, chunkInfos, isChunked) {
|
|
81
|
-
var segment = _a.segment,
|
|
80
|
+
var segment = _a.segment, language = _a.language, codecs = _a.codecs;
|
|
82
81
|
if (segment.isInit) {
|
|
83
82
|
return null;
|
|
84
83
|
}
|
|
@@ -102,10 +101,9 @@ export function getISOBMFFEmbeddedTextTrackData(_a, chunkBytes, chunkInfos, isCh
|
|
|
102
101
|
endTime = startTime + segment.duration;
|
|
103
102
|
}
|
|
104
103
|
}
|
|
105
|
-
var type = getISOBMFFTextTrackFormat(
|
|
104
|
+
var type = getISOBMFFTextTrackFormat(codecs);
|
|
106
105
|
var textData = extractTextTrackFromISOBMFF(chunkBytes);
|
|
107
|
-
return { data: textData, type: type, language:
|
|
108
|
-
start: startTime,
|
|
106
|
+
return { data: textData, type: type, language: language, start: startTime,
|
|
109
107
|
end: endTime };
|
|
110
108
|
}
|
|
111
109
|
/**
|
|
@@ -115,8 +113,8 @@ export function getISOBMFFEmbeddedTextTrackData(_a, chunkBytes, chunkInfos, isCh
|
|
|
115
113
|
* @param {boolean} isChunked
|
|
116
114
|
* @returns {Object|null}
|
|
117
115
|
*/
|
|
118
|
-
export function getPlainTextTrackData(
|
|
119
|
-
var segment =
|
|
116
|
+
export function getPlainTextTrackData(context, textTrackData, isChunked) {
|
|
117
|
+
var segment = context.segment;
|
|
120
118
|
if (segment.isInit) {
|
|
121
119
|
return null;
|
|
122
120
|
}
|
|
@@ -131,6 +129,6 @@ export function getPlainTextTrackData(_a, textTrackData, isChunked) {
|
|
|
131
129
|
end = segment.time + segment.duration;
|
|
132
130
|
}
|
|
133
131
|
}
|
|
134
|
-
var type = getPlainTextTrackFormat(
|
|
135
|
-
return { data: textTrackData, type: type, language:
|
|
132
|
+
var type = getPlainTextTrackFormat(context.codecs, context.mimeType);
|
|
133
|
+
return { data: textTrackData, type: type, language: context.language, start: start, end: end };
|
|
136
134
|
}
|
|
@@ -50,4 +50,5 @@
|
|
|
50
50
|
* @param {number} [fromIndex]
|
|
51
51
|
* @returns {boolean}
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
declare const _default: <T>(arr: T[], searchElement: T, fromIndex?: number) => boolean;
|
|
54
|
+
export default _default;
|
|
@@ -50,34 +50,36 @@
|
|
|
50
50
|
* @param {number} [fromIndex]
|
|
51
51
|
* @returns {boolean}
|
|
52
52
|
*/
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
58
|
-
// eslint-disable-next-line no-restricted-properties
|
|
53
|
+
/* eslint-disable @typescript-eslint/unbound-method */
|
|
54
|
+
/* eslint-disable no-restricted-properties */
|
|
55
|
+
export default typeof Array.prototype.includes === "function" ?
|
|
56
|
+
function realArrayIncludes(arr, searchElement, fromIndex) {
|
|
59
57
|
return arr.includes(searchElement, fromIndex);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
} :
|
|
59
|
+
function compatArrayIncludes(arr, searchElement, fromIndex) {
|
|
60
|
+
if (typeof Array.prototype.includes === "function") {
|
|
61
|
+
return arr.includes(searchElement, fromIndex);
|
|
62
|
+
}
|
|
63
|
+
var len = arr.length >>> 0;
|
|
64
|
+
if (len === 0) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
var n = fromIndex | 0;
|
|
68
|
+
var k = n >= 0 ?
|
|
69
|
+
Math.min(n, len - 1) :
|
|
70
|
+
Math.max(len + n, 0);
|
|
71
|
+
var areTheSame = function (x, y) {
|
|
72
|
+
return x === y ||
|
|
73
|
+
// Viva las JavaScriptas!
|
|
74
|
+
(typeof x === "number" &&
|
|
75
|
+
typeof y === "number" &&
|
|
76
|
+
isNaN(x) && isNaN(y));
|
|
77
|
+
};
|
|
78
|
+
while (k < len) {
|
|
79
|
+
if (areTheSame(arr[k], searchElement)) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
k++;
|
|
83
|
+
}
|
|
63
84
|
return false;
|
|
64
|
-
}
|
|
65
|
-
var n = fromIndex | 0;
|
|
66
|
-
var k = n >= 0 ?
|
|
67
|
-
Math.min(n, len - 1) :
|
|
68
|
-
Math.max(len + n, 0);
|
|
69
|
-
var areTheSame = function (x, y) {
|
|
70
|
-
return x === y ||
|
|
71
|
-
// Viva las JavaScriptas!
|
|
72
|
-
(typeof x === "number" &&
|
|
73
|
-
typeof y === "number" &&
|
|
74
|
-
isNaN(x) && isNaN(y));
|
|
75
85
|
};
|
|
76
|
-
while (k < len) {
|
|
77
|
-
if (areTheSame(arr[k], searchElement)) {
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
k++;
|
|
81
|
-
}
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
@@ -41,7 +41,7 @@ export default function request(options) {
|
|
|
41
41
|
// is more precise, it might also be more efficient.
|
|
42
42
|
timeoutId = window.setTimeout(function () {
|
|
43
43
|
clearCancellingProcess();
|
|
44
|
-
reject(new RequestError(url, xhr.status, "TIMEOUT"
|
|
44
|
+
reject(new RequestError(url, xhr.status, "TIMEOUT"));
|
|
45
45
|
}, timeout + 3000);
|
|
46
46
|
}
|
|
47
47
|
xhr.responseType = responseType;
|
|
@@ -74,11 +74,11 @@ export default function request(options) {
|
|
|
74
74
|
}
|
|
75
75
|
xhr.onerror = function onXHRError() {
|
|
76
76
|
clearCancellingProcess();
|
|
77
|
-
reject(new RequestError(url, xhr.status, "ERROR_EVENT"
|
|
77
|
+
reject(new RequestError(url, xhr.status, "ERROR_EVENT"));
|
|
78
78
|
};
|
|
79
79
|
xhr.ontimeout = function onXHRTimeout() {
|
|
80
80
|
clearCancellingProcess();
|
|
81
|
-
reject(new RequestError(url, xhr.status, "TIMEOUT"
|
|
81
|
+
reject(new RequestError(url, xhr.status, "TIMEOUT"));
|
|
82
82
|
};
|
|
83
83
|
if (onProgress !== undefined) {
|
|
84
84
|
xhr.onprogress = function onXHRProgress(event) {
|
|
@@ -112,7 +112,7 @@ export default function request(options) {
|
|
|
112
112
|
responseData = xhr.response;
|
|
113
113
|
}
|
|
114
114
|
if (isNullOrUndefined(responseData)) {
|
|
115
|
-
reject(new RequestError(url, xhr.status, "PARSE_ERROR"
|
|
115
|
+
reject(new RequestError(url, xhr.status, "PARSE_ERROR"));
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
resolve({ status: status_1, url: _url,
|
|
@@ -120,7 +120,7 @@ export default function request(options) {
|
|
|
120
120
|
size: totalSize, responseData: responseData });
|
|
121
121
|
}
|
|
122
122
|
else {
|
|
123
|
-
reject(new RequestError(url, xhr.status, "ERROR_HTTP_CODE"
|
|
123
|
+
reject(new RequestError(url, xhr.status, "ERROR_HTTP_CODE"));
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
};
|