rx-player 3.26.2 → 3.26.3-dev.2022021400
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/.github/workflows/perfs.yml +22 -0
- package/CHANGELOG.md +19 -1
- package/VERSION +1 -1
- package/dist/_esm5.processed/compat/eme/custom_media_keys/index.js +6 -2
- package/dist/_esm5.processed/core/abr/buffer_based_chooser.d.ts +28 -6
- package/dist/_esm5.processed/core/abr/buffer_based_chooser.js +63 -12
- package/dist/_esm5.processed/core/abr/network_analyzer.d.ts +1 -1
- package/dist/_esm5.processed/core/abr/pending_requests_store.js +3 -5
- package/dist/_esm5.processed/core/abr/representation_estimator.d.ts +1 -1
- package/dist/_esm5.processed/core/abr/representation_estimator.js +2 -2
- package/dist/_esm5.processed/core/api/media_element_track_choice_manager.d.ts +6 -0
- package/dist/_esm5.processed/core/api/media_element_track_choice_manager.js +20 -3
- package/dist/_esm5.processed/core/api/public_api.d.ts +3 -3
- package/dist/_esm5.processed/core/api/public_api.js +2 -2
- package/dist/_esm5.processed/core/api/track_choice_manager.d.ts +6 -6
- package/dist/_esm5.processed/core/eme/__tests__/__global__/utils.d.ts +0 -2
- package/dist/_esm5.processed/core/eme/__tests__/__global__/utils.js +5 -10
- package/dist/_esm5.processed/core/eme/find_key_system.js +15 -5
- package/dist/_esm5.processed/core/eme/types.d.ts +2 -2
- package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.d.ts +4 -4
- package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +1 -1
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.d.ts +2 -2
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +5 -1
- package/dist/_esm5.processed/core/fetchers/utils/try_urls_with_backoff.js +1 -1
- package/dist/_esm5.processed/core/init/initialize_directfile.d.ts +2 -2
- package/dist/_esm5.processed/core/init/initialize_media_source.d.ts +1 -1
- package/dist/_esm5.processed/core/init/manifest_update_scheduler.d.ts +4 -4
- package/dist/_esm5.processed/core/init/stream_events_emitter/are_same_stream_events.d.ts +4 -4
- package/dist/_esm5.processed/core/init/stream_events_emitter/types.d.ts +2 -2
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.d.ts +3 -3
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/text_track_cues_store.js +32 -31
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/native/native_text_segment_buffer.d.ts +4 -4
- package/dist/_esm5.processed/core/stream/representation/force_garbage_collection.js +3 -4
- package/dist/_esm5.processed/errors/request_error.js +3 -1
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/thumbnail_loader.d.ts +2 -2
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/thumbnail_loader.js +1 -3
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.d.ts +1 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.js +1 -1
- package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/types.d.ts +3 -3
- package/dist/_esm5.processed/manifest/adaptation.d.ts +2 -2
- package/dist/_esm5.processed/manifest/adaptation.js +3 -1
- package/dist/_esm5.processed/manifest/manifest.d.ts +9 -9
- package/dist/_esm5.processed/manifest/period.d.ts +3 -3
- package/dist/_esm5.processed/manifest/representation.d.ts +2 -2
- package/dist/_esm5.processed/manifest/representation_index/types.d.ts +18 -18
- package/dist/_esm5.processed/manifest/types.d.ts +3 -3
- package/dist/_esm5.processed/parsers/manifest/dash/common/get_hdr_information.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/get_periods_time_infos.d.ts +3 -3
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/base.d.ts +6 -6
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_init_segment.d.ts +3 -3
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/get_segments_from_timeline.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/list.d.ts +14 -14
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/template.d.ts +17 -17
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.js +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.d.ts +28 -20
- package/dist/_esm5.processed/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.js +19 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/dash/common/manifest_bounds_calculator.d.ts +1 -1
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.d.ts +17 -35
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +24 -23
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.d.ts +8 -8
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.d.ts +18 -27
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.js +25 -23
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.d.ts +21 -15
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representation_index.js +19 -19
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.d.ts +15 -38
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.js +8 -8
- package/dist/_esm5.processed/parsers/manifest/dash/node_parser_types.d.ts +30 -30
- package/dist/_esm5.processed/parsers/manifest/dash/parsers_types.d.ts +3 -3
- package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +1 -1
- package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/smooth/create_parser.d.ts +7 -7
- package/dist/_esm5.processed/parsers/manifest/smooth/representation_index.d.ts +8 -8
- package/dist/_esm5.processed/parsers/manifest/types.d.ts +28 -28
- package/dist/_esm5.processed/parsers/manifest/utils/clear_timeline_from_position.d.ts +3 -2
- package/dist/_esm5.processed/parsers/manifest/utils/clear_timeline_from_position.js +15 -5
- package/dist/_esm5.processed/parsers/manifest/utils/index_helpers.d.ts +2 -2
- package/dist/_esm5.processed/parsers/manifest/utils/update_segment_timeline.d.ts +11 -1
- package/dist/_esm5.processed/parsers/manifest/utils/update_segment_timeline.js +31 -19
- package/dist/_esm5.processed/parsers/texttracks/webvtt/html/to_html.d.ts +2 -2
- package/dist/_esm5.processed/parsers/texttracks/webvtt/parse_cue_block.d.ts +1 -1
- package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +2 -1
- package/dist/_esm5.processed/transports/dash/image_pipelines.js +1 -1
- package/dist/_esm5.processed/transports/dash/init_segment_loader.js +1 -1
- package/dist/_esm5.processed/transports/dash/manifest_parser.js +1 -1
- package/dist/_esm5.processed/transports/dash/segment_loader.d.ts +2 -2
- package/dist/_esm5.processed/transports/dash/segment_loader.js +2 -2
- package/dist/_esm5.processed/transports/dash/segment_parser.d.ts +1 -1
- package/dist/_esm5.processed/transports/dash/text_loader.d.ts +1 -1
- package/dist/_esm5.processed/transports/dash/text_loader.js +1 -1
- package/dist/_esm5.processed/transports/dash/text_parser.d.ts +1 -1
- package/dist/_esm5.processed/transports/local/segment_loader.d.ts +1 -2
- package/dist/_esm5.processed/transports/local/segment_loader.js +1 -1
- package/dist/_esm5.processed/transports/metaplaylist/manifest_loader.d.ts +1 -1
- package/dist/_esm5.processed/transports/metaplaylist/pipelines.js +1 -1
- package/dist/_esm5.processed/transports/smooth/pipelines.js +1 -1
- package/dist/_esm5.processed/transports/smooth/segment_loader.d.ts +0 -1
- package/dist/_esm5.processed/transports/smooth/segment_loader.js +2 -2
- package/dist/_esm5.processed/transports/types.d.ts +36 -30
- package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +1 -1
- package/dist/_esm5.processed/transports/utils/generate_manifest_loader.d.ts +1 -1
- package/dist/_esm5.processed/utils/cancellable_sleep.js +1 -1
- package/dist/_esm5.processed/utils/cast_to_observable.d.ts +1 -2
- package/dist/_esm5.processed/utils/cast_to_observable.js +1 -1
- package/dist/_esm5.processed/utils/request/fetch.d.ts +4 -5
- package/dist/_esm5.processed/utils/request/fetch.js +7 -4
- package/dist/_esm5.processed/utils/request/xhr.d.ts +6 -6
- package/dist/_esm5.processed/utils/request/xhr.js +2 -1
- package/dist/_esm5.processed/utils/rx-from_cancellable_promise.d.ts +1 -2
- package/dist/rx-player.js +404 -321
- package/dist/rx-player.min.js +1 -1
- package/package.json +3 -4
- package/scripts/doc-generator/generate_header_html.js +6 -7
- package/scripts/doc-generator/generate_page_html.js +3 -4
- package/scripts/doc-generator/generate_page_list_html.js +4 -5
- package/scripts/doc-generator/generate_sidebar_html.js +4 -7
- package/scripts/doc-generator/utils.js +0 -11
- package/scripts/generate_demo_list.js +3 -3
- package/scripts/generate_documentation_list.js +3 -3
- package/scripts/launch_static_server.js +127 -67
- package/scripts/run_standalone_demo.js +1 -0
- package/scripts/start_demo_web_server.js +1 -0
- package/sonar-project.properties +1 -1
- package/src/compat/__tests__/fullscreen.test.ts +7 -7
- package/src/compat/__tests__/is_vtt_cue.test.ts +1 -1
- package/src/compat/eme/custom_media_keys/ie11_media_keys.ts +1 -1
- package/src/compat/eme/custom_media_keys/index.ts +7 -3
- package/src/core/abr/__tests__/{get_estimate_from_buffer_levels.test.ts → buffer_based_chooser.test.ts} +94 -123
- package/src/core/abr/buffer_based_chooser.ts +85 -20
- package/src/core/abr/network_analyzer.ts +1 -1
- package/src/core/abr/pending_requests_store.ts +3 -5
- package/src/core/abr/representation_estimator.ts +6 -3
- package/src/core/api/media_element_track_choice_manager.ts +22 -3
- package/src/core/api/public_api.ts +6 -6
- package/src/core/api/track_choice_manager.ts +10 -9
- package/src/core/eme/__tests__/__global__/utils.ts +5 -10
- package/src/core/eme/find_key_system.ts +14 -12
- package/src/core/eme/types.ts +2 -2
- package/src/core/fetchers/manifest/manifest_fetcher.ts +5 -5
- package/src/core/fetchers/segment/segment_fetcher.ts +6 -3
- package/src/core/fetchers/utils/try_urls_with_backoff.ts +1 -1
- package/src/core/init/initialize_directfile.ts +2 -2
- package/src/core/init/initialize_media_source.ts +2 -2
- package/src/core/init/manifest_update_scheduler.ts +7 -7
- package/src/core/init/stream_events_emitter/are_same_stream_events.ts +4 -4
- package/src/core/init/stream_events_emitter/types.ts +2 -2
- package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +3 -3
- package/src/core/segment_buffers/implementations/text/html/text_track_cues_store.ts +32 -31
- package/src/core/segment_buffers/implementations/text/native/native_text_segment_buffer.ts +4 -4
- package/src/core/stream/representation/force_garbage_collection.ts +3 -5
- package/src/errors/request_error.ts +4 -1
- package/src/experimental/tools/VideoThumbnailLoader/thumbnail_loader.ts +3 -6
- package/src/experimental/tools/mediaCapabilitiesProber/api/index.ts +1 -1
- package/src/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.ts +3 -3
- package/src/experimental/tools/mediaCapabilitiesProber/types.ts +3 -3
- package/src/manifest/adaptation.ts +6 -4
- package/src/manifest/manifest.ts +10 -10
- package/src/manifest/period.ts +3 -3
- package/src/manifest/representation.ts +2 -2
- package/src/manifest/representation_index/types.ts +18 -18
- package/src/manifest/types.ts +3 -3
- package/src/parsers/manifest/dash/common/__tests__/manifest_bounds_calculator.test.ts +1 -0
- package/src/parsers/manifest/dash/common/get_hdr_information.ts +1 -1
- package/src/parsers/manifest/dash/common/get_periods_time_infos.ts +3 -3
- package/src/parsers/manifest/dash/common/indexes/base.ts +6 -6
- package/src/parsers/manifest/dash/common/indexes/get_init_segment.ts +4 -2
- package/src/parsers/manifest/dash/common/indexes/get_segments_from_timeline.ts +2 -2
- package/src/parsers/manifest/dash/common/indexes/list.ts +14 -14
- package/src/parsers/manifest/dash/common/indexes/template.ts +17 -16
- package/src/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.ts +1 -1
- package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +50 -22
- package/src/parsers/manifest/dash/common/infer_adaptation_type.ts +2 -2
- package/src/parsers/manifest/dash/common/manifest_bounds_calculator.ts +1 -1
- package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +58 -70
- package/src/parsers/manifest/dash/common/parse_mpd.ts +8 -8
- package/src/parsers/manifest/dash/common/parse_periods.ts +80 -79
- package/src/parsers/manifest/dash/common/parse_representation_index.ts +83 -75
- package/src/parsers/manifest/dash/common/parse_representations.ts +44 -63
- package/src/parsers/manifest/dash/node_parser_types.ts +30 -30
- package/src/parsers/manifest/dash/parsers_types.ts +3 -3
- package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +1 -1
- package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +4 -4
- package/src/parsers/manifest/smooth/create_parser.ts +23 -21
- package/src/parsers/manifest/smooth/representation_index.ts +14 -14
- package/src/parsers/manifest/types.ts +28 -28
- package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +31 -33
- package/src/parsers/manifest/utils/clear_timeline_from_position.ts +15 -6
- package/src/parsers/manifest/utils/index_helpers.ts +2 -2
- package/src/parsers/manifest/utils/update_segment_timeline.ts +32 -21
- package/src/parsers/texttracks/webvtt/html/to_html.ts +2 -2
- package/src/parsers/texttracks/webvtt/parse_cue_block.ts +1 -1
- package/src/transports/dash/add_segment_integrity_checks_to_loader.ts +2 -2
- package/src/transports/dash/image_pipelines.ts +1 -1
- package/src/transports/dash/init_segment_loader.ts +1 -1
- package/src/transports/dash/manifest_parser.ts +1 -1
- package/src/transports/dash/segment_loader.ts +7 -7
- package/src/transports/dash/segment_parser.ts +3 -1
- package/src/transports/dash/text_loader.ts +2 -2
- package/src/transports/dash/text_parser.ts +3 -1
- package/src/transports/local/segment_loader.ts +4 -4
- package/src/transports/metaplaylist/manifest_loader.ts +1 -1
- package/src/transports/metaplaylist/pipelines.ts +1 -1
- package/src/transports/smooth/pipelines.ts +7 -7
- package/src/transports/smooth/segment_loader.ts +8 -8
- package/src/transports/types.ts +37 -30
- package/src/transports/utils/call_custom_manifest_loader.ts +6 -6
- package/src/transports/utils/generate_manifest_loader.ts +1 -1
- package/src/utils/__tests__/flat_map.test.ts +12 -7
- package/src/utils/cancellable_sleep.ts +1 -1
- package/src/utils/cast_to_observable.ts +1 -2
- package/src/utils/request/fetch.ts +16 -13
- package/src/utils/request/xhr.ts +9 -7
- package/src/utils/rx-from_cancellable_promise.ts +1 -2
- package/tsconfig.json +1 -2
- package/tsconfig.modules.json +1 -2
- package/dist/_esm5.processed/core/abr/get_estimate_from_buffer_levels.d.ts +0 -29
- package/dist/_esm5.processed/core/abr/get_estimate_from_buffer_levels.js +0 -67
- package/src/core/abr/get_estimate_from_buffer_levels.ts +0 -85
|
@@ -91,14 +91,14 @@ export interface ISmoothRepresentationIndexContextInformation {
|
|
|
91
91
|
}
|
|
92
92
|
/** Information allowing to generate a Smooth initialization segment. */
|
|
93
93
|
interface ISmoothInitSegmentPrivateInfos {
|
|
94
|
-
bitsPerSample?: number;
|
|
95
|
-
channels?: number;
|
|
96
|
-
codecPrivateData?: string;
|
|
97
|
-
packetSize?: number;
|
|
98
|
-
samplingRate?: number;
|
|
94
|
+
bitsPerSample?: number | undefined;
|
|
95
|
+
channels?: number | undefined;
|
|
96
|
+
codecPrivateData?: string | undefined;
|
|
97
|
+
packetSize?: number | undefined;
|
|
98
|
+
samplingRate?: number | undefined;
|
|
99
99
|
protection?: {
|
|
100
100
|
keyId: Uint8Array;
|
|
101
|
-
};
|
|
101
|
+
} | undefined;
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
104
|
* RepresentationIndex implementation for Smooth Manifests.
|
|
@@ -131,12 +131,12 @@ export default class SmoothRepresentationIndex implements IRepresentationIndex {
|
|
|
131
131
|
* Useful to know if a segment present in the timeline has actually been
|
|
132
132
|
* generated on the server-side
|
|
133
133
|
*/
|
|
134
|
-
private _scaledLiveGap
|
|
134
|
+
private _scaledLiveGap;
|
|
135
135
|
/**
|
|
136
136
|
* Defines the end of the latest available segment when this index was known to
|
|
137
137
|
* be valid, in the index's timescale.
|
|
138
138
|
*/
|
|
139
|
-
private _initialScaledLastPosition
|
|
139
|
+
private _initialScaledLastPosition;
|
|
140
140
|
/**
|
|
141
141
|
* Defines the earliest time when this index was known to be valid (that is, when
|
|
142
142
|
* all segments declared in it are available). This means either:
|
|
@@ -17,8 +17,8 @@ import { IRepresentationIndex } from "../../manifest";
|
|
|
17
17
|
import { IHDRInformation } from "../../manifest/types";
|
|
18
18
|
export interface IManifestStreamEvent {
|
|
19
19
|
start: number;
|
|
20
|
-
end?: number;
|
|
21
|
-
id?: string;
|
|
20
|
+
end?: number | undefined;
|
|
21
|
+
id?: string | undefined;
|
|
22
22
|
data: IParsedStreamEventData;
|
|
23
23
|
}
|
|
24
24
|
export interface IParsedStreamEventData {
|
|
@@ -32,7 +32,7 @@ export interface IParsedStreamEventData {
|
|
|
32
32
|
/** Describes information about an encryption Key ID of a given media. */
|
|
33
33
|
export interface IContentProtectionKID {
|
|
34
34
|
keyId: Uint8Array;
|
|
35
|
-
systemId?: string;
|
|
35
|
+
systemId?: string | undefined;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Encryption initialization data.
|
|
@@ -88,37 +88,37 @@ export interface IParsedRepresentation {
|
|
|
88
88
|
*/
|
|
89
89
|
id: string;
|
|
90
90
|
/** Codec(s) associated with this Representation. */
|
|
91
|
-
codecs?: string;
|
|
91
|
+
codecs?: string | undefined;
|
|
92
92
|
/**
|
|
93
93
|
* Information about the encryption associated with this Representation.
|
|
94
94
|
* Not set if unknown or if the content is not encrypted.
|
|
95
95
|
*/
|
|
96
|
-
contentProtections?: IContentProtections;
|
|
96
|
+
contentProtections?: IContentProtections | undefined;
|
|
97
97
|
/**
|
|
98
98
|
* Frame rate (images per seconds) associated with this Representation.
|
|
99
99
|
* Not set if unknown or if it makes no sense (e.g. for subtitles).
|
|
100
100
|
*/
|
|
101
|
-
frameRate?: string;
|
|
101
|
+
frameRate?: string | undefined;
|
|
102
102
|
/**
|
|
103
103
|
* Height (top to bottom) in pixels this Representation has.
|
|
104
104
|
* Not set if unknown or if it makes no sense (e.g. for audio).
|
|
105
105
|
*/
|
|
106
|
-
height?: number;
|
|
106
|
+
height?: number | undefined;
|
|
107
107
|
/**
|
|
108
108
|
* Defines the mime-type of the content.
|
|
109
109
|
* This allows to deduce the media container but most of the time, the
|
|
110
110
|
* `codecs` will also be needed to know how to decode that media.
|
|
111
111
|
*/
|
|
112
|
-
mimeType?: string;
|
|
112
|
+
mimeType?: string | undefined;
|
|
113
113
|
/**
|
|
114
114
|
* Width (left to right) in pixels this Representation has.
|
|
115
115
|
* Not set if unknown or if it makes no sense (e.g. for audio).
|
|
116
116
|
*/
|
|
117
|
-
width?: number;
|
|
117
|
+
width?: number | undefined;
|
|
118
118
|
/**
|
|
119
119
|
* Information about the HDR characteristic of a content.
|
|
120
120
|
*/
|
|
121
|
-
hdrInfo?: IHDRInformation;
|
|
121
|
+
hdrInfo?: IHDRInformation | undefined;
|
|
122
122
|
}
|
|
123
123
|
/** Every possible types an Adaptation can have. */
|
|
124
124
|
export declare type IParsedAdaptationType = "audio" | "video" | "text" | "image";
|
|
@@ -144,34 +144,34 @@ export interface IParsedAdaptation {
|
|
|
144
144
|
* Not set if unknown or if it makes no sense for the current track (e.g. for
|
|
145
145
|
* a video track).
|
|
146
146
|
*/
|
|
147
|
-
audioDescription?: boolean;
|
|
147
|
+
audioDescription?: boolean | undefined;
|
|
148
148
|
/**
|
|
149
149
|
* Whether this Adaptation are closed captions for the hard of hearing.
|
|
150
150
|
* Not set if unknown or if it makes no sense for the current track (e.g. for
|
|
151
151
|
* a video track).
|
|
152
152
|
*/
|
|
153
|
-
closedCaption?: boolean;
|
|
153
|
+
closedCaption?: boolean | undefined;
|
|
154
154
|
/**
|
|
155
155
|
* If true this Adaptation is in a dub: it was recorded in another language
|
|
156
156
|
* than the original(s) one(s).
|
|
157
157
|
*/
|
|
158
|
-
isDub?: boolean;
|
|
158
|
+
isDub?: boolean | undefined;
|
|
159
159
|
/**
|
|
160
160
|
* If true this Adaptation is in a sign interpreted: which is a variant of the
|
|
161
161
|
* video with sign language.
|
|
162
162
|
*/
|
|
163
|
-
isSignInterpreted?: boolean;
|
|
163
|
+
isSignInterpreted?: boolean | undefined;
|
|
164
164
|
/** Tells if the track is a trick mode track. */
|
|
165
|
-
isTrickModeTrack?: boolean;
|
|
165
|
+
isTrickModeTrack?: boolean | undefined;
|
|
166
166
|
/**
|
|
167
167
|
* Language the `Adaptation` is in.
|
|
168
168
|
* Not set if unknown or if it makes no sense for the current track.
|
|
169
169
|
*/
|
|
170
|
-
language?: string;
|
|
170
|
+
language?: string | undefined;
|
|
171
171
|
/**
|
|
172
172
|
* TrickMode tracks attached to the adaptation.
|
|
173
173
|
*/
|
|
174
|
-
trickModeTracks?: IParsedAdaptation[];
|
|
174
|
+
trickModeTracks?: IParsedAdaptation[] | undefined;
|
|
175
175
|
}
|
|
176
176
|
/** Information on a given period of time in the Manifest */
|
|
177
177
|
export interface IParsedPeriod {
|
|
@@ -193,18 +193,18 @@ export interface IParsedPeriod {
|
|
|
193
193
|
* Duration of the Period (from the start to the end), in seconds.
|
|
194
194
|
* `undefined` if the Period is the last one and is still being updated.
|
|
195
195
|
*/
|
|
196
|
-
duration?: number;
|
|
196
|
+
duration?: number | undefined;
|
|
197
197
|
/**
|
|
198
198
|
* Time at which the Period ends, in seconds.
|
|
199
199
|
* `undefined` if the Period is the last one and is still
|
|
200
200
|
* being updated.
|
|
201
201
|
*/
|
|
202
|
-
end?: number;
|
|
202
|
+
end?: number | undefined;
|
|
203
203
|
/**
|
|
204
204
|
* Array containing every stream event from period in manifest.
|
|
205
205
|
* `undefined` if no parsed stream event in manifest.
|
|
206
206
|
*/
|
|
207
|
-
streamEvents?: IManifestStreamEvent[];
|
|
207
|
+
streamEvents?: IManifestStreamEvent[] | undefined;
|
|
208
208
|
}
|
|
209
209
|
/** Information on the whole content */
|
|
210
210
|
export interface IParsedManifest {
|
|
@@ -227,23 +227,23 @@ export interface IParsedManifest {
|
|
|
227
227
|
* The wall-clock time when the manifest was generated and published at the
|
|
228
228
|
* origin server
|
|
229
229
|
*/
|
|
230
|
-
publishTime?: number;
|
|
230
|
+
publishTime?: number | undefined;
|
|
231
231
|
/** Underlying transport protocol: "smooth", "dash", "metaplaylist" etc. */
|
|
232
232
|
transportType: string;
|
|
233
233
|
/** Base time from which the segments are generated. */
|
|
234
|
-
availabilityStartTime?: number;
|
|
234
|
+
availabilityStartTime?: number | undefined;
|
|
235
235
|
/**
|
|
236
236
|
* Offset, in milliseconds, the client's clock (in terms of `performance.now`)
|
|
237
237
|
* has relatively to the server's
|
|
238
238
|
*/
|
|
239
|
-
clockOffset?: number;
|
|
239
|
+
clockOffset?: number | undefined;
|
|
240
240
|
/** If set, the Manifest needs to be updated when that Promise resolves. */
|
|
241
|
-
expired?: Promise<void
|
|
241
|
+
expired?: Promise<void> | undefined;
|
|
242
242
|
/**
|
|
243
243
|
* Duration of the validity of this Manifest from its download time.
|
|
244
244
|
* After that time has elapsed, the Manifest should be refreshed.
|
|
245
245
|
*/
|
|
246
|
-
lifetime?: number;
|
|
246
|
+
lifetime?: number | undefined;
|
|
247
247
|
/**
|
|
248
248
|
* Data allowing to calculate the minimum and maximum seekable positions at
|
|
249
249
|
* any given time.
|
|
@@ -253,7 +253,7 @@ export interface IParsedManifest {
|
|
|
253
253
|
* The minimum time, in seconds, available in this Manifest.
|
|
254
254
|
* `undefined` if that value is unknown.
|
|
255
255
|
*/
|
|
256
|
-
absoluteMinimumTime?: number;
|
|
256
|
+
absoluteMinimumTime?: number | undefined;
|
|
257
257
|
/**
|
|
258
258
|
* Some dynamic contents have the concept of a "window depth" (or "buffer
|
|
259
259
|
* depth") which allows to set a minimum position for all reachable
|
|
@@ -298,7 +298,7 @@ export interface IParsedManifest {
|
|
|
298
298
|
* Suggested delay from the last position the player should start from by
|
|
299
299
|
* default.
|
|
300
300
|
*/
|
|
301
|
-
suggestedPresentationDelay?: number;
|
|
301
|
+
suggestedPresentationDelay?: number | undefined;
|
|
302
302
|
/** URIs where the manifest can be refreshed by order of importance. */
|
|
303
|
-
uris?: string[];
|
|
303
|
+
uris?: string[] | undefined;
|
|
304
304
|
}
|
|
@@ -18,6 +18,7 @@ import { IIndexSegment } from "./index_helpers";
|
|
|
18
18
|
* Remove segments which starts before the given `firstAvailablePosition` from
|
|
19
19
|
* the timeline. `firstAvailablePosition` has to be time scaled.
|
|
20
20
|
* @param {Array.<Object>}
|
|
21
|
-
* @returns {number}
|
|
21
|
+
* @returns {number} - Returns the number of removed segments. This includes
|
|
22
|
+
* potential implicit segment from decremented `repeatCount` attributes.
|
|
22
23
|
*/
|
|
23
|
-
export default function clearTimelineFromPosition(timeline: IIndexSegment[], firstAvailablePosition: number):
|
|
24
|
+
export default function clearTimelineFromPosition(timeline: IIndexSegment[], firstAvailablePosition: number): number;
|
|
@@ -17,25 +17,32 @@
|
|
|
17
17
|
* Remove segments which starts before the given `firstAvailablePosition` from
|
|
18
18
|
* the timeline. `firstAvailablePosition` has to be time scaled.
|
|
19
19
|
* @param {Array.<Object>}
|
|
20
|
-
* @returns {number}
|
|
20
|
+
* @returns {number} - Returns the number of removed segments. This includes
|
|
21
|
+
* potential implicit segment from decremented `repeatCount` attributes.
|
|
21
22
|
*/
|
|
22
23
|
export default function clearTimelineFromPosition(timeline, firstAvailablePosition) {
|
|
24
|
+
var nbEltsRemoved = 0;
|
|
23
25
|
while (timeline.length > 0) {
|
|
24
26
|
var firstElt = timeline[0];
|
|
25
27
|
if (firstElt.start >= firstAvailablePosition) {
|
|
26
|
-
return; // all clear
|
|
28
|
+
return nbEltsRemoved; // all clear
|
|
27
29
|
}
|
|
28
|
-
if (firstElt.repeatCount
|
|
30
|
+
if (firstElt.repeatCount === -1) {
|
|
31
|
+
return nbEltsRemoved;
|
|
32
|
+
}
|
|
33
|
+
else if (firstElt.repeatCount === 0) {
|
|
29
34
|
timeline.shift();
|
|
35
|
+
nbEltsRemoved += 1;
|
|
30
36
|
}
|
|
31
37
|
else { // we have a segment repetition
|
|
32
38
|
var nextElt = timeline[1];
|
|
33
39
|
if (nextElt !== undefined && nextElt.start <= firstAvailablePosition) {
|
|
34
40
|
timeline.shift();
|
|
41
|
+
nbEltsRemoved += 1;
|
|
35
42
|
}
|
|
36
43
|
else { // no next segment or next segment is available
|
|
37
44
|
if (firstElt.duration <= 0) {
|
|
38
|
-
return;
|
|
45
|
+
return nbEltsRemoved;
|
|
39
46
|
}
|
|
40
47
|
var nextStart = firstElt.start + firstElt.duration;
|
|
41
48
|
var nextRepeat = 1;
|
|
@@ -46,14 +53,17 @@ export default function clearTimelineFromPosition(timeline, firstAvailablePositi
|
|
|
46
53
|
}
|
|
47
54
|
if (nextRepeat > firstElt.repeatCount) { // every start is before
|
|
48
55
|
timeline.shift();
|
|
56
|
+
nbEltsRemoved = firstElt.repeatCount + 1;
|
|
49
57
|
}
|
|
50
58
|
else { // some repetitions start after and some before
|
|
51
59
|
var newRepeat = firstElt.repeatCount - nextRepeat;
|
|
52
60
|
firstElt.start = nextStart;
|
|
53
61
|
firstElt.repeatCount = newRepeat;
|
|
54
|
-
|
|
62
|
+
nbEltsRemoved += nextRepeat;
|
|
63
|
+
return nbEltsRemoved;
|
|
55
64
|
}
|
|
56
65
|
}
|
|
57
66
|
}
|
|
58
67
|
}
|
|
68
|
+
return nbEltsRemoved;
|
|
59
69
|
}
|
|
@@ -25,7 +25,7 @@ export interface IIndexSegment {
|
|
|
25
25
|
*/
|
|
26
26
|
repeatCount: number;
|
|
27
27
|
/** Optional byte-range the segment is available at when requested. */
|
|
28
|
-
range?: [number, number];
|
|
28
|
+
range?: [number, number] | undefined;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* Calculate the number of times a timeline element repeats based on the next
|
|
@@ -35,7 +35,7 @@ export interface IIndexSegment {
|
|
|
35
35
|
* @param {number|undefined} maxPosition
|
|
36
36
|
* @returns {Number}
|
|
37
37
|
*/
|
|
38
|
-
export declare function calculateRepeat(element: IIndexSegment, nextElement?: IIndexSegment | null | undefined, maxPosition?: number): number;
|
|
38
|
+
export declare function calculateRepeat(element: IIndexSegment, nextElement?: IIndexSegment | null | undefined, maxPosition?: number | undefined): number;
|
|
39
39
|
/**
|
|
40
40
|
* Returns end of the segment given, in index time.
|
|
41
41
|
* @param {Object} segment
|
|
@@ -17,7 +17,17 @@ import { IIndexSegment } from "./index_helpers";
|
|
|
17
17
|
/**
|
|
18
18
|
* Update a complete array of segments in a given timeline with a [generally]
|
|
19
19
|
* smaller but [generally] newer set of segments.
|
|
20
|
+
*
|
|
21
|
+
* Returns a boolean:
|
|
22
|
+
* - If set to `true`, the old timeline was emptied and completely replaced by
|
|
23
|
+
* the content of the newer timeline.
|
|
24
|
+
* This could happen either if a problem happened while trying to update or
|
|
25
|
+
* when the update is actually bigger than what it is updating.
|
|
26
|
+
* - If set to `false`, the older timeline was either updated to add the newer
|
|
27
|
+
* segments, or untouched.
|
|
28
|
+
*
|
|
20
29
|
* @param {Array.<Object>} oldTimeline
|
|
21
30
|
* @param {Array.<Object>} newTimeline
|
|
31
|
+
* @returns {boolean}
|
|
22
32
|
*/
|
|
23
|
-
export default function updateSegmentTimeline(oldTimeline: IIndexSegment[], newTimeline: IIndexSegment[]):
|
|
33
|
+
export default function updateSegmentTimeline(oldTimeline: IIndexSegment[], newTimeline: IIndexSegment[]): boolean;
|
|
@@ -28,18 +28,28 @@ import { getIndexSegmentEnd, } from "./index_helpers";
|
|
|
28
28
|
/**
|
|
29
29
|
* Update a complete array of segments in a given timeline with a [generally]
|
|
30
30
|
* smaller but [generally] newer set of segments.
|
|
31
|
+
*
|
|
32
|
+
* Returns a boolean:
|
|
33
|
+
* - If set to `true`, the old timeline was emptied and completely replaced by
|
|
34
|
+
* the content of the newer timeline.
|
|
35
|
+
* This could happen either if a problem happened while trying to update or
|
|
36
|
+
* when the update is actually bigger than what it is updating.
|
|
37
|
+
* - If set to `false`, the older timeline was either updated to add the newer
|
|
38
|
+
* segments, or untouched.
|
|
39
|
+
*
|
|
31
40
|
* @param {Array.<Object>} oldTimeline
|
|
32
41
|
* @param {Array.<Object>} newTimeline
|
|
42
|
+
* @returns {boolean}
|
|
33
43
|
*/
|
|
34
44
|
export default function updateSegmentTimeline(oldTimeline, newTimeline) {
|
|
35
|
-
var prevTimelineLength = oldTimeline.length;
|
|
36
45
|
if (oldTimeline.length === 0) {
|
|
37
|
-
oldTimeline.
|
|
38
|
-
return;
|
|
46
|
+
oldTimeline.push.apply(oldTimeline, newTimeline);
|
|
47
|
+
return true;
|
|
39
48
|
}
|
|
40
|
-
if (newTimeline.length === 0) {
|
|
41
|
-
return;
|
|
49
|
+
else if (newTimeline.length === 0) {
|
|
50
|
+
return false;
|
|
42
51
|
}
|
|
52
|
+
var prevTimelineLength = oldTimeline.length;
|
|
43
53
|
var newIndexStart = newTimeline[0].start;
|
|
44
54
|
var oldLastElt = oldTimeline[prevTimelineLength - 1];
|
|
45
55
|
var oldIndexEnd = getIndexSegmentEnd(oldLastElt, newTimeline[0]);
|
|
@@ -50,16 +60,18 @@ export default function updateSegmentTimeline(oldTimeline, newTimeline) {
|
|
|
50
60
|
var currStart = oldTimeline[i].start;
|
|
51
61
|
if (currStart === newIndexStart) {
|
|
52
62
|
// replace that one and those after it
|
|
53
|
-
|
|
54
|
-
|
|
63
|
+
var nbEltsToRemove = prevTimelineLength - i;
|
|
64
|
+
oldTimeline.splice.apply(oldTimeline, __spreadArray([i, nbEltsToRemove], newTimeline, false));
|
|
65
|
+
return false;
|
|
55
66
|
}
|
|
56
67
|
else if (currStart < newIndexStart) { // first to be before
|
|
57
68
|
var currElt = oldTimeline[i];
|
|
58
69
|
if (currElt.start + currElt.duration > newIndexStart) {
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
70
|
+
// The new Manifest overlaps a previous segment (weird)
|
|
71
|
+
// In that improbable case, we'll just completely replace segments
|
|
72
|
+
log.warn("RepresentationIndex: Manifest update removed all previous segments");
|
|
73
|
+
oldTimeline.splice.apply(oldTimeline, __spreadArray([0, prevTimelineLength], newTimeline, false));
|
|
74
|
+
return true;
|
|
63
75
|
}
|
|
64
76
|
else if (currElt.repeatCount === undefined || currElt.repeatCount <= 0) {
|
|
65
77
|
if (currElt.repeatCount < 0) {
|
|
@@ -67,7 +79,7 @@ export default function updateSegmentTimeline(oldTimeline, newTimeline) {
|
|
|
67
79
|
currElt.duration) - 1;
|
|
68
80
|
}
|
|
69
81
|
oldTimeline.splice.apply(oldTimeline, __spreadArray([i + 1, prevTimelineLength - (i + 1)], newTimeline, false));
|
|
70
|
-
return;
|
|
82
|
+
return false;
|
|
71
83
|
}
|
|
72
84
|
// else, there is a positive repeat we might want to update
|
|
73
85
|
var eltLastTime = currElt.start + currElt.duration * (currElt.repeatCount + 1);
|
|
@@ -75,7 +87,7 @@ export default function updateSegmentTimeline(oldTimeline, newTimeline) {
|
|
|
75
87
|
// put it after this one
|
|
76
88
|
oldTimeline.splice.apply(// our new index comes directly after
|
|
77
89
|
oldTimeline, __spreadArray([i + 1, prevTimelineLength - (i + 1)], newTimeline, false));
|
|
78
|
-
return;
|
|
90
|
+
return false;
|
|
79
91
|
}
|
|
80
92
|
var newCurrRepeat = ((newIndexStart - currElt.start) / currElt.duration) - 1;
|
|
81
93
|
if (newCurrRepeat % 1 === 0 && currElt.duration === newTimeline[0].duration) {
|
|
@@ -86,13 +98,13 @@ export default function updateSegmentTimeline(oldTimeline, newTimeline) {
|
|
|
86
98
|
oldTimeline.splice.apply(oldTimeline, __spreadArray([i, prevTimelineLength - i], newTimeline, false));
|
|
87
99
|
oldTimeline[i].start = currElt.start;
|
|
88
100
|
oldTimeline[i].repeatCount = newRepeatCount;
|
|
89
|
-
return;
|
|
101
|
+
return false;
|
|
90
102
|
}
|
|
91
103
|
log.warn("RepresentationIndex: Manifest update removed previous segments");
|
|
92
104
|
oldTimeline[i].repeatCount = Math.floor(newCurrRepeat);
|
|
93
105
|
// put it after this one
|
|
94
106
|
oldTimeline.splice.apply(oldTimeline, __spreadArray([i + 1, prevTimelineLength - (i + 1)], newTimeline, false));
|
|
95
|
-
return;
|
|
107
|
+
return false;
|
|
96
108
|
}
|
|
97
109
|
}
|
|
98
110
|
// if we got here, it means that every segments in the previous manifest are
|
|
@@ -103,12 +115,12 @@ export default function updateSegmentTimeline(oldTimeline, newTimeline) {
|
|
|
103
115
|
if (prevLastElt.repeatCount !== undefined && prevLastElt.repeatCount < 0) {
|
|
104
116
|
if (prevLastElt.start > newLastElt.start) {
|
|
105
117
|
log.warn("RepresentationIndex: The new index is older than the previous one");
|
|
106
|
-
return;
|
|
118
|
+
return false;
|
|
107
119
|
}
|
|
108
120
|
else { // the new has more depth
|
|
109
121
|
log.warn("RepresentationIndex: The new index is \"bigger\" than the previous one");
|
|
110
122
|
oldTimeline.splice.apply(oldTimeline, __spreadArray([0, prevTimelineLength], newTimeline, false));
|
|
111
|
-
return;
|
|
123
|
+
return true;
|
|
112
124
|
}
|
|
113
125
|
}
|
|
114
126
|
var prevLastTime = prevLastElt.start + prevLastElt.duration *
|
|
@@ -117,10 +129,10 @@ export default function updateSegmentTimeline(oldTimeline, newTimeline) {
|
|
|
117
129
|
(newLastElt.repeatCount + 1);
|
|
118
130
|
if (prevLastTime >= newLastTime) {
|
|
119
131
|
log.warn("RepresentationIndex: The new index is older than the previous one");
|
|
120
|
-
return;
|
|
132
|
+
return false;
|
|
121
133
|
}
|
|
122
134
|
// the new one has more depth. full update
|
|
123
135
|
log.warn("RepresentationIndex: The new index is \"bigger\" than the previous one");
|
|
124
136
|
oldTimeline.splice.apply(oldTimeline, __spreadArray([0, prevTimelineLength], newTimeline, false));
|
|
125
|
-
return;
|
|
137
|
+
return true;
|
|
126
138
|
}
|
|
@@ -35,9 +35,9 @@ export default function toHTML(cueObj: {
|
|
|
35
35
|
start: number;
|
|
36
36
|
end: number;
|
|
37
37
|
settings: Partial<Record<string, string>>;
|
|
38
|
-
header?: string;
|
|
38
|
+
header?: string | undefined;
|
|
39
39
|
payload: string[];
|
|
40
40
|
}, styling: {
|
|
41
41
|
classes: IStyleElements;
|
|
42
|
-
global?: string;
|
|
42
|
+
global?: string | undefined;
|
|
43
43
|
}): IVTTHTMLCue;
|
|
@@ -24,6 +24,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
24
|
};
|
|
25
25
|
return __assign.apply(this, arguments);
|
|
26
26
|
};
|
|
27
|
+
import PPromise from "../../utils/promise";
|
|
27
28
|
import TaskCanceller from "../../utils/task_canceller";
|
|
28
29
|
import checkISOBMFFIntegrity from "../utils/check_isobmff_integrity";
|
|
29
30
|
import inferSegmentContainer from "../utils/infer_segment_container";
|
|
@@ -36,7 +37,7 @@ import inferSegmentContainer from "../utils/infer_segment_container";
|
|
|
36
37
|
*/
|
|
37
38
|
export default function addSegmentIntegrityChecks(segmentLoader) {
|
|
38
39
|
return function (url, content, initialCancelSignal, callbacks) {
|
|
39
|
-
return new
|
|
40
|
+
return new PPromise(function (res, rej) {
|
|
40
41
|
var canceller = new TaskCanceller();
|
|
41
42
|
var unregisterCancelLstnr = initialCancelSignal
|
|
42
43
|
.register(function onCheckCancellation(err) {
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import PPromise from "pinkie";
|
|
17
16
|
import features from "../../features";
|
|
17
|
+
import PPromise from "../../utils/promise";
|
|
18
18
|
import request from "../../utils/request";
|
|
19
19
|
import takeFirstSet from "../../utils/take_first_set";
|
|
20
20
|
/**
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import PPromise from "pinkie";
|
|
17
16
|
import { concat } from "../../utils/byte_parsing";
|
|
17
|
+
import PPromise from "../../utils/promise";
|
|
18
18
|
import request from "../../utils/request";
|
|
19
19
|
import byteRange from "../utils/byte_range";
|
|
20
20
|
/**
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import PPromise from "pinkie";
|
|
17
16
|
import { formatError } from "../../errors";
|
|
18
17
|
import features from "../../features";
|
|
19
18
|
import log from "../../log";
|
|
20
19
|
import Manifest from "../../manifest";
|
|
21
20
|
import objectAssign from "../../utils/object_assign";
|
|
21
|
+
import PPromise from "../../utils/promise";
|
|
22
22
|
import request from "../../utils/request";
|
|
23
23
|
import { strToUtf8, utf8ToStr, } from "../../utils/string_parsing";
|
|
24
24
|
export default function generateManifestParser(options) {
|
|
@@ -31,6 +31,6 @@ export declare function regularSegmentLoader(url: string, content: ISegmentConte
|
|
|
31
31
|
*/
|
|
32
32
|
export default function generateSegmentLoader({ lowLatencyMode, segmentLoader: customSegmentLoader, checkMediaSegmentIntegrity }: {
|
|
33
33
|
lowLatencyMode: boolean;
|
|
34
|
-
segmentLoader?: ICustomSegmentLoader;
|
|
35
|
-
checkMediaSegmentIntegrity?: boolean;
|
|
34
|
+
segmentLoader?: ICustomSegmentLoader | undefined;
|
|
35
|
+
checkMediaSegmentIntegrity?: boolean | undefined;
|
|
36
36
|
}): ISegmentLoader<Uint8Array | ArrayBuffer | null>;
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import PPromise from "pinkie";
|
|
17
16
|
import { CustomLoaderError } from "../../errors";
|
|
17
|
+
import PPromise from "../../utils/promise";
|
|
18
18
|
import request, { fetchIsSupported, } from "../../utils/request";
|
|
19
19
|
import warnOnce from "../../utils/warn_once";
|
|
20
20
|
import byteRange from "../utils/byte_range";
|
|
@@ -79,7 +79,7 @@ export default function generateSegmentLoader(_a) {
|
|
|
79
79
|
representation: content.representation,
|
|
80
80
|
segment: content.segment,
|
|
81
81
|
transport: "dash", url: url };
|
|
82
|
-
return new
|
|
82
|
+
return new PPromise(function (res, rej) {
|
|
83
83
|
/** `true` when the custom segmentLoader should not be active anymore. */
|
|
84
84
|
var hasFinished = false;
|
|
85
85
|
/**
|
|
@@ -19,5 +19,5 @@ import { ISegmentParser } from "../types";
|
|
|
19
19
|
* @returns {Function}
|
|
20
20
|
*/
|
|
21
21
|
export default function generateAudioVideoSegmentParser({ __priv_patchLastSegmentInSidx }: {
|
|
22
|
-
__priv_patchLastSegmentInSidx?: boolean;
|
|
22
|
+
__priv_patchLastSegmentInSidx?: boolean | undefined;
|
|
23
23
|
}): ISegmentParser<ArrayBuffer | Uint8Array | null, ArrayBuffer | Uint8Array | null>;
|
|
@@ -21,5 +21,5 @@ import { ISegmentLoader } from "../types";
|
|
|
21
21
|
*/
|
|
22
22
|
export default function generateTextTrackLoader({ lowLatencyMode, checkMediaSegmentIntegrity }: {
|
|
23
23
|
lowLatencyMode: boolean;
|
|
24
|
-
checkMediaSegmentIntegrity?: boolean;
|
|
24
|
+
checkMediaSegmentIntegrity?: boolean | undefined;
|
|
25
25
|
}): ISegmentLoader<Uint8Array | ArrayBuffer | string | null>;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import PPromise from "
|
|
16
|
+
import PPromise from "../../utils/promise";
|
|
17
17
|
import request, { fetchIsSupported, } from "../../utils/request";
|
|
18
18
|
import warnOnce from "../../utils/warn_once";
|
|
19
19
|
import byteRange from "../utils/byte_range";
|
|
@@ -21,5 +21,5 @@ import { ISegmentParser, ITextTrackSegmentData } from "../types";
|
|
|
21
21
|
* @returns {Function}
|
|
22
22
|
*/
|
|
23
23
|
export default function generateTextTrackParser({ __priv_patchLastSegmentInSidx }: {
|
|
24
|
-
__priv_patchLastSegmentInSidx?: boolean;
|
|
24
|
+
__priv_patchLastSegmentInSidx?: boolean | undefined;
|
|
25
25
|
}): ISegmentParser<ArrayBuffer | Uint8Array | string | null, ITextTrackSegmentData | null>;
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import PPromise from "pinkie";
|
|
17
16
|
import { CancellationSignal } from "../../utils/task_canceller";
|
|
18
17
|
import { ISegmentContext, ISegmentLoaderCallbacks, ISegmentLoaderResultSegmentLoaded } from "../types";
|
|
19
18
|
/**
|
|
@@ -24,4 +23,4 @@ import { ISegmentContext, ISegmentLoaderCallbacks, ISegmentLoaderResultSegmentLo
|
|
|
24
23
|
* @param {Object} _callbacks
|
|
25
24
|
* @returns {Promise}
|
|
26
25
|
*/
|
|
27
|
-
export default function segmentLoader(_url: string | null, content: ISegmentContext, cancelSignal: CancellationSignal, _callbacks: ISegmentLoaderCallbacks<ArrayBuffer | null>):
|
|
26
|
+
export default function segmentLoader(_url: string | null, content: ISegmentContext, cancelSignal: CancellationSignal, _callbacks: ISegmentLoaderCallbacks<ArrayBuffer | null>): Promise<ISegmentLoaderResultSegmentLoaded<ArrayBuffer | null>>;
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import PPromise from "pinkie";
|
|
17
16
|
import { CustomLoaderError } from "../../errors";
|
|
18
17
|
import isNullOrUndefined from "../../utils/is_null_or_undefined";
|
|
18
|
+
import PPromise from "../../utils/promise";
|
|
19
19
|
/**
|
|
20
20
|
* @param {Function} customSegmentLoader
|
|
21
21
|
* @param {Object} cancelSignal
|
|
@@ -21,5 +21,5 @@ import { ICustomManifestLoader, ILoadedManifestFormat, IRequestedData } from "..
|
|
|
21
21
|
* @returns {Function}
|
|
22
22
|
*/
|
|
23
23
|
export default function generateManifestLoader({ customManifestLoader }: {
|
|
24
|
-
customManifestLoader?: ICustomManifestLoader;
|
|
24
|
+
customManifestLoader?: ICustomManifestLoader | undefined;
|
|
25
25
|
}): (url: string | undefined, cancelSignal: CancellationSignal) => Promise<IRequestedData<ILoadedManifestFormat>>;
|
|
@@ -24,12 +24,12 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
24
|
};
|
|
25
25
|
return __assign.apply(this, arguments);
|
|
26
26
|
};
|
|
27
|
-
import PPromise from "pinkie";
|
|
28
27
|
import features from "../../features";
|
|
29
28
|
import Manifest from "../../manifest";
|
|
30
29
|
import parseMetaPlaylist from "../../parsers/manifest/metaplaylist";
|
|
31
30
|
import isNullOrUndefined from "../../utils/is_null_or_undefined";
|
|
32
31
|
import objectAssign from "../../utils/object_assign";
|
|
32
|
+
import PPromise from "../../utils/promise";
|
|
33
33
|
import generateManifestLoader from "./manifest_loader";
|
|
34
34
|
/**
|
|
35
35
|
* Get base - real - content from an offseted metaplaylist content.
|
|
@@ -24,12 +24,12 @@ var __assign = (this && this.__assign) || function () {
|
|
|
24
24
|
};
|
|
25
25
|
return __assign.apply(this, arguments);
|
|
26
26
|
};
|
|
27
|
-
import PPromise from "pinkie";
|
|
28
27
|
import features from "../../features";
|
|
29
28
|
import log from "../../log";
|
|
30
29
|
import Manifest from "../../manifest";
|
|
31
30
|
import { getMDAT } from "../../parsers/containers/isobmff";
|
|
32
31
|
import createSmoothManifestParser, { SmoothRepresentationIndex, } from "../../parsers/manifest/smooth";
|
|
32
|
+
import PPromise from "../../utils/promise";
|
|
33
33
|
import request from "../../utils/request";
|
|
34
34
|
import { strToUtf8, utf8ToStr, } from "../../utils/string_parsing";
|
|
35
35
|
import warnOnce from "../../utils/warn_once";
|