rx-player 4.0.0-dev.2023110700 → 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 +18 -226
- 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 +14 -35
- package/dist/_esm5.processed/core/api/option_utils.js +47 -230
- package/dist/_esm5.processed/core/api/public_api.d.ts +92 -266
- package/dist/_esm5.processed/core/api/public_api.js +451 -807
- 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/html/text_track_cues_store.js +54 -6
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/utils.d.ts +2 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/utils.js +19 -2
- 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 +33 -10
- 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/convert_supplemental_codecs.d.ts +17 -0
- package/dist/_esm5.processed/parsers/manifest/dash/common/convert_supplemental_codecs.js +26 -0
- package/dist/_esm5.processed/parsers/manifest/dash/common/flatten_overlapping_periods.js +5 -0
- 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/common/parse_representations.js +29 -17
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.js +13 -6
- package/dist/_esm5.processed/parsers/manifest/dash/js-parser/node_parsers/Representation.js +7 -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 +6 -4
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +7 -6
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/Representation.js +5 -2
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/types.d.ts +2 -1
- 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 +4 -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/compat/patch_webkit_source_buffer.js +2 -2
- 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 +4 -0
- package/dist/commonjs/core/api/option_utils.js +8 -3
- package/dist/commonjs/core/api/public_api.d.ts +11 -1
- package/dist/commonjs/core/api/public_api.js +46 -11
- 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/segment_buffers/implementations/text/html/text_track_cues_store.js +54 -6
- package/dist/commonjs/core/segment_buffers/implementations/text/html/utils.d.ts +2 -1
- package/dist/commonjs/core/segment_buffers/implementations/text/html/utils.js +19 -2
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +2 -2
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +3 -3
- package/dist/commonjs/core/stream/period/period_stream.js +2 -2
- 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.js +18 -5
- 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/convert_supplemental_codecs.d.ts +17 -0
- package/dist/commonjs/parsers/manifest/dash/common/convert_supplemental_codecs.js +30 -0
- package/dist/commonjs/parsers/manifest/dash/common/flatten_overlapping_periods.js +5 -0
- 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 +36 -20
- package/dist/commonjs/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.js +3 -0
- package/dist/commonjs/parsers/manifest/dash/js-parser/node_parsers/Representation.js +3 -0
- package/dist/commonjs/parsers/manifest/dash/node_parser_types.d.ts +2 -0
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +4 -0
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Representation.js +4 -0
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/types.d.ts +2 -1
- 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/types.d.ts +1 -0
- 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/queue_microtask.d.ts +2 -0
- package/dist/commonjs/utils/queue_microtask.js +7 -0
- 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/compat/patch_webkit_source_buffer.js +2 -2
- 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 +4 -0
- package/dist/es2017/core/api/option_utils.js +8 -3
- package/dist/es2017/core/api/public_api.d.ts +11 -1
- package/dist/es2017/core/api/public_api.js +44 -9
- 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/segment_buffers/implementations/text/html/text_track_cues_store.js +54 -6
- package/dist/es2017/core/segment_buffers/implementations/text/html/utils.d.ts +2 -1
- package/dist/es2017/core/segment_buffers/implementations/text/html/utils.js +18 -2
- package/dist/es2017/core/stream/adaptation/adaptation_stream.js +2 -2
- package/dist/es2017/core/stream/orchestrator/stream_orchestrator.js +3 -3
- package/dist/es2017/core/stream/period/period_stream.js +2 -2
- 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.js +18 -5
- 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/convert_supplemental_codecs.d.ts +17 -0
- package/dist/es2017/parsers/manifest/dash/common/convert_supplemental_codecs.js +26 -0
- package/dist/es2017/parsers/manifest/dash/common/flatten_overlapping_periods.js +5 -0
- 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 +36 -20
- package/dist/es2017/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.js +3 -0
- package/dist/es2017/parsers/manifest/dash/js-parser/node_parsers/Representation.js +3 -0
- package/dist/es2017/parsers/manifest/dash/node_parser_types.d.ts +2 -0
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +4 -0
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Representation.js +4 -0
- package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/types.d.ts +2 -1
- 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/types.d.ts +1 -0
- 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/queue_microtask.d.ts +2 -0
- package/dist/es2017/utils/queue_microtask.js +5 -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/mpd-parser.wasm +0 -0
- package/dist/rx-player.js +900 -492
- package/dist/rx-player.min.js +1 -1
- package/package.json +3 -7
- package/scripts/update-version +2 -0
- package/sonar-project.properties +1 -1
- package/src/compat/is_codec_supported.ts +23 -1
- package/src/compat/patch_webkit_source_buffer.ts +2 -2
- 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 +11 -3
- package/src/core/api/public_api.ts +48 -8
- 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/segment_buffers/implementations/text/html/__tests__/utils.test.ts +15 -0
- package/src/core/segment_buffers/implementations/text/html/text_track_cues_store.ts +57 -6
- package/src/core/segment_buffers/implementations/text/html/utils.ts +19 -2
- package/src/core/stream/adaptation/adaptation_stream.ts +2 -2
- package/src/core/stream/orchestrator/stream_orchestrator.ts +3 -3
- package/src/core/stream/period/period_stream.ts +2 -2
- 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.ts +19 -6
- 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__/convert_supplemental_codecs.test.ts +37 -0
- package/src/parsers/manifest/dash/common/__tests__/flatten_overlapping_period.test.ts +20 -0
- package/src/parsers/manifest/dash/common/__tests__/manifest_bounds_calculator.test.ts +182 -36
- package/src/parsers/manifest/dash/common/convert_supplemental_codecs.ts +32 -0
- package/src/parsers/manifest/dash/common/flatten_overlapping_periods.ts +5 -0
- 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 +39 -20
- package/src/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.ts +4 -0
- package/src/parsers/manifest/dash/js-parser/node_parsers/Representation.ts +4 -0
- package/src/parsers/manifest/dash/node_parser_types.ts +2 -0
- package/src/parsers/manifest/dash/wasm-parser/rs/events.rs +2 -0
- package/src/parsers/manifest/dash/wasm-parser/rs/processor/attributes.rs +2 -0
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.ts +4 -0
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/Representation.ts +4 -0
- package/src/parsers/manifest/dash/wasm-parser/ts/types.ts +2 -0
- 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/types.ts +2 -0
- 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/queue_microtask.ts +7 -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/next-tick.d.ts +0 -23
- package/src/typings/object-assign.d.ts +0 -48
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { IPreferredEmeApiType
|
|
16
|
+
import { IPreferredEmeApiType } from "./compat/eme";
|
|
17
17
|
import { IPersistentSessionInfoV0, IPersistentSessionInfoV1, IPersistentSessionInfoV2, IPersistentSessionInfoV3, IPersistentSessionInfoV4 } from "./core/decrypt";
|
|
18
|
-
import { IBufferType } from "./core/segment_buffers";
|
|
19
18
|
import { IMediaErrorTrackContext, EncryptedMediaError, MediaError, NetworkError, OtherError } from "./errors";
|
|
20
19
|
import Manifest from "./manifest";
|
|
21
20
|
import { ILocalManifest } from "./parsers/manifest/local";
|
|
@@ -33,115 +32,81 @@ export interface IConstructorOptions {
|
|
|
33
32
|
wantedBufferAhead?: number;
|
|
34
33
|
maxVideoBufferSize?: number;
|
|
35
34
|
limitVideoWidth?: boolean;
|
|
36
|
-
throttleWhenHidden?: boolean;
|
|
37
35
|
throttleVideoBitrateWhenHidden?: boolean;
|
|
38
|
-
preferredAudioTracks?: IAudioTrackPreference[];
|
|
39
|
-
preferredTextTracks?: ITextTrackPreference[];
|
|
40
|
-
preferredVideoTracks?: IVideoTrackPreference[];
|
|
41
36
|
videoElement?: HTMLMediaElement;
|
|
42
|
-
|
|
43
|
-
initialAudioBitrate?: number;
|
|
44
|
-
minAudioBitrate?: number;
|
|
45
|
-
minVideoBitrate?: number;
|
|
46
|
-
maxAudioBitrate?: number;
|
|
47
|
-
maxVideoBitrate?: number;
|
|
48
|
-
stopAtEnd?: boolean;
|
|
37
|
+
baseBandwidth?: number;
|
|
49
38
|
}
|
|
50
39
|
/** Every options that can be given to the RxPlayer's `loadVideo` method. */
|
|
51
40
|
export interface ILoadVideoOptions {
|
|
41
|
+
/**
|
|
42
|
+
* Streaming protocol used (e.g. "dash" or "smooth").
|
|
43
|
+
*
|
|
44
|
+
* It is a mandatory property.
|
|
45
|
+
*/
|
|
52
46
|
transport: string;
|
|
47
|
+
/** Main URL to the content (Manifest or video file for directfile contents. */
|
|
53
48
|
url?: string;
|
|
49
|
+
/** If `true` the Content will automatically play once loaded. */
|
|
54
50
|
autoPlay?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Decryption-related options.
|
|
53
|
+
* Can be left to undefined if no decryption is wanted.
|
|
54
|
+
*/
|
|
55
55
|
keySystems?: IKeySystemOption[];
|
|
56
|
-
|
|
56
|
+
/**
|
|
57
|
+
* If set to `true`, and if the content is compatible, it will be played in a
|
|
58
|
+
* special mode where the latency is greatly reduced.
|
|
59
|
+
*
|
|
60
|
+
* Should only be set for known to be compatible contents.
|
|
61
|
+
*/
|
|
57
62
|
lowLatencyMode?: boolean;
|
|
58
|
-
|
|
63
|
+
requestConfig?: IRequestConfig;
|
|
64
|
+
/** Indicate the position the RxPlayer should start at on the loaded content. */
|
|
59
65
|
startAt?: IStartAtOption;
|
|
66
|
+
/**
|
|
67
|
+
* The "mode" in which the text tracks will be displayed.
|
|
68
|
+
*
|
|
69
|
+
* The default `"native"` mode will use HTMLMediaElement's `track`elements and
|
|
70
|
+
* poor stylization capabilities.
|
|
71
|
+
*
|
|
72
|
+
* The `"html"` mode use the `textTrackElement` option to display subtitles
|
|
73
|
+
* with rich stylization capabilities inside that `HTMLElement`.
|
|
74
|
+
*/
|
|
60
75
|
textTrackMode?: "native" | "html";
|
|
61
|
-
|
|
76
|
+
/**
|
|
77
|
+
* The HTMLElement in which text track will be pushed in a `"html"`
|
|
78
|
+
* `textTrackMode`.
|
|
79
|
+
*
|
|
80
|
+
* Mandatory if `textTrackMode` is set to `"html"`.
|
|
81
|
+
*
|
|
82
|
+
* Has no effect when `textTrackMode` is not set or set to `"native"`.
|
|
83
|
+
*/
|
|
62
84
|
textTrackElement?: HTMLElement;
|
|
63
|
-
|
|
85
|
+
/**
|
|
86
|
+
* `true` by default.
|
|
87
|
+
*
|
|
88
|
+
* If set to `false`, the RxPlayer won't use the "fast-switching" optimization
|
|
89
|
+
* that allows to see raise in qualities quicker.
|
|
90
|
+
*
|
|
91
|
+
* You might want to set to `false` when the current device does not support
|
|
92
|
+
* segment replacement well.
|
|
93
|
+
*/
|
|
64
94
|
enableFastSwitching?: boolean;
|
|
65
|
-
|
|
95
|
+
/** Default behavior when switching to a different audio track. */
|
|
96
|
+
defaultAudioTrackSwitchingMode?: IAudioTrackSwitchingMode;
|
|
97
|
+
/**
|
|
98
|
+
* Behavior when a audio or video codec just switched to another
|
|
99
|
+
* non-compatible one.
|
|
100
|
+
*
|
|
101
|
+
* This value might depend on the device's capabilities.
|
|
102
|
+
*/
|
|
66
103
|
onCodecSwitch?: "continue" | "reload";
|
|
67
|
-
supplementaryTextTracks?: ISupplementaryTextTrackOption[];
|
|
68
|
-
supplementaryImageTracks?: ISupplementaryImageTrackOption[];
|
|
69
|
-
defaultAudioTrack?: IDefaultAudioTrackOption | null | undefined;
|
|
70
|
-
defaultTextTrack?: IDefaultTextTrackOption | null | undefined;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Value for the `defaultAudioTrack` option of the `loadVideo` method.
|
|
74
|
-
* @deprecated
|
|
75
|
-
*/
|
|
76
|
-
export interface IDefaultAudioTrackOption {
|
|
77
|
-
/** The language wanted for the audio track. */
|
|
78
|
-
language: string;
|
|
79
|
-
/** The language normalized into ISO639-3 */
|
|
80
|
-
normalized: string;
|
|
81
|
-
/** If `true`, this is an audio description for the visually impaired. */
|
|
82
|
-
audioDescription: boolean;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Value for the `defaultTextTrack` option of the `loadVideo` method.
|
|
86
|
-
* @deprecated
|
|
87
|
-
*/
|
|
88
|
-
export interface IDefaultTextTrackOption {
|
|
89
|
-
/** The language wanted for the text track. */
|
|
90
|
-
language: string;
|
|
91
|
-
/** The language normalized into ISO639-3 */
|
|
92
|
-
normalized: string;
|
|
93
|
-
/** If `true`, this is closed captions for the hard of hearing. */
|
|
94
|
-
closedCaption: boolean;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* External text track we have to add to the Manifest once downloaded.
|
|
98
|
-
* @deprecated
|
|
99
|
-
*/
|
|
100
|
-
export interface ISupplementaryTextTrackOption {
|
|
101
|
-
/** URL the external text track can be found at. */
|
|
102
|
-
url: string;
|
|
103
|
-
/** Language the text track is in. */
|
|
104
|
-
language: string;
|
|
105
|
-
/** If `true` the text track contains closed captions. */
|
|
106
|
-
closedCaption: boolean;
|
|
107
|
-
/** Mime-type used to know the container and/or format of the text track. */
|
|
108
|
-
mimeType: string;
|
|
109
|
-
/** Codec used to know the format of the text track. */
|
|
110
|
-
codecs?: string;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* External image (".bif") track we have to add to the Manifest once downloaded.
|
|
114
|
-
* @deprecated
|
|
115
|
-
*/
|
|
116
|
-
export interface ISupplementaryImageTrackOption {
|
|
117
|
-
/** URL the external image track can be found at. */
|
|
118
|
-
url: string;
|
|
119
|
-
/** Mime-type used to know the format of the image track. */
|
|
120
|
-
mimeType: string;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Strategy to adopt when manually switching of audio adaptation.
|
|
124
|
-
* Can be either:
|
|
125
|
-
* - "seamless": transitions are smooth but could be not immediate.
|
|
126
|
-
* - "direct": strategy will be "smart", if the mimetype and the codec,
|
|
127
|
-
* change, we will perform a hard reload of the media source, however, if it
|
|
128
|
-
* doesn't change, we will just perform a small flush by removing buffered range
|
|
129
|
-
* and performing, a small seek on the media element.
|
|
130
|
-
* Transitions are faster, but, we could see appear a BUFFERING state.
|
|
131
|
-
* - "reload": completely reload the content. This allows a direct switch
|
|
132
|
-
* compatible with most device but may necessitate a RELOADING phase.
|
|
133
|
-
*/
|
|
134
|
-
export type IAudioTrackSwitchingMode = "seamless" | "direct" | "reload";
|
|
135
|
-
/** Value of the `transportOptions` option of the `loadVideo` method. */
|
|
136
|
-
export interface ITransportOptions {
|
|
137
|
-
/** Whether we can perform request for segments in advance. */
|
|
138
|
-
aggressiveMode?: boolean;
|
|
139
104
|
/**
|
|
140
105
|
* Whether we should check that an obtain segment is truncated and retry the
|
|
141
106
|
* request if that's the case.
|
|
142
107
|
*/
|
|
143
108
|
checkMediaSegmentIntegrity?: boolean;
|
|
144
|
-
/** Manifest object that
|
|
109
|
+
/** Manifest object that may be used initially. */
|
|
145
110
|
initialManifest?: IInitialManifest;
|
|
146
111
|
/** Custom implementation for performing Manifest requests. */
|
|
147
112
|
manifestLoader?: IManifestLoader;
|
|
@@ -171,80 +136,14 @@ export interface IServerSyncInfos {
|
|
|
171
136
|
/** Format of a loaded Manifest before parsing. */
|
|
172
137
|
export type IInitialManifest = Document | string | ArrayBuffer | IMetaPlaylist | ILocalManifest | Manifest;
|
|
173
138
|
/** Type for the `representationFilter` API. */
|
|
174
|
-
export type IRepresentationFilter = (representation:
|
|
175
|
-
/**
|
|
176
|
-
export interface
|
|
177
|
-
periods: IPeriod[];
|
|
178
|
-
/**
|
|
179
|
-
* @deprecated
|
|
180
|
-
*/
|
|
181
|
-
adaptations: {
|
|
182
|
-
audio?: IAdaptation[];
|
|
183
|
-
video?: IAdaptation[];
|
|
184
|
-
text?: IAdaptation[];
|
|
185
|
-
image?: IAdaptation[];
|
|
186
|
-
};
|
|
187
|
-
isLive: boolean;
|
|
188
|
-
transport: string;
|
|
189
|
-
}
|
|
190
|
-
/** Period, as documented in the API documentation. */
|
|
191
|
-
export interface IPeriod {
|
|
192
|
-
id: string;
|
|
193
|
-
start: number;
|
|
194
|
-
end?: number | undefined;
|
|
195
|
-
adaptations: {
|
|
196
|
-
audio?: IAdaptation[];
|
|
197
|
-
video?: IAdaptation[];
|
|
198
|
-
text?: IAdaptation[];
|
|
199
|
-
image?: IAdaptation[];
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
export type IAdaptationType = "video" | "audio" | "text" | "image";
|
|
203
|
-
/** Adaptation (represents a track), as documented in the API documentation. */
|
|
204
|
-
export interface IAdaptation {
|
|
205
|
-
/** String identifying the Adaptation, unique per Period. */
|
|
206
|
-
id: string;
|
|
207
|
-
type: IAdaptationType;
|
|
208
|
-
language?: string | undefined;
|
|
209
|
-
normalizedLanguage?: string | undefined;
|
|
210
|
-
isAudioDescription?: boolean | undefined;
|
|
211
|
-
isClosedCaption?: boolean | undefined;
|
|
212
|
-
isSignInterpreted?: boolean | undefined;
|
|
213
|
-
isTrickModeTrack?: boolean | undefined;
|
|
214
|
-
representations: IRepresentation[];
|
|
215
|
-
getAvailableBitrates(): number[];
|
|
216
|
-
}
|
|
217
|
-
interface IRepresentationIndex {
|
|
218
|
-
getSegments(up: number, duration: number): IExposedSegment[];
|
|
219
|
-
}
|
|
220
|
-
/** Segment, as documented in the API documentation. */
|
|
221
|
-
export interface IExposedSegment {
|
|
222
|
-
id: string;
|
|
223
|
-
timescale: number;
|
|
224
|
-
duration?: number | undefined;
|
|
225
|
-
time: number;
|
|
226
|
-
isInit?: boolean | undefined;
|
|
227
|
-
range?: number[] | null | undefined;
|
|
228
|
-
indexRange?: number[] | null | undefined;
|
|
229
|
-
number?: number | undefined;
|
|
230
|
-
}
|
|
231
|
-
/** Representation (represents a quality), as documented in the API documentation. */
|
|
232
|
-
export interface IRepresentation {
|
|
139
|
+
export type IRepresentationFilter = (representation: IRepresentationFilterRepresentation, context: IRepresentationContext) => boolean;
|
|
140
|
+
/** Representation object given to the `representationFilter` API. */
|
|
141
|
+
export interface IRepresentationFilterRepresentation {
|
|
233
142
|
/** String identifying the Representation, unique per Adaptation. */
|
|
234
143
|
id: string;
|
|
235
|
-
bitrate
|
|
236
|
-
/** Codec used by the
|
|
144
|
+
bitrate?: number | undefined;
|
|
145
|
+
/** Codec used by the media segments of that Representation. */
|
|
237
146
|
codec?: string | undefined;
|
|
238
|
-
/**
|
|
239
|
-
* Whether we are able to decrypt this Representation / unable to decrypt it or
|
|
240
|
-
* if we don't know yet:
|
|
241
|
-
* - if `true`, it means that we know we were able to decrypt this
|
|
242
|
-
* Representation in the current content.
|
|
243
|
-
* - if `false`, it means that we know we were unable to decrypt this
|
|
244
|
-
* Representation
|
|
245
|
-
* - if `undefined` there is no certainty on this matter
|
|
246
|
-
*/
|
|
247
|
-
decipherable?: boolean | undefined;
|
|
248
147
|
/**
|
|
249
148
|
* This property makes the most sense for video Representations.
|
|
250
149
|
* It defines the height of the video, in pixels.
|
|
@@ -255,15 +154,20 @@ export interface IRepresentation {
|
|
|
255
154
|
* It defines the height of the video, in pixels.
|
|
256
155
|
*/
|
|
257
156
|
width?: number | undefined;
|
|
157
|
+
/** The frame rate for this Representation, in frame per seconds. */
|
|
158
|
+
frameRate?: number | undefined;
|
|
159
|
+
/** If the track is HDR, gives the HDR characteristics of the content */
|
|
160
|
+
hdrInfo?: IHDRInformation | undefined;
|
|
258
161
|
/**
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
162
|
+
* Encryption information linked to this content.
|
|
163
|
+
* If set to an Object, the Representation is known to be encrypted.
|
|
164
|
+
* If unset or set to `undefined` the Representation is either unencrypted or
|
|
165
|
+
* we don't know if it is.
|
|
262
166
|
*/
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
167
|
+
contentProtections?: {
|
|
168
|
+
/** Known key ids linked to that Representation. */
|
|
169
|
+
keyIds?: Uint8Array[] | undefined;
|
|
170
|
+
} | undefined;
|
|
267
171
|
}
|
|
268
172
|
export interface IHDRInformation {
|
|
269
173
|
/**
|
|
@@ -315,52 +219,44 @@ export type IStartAtOption = {
|
|
|
315
219
|
*/
|
|
316
220
|
fromFirstPosition: number;
|
|
317
221
|
};
|
|
318
|
-
/** Value for the `
|
|
319
|
-
export interface
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
*/
|
|
353
|
-
segmentRequestTimeout?: number | undefined;
|
|
222
|
+
/** Value for the `requestConfig` option of the `loadVideo` method. */
|
|
223
|
+
export interface IRequestConfig {
|
|
224
|
+
manifest?: {
|
|
225
|
+
/**
|
|
226
|
+
* The amount of time maximum we should retry a Manifest or Manifest-related
|
|
227
|
+
* request before failing on Error.
|
|
228
|
+
* Set to `Infinity` for an infinite number of requests.
|
|
229
|
+
*/
|
|
230
|
+
maxRetry?: number | undefined;
|
|
231
|
+
/**
|
|
232
|
+
* Amount of time, in milliseconds, after which a manifest request should be
|
|
233
|
+
* aborted and optionally retried, depending on the current configuration.
|
|
234
|
+
*
|
|
235
|
+
* Setting it to `-1` allows to disable any timeout.
|
|
236
|
+
* `undefined` means that a default, large, timeout will be used instead.
|
|
237
|
+
*/
|
|
238
|
+
timeout?: number | undefined;
|
|
239
|
+
} | undefined;
|
|
240
|
+
segment?: {
|
|
241
|
+
/**
|
|
242
|
+
* The amount of time maximum we should retry a segment or segment-related
|
|
243
|
+
* request before failing on Error.
|
|
244
|
+
* Set to `Infinity` for an infinite number of requests.
|
|
245
|
+
*/
|
|
246
|
+
maxRetry?: number | undefined;
|
|
247
|
+
/**
|
|
248
|
+
* Amount of time, in milliseconds, after which a segment request should be
|
|
249
|
+
* aborted and optionally retried, depending on the current configuration.
|
|
250
|
+
*
|
|
251
|
+
* Setting it to `-1` allows to disable any timeout.
|
|
252
|
+
* `undefined` means that a default, large, timeout will be used instead.
|
|
253
|
+
*/
|
|
254
|
+
timeout?: number | undefined;
|
|
255
|
+
} | undefined;
|
|
354
256
|
}
|
|
355
|
-
export type ISegmentLoader = (
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
manifest: IManifest;
|
|
359
|
-
period: IPeriod;
|
|
360
|
-
adaptation: IAdaptation;
|
|
361
|
-
representation: IRepresentation;
|
|
362
|
-
segment: IExposedSegment;
|
|
363
|
-
}, callbacks: {
|
|
257
|
+
export type ISegmentLoader = (
|
|
258
|
+
/** Information on the segment to request */
|
|
259
|
+
context: ISegmentLoaderContext, callbacks: {
|
|
364
260
|
resolve: (rArgs: {
|
|
365
261
|
data: ArrayBuffer | Uint8Array;
|
|
366
262
|
sendingTime?: number | undefined;
|
|
@@ -376,8 +272,53 @@ export type ISegmentLoader = (infos: {
|
|
|
376
272
|
totalSize?: number | undefined;
|
|
377
273
|
}) => void;
|
|
378
274
|
}) => (() => void) | void;
|
|
275
|
+
/** Context given to a segment loader. */
|
|
276
|
+
export interface ISegmentLoaderContext {
|
|
277
|
+
/** URL where the segment should be loaded. */
|
|
278
|
+
url: string | undefined;
|
|
279
|
+
/**
|
|
280
|
+
* Indicative request timeout as configured on the RxPlayer.
|
|
281
|
+
*/
|
|
282
|
+
timeout: number | undefined;
|
|
283
|
+
/**
|
|
284
|
+
* If true, this segment is an initialization segment with no decodable data.
|
|
285
|
+
*
|
|
286
|
+
* Those types of segment contain no decodable data and are only there for
|
|
287
|
+
* initialization purposes, such as giving initial infos to the decoder on
|
|
288
|
+
* subsequent media segments that will be pushed.
|
|
289
|
+
*
|
|
290
|
+
* Note that if `isInit` is false, it only means that the segment contains
|
|
291
|
+
* decodable media, it can also contain important initialization information.
|
|
292
|
+
*
|
|
293
|
+
* Also, a segment which would contain both all initialization data and the
|
|
294
|
+
* decodable data would have `isInit` set to `false` as it is not purely an
|
|
295
|
+
* initialization segment.
|
|
296
|
+
*
|
|
297
|
+
* Segments which are not purely an initialization segment are called "media
|
|
298
|
+
* segments" in the RxPlayer.
|
|
299
|
+
*/
|
|
300
|
+
isInit: boolean | undefined;
|
|
301
|
+
/**
|
|
302
|
+
* If set, only the corresponding byte-ranges, which are subsets in bytes of
|
|
303
|
+
* the loaded data, should be loaded.
|
|
304
|
+
* If multiple non-contiguous byte-ranges are given, the result should be
|
|
305
|
+
* the concatenation of those byte-ranges, in the same order.
|
|
306
|
+
*
|
|
307
|
+
* For example `[[0, 100], [150, 180]]` means that the bytes of both 0 to 100
|
|
308
|
+
* (included) and from 150 to 180 (included) should be requested.
|
|
309
|
+
* The communicated result should then be a concatenation of both in the same
|
|
310
|
+
* order.
|
|
311
|
+
*/
|
|
312
|
+
byteRanges?: Array<[number, number]> | undefined;
|
|
313
|
+
/** Type of the corresponding track. */
|
|
314
|
+
type: ITrackType;
|
|
315
|
+
}
|
|
316
|
+
/** Every possible value for the Adaptation's `type` property. */
|
|
317
|
+
export type ITrackType = "video" | "audio" | "text";
|
|
379
318
|
export type ILoadedManifestFormat = IInitialManifest;
|
|
380
|
-
export type IManifestLoader = (
|
|
319
|
+
export type IManifestLoader = (
|
|
320
|
+
/** Information on the wanted Manifest. */
|
|
321
|
+
info: IManifestLoaderInfo, callbacks: {
|
|
381
322
|
resolve: (args: {
|
|
382
323
|
data: ILoadedManifestFormat;
|
|
383
324
|
url?: string | undefined;
|
|
@@ -388,9 +329,11 @@ export type IManifestLoader = (url: string | undefined, callbacks: {
|
|
|
388
329
|
}) => void;
|
|
389
330
|
reject: (err?: Error) => void;
|
|
390
331
|
fallback: () => void;
|
|
391
|
-
}, options: {
|
|
392
|
-
timeout: number | undefined;
|
|
393
332
|
}) => (() => void) | void;
|
|
333
|
+
export interface IManifestLoaderInfo {
|
|
334
|
+
url: string | undefined;
|
|
335
|
+
timeout: number | undefined;
|
|
336
|
+
}
|
|
394
337
|
/** Options related to a single key system. */
|
|
395
338
|
export interface IKeySystemOption {
|
|
396
339
|
/**
|
|
@@ -414,23 +357,18 @@ export interface IKeySystemOption {
|
|
|
414
357
|
* set.
|
|
415
358
|
*/
|
|
416
359
|
serverCertificate?: BufferSource | null;
|
|
417
|
-
/**
|
|
418
|
-
* If `true`, we will try to persist the licenses obtained as well as try to
|
|
419
|
-
* load already-persisted licenses.
|
|
420
|
-
*/
|
|
421
|
-
persistentLicense?: boolean;
|
|
422
360
|
/** Storage mechanism used to store and retrieve information on stored licenses. */
|
|
423
|
-
|
|
361
|
+
persistentLicenseConfig?: IPersistentLicenseConfig;
|
|
424
362
|
/**
|
|
425
|
-
*
|
|
426
|
-
*
|
|
363
|
+
* Wanted value for the `persistentState` property of this
|
|
364
|
+
* `MediaKeySystemConfiguration` according to the EME API.
|
|
427
365
|
*/
|
|
428
|
-
|
|
366
|
+
persistentState?: MediaKeysRequirement | undefined;
|
|
429
367
|
/**
|
|
430
|
-
*
|
|
431
|
-
*
|
|
368
|
+
* Wanted value for the `distinctiveIdentifier` property of this
|
|
369
|
+
* `MediaKeySystemConfiguration` according to the EME API.
|
|
432
370
|
*/
|
|
433
|
-
|
|
371
|
+
distinctiveIdentifier?: MediaKeysRequirement | undefined;
|
|
434
372
|
/**
|
|
435
373
|
* If true, all open MediaKeySession (used to decrypt the content) will be
|
|
436
374
|
* closed when the current playback stops.
|
|
@@ -442,12 +380,8 @@ export interface IKeySystemOption {
|
|
|
442
380
|
* MediaKeys.
|
|
443
381
|
*/
|
|
444
382
|
maxSessionCacheSize?: number;
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
/** Allows to define custom robustnesses value for the video data. */
|
|
448
|
-
videoRobustnesses?: Array<string | undefined>;
|
|
449
|
-
/** Allows to define custom robustnesses value for the audio data. */
|
|
450
|
-
audioRobustnesses?: Array<string | undefined>;
|
|
383
|
+
videoCapabilitiesConfig?: IVideoCapabilitiesConfiguration;
|
|
384
|
+
audioCapabilitiesConfig?: IAudioCapabilitiesConfiguration;
|
|
451
385
|
/**
|
|
452
386
|
* If explicitely set to `false`, we won't throw on error when a used license
|
|
453
387
|
* is expired.
|
|
@@ -518,6 +452,48 @@ export interface IKeySystemOption {
|
|
|
518
452
|
*/
|
|
519
453
|
onKeyExpiration?: "error" | "continue" | "fallback" | "close-session";
|
|
520
454
|
}
|
|
455
|
+
/** Values that can be given to the `videoCapabilitiesConfig` `keySystems`'s property. */
|
|
456
|
+
export type IVideoCapabilitiesConfiguration = IRobustnessMediaKeySystemCapabilities | IContentTypeMediaKeySystemCapabilities | IFullMediaKeySystemCapabilities;
|
|
457
|
+
/** Values that can be given to the `audioCapabilitiesConfig` `keySystems`'s property. */
|
|
458
|
+
export type IAudioCapabilitiesConfiguration = IRobustnessMediaKeySystemCapabilities | IContentTypeMediaKeySystemCapabilities | IFullMediaKeySystemCapabilities;
|
|
459
|
+
/**
|
|
460
|
+
* Value that can be given to either the `audioCapabilitiesConfig` or to the
|
|
461
|
+
* `videoCapabilitiesConfig` `keySystems`'s property when the application only
|
|
462
|
+
* wants to specify the "robustness" part of the `MediaKeySystemMediaCapability`
|
|
463
|
+
* sent through the corresponding `MediaKeySystemConfiguration` used to decrypt
|
|
464
|
+
* the content.
|
|
465
|
+
*
|
|
466
|
+
* In this case, the RxPlayer will define potentially default values for
|
|
467
|
+
* other capability-related properties (such as the "contentType").
|
|
468
|
+
*/
|
|
469
|
+
export interface IRobustnessMediaKeySystemCapabilities {
|
|
470
|
+
type: "robustness";
|
|
471
|
+
value: Array<string | undefined>;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Value that can be given to either the `audioCapabilitiesConfig` or to the
|
|
475
|
+
* `videoCapabilitiesConfig` `keySystems`'s property when the application only
|
|
476
|
+
* wants to specify the "contentType" part of the
|
|
477
|
+
* `MediaKeySystemMediaCapability` sent through the corresponding
|
|
478
|
+
* `MediaKeySystemConfiguration` used to decrypt the content.
|
|
479
|
+
*
|
|
480
|
+
* In this case, the RxPlayer will define potentially default values for
|
|
481
|
+
* other capability-related properties (such as the "robustness").
|
|
482
|
+
*/
|
|
483
|
+
export interface IContentTypeMediaKeySystemCapabilities {
|
|
484
|
+
type: "contentType";
|
|
485
|
+
value: string[];
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Value that can be given to either the `audioCapabilitiesConfig` or to the
|
|
489
|
+
* `videoCapabilitiesConfig` `keySystems`'s property when the application wants
|
|
490
|
+
* to specify the full `MediaKeySystemMediaCapability` object sent through the
|
|
491
|
+
* corresponding `MediaKeySystemConfiguration` used to decrypt the content.
|
|
492
|
+
*/
|
|
493
|
+
export interface IFullMediaKeySystemCapabilities {
|
|
494
|
+
type: "full";
|
|
495
|
+
value: MediaKeySystemMediaCapability[];
|
|
496
|
+
}
|
|
521
497
|
/**
|
|
522
498
|
* Data stored in a persistent MediaKeySession storage.
|
|
523
499
|
* Has to be versioned to be able to play MediaKeySessions persisted in an old
|
|
@@ -525,7 +501,7 @@ export interface IKeySystemOption {
|
|
|
525
501
|
*/
|
|
526
502
|
export type IPersistentSessionInfo = IPersistentSessionInfoV4 | IPersistentSessionInfoV3 | IPersistentSessionInfoV2 | IPersistentSessionInfoV1 | IPersistentSessionInfoV0;
|
|
527
503
|
/** Persistent MediaKeySession storage interface. */
|
|
528
|
-
export interface
|
|
504
|
+
export interface IPersistentLicenseConfig {
|
|
529
505
|
/** Load persistent MediaKeySessions previously saved through the `save` callback. */
|
|
530
506
|
load(): IPersistentSessionInfo[] | undefined | null;
|
|
531
507
|
/**
|
|
@@ -546,44 +522,6 @@ export interface IPersistentSessionStorage {
|
|
|
546
522
|
*/
|
|
547
523
|
disableRetroCompatibility?: boolean;
|
|
548
524
|
}
|
|
549
|
-
/** Single preference for an audio track Adaptation. */
|
|
550
|
-
export type IAudioTrackPreference = null | {
|
|
551
|
-
language?: string;
|
|
552
|
-
audioDescription?: boolean;
|
|
553
|
-
codec?: {
|
|
554
|
-
all: boolean;
|
|
555
|
-
test: RegExp;
|
|
556
|
-
};
|
|
557
|
-
};
|
|
558
|
-
/** Single preference for a text track Adaptation. */
|
|
559
|
-
export type ITextTrackPreference = null | {
|
|
560
|
-
language: string;
|
|
561
|
-
forced?: boolean | undefined;
|
|
562
|
-
closedCaption: boolean;
|
|
563
|
-
};
|
|
564
|
-
/** Single preference for a video track Adaptation. */
|
|
565
|
-
export type IVideoTrackPreference = null | IVideoTrackPreferenceObject;
|
|
566
|
-
/** Preference for a video track Adaptation for when it is not set to `null`. */
|
|
567
|
-
interface IVideoTrackPreferenceObject {
|
|
568
|
-
codec?: {
|
|
569
|
-
all: boolean;
|
|
570
|
-
test: RegExp;
|
|
571
|
-
};
|
|
572
|
-
signInterpreted?: boolean;
|
|
573
|
-
}
|
|
574
|
-
/** Payload emitted with a `bitrateEstimationChange` event. */
|
|
575
|
-
export interface IBitrateEstimate {
|
|
576
|
-
/** The type of buffer this estimate was done for (e.g. "audio). */
|
|
577
|
-
type: IBufferType;
|
|
578
|
-
/** The calculated bitrate, in bits per seconds. */
|
|
579
|
-
bitrate: number | undefined;
|
|
580
|
-
}
|
|
581
|
-
export interface IDecipherabilityUpdateContent {
|
|
582
|
-
manifest: IManifest;
|
|
583
|
-
period: IPeriod;
|
|
584
|
-
adaptation: IAdaptation;
|
|
585
|
-
representation: IRepresentation;
|
|
586
|
-
}
|
|
587
525
|
/** Payload emitted with a `positionUpdate` event. */
|
|
588
526
|
export interface IPositionUpdate {
|
|
589
527
|
/** current position the player is in, in seconds. */
|
|
@@ -595,7 +533,7 @@ export interface IPositionUpdate {
|
|
|
595
533
|
/** Amount of buffer available for now in front of the current position, in seconds. */
|
|
596
534
|
bufferGap: number;
|
|
597
535
|
/** Current maximum seekable position. */
|
|
598
|
-
|
|
536
|
+
maximumPosition?: number | undefined;
|
|
599
537
|
wallClockTime?: number | undefined;
|
|
600
538
|
/**
|
|
601
539
|
* Only for live contents. Difference between the "live edge" and the current
|
|
@@ -603,7 +541,12 @@ export interface IPositionUpdate {
|
|
|
603
541
|
*/
|
|
604
542
|
liveGap?: number | undefined;
|
|
605
543
|
}
|
|
606
|
-
export type IPlayerState = "STOPPED" | "LOADED" | "LOADING" | "PLAYING" | "PAUSED" | "ENDED" | "BUFFERING" | "SEEKING" | "RELOADING";
|
|
544
|
+
export type IPlayerState = "STOPPED" | "LOADED" | "LOADING" | "PLAYING" | "PAUSED" | "ENDED" | "BUFFERING" | "FREEZING" | "SEEKING" | "RELOADING";
|
|
545
|
+
export interface IPeriodChangeEvent {
|
|
546
|
+
start: number;
|
|
547
|
+
id: string;
|
|
548
|
+
end?: number | undefined;
|
|
549
|
+
}
|
|
607
550
|
export type IStreamEvent = {
|
|
608
551
|
data: IStreamEventData;
|
|
609
552
|
start: number;
|
|
@@ -626,7 +569,7 @@ export type IPlayerError = EncryptedMediaError | MediaError | OtherError | Netwo
|
|
|
626
569
|
* Information describing a single Representation from an Adaptation, to be used
|
|
627
570
|
* in the `representationFilter` API.
|
|
628
571
|
*/
|
|
629
|
-
export interface
|
|
572
|
+
export interface IRepresentationContext {
|
|
630
573
|
bufferType: string;
|
|
631
574
|
language?: string | undefined;
|
|
632
575
|
isAudioDescription?: boolean | undefined;
|
|
@@ -635,51 +578,45 @@ export interface IRepresentationInfos {
|
|
|
635
578
|
isSignInterpreted?: boolean | undefined;
|
|
636
579
|
normalizedLanguage?: string | undefined;
|
|
637
580
|
}
|
|
638
|
-
export interface IBifThumbnail {
|
|
639
|
-
index: number;
|
|
640
|
-
duration: number;
|
|
641
|
-
ts: number;
|
|
642
|
-
data: Uint8Array;
|
|
643
|
-
}
|
|
644
|
-
export interface IBifObject {
|
|
645
|
-
fileFormat: string;
|
|
646
|
-
version: string;
|
|
647
|
-
imageCount: number;
|
|
648
|
-
timescale: number;
|
|
649
|
-
format: string;
|
|
650
|
-
width: number;
|
|
651
|
-
height: number;
|
|
652
|
-
aspectRatio: string;
|
|
653
|
-
isVod: boolean;
|
|
654
|
-
thumbs: IBifThumbnail[];
|
|
655
|
-
}
|
|
656
581
|
/**
|
|
657
582
|
* Definition of a single audio Representation as represented by the
|
|
658
583
|
* RxPlayer.
|
|
659
584
|
*/
|
|
660
585
|
export interface IAudioRepresentation {
|
|
661
586
|
id: string | number;
|
|
662
|
-
|
|
663
|
-
bitrate: number;
|
|
587
|
+
bitrate?: number | undefined;
|
|
664
588
|
codec?: string | undefined;
|
|
589
|
+
isSpatialAudio?: boolean | undefined;
|
|
590
|
+
isCodecSupported?: boolean | undefined;
|
|
591
|
+
seemsDecipherable?: boolean | undefined;
|
|
665
592
|
}
|
|
666
593
|
/** Audio track returned by the RxPlayer. */
|
|
667
594
|
export interface IAudioTrack {
|
|
595
|
+
/** The language the audio track is in, as it is named in the Manifest. */
|
|
668
596
|
language: string;
|
|
597
|
+
/**
|
|
598
|
+
* An attempt to translate `language` into a valid ISO639-3 language code.
|
|
599
|
+
* Kept equal to `language` if the attempt failed.
|
|
600
|
+
*/
|
|
669
601
|
normalized: string;
|
|
670
602
|
audioDescription: boolean;
|
|
671
|
-
dub?: boolean;
|
|
672
|
-
id:
|
|
603
|
+
dub?: boolean | undefined;
|
|
604
|
+
id: string;
|
|
673
605
|
label?: string | undefined;
|
|
674
606
|
representations: IAudioRepresentation[];
|
|
675
607
|
}
|
|
676
608
|
/** Text track returned by the RxPlayer. */
|
|
677
609
|
export interface ITextTrack {
|
|
610
|
+
/** The language the text track is in, as it is named in the Manifest. */
|
|
678
611
|
language: string;
|
|
612
|
+
/**
|
|
613
|
+
* An attempt to translate `language` into a valid ISO639-3 language code.
|
|
614
|
+
* Kept equal to `language` if the attempt failed.
|
|
615
|
+
*/
|
|
679
616
|
normalized: string;
|
|
680
|
-
closedCaption: boolean;
|
|
681
617
|
forced: boolean | undefined;
|
|
682
|
-
|
|
618
|
+
closedCaption: boolean;
|
|
619
|
+
label?: string | undefined;
|
|
683
620
|
id: number | string;
|
|
684
621
|
}
|
|
685
622
|
/**
|
|
@@ -687,20 +624,22 @@ export interface ITextTrack {
|
|
|
687
624
|
* RxPlayer.
|
|
688
625
|
*/
|
|
689
626
|
export interface IVideoRepresentation {
|
|
690
|
-
id: string
|
|
691
|
-
bitrate
|
|
627
|
+
id: string;
|
|
628
|
+
bitrate?: number | undefined;
|
|
692
629
|
width?: number | undefined;
|
|
693
630
|
height?: number | undefined;
|
|
694
631
|
codec?: string | undefined;
|
|
695
|
-
frameRate?:
|
|
632
|
+
frameRate?: number | undefined;
|
|
696
633
|
hdrInfo?: IHDRInformation | undefined;
|
|
634
|
+
isCodecSupported?: boolean | undefined;
|
|
635
|
+
seemsDecipherable?: boolean | undefined;
|
|
697
636
|
}
|
|
698
637
|
/** Video track returned by the RxPlayer. */
|
|
699
638
|
export interface IVideoTrack {
|
|
700
|
-
id:
|
|
701
|
-
signInterpreted?: boolean;
|
|
702
|
-
isTrickModeTrack?: boolean;
|
|
703
|
-
trickModeTracks?: IVideoTrack[];
|
|
639
|
+
id: string;
|
|
640
|
+
signInterpreted?: boolean | undefined;
|
|
641
|
+
isTrickModeTrack?: boolean | undefined;
|
|
642
|
+
trickModeTracks?: IVideoTrack[] | undefined;
|
|
704
643
|
label?: string | undefined;
|
|
705
644
|
representations: IVideoRepresentation[];
|
|
706
645
|
}
|
|
@@ -711,6 +650,18 @@ export interface IKeySystemConfigurationOutput {
|
|
|
711
650
|
/** `MediaKeySystemConfiguration` actually used by the key system. */
|
|
712
651
|
configuration: MediaKeySystemConfiguration;
|
|
713
652
|
}
|
|
653
|
+
/** Period from a list of Periods as returned by the RxPlayer. */
|
|
654
|
+
export interface IPeriod {
|
|
655
|
+
/** Start time in seconds at which the Period starts. */
|
|
656
|
+
start: number;
|
|
657
|
+
/**
|
|
658
|
+
* End time in seconds at which the Period ends.
|
|
659
|
+
* `undefined` if that end is unknown for now.
|
|
660
|
+
*/
|
|
661
|
+
end: number | undefined;
|
|
662
|
+
/** Identifier for this Period allowing to perform track modification for it. */
|
|
663
|
+
id: string;
|
|
664
|
+
}
|
|
714
665
|
/** Audio track from a list of audio tracks returned by the RxPlayer. */
|
|
715
666
|
export interface IAvailableAudioTrack extends IAudioTrack {
|
|
716
667
|
active: boolean;
|
|
@@ -733,3 +684,140 @@ export interface IEncryptedMediaErrorKeyStatusObject {
|
|
|
733
684
|
/** Problematic MediaKeyStatus encountered. */
|
|
734
685
|
keyStatus: MediaKeyStatus;
|
|
735
686
|
}
|
|
687
|
+
/**
|
|
688
|
+
* Behavior wanted when replacing an audio track / Adaptation by another:
|
|
689
|
+
*
|
|
690
|
+
* - direct: Switch audio track immediately by removing all the previous
|
|
691
|
+
* track's data.
|
|
692
|
+
*
|
|
693
|
+
* This might interrupt playback while data for any of the new
|
|
694
|
+
* track wanted is loaded.
|
|
695
|
+
*
|
|
696
|
+
* - seamless: Switch audio track without interrupting playback by still
|
|
697
|
+
* keeping data from the previous track around the current
|
|
698
|
+
* position.
|
|
699
|
+
*
|
|
700
|
+
* This could have the disadvantage of still playing the previous
|
|
701
|
+
* track during a short time (not more than a few seconds in
|
|
702
|
+
* most cases).
|
|
703
|
+
*
|
|
704
|
+
* - reload: Reload content to provide an immediate interruption of the
|
|
705
|
+
* previous audio track before switching to the new one.
|
|
706
|
+
*
|
|
707
|
+
* Some targets might not handle "direct" mode properly. The "reload"
|
|
708
|
+
* mode is kind of a more compatible attempt of immediately switching the
|
|
709
|
+
* audio track.
|
|
710
|
+
*/
|
|
711
|
+
export type IAudioTrackSwitchingMode = "direct" | "seamless" | "reload";
|
|
712
|
+
/**
|
|
713
|
+
* Behavior wanted when replacing a video track / Adaptation by another:
|
|
714
|
+
*
|
|
715
|
+
* - direct: Switch video track immediately by removing all the previous
|
|
716
|
+
* track's data.
|
|
717
|
+
*
|
|
718
|
+
* This might interrupt playback while data for any of the new
|
|
719
|
+
* track wanted is loaded.
|
|
720
|
+
* Moreover, the previous video frame at the time of the switch will
|
|
721
|
+
* probably still be on display while this is happening. If this is
|
|
722
|
+
* not something you want, you might prefer the "reload" mode.
|
|
723
|
+
*
|
|
724
|
+
* - seamless: Switch video track without interrupting playback by still
|
|
725
|
+
* keeping data from the previous track around the current
|
|
726
|
+
* position.
|
|
727
|
+
* This could have the disadvantage of still playing the previous
|
|
728
|
+
* track during a short time (not more than a few seconds in
|
|
729
|
+
* most cases).
|
|
730
|
+
*
|
|
731
|
+
* - reload: Reload content to provide an immediate interruption of the
|
|
732
|
+
* previous video track before switching to the new one.
|
|
733
|
+
*
|
|
734
|
+
* This can be seen like the "direct" mode with two differences:
|
|
735
|
+
*
|
|
736
|
+
* - The "direct" mode might rebuffer for a time with the previous
|
|
737
|
+
* frame displaying. With "reload" a black screen will probably be shown
|
|
738
|
+
* instead.
|
|
739
|
+
*
|
|
740
|
+
* - some targets might not handle "direct" mode properly. The "reload"
|
|
741
|
+
* mode is kind of a more compatible attempt of immediately switching the
|
|
742
|
+
* Adaptation.
|
|
743
|
+
*/
|
|
744
|
+
export type IVideoTrackSwitchingMode = "direct" | "seamless" | "reload";
|
|
745
|
+
export type IVideoRepresentationsSwitchingMode = IRepresentationsSwitchingMode;
|
|
746
|
+
export type IAudioRepresentationsSwitchingMode = IRepresentationsSwitchingMode;
|
|
747
|
+
/**
|
|
748
|
+
* Behavior wanted when replacing active Representations by others:
|
|
749
|
+
*
|
|
750
|
+
* - direct: Switch Representation immediately by removing all the previous
|
|
751
|
+
* Representations's data.
|
|
752
|
+
* This might interrupt playback while data for any of the new
|
|
753
|
+
* Representations wanted is loaded.
|
|
754
|
+
*
|
|
755
|
+
* If talking about video Representations, the previous video frame at the
|
|
756
|
+
* time of the switch will probably still be on display while this is
|
|
757
|
+
* happening.
|
|
758
|
+
* If this is not something you want, you might prefer the "reload" mode.
|
|
759
|
+
*
|
|
760
|
+
* - seamless: Switch Representation without interrupting playback by still
|
|
761
|
+
* keeping data from the previous Representations around the current
|
|
762
|
+
* position.
|
|
763
|
+
* This could have the disadvantage of still playing the previous
|
|
764
|
+
* Representations during a short time (not more than a few seconds in
|
|
765
|
+
* most cases).
|
|
766
|
+
*
|
|
767
|
+
* - reload: Reload `MediaSource` to provide an immediate interruption of the
|
|
768
|
+
* previous interruption before switching to the new Representation.
|
|
769
|
+
*
|
|
770
|
+
* This can be seen like the "direct" mode with two differences:
|
|
771
|
+
*
|
|
772
|
+
* - in case of video contents, the "direct" mode might rebuffer for a
|
|
773
|
+
* time with the previous frame displaying. With "reload" a black screen
|
|
774
|
+
* will probably be shown instead.
|
|
775
|
+
*
|
|
776
|
+
* - some targets might not handle "direct" mode properly. The "reload"
|
|
777
|
+
* mode is kind of a more compatible attempt of immediately switching the
|
|
778
|
+
* Representation.
|
|
779
|
+
*
|
|
780
|
+
* - lazy: Keep data from the previous Representation in the buffer.
|
|
781
|
+
* It still might eventually be replaced by Representation of a better
|
|
782
|
+
* quality when depending on future playback condition.
|
|
783
|
+
*/
|
|
784
|
+
type IRepresentationsSwitchingMode = "direct" | "seamless" | "reload" | "lazy";
|
|
785
|
+
export interface IBrokenRepresentationsLockContext {
|
|
786
|
+
period: IPeriod;
|
|
787
|
+
trackType: ITrackType;
|
|
788
|
+
}
|
|
789
|
+
export interface ITrackUpdateEventPayload {
|
|
790
|
+
period: IPeriod;
|
|
791
|
+
trackType: ITrackType;
|
|
792
|
+
reason: "missing" | // Missing from Manifest update
|
|
793
|
+
"manual" | // Manually and explicitely updated
|
|
794
|
+
"trickmode-enabled" | // Video trickmode tracks being enabled
|
|
795
|
+
"trickmode-disabled" | // Video trickmode tracks being disabled
|
|
796
|
+
string;
|
|
797
|
+
}
|
|
798
|
+
export interface ILockedVideoRepresentationsSettings {
|
|
799
|
+
representations: string[];
|
|
800
|
+
periodId?: string | undefined;
|
|
801
|
+
switchingMode?: IVideoRepresentationsSwitchingMode | undefined;
|
|
802
|
+
}
|
|
803
|
+
export interface ILockedAudioRepresentationsSettings {
|
|
804
|
+
representations: string[];
|
|
805
|
+
periodId?: string | undefined;
|
|
806
|
+
switchingMode?: IAudioRepresentationsSwitchingMode | undefined;
|
|
807
|
+
}
|
|
808
|
+
export interface IAudioTrackSetting {
|
|
809
|
+
trackId: string;
|
|
810
|
+
periodId?: string | undefined;
|
|
811
|
+
switchingMode?: IAudioTrackSwitchingMode | undefined;
|
|
812
|
+
lockedRepresentations?: string[] | undefined;
|
|
813
|
+
}
|
|
814
|
+
export interface IVideoTrackSetting {
|
|
815
|
+
trackId: string;
|
|
816
|
+
periodId?: string | undefined;
|
|
817
|
+
switchingMode?: IVideoTrackSwitchingMode | undefined;
|
|
818
|
+
lockedRepresentations?: string[] | undefined;
|
|
819
|
+
}
|
|
820
|
+
export interface ITextTrackSetting {
|
|
821
|
+
trackId: string;
|
|
822
|
+
periodId?: string | undefined;
|
|
823
|
+
}
|