rx-player 3.27.0-dev.2022032800 → 3.27.0
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 +3 -2
- package/VERSION +1 -1
- package/dist/_esm5.processed/compat/get_start_date.d.ts +30 -0
- package/dist/_esm5.processed/compat/get_start_date.js +44 -0
- package/dist/_esm5.processed/compat/index.d.ts +2 -1
- package/dist/_esm5.processed/compat/index.js +2 -1
- package/dist/_esm5.processed/config.d.ts +1 -2
- package/dist/_esm5.processed/core/api/public_api.js +25 -25
- package/dist/_esm5.processed/core/segment_buffers/garbage_collector.js +4 -1
- package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.js +2 -1
- package/dist/_esm5.processed/core/stream/period/period_stream.js +9 -3
- package/dist/_esm5.processed/core/stream/representation/force_garbage_collection.js +3 -2
- package/dist/_esm5.processed/core/stream/representation/get_buffer_status.d.ts +2 -2
- package/dist/_esm5.processed/core/stream/representation/get_buffer_status.js +9 -3
- package/dist/_esm5.processed/core/stream/representation/get_needed_segments.d.ts +11 -1
- package/dist/_esm5.processed/core/stream/representation/get_needed_segments.js +27 -45
- package/dist/_esm5.processed/core/stream/representation/representation_stream.js +6 -4
- package/dist/_esm5.processed/default_config.d.ts +2 -8
- package/dist/_esm5.processed/default_config.js +2 -8
- package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +39 -38
- package/dist/_esm5.processed/utils/reference.js +0 -2
- package/dist/_esm5.processed/utils/task_canceller.d.ts +8 -1
- package/dist/_esm5.processed/utils/task_canceller.js +9 -1
- package/dist/rx-player.js +198 -145
- package/dist/rx-player.min.js +1 -1
- package/package.json +1 -1
- package/sonar-project.properties +1 -1
- package/src/compat/get_start_date.ts +48 -0
- package/src/compat/index.ts +2 -0
- package/src/core/api/public_api.ts +23 -27
- package/src/core/segment_buffers/garbage_collector.ts +4 -0
- package/src/core/stream/orchestrator/stream_orchestrator.ts +2 -1
- package/src/core/stream/period/period_stream.ts +9 -4
- package/src/core/stream/representation/force_garbage_collection.ts +4 -1
- package/src/core/stream/representation/get_buffer_status.ts +21 -13
- package/src/core/stream/representation/get_needed_segments.ts +40 -55
- package/src/core/stream/representation/representation_stream.ts +6 -4
- package/src/default_config.ts +20 -27
- package/src/transports/dash/add_segment_integrity_checks_to_loader.ts +41 -44
- package/src/utils/reference.ts +0 -2
- package/src/utils/task_canceller.ts +16 -1
package/src/utils/reference.ts
CHANGED
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
Observable,
|
|
19
19
|
Subscriber,
|
|
20
20
|
} from "rxjs";
|
|
21
|
-
import log from "../log";
|
|
22
21
|
import { CancellationSignal } from "./task_canceller";
|
|
23
22
|
|
|
24
23
|
/**
|
|
@@ -194,7 +193,6 @@ export function createSharedReference<T>(initialValue : T) : ISharedReference<T>
|
|
|
194
193
|
if (__ENVIRONMENT__.CURRENT_ENV === __ENVIRONMENT__.DEV as number) {
|
|
195
194
|
throw new Error("Finished shared references cannot be updated");
|
|
196
195
|
} else {
|
|
197
|
-
log.error("Finished shared references cannot be updated");
|
|
198
196
|
return;
|
|
199
197
|
}
|
|
200
198
|
}
|
|
@@ -136,14 +136,29 @@ export default class TaskCanceller {
|
|
|
136
136
|
* Creates a new `TaskCanceller`, with its own `CancellationSignal` created
|
|
137
137
|
* as its `signal` provide.
|
|
138
138
|
* You can then pass this property to async task you wish to be cancellable.
|
|
139
|
+
* @param {Object|undefined} options
|
|
139
140
|
*/
|
|
140
|
-
constructor(
|
|
141
|
+
constructor(options? : {
|
|
142
|
+
/**
|
|
143
|
+
* If set the TaskCanceller created here will automatically be triggered
|
|
144
|
+
* when that signal emits.
|
|
145
|
+
*/
|
|
146
|
+
cancelOn? : CancellationSignal | undefined;
|
|
147
|
+
} | undefined) {
|
|
141
148
|
const [trigger, register] = createCancellationFunctions();
|
|
142
149
|
this.isUsed = false;
|
|
143
150
|
this._trigger = trigger;
|
|
144
151
|
this.signal = new CancellationSignal(register);
|
|
152
|
+
|
|
153
|
+
if (options?.cancelOn !== undefined) {
|
|
154
|
+
const unregisterParent = options.cancelOn.register(() => {
|
|
155
|
+
this.cancel();
|
|
156
|
+
});
|
|
157
|
+
this.signal.register(unregisterParent);
|
|
158
|
+
}
|
|
145
159
|
}
|
|
146
160
|
|
|
161
|
+
|
|
147
162
|
/**
|
|
148
163
|
* "Trigger" the `TaskCanceller`, notify through its associated
|
|
149
164
|
* `CancellationSignal` (its `signal` property) that a task should be aborted.
|