rx-player 3.30.0-dev.2023020100 → 3.30.0-dev.2023030200
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/.eslintrc.js +8 -0
- package/CHANGELOG.md +5 -1
- package/VERSION +1 -1
- package/dist/_esm5.processed/compat/browser_detection.d.ts +23 -12
- package/dist/_esm5.processed/compat/browser_detection.js +80 -38
- package/dist/_esm5.processed/compat/can_reuse_media_keys.js +2 -2
- package/dist/_esm5.processed/compat/eme/close_session.js +2 -2
- package/dist/_esm5.processed/compat/event_listeners.js +1 -1
- package/dist/_esm5.processed/config.d.ts +2 -0
- package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.js +4 -2
- package/dist/_esm5.processed/core/api/debug/buffer_graph.d.ts +28 -0
- package/dist/_esm5.processed/core/api/debug/buffer_graph.js +175 -0
- package/dist/_esm5.processed/core/api/debug/buffer_size_graph.d.ts +10 -0
- package/dist/_esm5.processed/core/api/debug/buffer_size_graph.js +104 -0
- package/dist/_esm5.processed/core/api/debug/constants.d.ts +2 -0
- package/dist/_esm5.processed/core/api/debug/constants.js +2 -0
- package/dist/_esm5.processed/core/api/debug/index.d.ts +2 -0
- package/dist/_esm5.processed/core/api/debug/index.js +2 -0
- package/dist/_esm5.processed/core/api/debug/modules/general_info.d.ts +3 -0
- package/dist/_esm5.processed/core/api/debug/modules/general_info.js +199 -0
- package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_content.d.ts +4 -0
- package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_content.js +121 -0
- package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_size.d.ts +3 -0
- package/dist/_esm5.processed/core/api/debug/modules/segment_buffer_size.js +35 -0
- package/dist/_esm5.processed/core/api/debug/render.d.ts +3 -0
- package/dist/_esm5.processed/core/api/debug/render.js +32 -0
- package/dist/_esm5.processed/core/api/debug/utils.d.ts +39 -0
- package/dist/_esm5.processed/core/api/debug/utils.js +57 -0
- package/dist/_esm5.processed/core/api/playback_observer.js +3 -2
- package/dist/_esm5.processed/core/api/public_api.d.ts +3 -0
- package/dist/_esm5.processed/core/api/public_api.js +25 -14
- package/dist/_esm5.processed/core/api/utils.js +3 -3
- package/dist/_esm5.processed/core/decrypt/__tests__/__global__/utils.d.ts +32 -13
- package/dist/_esm5.processed/core/decrypt/__tests__/__global__/utils.js +28 -7
- package/dist/_esm5.processed/core/decrypt/attach_media_keys.js +1 -1
- package/dist/_esm5.processed/core/decrypt/content_decryptor.js +1 -1
- package/dist/_esm5.processed/core/decrypt/find_key_system.js +33 -24
- package/dist/_esm5.processed/core/decrypt/session_events_listener.js +54 -50
- package/dist/_esm5.processed/core/decrypt/utils/check_key_statuses.js +4 -0
- package/dist/_esm5.processed/core/fetchers/cdn_prioritizer.d.ts +17 -8
- package/dist/_esm5.processed/core/fetchers/cdn_prioritizer.js +10 -6
- package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +5 -4
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.d.ts +22 -5
- package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +37 -21
- package/dist/_esm5.processed/core/fetchers/segment/task_prioritizer.js +21 -23
- package/dist/_esm5.processed/core/fetchers/utils/schedule_request.js +17 -7
- package/dist/_esm5.processed/core/init/directfile_content_initializer.js +1 -1
- package/dist/_esm5.processed/core/init/media_source_content_initializer.js +27 -31
- package/dist/_esm5.processed/core/init/utils/content_time_boundaries_observer.js +2 -2
- package/dist/_esm5.processed/core/init/utils/create_media_source.js +3 -12
- package/dist/_esm5.processed/core/init/utils/end_of_stream.js +6 -3
- package/dist/_esm5.processed/core/init/utils/get_loaded_reference.js +2 -1
- package/dist/_esm5.processed/core/init/utils/initial_seek_and_play.js +9 -5
- package/dist/_esm5.processed/core/init/utils/initialize_content_decryption.js +2 -1
- package/dist/_esm5.processed/core/init/utils/media_duration_updater.js +23 -19
- package/dist/_esm5.processed/core/init/utils/rebuffering_controller.js +1 -1
- package/dist/_esm5.processed/core/init/utils/stream_events_emitter/stream_events_emitter.js +6 -4
- package/dist/_esm5.processed/core/init/utils/throw_on_media_error.js +1 -1
- package/dist/_esm5.processed/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.js +7 -10
- package/dist/_esm5.processed/core/segment_buffers/implementations/text/html/html_text_segment_buffer.js +4 -2
- package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.js +13 -9
- package/dist/_esm5.processed/core/stream/adaptation/adaptation_stream.js +25 -16
- package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +26 -12
- package/dist/_esm5.processed/core/stream/period/period_stream.js +11 -10
- package/dist/_esm5.processed/core/stream/representation/representation_stream.js +15 -15
- package/dist/_esm5.processed/core/stream/representation/utils/append_segment_to_buffer.js +1 -1
- package/dist/_esm5.processed/core/stream/representation/utils/downloading_queue.js +16 -6
- package/dist/_esm5.processed/default_config.d.ts +16 -0
- package/dist/_esm5.processed/default_config.js +19 -0
- package/dist/_esm5.processed/experimental/features/debug_element.d.ts +8 -0
- package/dist/_esm5.processed/experimental/features/debug_element.js +10 -0
- package/dist/_esm5.processed/experimental/features/index.d.ts +1 -0
- package/dist/_esm5.processed/experimental/features/index.js +1 -0
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.js +7 -4
- package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +8 -4
- package/dist/_esm5.processed/features/features_object.js +1 -0
- package/dist/_esm5.processed/features/initialize_features.js +13 -10
- package/dist/_esm5.processed/features/types.d.ts +3 -0
- package/dist/_esm5.processed/manifest/adaptation.js +4 -0
- package/dist/_esm5.processed/manifest/manifest.js +2 -0
- package/dist/_esm5.processed/manifest/representation.js +11 -4
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.js +105 -137
- package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.js +25 -5
- package/dist/_esm5.processed/public_types.d.ts +1 -0
- package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +15 -11
- package/dist/_esm5.processed/transports/dash/low_latency_segment_loader.js +2 -2
- package/dist/_esm5.processed/transports/dash/manifest_parser.js +1 -1
- package/dist/_esm5.processed/transports/dash/segment_loader.js +4 -4
- package/dist/_esm5.processed/transports/local/segment_loader.js +13 -26
- package/dist/_esm5.processed/transports/smooth/segment_loader.js +4 -4
- package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +3 -3
- package/dist/_esm5.processed/utils/cancellable_sleep.js +4 -10
- package/dist/_esm5.processed/utils/create_cancellable_promise.d.ts +26 -0
- package/dist/_esm5.processed/utils/create_cancellable_promise.js +52 -0
- package/dist/_esm5.processed/utils/reference.js +6 -0
- package/dist/_esm5.processed/utils/request/xhr.js +1 -1
- package/dist/_esm5.processed/utils/task_canceller.d.ts +34 -15
- package/dist/_esm5.processed/utils/task_canceller.js +55 -22
- package/dist/rx-player.js +880 -677
- package/dist/rx-player.min.js +1 -1
- package/jest.config.js +1 -0
- package/package.json +19 -18
- package/scripts/build/constants.d.ts +1 -0
- package/scripts/report_build_sizes +4 -0
- package/sonar-project.properties +1 -1
- package/src/compat/browser_detection.ts +99 -52
- package/src/compat/can_reuse_media_keys.ts +5 -2
- package/src/compat/eme/close_session.ts +2 -2
- package/src/compat/event_listeners.ts +1 -1
- package/src/core/adaptive/adaptive_representation_selector.ts +4 -2
- package/src/core/api/debug/buffer_graph.ts +247 -0
- package/src/core/api/debug/buffer_size_graph.ts +130 -0
- package/src/core/api/debug/constants.ts +2 -0
- package/src/core/api/debug/index.ts +3 -0
- package/src/core/api/debug/modules/general_info.ts +204 -0
- package/src/core/api/debug/modules/segment_buffer_content.ts +155 -0
- package/src/core/api/debug/modules/segment_buffer_size.ts +48 -0
- package/src/core/api/debug/render.ts +40 -0
- package/src/core/api/debug/utils.ts +103 -0
- package/src/core/api/playback_observer.ts +4 -2
- package/src/core/api/public_api.ts +28 -14
- package/src/core/api/utils.ts +3 -3
- package/src/core/decrypt/__tests__/__global__/utils.ts +61 -40
- package/src/core/decrypt/attach_media_keys.ts +1 -1
- package/src/core/decrypt/content_decryptor.ts +1 -1
- package/src/core/decrypt/find_key_system.ts +36 -35
- package/src/core/decrypt/session_events_listener.ts +57 -56
- package/src/core/decrypt/utils/check_key_statuses.ts +6 -0
- package/src/core/fetchers/cdn_prioritizer.ts +18 -9
- package/src/core/fetchers/manifest/manifest_fetcher.ts +5 -4
- package/src/core/fetchers/segment/segment_fetcher.ts +36 -14
- package/src/core/fetchers/segment/task_prioritizer.ts +25 -30
- package/src/core/fetchers/utils/schedule_request.ts +18 -7
- package/src/core/init/directfile_content_initializer.ts +1 -1
- package/src/core/init/media_source_content_initializer.ts +37 -41
- package/src/core/init/utils/content_time_boundaries_observer.ts +2 -2
- package/src/core/init/utils/create_media_source.ts +4 -16
- package/src/core/init/utils/end_of_stream.ts +6 -3
- package/src/core/init/utils/get_loaded_reference.ts +2 -1
- package/src/core/init/utils/initial_seek_and_play.ts +9 -5
- package/src/core/init/utils/initialize_content_decryption.ts +2 -1
- package/src/core/init/utils/media_duration_updater.ts +25 -20
- package/src/core/init/utils/rebuffering_controller.ts +1 -1
- package/src/core/init/utils/stream_events_emitter/stream_events_emitter.ts +6 -4
- package/src/core/init/utils/throw_on_media_error.ts +1 -1
- package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +7 -11
- package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +4 -2
- package/src/core/segment_buffers/segment_buffers_store.ts +16 -13
- package/src/core/stream/adaptation/adaptation_stream.ts +28 -19
- package/src/core/stream/orchestrator/stream_orchestrator.ts +26 -12
- package/src/core/stream/period/period_stream.ts +11 -10
- package/src/core/stream/representation/representation_stream.ts +15 -15
- package/src/core/stream/representation/utils/append_segment_to_buffer.ts +1 -1
- package/src/core/stream/representation/utils/downloading_queue.ts +16 -4
- package/src/default_config.ts +30 -9
- package/src/experimental/features/__tests__/debug_element.test.ts +26 -0
- package/src/experimental/features/debug_element.ts +13 -0
- package/src/experimental/features/index.ts +1 -0
- package/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts +7 -4
- package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +8 -4
- package/src/features/__tests__/initialize_features.test.ts +11 -0
- package/src/features/features_object.ts +1 -0
- package/src/features/initialize_features.ts +15 -10
- package/src/features/types.ts +9 -0
- package/src/manifest/adaptation.ts +7 -0
- package/src/manifest/manifest.ts +4 -0
- package/src/manifest/representation.ts +10 -4
- package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +116 -151
- package/src/parsers/manifest/dash/common/parse_representations.ts +21 -4
- package/src/public_types.ts +1 -0
- package/src/transports/dash/add_segment_integrity_checks_to_loader.ts +31 -22
- package/src/transports/dash/low_latency_segment_loader.ts +2 -2
- package/src/transports/dash/manifest_parser.ts +1 -1
- package/src/transports/dash/segment_loader.ts +4 -4
- package/src/transports/local/segment_loader.ts +14 -30
- package/src/transports/smooth/segment_loader.ts +4 -4
- package/src/transports/utils/call_custom_manifest_loader.ts +3 -3
- package/src/typings/globals.d.ts +2 -0
- package/src/utils/cancellable_sleep.ts +5 -14
- package/src/utils/create_cancellable_promise.ts +69 -0
- package/src/utils/reference.ts +6 -0
- package/src/utils/request/xhr.ts +1 -1
- package/src/utils/task_canceller.ts +63 -34
|
@@ -90,7 +90,7 @@ export default function performInitialSeekAndPlay(
|
|
|
90
90
|
onLoadedMetadata();
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
cancelSignal.register((err : CancellationError) => {
|
|
93
|
+
const deregisterCancellation = cancelSignal.register((err : CancellationError) => {
|
|
94
94
|
mediaElement.removeEventListener("loadedmetadata", onLoadedMetadata);
|
|
95
95
|
rejectAutoPlay(err);
|
|
96
96
|
});
|
|
@@ -112,7 +112,7 @@ export default function performInitialSeekAndPlay(
|
|
|
112
112
|
"falsely announced having loaded the content.");
|
|
113
113
|
onWarning(error);
|
|
114
114
|
}
|
|
115
|
-
if (cancelSignal.isCancelled) {
|
|
115
|
+
if (cancelSignal.isCancelled()) {
|
|
116
116
|
return ;
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -136,6 +136,7 @@ export default function performInitialSeekAndPlay(
|
|
|
136
136
|
}
|
|
137
137
|
initialPlayPerformed.setValue(true);
|
|
138
138
|
initialPlayPerformed.finish();
|
|
139
|
+
deregisterCancellation();
|
|
139
140
|
return resolveAutoPlay({ type: "skipped" as const });
|
|
140
141
|
}
|
|
141
142
|
|
|
@@ -143,19 +144,22 @@ export default function performInitialSeekAndPlay(
|
|
|
143
144
|
try {
|
|
144
145
|
playResult = mediaElement.play() ?? Promise.resolve();
|
|
145
146
|
} catch (playError) {
|
|
147
|
+
deregisterCancellation();
|
|
146
148
|
return rejectAutoPlay(playError);
|
|
147
149
|
}
|
|
148
150
|
playResult
|
|
149
151
|
.then(() => {
|
|
150
|
-
if (cancelSignal.isCancelled) {
|
|
152
|
+
if (cancelSignal.isCancelled()) {
|
|
151
153
|
return;
|
|
152
154
|
}
|
|
153
155
|
initialPlayPerformed.setValue(true);
|
|
154
156
|
initialPlayPerformed.finish();
|
|
157
|
+
deregisterCancellation();
|
|
155
158
|
return resolveAutoPlay({ type: "autoplay" as const });
|
|
156
159
|
})
|
|
157
160
|
.catch((playError : unknown) => {
|
|
158
|
-
|
|
161
|
+
deregisterCancellation();
|
|
162
|
+
if (cancelSignal.isCancelled()) {
|
|
159
163
|
return;
|
|
160
164
|
}
|
|
161
165
|
if (playError instanceof Error && playError.name === "NotAllowedError") {
|
|
@@ -167,7 +171,7 @@ export default function performInitialSeekAndPlay(
|
|
|
167
171
|
"Cannot trigger auto-play automatically: " +
|
|
168
172
|
"your browser does not allow it.");
|
|
169
173
|
onWarning(error);
|
|
170
|
-
if (cancelSignal.isCancelled) {
|
|
174
|
+
if (cancelSignal.isCancelled()) {
|
|
171
175
|
return;
|
|
172
176
|
}
|
|
173
177
|
return resolveAutoPlay({ type: "autoplay-blocked" as const });
|
|
@@ -82,7 +82,8 @@ export default function initializeContentDecryption(
|
|
|
82
82
|
return ref;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
const decryptorCanceller = new TaskCanceller(
|
|
85
|
+
const decryptorCanceller = new TaskCanceller();
|
|
86
|
+
decryptorCanceller.linkToSignal(cancelSignal);
|
|
86
87
|
const drmStatusRef = createSharedReference<IDrmInitializationStatus>({
|
|
87
88
|
initializationState: { type: "uninitialized", value: null },
|
|
88
89
|
drmSystemId: undefined,
|
|
@@ -67,7 +67,8 @@ export default class MediaDurationUpdater {
|
|
|
67
67
|
this._canceller.signal);
|
|
68
68
|
|
|
69
69
|
/** TaskCanceller triggered each time the MediaSource open status changes. */
|
|
70
|
-
let msUpdateCanceller = new TaskCanceller(
|
|
70
|
+
let msUpdateCanceller = new TaskCanceller();
|
|
71
|
+
msUpdateCanceller.linkToSignal(this._canceller.signal);
|
|
71
72
|
|
|
72
73
|
isMediaSourceOpened.onUpdate(onMediaSourceOpenedStatusChanged,
|
|
73
74
|
{ emitCurrentValue: true,
|
|
@@ -79,18 +80,17 @@ export default class MediaDurationUpdater {
|
|
|
79
80
|
if (!isMediaSourceOpened.getValue()) {
|
|
80
81
|
return;
|
|
81
82
|
}
|
|
82
|
-
msUpdateCanceller = new TaskCanceller(
|
|
83
|
+
msUpdateCanceller = new TaskCanceller();
|
|
84
|
+
msUpdateCanceller.linkToSignal(canceller.signal);
|
|
83
85
|
|
|
84
|
-
/** TaskCanceller triggered each time the content's duration may have
|
|
85
|
-
let durationChangeCanceller = new TaskCanceller(
|
|
86
|
-
|
|
87
|
-
});
|
|
86
|
+
/** TaskCanceller triggered each time the content's duration may have changed */
|
|
87
|
+
let durationChangeCanceller = new TaskCanceller();
|
|
88
|
+
durationChangeCanceller.linkToSignal(msUpdateCanceller.signal);
|
|
88
89
|
|
|
89
90
|
const reSetDuration = () => {
|
|
90
91
|
durationChangeCanceller.cancel();
|
|
91
|
-
durationChangeCanceller = new TaskCanceller(
|
|
92
|
-
|
|
93
|
-
});
|
|
92
|
+
durationChangeCanceller = new TaskCanceller();
|
|
93
|
+
durationChangeCanceller.linkToSignal(msUpdateCanceller.signal);
|
|
94
94
|
onDurationMayHaveChanged(durationChangeCanceller.signal);
|
|
95
95
|
};
|
|
96
96
|
|
|
@@ -112,10 +112,12 @@ export default class MediaDurationUpdater {
|
|
|
112
112
|
);
|
|
113
113
|
|
|
114
114
|
/** TaskCanceller triggered each time SourceBuffers' updating status changes */
|
|
115
|
-
let sourceBuffersUpdatingCanceller = new TaskCanceller(
|
|
115
|
+
let sourceBuffersUpdatingCanceller = new TaskCanceller();
|
|
116
|
+
sourceBuffersUpdatingCanceller.linkToSignal(cancelSignal);
|
|
116
117
|
return areSourceBuffersUpdating.onUpdate((areUpdating) => {
|
|
117
118
|
sourceBuffersUpdatingCanceller.cancel();
|
|
118
|
-
sourceBuffersUpdatingCanceller = new TaskCanceller(
|
|
119
|
+
sourceBuffersUpdatingCanceller = new TaskCanceller();
|
|
120
|
+
sourceBuffersUpdatingCanceller.linkToSignal(cancelSignal);
|
|
119
121
|
if (areUpdating) {
|
|
120
122
|
return;
|
|
121
123
|
}
|
|
@@ -173,20 +175,23 @@ function setMediaSourceDuration(
|
|
|
173
175
|
|
|
174
176
|
if (newDuration === undefined) {
|
|
175
177
|
if (manifest.isDynamic) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
// Some targets poorly support setting a very high number for durations.
|
|
179
|
-
// Yet, in dynamic contents, we would prefer setting a value as high as possible
|
|
180
|
-
// to still be able to seek anywhere we want to (even ahead of the Manifest if
|
|
181
|
-
// we want to). As such, we put it at a safe default value of 2^32 excepted
|
|
182
|
-
// when the maximum position is already relatively close to that value, where
|
|
183
|
-
// we authorize exceptionally going over it.
|
|
184
|
-
newDuration = Math.max(Math.pow(2, 32), maxPotentialPos + YEAR_IN_SECONDS);
|
|
178
|
+
newDuration = manifest.getLivePosition() ??
|
|
179
|
+
manifest.getMaximumSafePosition();
|
|
185
180
|
} else {
|
|
186
181
|
newDuration = manifest.getMaximumSafePosition();
|
|
187
182
|
}
|
|
188
183
|
}
|
|
189
184
|
|
|
185
|
+
if (manifest.isDynamic) {
|
|
186
|
+
// Some targets poorly support setting a very high number for durations.
|
|
187
|
+
// Yet, in dynamic contents, we would prefer setting a value as high as possible
|
|
188
|
+
// to still be able to seek anywhere we want to (even ahead of the Manifest if
|
|
189
|
+
// we want to). As such, we put it at a safe default value of 2^32 excepted
|
|
190
|
+
// when the maximum position is already relatively close to that value, where
|
|
191
|
+
// we authorize exceptionally going over it.
|
|
192
|
+
newDuration = Math.max(Math.pow(2, 32), newDuration + YEAR_IN_SECONDS);
|
|
193
|
+
}
|
|
194
|
+
|
|
190
195
|
let maxBufferedEnd : number = 0;
|
|
191
196
|
for (let i = 0; i < mediaSource.sourceBuffers.length; i++) {
|
|
192
197
|
const sourceBuffer = mediaSource.sourceBuffers[i];
|
|
@@ -123,7 +123,7 @@ export default class RebufferingController
|
|
|
123
123
|
playbackRateUpdater.dispose();
|
|
124
124
|
});
|
|
125
125
|
|
|
126
|
-
let prevFreezingState : { attemptTimestamp : number } | null;
|
|
126
|
+
let prevFreezingState : { attemptTimestamp : number } | null = null;
|
|
127
127
|
|
|
128
128
|
this._playbackObserver.listen((observation) => {
|
|
129
129
|
const discontinuitiesStore = this._discontinuitiesStore;
|
|
@@ -56,13 +56,15 @@ export default function streamEventsEmitter(
|
|
|
56
56
|
}, cancelSignal);
|
|
57
57
|
|
|
58
58
|
let isPollingEvents = false;
|
|
59
|
-
let cancelCurrentPolling = new TaskCanceller(
|
|
59
|
+
let cancelCurrentPolling = new TaskCanceller();
|
|
60
|
+
cancelCurrentPolling.linkToSignal(cancelSignal);
|
|
60
61
|
|
|
61
62
|
scheduledEventsRef.onUpdate(({ length: scheduledEventsLength }) => {
|
|
62
63
|
if (scheduledEventsLength === 0) {
|
|
63
64
|
if (isPollingEvents) {
|
|
64
65
|
cancelCurrentPolling.cancel();
|
|
65
|
-
cancelCurrentPolling = new TaskCanceller(
|
|
66
|
+
cancelCurrentPolling = new TaskCanceller();
|
|
67
|
+
cancelCurrentPolling.linkToSignal(cancelSignal);
|
|
66
68
|
isPollingEvents = false;
|
|
67
69
|
}
|
|
68
70
|
return;
|
|
@@ -161,7 +163,7 @@ export default function streamEventsEmitter(
|
|
|
161
163
|
} else {
|
|
162
164
|
onEventSkip(event.value);
|
|
163
165
|
}
|
|
164
|
-
if (stopSignal.isCancelled) {
|
|
166
|
+
if (stopSignal.isCancelled()) {
|
|
165
167
|
return;
|
|
166
168
|
}
|
|
167
169
|
}
|
|
@@ -172,7 +174,7 @@ export default function streamEventsEmitter(
|
|
|
172
174
|
if (typeof event.onExit === "function") {
|
|
173
175
|
event.onExit();
|
|
174
176
|
}
|
|
175
|
-
if (stopSignal.isCancelled) {
|
|
177
|
+
if (stopSignal.isCancelled()) {
|
|
176
178
|
return;
|
|
177
179
|
}
|
|
178
180
|
}
|
|
@@ -24,6 +24,7 @@ import { getLoggableSegmentId } from "../../../../manifest";
|
|
|
24
24
|
import areArraysOfNumbersEqual from "../../../../utils/are_arrays_of_numbers_equal";
|
|
25
25
|
import assertUnreachable from "../../../../utils/assert_unreachable";
|
|
26
26
|
import { toUint8Array } from "../../../../utils/byte_parsing";
|
|
27
|
+
import createCancellablePromise from "../../../../utils/create_cancellable_promise";
|
|
27
28
|
import hashBuffer from "../../../../utils/hash_buffer";
|
|
28
29
|
import noop from "../../../../utils/noop";
|
|
29
30
|
import objectAssign from "../../../../utils/object_assign";
|
|
@@ -369,15 +370,15 @@ export default class AudioVideoSegmentBuffer extends SegmentBuffer {
|
|
|
369
370
|
operation : ISBOperation<BufferSource>,
|
|
370
371
|
cancellationSignal : CancellationSignal
|
|
371
372
|
) : Promise<void> {
|
|
372
|
-
return
|
|
373
|
-
if (cancellationSignal.cancellationError !== null) {
|
|
374
|
-
return reject(cancellationSignal.cancellationError);
|
|
375
|
-
}
|
|
373
|
+
return createCancellablePromise(cancellationSignal, (resolve, reject) => {
|
|
376
374
|
const shouldRestartQueue = this._queue.length === 0 &&
|
|
377
375
|
this._pendingTask === null;
|
|
378
376
|
const queueItem = objectAssign({ resolve, reject }, operation);
|
|
379
377
|
this._queue.push(queueItem);
|
|
380
|
-
|
|
378
|
+
if (shouldRestartQueue) {
|
|
379
|
+
this._flush();
|
|
380
|
+
}
|
|
381
|
+
return () => {
|
|
381
382
|
// Remove the corresponding element from the AudioVideoSegmentBuffer's
|
|
382
383
|
// queue.
|
|
383
384
|
// If the operation was a pending task, it should still continue to not
|
|
@@ -388,12 +389,7 @@ export default class AudioVideoSegmentBuffer extends SegmentBuffer {
|
|
|
388
389
|
}
|
|
389
390
|
queueItem.resolve = noop;
|
|
390
391
|
queueItem.reject = noop;
|
|
391
|
-
|
|
392
|
-
});
|
|
393
|
-
|
|
394
|
-
if (shouldRestartQueue) {
|
|
395
|
-
this._flush();
|
|
396
|
-
}
|
|
392
|
+
};
|
|
397
393
|
});
|
|
398
394
|
}
|
|
399
395
|
|
|
@@ -353,7 +353,8 @@ export default class HTMLTextSegmentBuffer extends SegmentBuffer {
|
|
|
353
353
|
element : HTMLElement; } => cue.resolution !== null);
|
|
354
354
|
|
|
355
355
|
if (proportionalCues.length > 0) {
|
|
356
|
-
this._sizeUpdateCanceller = new TaskCanceller(
|
|
356
|
+
this._sizeUpdateCanceller = new TaskCanceller();
|
|
357
|
+
this._sizeUpdateCanceller.linkToSignal(this._canceller.signal);
|
|
357
358
|
const { TEXT_TRACK_SIZE_CHECKS_INTERVAL } = config.getCurrent();
|
|
358
359
|
// update propertionally-sized elements periodically
|
|
359
360
|
const heightWidthRef = onHeightWidthChange(this._textTrackElement,
|
|
@@ -382,7 +383,8 @@ export default class HTMLTextSegmentBuffer extends SegmentBuffer {
|
|
|
382
383
|
|
|
383
384
|
const startAutoRefresh = () => {
|
|
384
385
|
stopAutoRefresh();
|
|
385
|
-
autoRefreshCanceller = new TaskCanceller(
|
|
386
|
+
autoRefreshCanceller = new TaskCanceller();
|
|
387
|
+
autoRefreshCanceller.linkToSignal(cancellationSignal);
|
|
386
388
|
const intervalId = setInterval(() => this.refreshSubtitles(),
|
|
387
389
|
MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL);
|
|
388
390
|
autoRefreshCanceller.signal.register(() => {
|
|
@@ -17,10 +17,8 @@
|
|
|
17
17
|
import { MediaError } from "../../errors";
|
|
18
18
|
import features from "../../features";
|
|
19
19
|
import log from "../../log";
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
CancellationSignal,
|
|
23
|
-
} from "../../utils/task_canceller";
|
|
20
|
+
import createCancellablePromise from "../../utils/create_cancellable_promise";
|
|
21
|
+
import { CancellationSignal } from "../../utils/task_canceller";
|
|
24
22
|
import {
|
|
25
23
|
AudioVideoSegmentBuffer,
|
|
26
24
|
IBufferType,
|
|
@@ -194,21 +192,26 @@ export default class SegmentBuffersStore {
|
|
|
194
192
|
if (this._areNativeBuffersUsable()) {
|
|
195
193
|
return Promise.resolve();
|
|
196
194
|
}
|
|
197
|
-
return
|
|
198
|
-
|
|
195
|
+
return createCancellablePromise(cancelWaitSignal, (res) => {
|
|
196
|
+
/* eslint-disable-next-line prefer-const */
|
|
197
|
+
let onAddedOrDisabled : () => void;
|
|
198
|
+
|
|
199
|
+
const removeCallback = () => {
|
|
200
|
+
const indexOf = this._onNativeBufferAddedOrDisabled.indexOf(onAddedOrDisabled);
|
|
201
|
+
if (indexOf >= 0) {
|
|
202
|
+
this._onNativeBufferAddedOrDisabled.splice(indexOf, 1);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
onAddedOrDisabled = () => {
|
|
199
207
|
if (this._areNativeBuffersUsable()) {
|
|
208
|
+
removeCallback();
|
|
200
209
|
res();
|
|
201
210
|
}
|
|
202
211
|
};
|
|
203
212
|
this._onNativeBufferAddedOrDisabled.push(onAddedOrDisabled);
|
|
204
213
|
|
|
205
|
-
|
|
206
|
-
const indexOf = this._onNativeBufferAddedOrDisabled.indexOf(onAddedOrDisabled);
|
|
207
|
-
if (indexOf >= 0) {
|
|
208
|
-
this._onNativeBufferAddedOrDisabled.splice(indexOf, 1);
|
|
209
|
-
}
|
|
210
|
-
rej(error);
|
|
211
|
-
});
|
|
214
|
+
return removeCallback;
|
|
212
215
|
});
|
|
213
216
|
}
|
|
214
217
|
|
|
@@ -19,6 +19,8 @@ import config from "../../../config";
|
|
|
19
19
|
import { formatError } from "../../../errors";
|
|
20
20
|
import log from "../../../log";
|
|
21
21
|
import { Representation } from "../../../manifest";
|
|
22
|
+
import cancellableSleep from "../../../utils/cancellable_sleep";
|
|
23
|
+
import noop from "../../../utils/noop";
|
|
22
24
|
import objectAssign from "../../../utils/object_assign";
|
|
23
25
|
import {
|
|
24
26
|
createMappedReference,
|
|
@@ -84,7 +86,8 @@ export default function AdaptationStream<T>(
|
|
|
84
86
|
const { manifest, period, adaptation } = content;
|
|
85
87
|
|
|
86
88
|
/** Allows to cancel everything the `AdaptationStream` is doing. */
|
|
87
|
-
const adapStreamCanceller = new TaskCanceller(
|
|
89
|
+
const adapStreamCanceller = new TaskCanceller();
|
|
90
|
+
adapStreamCanceller.linkToSignal(parentCancelSignal);
|
|
88
91
|
|
|
89
92
|
/**
|
|
90
93
|
* The buffer goal ratio base itself on the value given by `wantedBufferAhead`
|
|
@@ -162,9 +165,8 @@ export default function AdaptationStream<T>(
|
|
|
162
165
|
* terminating and as such the next one might be immediately created
|
|
163
166
|
* recursively.
|
|
164
167
|
*/
|
|
165
|
-
const repStreamTerminatingCanceller = new TaskCanceller(
|
|
166
|
-
|
|
167
|
-
});
|
|
168
|
+
const repStreamTerminatingCanceller = new TaskCanceller();
|
|
169
|
+
repStreamTerminatingCanceller.linkToSignal(adapStreamCanceller.signal);
|
|
168
170
|
const { representation, manual } = estimateRef.getValue();
|
|
169
171
|
if (representation === null) {
|
|
170
172
|
return;
|
|
@@ -247,11 +249,11 @@ export default function AdaptationStream<T>(
|
|
|
247
249
|
|
|
248
250
|
const repInfo = { type: adaptation.type, period, representation };
|
|
249
251
|
currentRepresentation.setValue(representation);
|
|
250
|
-
if (adapStreamCanceller.isUsed) {
|
|
252
|
+
if (adapStreamCanceller.isUsed()) {
|
|
251
253
|
return ; // previous callback has stopped everything by side-effect
|
|
252
254
|
}
|
|
253
255
|
callbacks.representationChange(repInfo);
|
|
254
|
-
if (adapStreamCanceller.isUsed) {
|
|
256
|
+
if (adapStreamCanceller.isUsed()) {
|
|
255
257
|
return ; // previous callback has stopped everything by side-effect
|
|
256
258
|
}
|
|
257
259
|
|
|
@@ -268,13 +270,13 @@ export default function AdaptationStream<T>(
|
|
|
268
270
|
},
|
|
269
271
|
addedSegment(segmentInfo) {
|
|
270
272
|
abrCallbacks.addedSegment(segmentInfo);
|
|
271
|
-
if (adapStreamCanceller.isUsed) {
|
|
273
|
+
if (adapStreamCanceller.isUsed()) {
|
|
272
274
|
return;
|
|
273
275
|
}
|
|
274
276
|
callbacks.addedSegment(segmentInfo);
|
|
275
277
|
},
|
|
276
278
|
terminating() {
|
|
277
|
-
if (repStreamTerminatingCanceller.isUsed) {
|
|
279
|
+
if (repStreamTerminatingCanceller.isUsed()) {
|
|
278
280
|
return; // Already handled
|
|
279
281
|
}
|
|
280
282
|
repStreamTerminatingCanceller.cancel();
|
|
@@ -306,9 +308,8 @@ export default function AdaptationStream<T>(
|
|
|
306
308
|
* `TaskCanceller` triggered when the `RepresentationStream` calls its
|
|
307
309
|
* `terminating` callback.
|
|
308
310
|
*/
|
|
309
|
-
const terminatingRepStreamCanceller = new TaskCanceller(
|
|
310
|
-
|
|
311
|
-
});
|
|
311
|
+
const terminatingRepStreamCanceller = new TaskCanceller();
|
|
312
|
+
terminatingRepStreamCanceller.linkToSignal(adapStreamCanceller.signal);
|
|
312
313
|
const bufferGoal = createMappedReference(wantedBufferAhead, prev => {
|
|
313
314
|
return prev * getBufferGoalRatio(representation);
|
|
314
315
|
}, terminatingRepStreamCanceller.signal);
|
|
@@ -326,19 +327,27 @@ export default function AdaptationStream<T>(
|
|
|
326
327
|
defaultCode: "NONE",
|
|
327
328
|
defaultReason: "Unknown `RepresentationStream` error",
|
|
328
329
|
});
|
|
329
|
-
if (formattedError.code
|
|
330
|
+
if (formattedError.code !== "BUFFER_FULL_ERROR") {
|
|
331
|
+
representationStreamCallbacks.error(err);
|
|
332
|
+
} else {
|
|
330
333
|
const wba = wantedBufferAhead.getValue();
|
|
331
334
|
const lastBufferGoalRatio = bufferGoalRatioMap.get(representation.id) ?? 1;
|
|
332
|
-
|
|
335
|
+
// 70%, 49%, 34.3%, 24%, 16.81%, 11.76%, 8.24% and 5.76%
|
|
336
|
+
const newBufferGoalRatio = lastBufferGoalRatio * 0.7;
|
|
337
|
+
if (newBufferGoalRatio <= 0.05 || wba * newBufferGoalRatio <= 2) {
|
|
333
338
|
throw formattedError;
|
|
334
339
|
}
|
|
335
|
-
bufferGoalRatioMap.set(representation.id,
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
+
bufferGoalRatioMap.set(representation.id, newBufferGoalRatio);
|
|
341
|
+
|
|
342
|
+
// We wait 4 seconds to let the situation evolve by itself before
|
|
343
|
+
// retrying loading segments with a lower buffer goal
|
|
344
|
+
cancellableSleep(4000, adapStreamCanceller.signal).then(() => {
|
|
345
|
+
return createRepresentationStream(representation,
|
|
346
|
+
terminateCurrentStream,
|
|
347
|
+
fastSwitchThreshold,
|
|
348
|
+
representationStreamCallbacks);
|
|
349
|
+
}).catch(noop);
|
|
340
350
|
}
|
|
341
|
-
representationStreamCallbacks.error(err);
|
|
342
351
|
},
|
|
343
352
|
terminating() {
|
|
344
353
|
terminatingRepStreamCanceller.cancel();
|
|
@@ -140,9 +140,9 @@ export default function StreamOrchestrator(
|
|
|
140
140
|
});
|
|
141
141
|
|
|
142
142
|
// Create automatically the right `PeriodStream` for every possible types
|
|
143
|
-
segmentBuffersStore.getBufferTypes()
|
|
143
|
+
for (const bufferType of segmentBuffersStore.getBufferTypes()) {
|
|
144
144
|
manageEveryStreams(bufferType, initialPeriod);
|
|
145
|
-
}
|
|
145
|
+
}
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* Manage creation and removal of Streams for every Periods for a given type.
|
|
@@ -167,7 +167,8 @@ export default function StreamOrchestrator(
|
|
|
167
167
|
let enableOutOfBoundsCheck = false;
|
|
168
168
|
|
|
169
169
|
/** Cancels currently created `PeriodStream`s. */
|
|
170
|
-
let currentCanceller = new TaskCanceller(
|
|
170
|
+
let currentCanceller = new TaskCanceller();
|
|
171
|
+
currentCanceller.linkToSignal(orchestratorCancelSignal);
|
|
171
172
|
|
|
172
173
|
// Restart the current Stream when the wanted time is in another period
|
|
173
174
|
// than the ones already considered
|
|
@@ -186,7 +187,8 @@ export default function StreamOrchestrator(
|
|
|
186
187
|
callbacks.periodStreamCleared({ type: bufferType, period });
|
|
187
188
|
}
|
|
188
189
|
currentCanceller.cancel();
|
|
189
|
-
currentCanceller = new TaskCanceller(
|
|
190
|
+
currentCanceller = new TaskCanceller();
|
|
191
|
+
currentCanceller.linkToSignal(orchestratorCancelSignal);
|
|
190
192
|
|
|
191
193
|
const nextPeriod = manifest.getPeriodForTime(time) ??
|
|
192
194
|
manifest.getNextPeriod(time);
|
|
@@ -275,8 +277,16 @@ export default function StreamOrchestrator(
|
|
|
275
277
|
const segmentBufferStatus = segmentBuffersStore.getStatus(bufferType);
|
|
276
278
|
const ofCurrentType = updates
|
|
277
279
|
.filter(update => update.adaptation.type === bufferType);
|
|
278
|
-
if (
|
|
279
|
-
|
|
280
|
+
if (
|
|
281
|
+
// No update concerns the current type of data
|
|
282
|
+
ofCurrentType.length === 0 ||
|
|
283
|
+
segmentBufferStatus.type !== "initialized" ||
|
|
284
|
+
// The update only notifies of now-decipherable streams
|
|
285
|
+
ofCurrentType.every(x => x.representation.decipherable === true)
|
|
286
|
+
) {
|
|
287
|
+
// Data won't have to be removed from the buffers, no need to stop the
|
|
288
|
+
// current Streams.
|
|
289
|
+
return ;
|
|
280
290
|
}
|
|
281
291
|
|
|
282
292
|
const segmentBuffer = segmentBufferStatus.value;
|
|
@@ -316,7 +326,8 @@ export default function StreamOrchestrator(
|
|
|
316
326
|
}
|
|
317
327
|
|
|
318
328
|
currentCanceller.cancel();
|
|
319
|
-
currentCanceller = new TaskCanceller(
|
|
329
|
+
currentCanceller = new TaskCanceller();
|
|
330
|
+
currentCanceller.linkToSignal(orchestratorCancelSignal);
|
|
320
331
|
|
|
321
332
|
/** Remove from the `SegmentBuffer` all the concerned time ranges. */
|
|
322
333
|
for (const { start, end } of [...undecipherableRanges, ...rangesToRemove]) {
|
|
@@ -329,7 +340,7 @@ export default function StreamOrchestrator(
|
|
|
329
340
|
// to reduce the risk of race conditions where the next observation
|
|
330
341
|
// was going to be emitted synchronously.
|
|
331
342
|
nextTick(() => {
|
|
332
|
-
if (orchestratorCancelSignal.isCancelled) {
|
|
343
|
+
if (orchestratorCancelSignal.isCancelled()) {
|
|
333
344
|
return ;
|
|
334
345
|
}
|
|
335
346
|
const observation = playbackObserver.getReference().getValue();
|
|
@@ -339,12 +350,12 @@ export default function StreamOrchestrator(
|
|
|
339
350
|
callbacks.needsDecipherabilityFlush({ position: observation.position.last,
|
|
340
351
|
autoPlay: shouldAutoPlay,
|
|
341
352
|
duration: observation.duration });
|
|
342
|
-
if (orchestratorCancelSignal.isCancelled) {
|
|
353
|
+
if (orchestratorCancelSignal.isCancelled()) {
|
|
343
354
|
return ;
|
|
344
355
|
}
|
|
345
356
|
} else if (needsFlushingAfterClean(observation, rangesToRemove)) {
|
|
346
357
|
callbacks.needsBufferFlush();
|
|
347
|
-
if (orchestratorCancelSignal.isCancelled) {
|
|
358
|
+
if (orchestratorCancelSignal.isCancelled()) {
|
|
348
359
|
return ;
|
|
349
360
|
}
|
|
350
361
|
}
|
|
@@ -417,7 +428,8 @@ export default function StreamOrchestrator(
|
|
|
417
428
|
} | null = null;
|
|
418
429
|
|
|
419
430
|
/** Emits when the `PeriodStream` linked to `basePeriod` should be destroyed. */
|
|
420
|
-
const currentStreamCanceller = new TaskCanceller(
|
|
431
|
+
const currentStreamCanceller = new TaskCanceller();
|
|
432
|
+
currentStreamCanceller.linkToSignal(cancelSignal);
|
|
421
433
|
|
|
422
434
|
// Stop current PeriodStream when the current position goes over the end of
|
|
423
435
|
// that Period.
|
|
@@ -490,7 +502,9 @@ export default function StreamOrchestrator(
|
|
|
490
502
|
period: nextStreamInfo.period });
|
|
491
503
|
nextStreamInfo.canceller.cancel();
|
|
492
504
|
}
|
|
493
|
-
|
|
505
|
+
const nextStreamCanceller = new TaskCanceller();
|
|
506
|
+
nextStreamCanceller.linkToSignal(cancelSignal);
|
|
507
|
+
nextStreamInfo = { canceller: nextStreamCanceller,
|
|
494
508
|
period: nextPeriod };
|
|
495
509
|
manageConsecutivePeriodStreams(bufferType,
|
|
496
510
|
nextPeriod,
|
|
@@ -109,7 +109,7 @@ export default function PeriodStream(
|
|
|
109
109
|
);
|
|
110
110
|
|
|
111
111
|
callbacks.periodStreamReady({ type: bufferType, period, adaptationRef });
|
|
112
|
-
if (parentCancelSignal.isCancelled) {
|
|
112
|
+
if (parentCancelSignal.isCancelled()) {
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -122,7 +122,8 @@ export default function PeriodStream(
|
|
|
122
122
|
if (adaptation === undefined) {
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
-
const streamCanceller = new TaskCanceller(
|
|
125
|
+
const streamCanceller = new TaskCanceller();
|
|
126
|
+
streamCanceller.linkToSignal(parentCancelSignal);
|
|
126
127
|
currentStreamCanceller?.cancel(); // Cancel oreviously created stream if one
|
|
127
128
|
currentStreamCanceller = streamCanceller;
|
|
128
129
|
|
|
@@ -142,20 +143,20 @@ export default function PeriodStream(
|
|
|
142
143
|
await segmentBufferStatus.value.removeBuffer(period.start,
|
|
143
144
|
periodEnd,
|
|
144
145
|
streamCanceller.signal);
|
|
145
|
-
if (streamCanceller.isUsed) {
|
|
146
|
+
if (streamCanceller.isUsed()) {
|
|
146
147
|
return; // The stream has been cancelled
|
|
147
148
|
}
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
151
|
} else if (segmentBufferStatus.type === "uninitialized") {
|
|
151
152
|
segmentBuffersStore.disableSegmentBuffer(bufferType);
|
|
152
|
-
if (streamCanceller.isUsed) {
|
|
153
|
+
if (streamCanceller.isUsed()) {
|
|
153
154
|
return; // The stream has been cancelled
|
|
154
155
|
}
|
|
155
156
|
}
|
|
156
157
|
|
|
157
158
|
callbacks.adaptationChange({ type: bufferType, adaptation: null, period });
|
|
158
|
-
if (streamCanceller.isUsed) {
|
|
159
|
+
if (streamCanceller.isUsed()) {
|
|
159
160
|
return; // Previous call has provoken Stream cancellation by side-effect
|
|
160
161
|
}
|
|
161
162
|
|
|
@@ -193,7 +194,7 @@ export default function PeriodStream(
|
|
|
193
194
|
`P: ${period.start}`);
|
|
194
195
|
|
|
195
196
|
callbacks.adaptationChange({ type: bufferType, adaptation, period });
|
|
196
|
-
if (streamCanceller.isUsed) {
|
|
197
|
+
if (streamCanceller.isUsed()) {
|
|
197
198
|
return; // Previous call has provoken cancellation by side-effect
|
|
198
199
|
}
|
|
199
200
|
|
|
@@ -214,19 +215,19 @@ export default function PeriodStream(
|
|
|
214
215
|
}
|
|
215
216
|
|
|
216
217
|
await segmentBuffersStore.waitForUsableBuffers(streamCanceller.signal);
|
|
217
|
-
if (streamCanceller.isUsed) {
|
|
218
|
+
if (streamCanceller.isUsed()) {
|
|
218
219
|
return; // The Stream has since been cancelled
|
|
219
220
|
}
|
|
220
221
|
if (strategy.type === "flush-buffer" || strategy.type === "clean-buffer") {
|
|
221
222
|
for (const { start, end } of strategy.value) {
|
|
222
223
|
await segmentBuffer.removeBuffer(start, end, streamCanceller.signal);
|
|
223
|
-
if (streamCanceller.isUsed) {
|
|
224
|
+
if (streamCanceller.isUsed()) {
|
|
224
225
|
return; // The Stream has since been cancelled
|
|
225
226
|
}
|
|
226
227
|
}
|
|
227
228
|
if (strategy.type === "flush-buffer") {
|
|
228
229
|
callbacks.needsBufferFlush();
|
|
229
|
-
if (streamCanceller.isUsed) {
|
|
230
|
+
if (streamCanceller.isUsed()) {
|
|
230
231
|
return ; // Previous callback cancelled the Stream by side-effect
|
|
231
232
|
}
|
|
232
233
|
}
|
|
@@ -282,7 +283,7 @@ export default function PeriodStream(
|
|
|
282
283
|
defaultReason: "Unknown `AdaptationStream` error",
|
|
283
284
|
});
|
|
284
285
|
callbacks.warning(formattedError);
|
|
285
|
-
if (cancelSignal.isCancelled) {
|
|
286
|
+
if (cancelSignal.isCancelled()) {
|
|
286
287
|
return ; // Previous callback cancelled the Stream by side-effect
|
|
287
288
|
}
|
|
288
289
|
|