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
|
@@ -32,8 +32,8 @@ import { IStreamOrchestratorPlaybackObservation } from "../../stream";
|
|
|
32
32
|
/**
|
|
33
33
|
* Observes what's being played and take care of media events relating to time
|
|
34
34
|
* boundaries:
|
|
35
|
-
* - Emits a `
|
|
36
|
-
* known and every time it changes.
|
|
35
|
+
* - Emits a `endingPositionChange` when the known maximum playable position
|
|
36
|
+
* of the current content is known and every time it changes.
|
|
37
37
|
* - Emits `endOfStream` API once segments have been pushed until the end and
|
|
38
38
|
* `resumeStream` if downloads starts back.
|
|
39
39
|
* - Emits a `periodChange` event when the currently-playing Period seemed to
|
|
@@ -111,7 +111,7 @@ export default class ContentTimeBoundariesObserver
|
|
|
111
111
|
}, { includeLastObservation: true, clearSignal: cancelSignal });
|
|
112
112
|
|
|
113
113
|
manifest.addEventListener("manifestUpdate", () => {
|
|
114
|
-
this.trigger("
|
|
114
|
+
this.trigger("endingPositionChange", this._getManifestEndTime());
|
|
115
115
|
if (cancelSignal.isCancelled()) {
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
@@ -120,11 +120,12 @@ export default class ContentTimeBoundariesObserver
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
|
-
* Returns an estimate of the current
|
|
123
|
+
* Returns an estimate of the current last position which may be played in
|
|
124
|
+
* the content at the moment.
|
|
124
125
|
* @returns {Object}
|
|
125
126
|
*/
|
|
126
|
-
public
|
|
127
|
-
return this.
|
|
127
|
+
public getCurrentEndingTime() : IEndingPositionInformation {
|
|
128
|
+
return this._getManifestEndTime();
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
/**
|
|
@@ -157,12 +158,13 @@ export default class ContentTimeBoundariesObserver
|
|
|
157
158
|
.updateLastVideoAdaptation(adaptation);
|
|
158
159
|
}
|
|
159
160
|
const endingPosition = this._maximumPositionCalculator.getEndingPosition();
|
|
160
|
-
const
|
|
161
|
+
const newEndingPosition = endingPosition !== undefined ?
|
|
161
162
|
{ isEnd: true,
|
|
162
|
-
|
|
163
|
+
endingPosition } :
|
|
163
164
|
{ isEnd: false,
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
endingPosition: this._maximumPositionCalculator
|
|
166
|
+
.getMaximumAvailablePosition() };
|
|
167
|
+
this.trigger("endingPositionChange", newEndingPosition);
|
|
166
168
|
}
|
|
167
169
|
}
|
|
168
170
|
}
|
|
@@ -311,13 +313,13 @@ export default class ContentTimeBoundariesObserver
|
|
|
311
313
|
}
|
|
312
314
|
}
|
|
313
315
|
|
|
314
|
-
private
|
|
316
|
+
private _getManifestEndTime() : IEndingPositionInformation {
|
|
315
317
|
const endingPosition = this._maximumPositionCalculator.getEndingPosition();
|
|
316
318
|
return endingPosition !== undefined ?
|
|
317
319
|
{ isEnd: true,
|
|
318
|
-
|
|
320
|
+
endingPosition } :
|
|
319
321
|
{ isEnd: false,
|
|
320
|
-
|
|
322
|
+
endingPosition: this._maximumPositionCalculator.getMaximumAvailablePosition() };
|
|
321
323
|
}
|
|
322
324
|
|
|
323
325
|
private _lazilyCreateActiveStreamInfo(bufferType : IBufferType) : IActiveStreamsInfo {
|
|
@@ -348,16 +350,16 @@ export default class ContentTimeBoundariesObserver
|
|
|
348
350
|
}
|
|
349
351
|
}
|
|
350
352
|
|
|
351
|
-
export interface
|
|
353
|
+
export interface IEndingPositionInformation {
|
|
352
354
|
/**
|
|
353
355
|
* The new maximum known position (note that this is the ending position
|
|
354
356
|
* currently known of the current content, it might be superior to the last
|
|
355
357
|
* position at which segments are available and it might also evolve over
|
|
356
358
|
* time), in seconds.
|
|
357
359
|
*/
|
|
358
|
-
|
|
360
|
+
endingPosition : number;
|
|
359
361
|
/**
|
|
360
|
-
* If `true`, the communicated `
|
|
362
|
+
* If `true`, the communicated `endingPosition` is the actual end of the content.
|
|
361
363
|
* It may still be updated due to a track change or to add precision, but it
|
|
362
364
|
* is still a (rough) estimate of the maximum position that content should
|
|
363
365
|
* have.
|
|
@@ -365,7 +367,7 @@ export interface IDurationItem {
|
|
|
365
367
|
* If `false`, this is the currently known maximum position associated to
|
|
366
368
|
* the content, but the content is still evolving (typically, new media
|
|
367
369
|
* segments are still being generated) and as such it can still have a
|
|
368
|
-
* longer
|
|
370
|
+
* longer `endingPosition` in the future.
|
|
369
371
|
*/
|
|
370
372
|
isEnd : boolean;
|
|
371
373
|
}
|
|
@@ -380,10 +382,10 @@ export interface IContentTimeBoundariesObserverEvent {
|
|
|
380
382
|
/** Triggered when a new `Period` is currently playing. */
|
|
381
383
|
periodChange : Period;
|
|
382
384
|
/**
|
|
383
|
-
* Triggered when the
|
|
384
|
-
* or changed.
|
|
385
|
+
* Triggered when the ending position of the currently-playing content became
|
|
386
|
+
* known or changed.
|
|
385
387
|
*/
|
|
386
|
-
|
|
388
|
+
endingPositionChange : IEndingPositionInformation;
|
|
387
389
|
/**
|
|
388
390
|
* Triggered when the last possible chronological segment for all types of
|
|
389
391
|
* buffers has either been pushed or is being pushed to the corresponding
|
|
@@ -460,8 +462,7 @@ class MaximumPositionCalculator {
|
|
|
460
462
|
*/
|
|
461
463
|
public getMaximumAvailablePosition() : number {
|
|
462
464
|
if (this._manifest.isDynamic) {
|
|
463
|
-
return this._manifest.
|
|
464
|
-
this._manifest.getMaximumSafePosition();
|
|
465
|
+
return this._manifest.getMaximumSafePosition();
|
|
465
466
|
}
|
|
466
467
|
if (this._lastVideoAdaptation === undefined ||
|
|
467
468
|
this._lastAudioAdaptation === undefined)
|
|
@@ -43,11 +43,25 @@ export interface IInitialTimeOptions {
|
|
|
43
43
|
*/
|
|
44
44
|
fromFirstPosition? : number | null | undefined;
|
|
45
45
|
/**
|
|
46
|
-
* If set, we should begin at this position relative to the content's
|
|
47
|
-
* in seconds.
|
|
46
|
+
* If set, we should begin at this position relative to the content's maximum
|
|
47
|
+
* seekable position, in seconds.
|
|
48
|
+
*
|
|
49
|
+
* It should consequently in most cases be a negative value.
|
|
48
50
|
*/
|
|
49
51
|
fromLastPosition? : number | null | undefined;
|
|
50
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* If set, we should begin at this position relative to the content's live
|
|
54
|
+
* edge if it makes sense, in seconds.
|
|
55
|
+
*
|
|
56
|
+
* It should consequently in most cases be a negative value.
|
|
57
|
+
*
|
|
58
|
+
* If the live edge is unknown or if it does not make sense for the current
|
|
59
|
+
* content, that position is relative to the content's maximum position
|
|
60
|
+
* instead.
|
|
61
|
+
*/
|
|
62
|
+
fromLivePosition? : number | null | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* If set, we should begin at this position relative to the whole duration of
|
|
51
65
|
* the content, in percentage.
|
|
52
66
|
*/
|
|
53
67
|
percentage? : number | null | undefined;
|
|
@@ -73,13 +87,7 @@ export default function getInitialTime(
|
|
|
73
87
|
) : number {
|
|
74
88
|
if (!isNullOrUndefined(startAt)) {
|
|
75
89
|
const min = manifest.getMinimumSafePosition();
|
|
76
|
-
|
|
77
|
-
if (manifest.isLive) {
|
|
78
|
-
max = manifest.getLivePosition();
|
|
79
|
-
}
|
|
80
|
-
if (max === undefined) {
|
|
81
|
-
max = manifest.getMaximumSafePosition();
|
|
82
|
-
}
|
|
90
|
+
const max = manifest.getMaximumSafePosition();
|
|
83
91
|
if (!isNullOrUndefined(startAt.position)) {
|
|
84
92
|
log.debug("Init: using startAt.minimumPosition");
|
|
85
93
|
return Math.max(Math.min(startAt.position, max), min);
|
|
@@ -97,12 +105,17 @@ export default function getInitialTime(
|
|
|
97
105
|
const { fromFirstPosition } = startAt;
|
|
98
106
|
return fromFirstPosition <= 0 ? min :
|
|
99
107
|
Math.min(max, min + fromFirstPosition);
|
|
100
|
-
}
|
|
101
|
-
else if (!isNullOrUndefined(startAt.fromLastPosition)) {
|
|
108
|
+
} else if (!isNullOrUndefined(startAt.fromLastPosition)) {
|
|
102
109
|
log.debug("Init: using startAt.fromLastPosition");
|
|
103
110
|
const { fromLastPosition } = startAt;
|
|
104
111
|
return fromLastPosition >= 0 ? max :
|
|
105
112
|
Math.max(min, max + fromLastPosition);
|
|
113
|
+
} else if (!isNullOrUndefined(startAt.fromLivePosition)) {
|
|
114
|
+
log.debug("Init: using startAt.fromLivePosition");
|
|
115
|
+
const livePosition = manifest.getLivePosition() ?? max;
|
|
116
|
+
const { fromLivePosition } = startAt;
|
|
117
|
+
return fromLivePosition >= 0 ? livePosition :
|
|
118
|
+
Math.max(min, livePosition + fromLivePosition);
|
|
106
119
|
} else if (!isNullOrUndefined(startAt.percentage)) {
|
|
107
120
|
log.debug("Init: using startAt.percentage");
|
|
108
121
|
const { percentage } = startAt;
|
|
@@ -261,6 +261,21 @@ describe("HTML Text buffer utils - areNearlyEqual", () => {
|
|
|
261
261
|
it("should return true if input number are equals", () => {
|
|
262
262
|
expect(areNearlyEqual(5, 5)).toBe(true);
|
|
263
263
|
});
|
|
264
|
+
it(
|
|
265
|
+
"should return false if input number are not nearly equals with delta parameter",
|
|
266
|
+
() => {
|
|
267
|
+
expect(areNearlyEqual(5, 5.1, 0.02)).toBe(false);
|
|
268
|
+
});
|
|
269
|
+
it(
|
|
270
|
+
"should return true if input number are nearly equals with delta parameter",
|
|
271
|
+
() => {
|
|
272
|
+
expect(areNearlyEqual(5, 5.01, 0.02)).toBe(true);
|
|
273
|
+
});
|
|
274
|
+
it(
|
|
275
|
+
"should return true if input number are equals with delta parameter",
|
|
276
|
+
() => {
|
|
277
|
+
expect(areNearlyEqual(5, 5, 0.02)).toBe(true);
|
|
278
|
+
});
|
|
264
279
|
});
|
|
265
280
|
|
|
266
281
|
describe("HTML Text buffer utils - removeCuesInfosBetween", () => {
|
|
@@ -26,6 +26,23 @@ import {
|
|
|
26
26
|
removeCuesInfosBetween,
|
|
27
27
|
} from "./utils";
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* first or last IHTMLCue in a group can have a slighlty different start
|
|
31
|
+
* or end time than the start or end time of the ICuesGroup due to parsing
|
|
32
|
+
* approximation.
|
|
33
|
+
* DELTA_CUES_GROUP defines the tolerance level when comparing the start/end
|
|
34
|
+
* of a IHTMLCue to the start/end of a ICuesGroup.
|
|
35
|
+
* Having this value too high may lead to have unwanted subtitle displayed
|
|
36
|
+
* Having this value too low may lead to have subtitles not displayed
|
|
37
|
+
*/
|
|
38
|
+
const DELTA_CUES_GROUP = 1e-3;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* segment_duration / RELATIVE_DELTA_RATIO = relative_delta
|
|
42
|
+
*
|
|
43
|
+
* relative_delta is the tolerance to determine if two segements are the same
|
|
44
|
+
*/
|
|
45
|
+
const RELATIVE_DELTA_RATIO = 5;
|
|
29
46
|
/**
|
|
30
47
|
* Manage the buffer of the HTMLTextSegmentBuffer.
|
|
31
48
|
* Allows to add, remove and recuperate cues at given times.
|
|
@@ -72,6 +89,19 @@ export default class TextTrackCuesStore {
|
|
|
72
89
|
ret.push(cues[j].element);
|
|
73
90
|
}
|
|
74
91
|
}
|
|
92
|
+
// first or last IHTMLCue in a group can have a slighlty different start
|
|
93
|
+
// or end time than the start or end time of the ICuesGroup due to parsing
|
|
94
|
+
// approximation.
|
|
95
|
+
// Add a tolerance of 1ms to fix this issue
|
|
96
|
+
if (ret.length === 0 && cues.length > 0) {
|
|
97
|
+
for (let j = 0; j < cues.length; j++) {
|
|
98
|
+
if (areNearlyEqual(time, cues[j].start, DELTA_CUES_GROUP)
|
|
99
|
+
|| areNearlyEqual(time, cues[j].end, DELTA_CUES_GROUP)
|
|
100
|
+
) {
|
|
101
|
+
ret.push(cues[j].element);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
75
105
|
return ret;
|
|
76
106
|
}
|
|
77
107
|
}
|
|
@@ -163,6 +193,11 @@ export default class TextTrackCuesStore {
|
|
|
163
193
|
insert(cues : IHTMLCue[], start : number, end : number) : void {
|
|
164
194
|
const cuesBuffer = this._cuesBuffer;
|
|
165
195
|
const cuesInfosToInsert = { start, end, cues };
|
|
196
|
+
// it's preferable to have a delta depending on the duration of the segment
|
|
197
|
+
// if the delta is one fifth of the length of the segment:
|
|
198
|
+
// a segment of [0, 2] is the "same" segment as [0, 2.1]
|
|
199
|
+
// but [0, 0.04] is not the "same" segement as [0,04, 0.08]
|
|
200
|
+
const relativeDelta = Math.abs(start - end) / RELATIVE_DELTA_RATIO;
|
|
166
201
|
|
|
167
202
|
/**
|
|
168
203
|
* Called when we found the index of the next cue relative to the cue we
|
|
@@ -175,7 +210,7 @@ export default class TextTrackCuesStore {
|
|
|
175
210
|
function onIndexOfNextCueFound(indexOfNextCue : number) : void {
|
|
176
211
|
const nextCue = cuesBuffer[indexOfNextCue];
|
|
177
212
|
if (nextCue === undefined || // no cue
|
|
178
|
-
areNearlyEqual(cuesInfosToInsert.end, nextCue.end)) // samey end
|
|
213
|
+
areNearlyEqual(cuesInfosToInsert.end, nextCue.end, relativeDelta)) // samey end
|
|
179
214
|
{
|
|
180
215
|
// ours: |AAAAA|
|
|
181
216
|
// the current one: |BBBBB|
|
|
@@ -210,8 +245,8 @@ export default class TextTrackCuesStore {
|
|
|
210
245
|
for (let cueIdx = 0; cueIdx < cuesBuffer.length; cueIdx++) {
|
|
211
246
|
let cuesInfos = cuesBuffer[cueIdx];
|
|
212
247
|
if (start < cuesInfos.end) {
|
|
213
|
-
if (areNearlyEqual(start, cuesInfos.start)) {
|
|
214
|
-
if (areNearlyEqual(end, cuesInfos.end)) {
|
|
248
|
+
if (areNearlyEqual(start, cuesInfos.start, relativeDelta)) {
|
|
249
|
+
if (areNearlyEqual(end, cuesInfos.end, relativeDelta)) {
|
|
215
250
|
// exact same segment
|
|
216
251
|
// ours: |AAAAA|
|
|
217
252
|
// the current one: |BBBBB|
|
|
@@ -257,7 +292,7 @@ export default class TextTrackCuesStore {
|
|
|
257
292
|
// - add ours before the current one
|
|
258
293
|
cuesBuffer.splice(cueIdx, 0, cuesInfosToInsert);
|
|
259
294
|
return;
|
|
260
|
-
} else if (areNearlyEqual(end, cuesInfos.start)) {
|
|
295
|
+
} else if (areNearlyEqual(end, cuesInfos.start, relativeDelta)) {
|
|
261
296
|
// our cue goes just before the current one:
|
|
262
297
|
// ours: |AAAAAAA|
|
|
263
298
|
// the current one: |BBBB|
|
|
@@ -268,7 +303,7 @@ export default class TextTrackCuesStore {
|
|
|
268
303
|
cuesInfos.start = end;
|
|
269
304
|
cuesBuffer.splice(cueIdx, 0, cuesInfosToInsert);
|
|
270
305
|
return;
|
|
271
|
-
} else if (areNearlyEqual(end, cuesInfos.end)) {
|
|
306
|
+
} else if (areNearlyEqual(end, cuesInfos.end, relativeDelta)) {
|
|
272
307
|
// ours: |AAAAAAA|
|
|
273
308
|
// the current one: |BBBB|
|
|
274
309
|
// Result: |AAAAAAA|
|
|
@@ -297,7 +332,7 @@ export default class TextTrackCuesStore {
|
|
|
297
332
|
}
|
|
298
333
|
// else -> start > cuesInfos.start
|
|
299
334
|
|
|
300
|
-
if (areNearlyEqual(cuesInfos.end, end)) {
|
|
335
|
+
if (areNearlyEqual(cuesInfos.end, end, relativeDelta)) {
|
|
301
336
|
// ours: |AAAAAA|
|
|
302
337
|
// the current one: |BBBBBBBB|
|
|
303
338
|
// Result: |BBAAAAAA|
|
|
@@ -333,6 +368,22 @@ export default class TextTrackCuesStore {
|
|
|
333
368
|
}
|
|
334
369
|
}
|
|
335
370
|
}
|
|
371
|
+
|
|
372
|
+
if (cuesBuffer.length) {
|
|
373
|
+
const lastCue = cuesBuffer[cuesBuffer.length - 1];
|
|
374
|
+
if (areNearlyEqual(lastCue.end, start, relativeDelta)) {
|
|
375
|
+
// Match the end of the previous cue to the start of the following one
|
|
376
|
+
// if they are close enough. If there is a small gap between two segments
|
|
377
|
+
// it can lead to having no subtitles for a short time, this is noticeable when
|
|
378
|
+
// two successive segments displays the same text, making it diseappear
|
|
379
|
+
// and reappear quickly, which gives the impression of blinking
|
|
380
|
+
//
|
|
381
|
+
// ours: |AAAAA|
|
|
382
|
+
// the current one: |BBBBB|...
|
|
383
|
+
// Result: |BBBBBBBAAAAA|
|
|
384
|
+
lastCue.end = start;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
336
387
|
// no cues group has the end after our current start.
|
|
337
388
|
// These cues should be the last one
|
|
338
389
|
cuesBuffer.push(cuesInfosToInsert);
|
|
@@ -50,6 +50,21 @@ import {
|
|
|
50
50
|
* Setting a value too high might lead to two segments targeting different times
|
|
51
51
|
* to be wrongly believed to target the same time. In worst case scenarios, this
|
|
52
52
|
* could lead to wanted text tracks being removed.
|
|
53
|
+
*
|
|
54
|
+
* When comparing 2 segments s1 and s2, you may want to take into account the duration
|
|
55
|
+
* of the segments:
|
|
56
|
+
* - if s1 is [0, 2] and s2 is [0, 2.1] s1 and s2 can be considered as nearly equal as
|
|
57
|
+
* there is a relative difference of: (2.1-2) / 2 = 5%;
|
|
58
|
+
* Formula: (end_s1 - end_s2) / duration_s2 = relative_difference
|
|
59
|
+
* - if s1 is [0, 0.04] and s2 is [0.04, 0.08] s1 and s2 may not considered as nearly
|
|
60
|
+
* equal as there is a relative difference of: (0.04-0.08) / 0.04 = 100%
|
|
61
|
+
*
|
|
62
|
+
* To compare relatively to the duration of a segment you can provide and additional
|
|
63
|
+
* parameter "delta" that remplace MAX_DELTA_BUFFER_TIME.
|
|
64
|
+
* If parameter "delta" is higher than MAX_DELTA_BUFFER_TIME, MAX_DELTA_BUFFER_TIME
|
|
65
|
+
* is used instead of delta. This ensure that segments are nearly equal when comparing
|
|
66
|
+
* relatively AND absolutely.
|
|
67
|
+
*
|
|
53
68
|
* @type Number
|
|
54
69
|
*/
|
|
55
70
|
const MAX_DELTA_BUFFER_TIME = 0.2;
|
|
@@ -58,10 +73,12 @@ const MAX_DELTA_BUFFER_TIME = 0.2;
|
|
|
58
73
|
* @see MAX_DELTA_BUFFER_TIME
|
|
59
74
|
* @param {Number} a
|
|
60
75
|
* @param {Number} b
|
|
76
|
+
* @param {Number} delta
|
|
61
77
|
* @returns {Boolean}
|
|
62
78
|
*/
|
|
63
|
-
export function areNearlyEqual(
|
|
64
|
-
|
|
79
|
+
export function areNearlyEqual(
|
|
80
|
+
a : number, b : number, delta: number = MAX_DELTA_BUFFER_TIME) : boolean {
|
|
81
|
+
return Math.abs(a - b) <= Math.min(delta, MAX_DELTA_BUFFER_TIME);
|
|
65
82
|
}
|
|
66
83
|
|
|
67
84
|
/**
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import nextTick from "next-tick";
|
|
2
1
|
import config from "../../../config";
|
|
3
2
|
import { formatError } from "../../../errors";
|
|
4
3
|
import log from "../../../log";
|
|
@@ -7,6 +6,7 @@ import assertUnreachable from "../../../utils/assert_unreachable";
|
|
|
7
6
|
import cancellableSleep from "../../../utils/cancellable_sleep";
|
|
8
7
|
import noop from "../../../utils/noop";
|
|
9
8
|
import objectAssign from "../../../utils/object_assign";
|
|
9
|
+
import queueMicrotask from "../../../utils/queue_microtask";
|
|
10
10
|
import SharedReference, {
|
|
11
11
|
createMappedReference,
|
|
12
12
|
IReadOnlySharedReference,
|
|
@@ -192,7 +192,7 @@ export default function AdaptationStream(
|
|
|
192
192
|
// conditions where the inner logic would be called synchronously before
|
|
193
193
|
// the next observation (which may reflect very different playback conditions)
|
|
194
194
|
// is actually received.
|
|
195
|
-
return
|
|
195
|
+
return queueMicrotask(() => {
|
|
196
196
|
playbackObserver.listen(() => {
|
|
197
197
|
if (fnCancelSignal.isCancelled()) {
|
|
198
198
|
return;
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import nextTick from "next-tick";
|
|
18
17
|
import config from "../../../config";
|
|
19
18
|
import { MediaError } from "../../../errors";
|
|
20
19
|
import log from "../../../log";
|
|
@@ -22,6 +21,7 @@ import Manifest, {
|
|
|
22
21
|
IDecipherabilityUpdateElement,
|
|
23
22
|
Period,
|
|
24
23
|
} from "../../../manifest";
|
|
24
|
+
import queueMicrotask from "../../../utils/queue_microtask";
|
|
25
25
|
import {
|
|
26
26
|
createMappedReference,
|
|
27
27
|
IReadOnlySharedReference,
|
|
@@ -351,7 +351,7 @@ export default function StreamOrchestrator(
|
|
|
351
351
|
// Schedule micro task before checking the last playback observation
|
|
352
352
|
// to reduce the risk of race conditions where the next observation
|
|
353
353
|
// was going to be emitted synchronously.
|
|
354
|
-
|
|
354
|
+
queueMicrotask(() => {
|
|
355
355
|
if (orchestratorCancelSignal.isCancelled()) {
|
|
356
356
|
return ;
|
|
357
357
|
}
|
|
@@ -554,7 +554,7 @@ export default function StreamOrchestrator(
|
|
|
554
554
|
// conditions where the inner logic would be called synchronously before
|
|
555
555
|
// the next observation (which may reflect very different playback
|
|
556
556
|
// conditions) is actually received.
|
|
557
|
-
return
|
|
557
|
+
return queueMicrotask(() => {
|
|
558
558
|
if (innerCancelSignal.isCancelled()) {
|
|
559
559
|
return;
|
|
560
560
|
}
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import nextTick from "next-tick";
|
|
18
17
|
import config from "../../../config";
|
|
19
18
|
import {
|
|
20
19
|
formatError,
|
|
@@ -26,6 +25,7 @@ import {
|
|
|
26
25
|
Period,
|
|
27
26
|
} from "../../../manifest";
|
|
28
27
|
import objectAssign from "../../../utils/object_assign";
|
|
28
|
+
import queueMicrotask from "../../../utils/queue_microtask";
|
|
29
29
|
import { getLeftSizeOfBufferedTimeRange } from "../../../utils/ranges";
|
|
30
30
|
import SharedReference, {
|
|
31
31
|
IReadOnlySharedReference,
|
|
@@ -362,7 +362,7 @@ export default function PeriodStream(
|
|
|
362
362
|
// is actually received.
|
|
363
363
|
// It can happen when `askForMediaSourceReload` is called as a side-effect of
|
|
364
364
|
// the same event that triggers the playback observation to be emitted.
|
|
365
|
-
|
|
365
|
+
queueMicrotask(() => {
|
|
366
366
|
playbackObserver.listen(() => {
|
|
367
367
|
if (cancelSignal.isCancelled()) {
|
|
368
368
|
return;
|
|
@@ -153,7 +153,7 @@ export default function getBufferStatus(
|
|
|
153
153
|
* needed segments for this Representation until the end of the Period.
|
|
154
154
|
*/
|
|
155
155
|
const hasFinishedLoading = representation.index.isInitialized() &&
|
|
156
|
-
representation.index.
|
|
156
|
+
!representation.index.isStillAwaitingFutureSegments() &&
|
|
157
157
|
neededRange.hasReachedPeriodEnd &&
|
|
158
158
|
prioritizedNeededSegments.length === 0 &&
|
|
159
159
|
segmentsOnHold.length === 0;
|
|
@@ -221,7 +221,7 @@ function getRangeOfNeededSegments(
|
|
|
221
221
|
SegmentBuffersStore.isNative(content.adaptation.type) &&
|
|
222
222
|
initialWantedTime >= lastIndexPosition &&
|
|
223
223
|
representationIndex.isInitialized() &&
|
|
224
|
-
representationIndex.
|
|
224
|
+
!representationIndex.isStillAwaitingFutureSegments() &&
|
|
225
225
|
isPeriodTheCurrentAndLastOne(manifest, period, initialWantedTime))
|
|
226
226
|
{
|
|
227
227
|
wantedStartPosition = lastIndexPosition - 1;
|
|
@@ -233,7 +233,7 @@ function getRangeOfNeededSegments(
|
|
|
233
233
|
|
|
234
234
|
let hasReachedPeriodEnd;
|
|
235
235
|
if (!representation.index.isInitialized() ||
|
|
236
|
-
|
|
236
|
+
representation.index.isStillAwaitingFutureSegments() ||
|
|
237
237
|
period.end === undefined)
|
|
238
238
|
{
|
|
239
239
|
hasReachedPeriodEnd = false;
|
|
@@ -493,8 +493,8 @@ function doesEndSeemGarbageCollected(
|
|
|
493
493
|
currentSeg.end - currentSeg.bufferedEnd > MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT)
|
|
494
494
|
{
|
|
495
495
|
log.info("Stream: The end of the wanted segment has been garbage collected",
|
|
496
|
-
currentSeg.
|
|
497
|
-
currentSeg.
|
|
496
|
+
currentSeg.end,
|
|
497
|
+
currentSeg.bufferedEnd);
|
|
498
498
|
return true;
|
|
499
499
|
}
|
|
500
500
|
|
package/src/default_config.ts
CHANGED
|
@@ -23,6 +23,11 @@ const DEFAULT_CONFIG = {
|
|
|
23
23
|
*/
|
|
24
24
|
DEFAULT_REQUEST_TIMEOUT: 30 * 1000,
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Default connection time after which a request will timeout, in ms.
|
|
28
|
+
* @type {Number}
|
|
29
|
+
*/
|
|
30
|
+
DEFAULT_CONNECTION_TIMEOUT: 15 * 1000,
|
|
26
31
|
/**
|
|
27
32
|
* Can be either:
|
|
28
33
|
* - "native": Subtitles are all displayed in a <track> element
|
|
@@ -177,7 +177,9 @@ export default class VideoThumbnailLoader {
|
|
|
177
177
|
{ baseDelay: 0,
|
|
178
178
|
maxDelay: 0,
|
|
179
179
|
maxRetry: 0,
|
|
180
|
-
requestTimeout: config.getCurrent().DEFAULT_REQUEST_TIMEOUT
|
|
180
|
+
requestTimeout: config.getCurrent().DEFAULT_REQUEST_TIMEOUT,
|
|
181
|
+
connectionTimeout: config.getCurrent().DEFAULT_CONNECTION_TIMEOUT,
|
|
182
|
+
}
|
|
181
183
|
) as ISegmentFetcher<ArrayBuffer | Uint8Array>;
|
|
182
184
|
const initSegment = content.representation.index.getInitSegment();
|
|
183
185
|
const initSegmentUniqueId = initSegment !== null ?
|
|
@@ -83,6 +83,7 @@ async function getDurationFromManifest(
|
|
|
83
83
|
url,
|
|
84
84
|
responseType: "document",
|
|
85
85
|
timeout: config.getCurrent().DEFAULT_REQUEST_TIMEOUT,
|
|
86
|
+
connectionTimeout: config.getCurrent().DEFAULT_CONNECTION_TIMEOUT,
|
|
86
87
|
// We won't cancel
|
|
87
88
|
cancelSignal: new TaskCanceller().signal,
|
|
88
89
|
});
|
|
@@ -122,6 +123,7 @@ async function getDurationFromManifest(
|
|
|
122
123
|
url,
|
|
123
124
|
responseType: "text",
|
|
124
125
|
timeout: config.getCurrent().DEFAULT_REQUEST_TIMEOUT,
|
|
126
|
+
connectionTimeout: config.getCurrent().DEFAULT_CONNECTION_TIMEOUT,
|
|
125
127
|
// We won't cancel
|
|
126
128
|
cancelSignal: new TaskCanceller().signal,
|
|
127
129
|
});
|
|
@@ -188,15 +188,28 @@ class Representation {
|
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
this.cdnMetadata = args.cdnMetadata;
|
|
191
|
-
|
|
192
191
|
this.index = args.index;
|
|
192
|
+
|
|
193
193
|
if (opts.type === "audio" || opts.type === "video") {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
194
|
+
this.isSupported = false;
|
|
195
|
+
// Supplemental codecs are defined as backwards-compatible codecs enhancing
|
|
196
|
+
// the experience of a base layer codec
|
|
197
|
+
if (args.supplementalCodecs !== undefined) {
|
|
198
|
+
const supplementalCodecMimeTypeStr =
|
|
199
|
+
`${this.mimeType ?? ""};codecs="${args.supplementalCodecs}"`;
|
|
200
|
+
if (isCodecSupported(supplementalCodecMimeTypeStr)) {
|
|
201
|
+
this.codec = args.supplementalCodecs;
|
|
202
|
+
this.isSupported = true;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (!this.isSupported) {
|
|
206
|
+
const mimeTypeStr = this.getMimeTypeString();
|
|
207
|
+
const isSupported = isCodecSupported(mimeTypeStr);
|
|
208
|
+
if (!isSupported) {
|
|
209
|
+
log.info("Unsupported Representation", mimeTypeStr, this.id, this.bitrate);
|
|
210
|
+
}
|
|
211
|
+
this.isSupported = isSupported;
|
|
198
212
|
}
|
|
199
|
-
this.isSupported = isSupported;
|
|
200
213
|
} else {
|
|
201
214
|
this.isSupported = true; // TODO for other types
|
|
202
215
|
}
|
|
@@ -329,7 +329,7 @@ export interface IRepresentationIndex {
|
|
|
329
329
|
|
|
330
330
|
/**
|
|
331
331
|
* Returns the ending time, in seconds, of the Representation once it is
|
|
332
|
-
* "finished" (@see
|
|
332
|
+
* "finished" (@see isStillAwaitingFutureSegments).
|
|
333
333
|
* Should thus be equivalent to `getLastAvailablePosition` once finished.
|
|
334
334
|
*
|
|
335
335
|
* Returns `null` if nothing is in the index
|
|
@@ -381,13 +381,13 @@ export interface IRepresentationIndex {
|
|
|
381
381
|
checkDiscontinuity(time : number) : number | null;
|
|
382
382
|
|
|
383
383
|
/**
|
|
384
|
-
* Returns `
|
|
384
|
+
* Returns `false` if the last segments in this index have already been
|
|
385
385
|
* generated so that we can freely go to the next period.
|
|
386
|
-
* Returns `
|
|
386
|
+
* Returns `true` if the index is still waiting on future segments to be
|
|
387
387
|
* generated.
|
|
388
388
|
* @returns {boolean}
|
|
389
389
|
*/
|
|
390
|
-
|
|
390
|
+
isStillAwaitingFutureSegments() : boolean;
|
|
391
391
|
|
|
392
392
|
/**
|
|
393
393
|
* Returns `true` if this index has all the data it needs to give the list
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { convertSupplementalCodecsToRFC6381 } from "../convert_supplemental_codecs";
|
|
2
|
+
|
|
3
|
+
describe("parseSupplementalCodec", () => {
|
|
4
|
+
it("should return the codec unchanged if there is only one codec", () => {
|
|
5
|
+
expect(convertSupplementalCodecsToRFC6381("avc1.4d400d"))
|
|
6
|
+
.toEqual("avc1.4d400d");
|
|
7
|
+
});
|
|
8
|
+
it("should trim starting and ending whitespace", () => {
|
|
9
|
+
expect(
|
|
10
|
+
convertSupplementalCodecsToRFC6381(" avc1.4d400d "))
|
|
11
|
+
.toEqual("avc1.4d400d");
|
|
12
|
+
});
|
|
13
|
+
it("should return comma-separated list if input is whitespace-separated", () => {
|
|
14
|
+
expect(
|
|
15
|
+
convertSupplementalCodecsToRFC6381("avc1.4d400d avc1.4d4015"))
|
|
16
|
+
.toEqual("avc1.4d400d, avc1.4d4015");
|
|
17
|
+
});
|
|
18
|
+
it("should return comma-separated value if input is already comma-separated", () => {
|
|
19
|
+
expect(
|
|
20
|
+
convertSupplementalCodecsToRFC6381("avc1.4d400d, avc1.4d4015"))
|
|
21
|
+
.toEqual("avc1.4d400d, avc1.4d4015");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("should return comma-separated value if input as missplaced whitespace", () => {
|
|
25
|
+
expect(
|
|
26
|
+
convertSupplementalCodecsToRFC6381("avc1.4d400d , avc1.4d4015 "))
|
|
27
|
+
.toEqual("avc1.4d400d, avc1.4d4015");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it(`should return comma-separated value if input is mix of comma and
|
|
31
|
+
whitespace separated list`
|
|
32
|
+
, () => {
|
|
33
|
+
expect(
|
|
34
|
+
convertSupplementalCodecsToRFC6381("avc1.4d400d avc1.4d4015, avc1.4d401f"))
|
|
35
|
+
.toEqual("avc1.4d400d, avc1.4d4015, avc1.4d401f");
|
|
36
|
+
});
|
|
37
|
+
});
|