rx-player 4.2.0-dev.2024091600 → 4.2.0-dev.2024092400
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 +13 -11
- package/VERSION +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/commonjs/compat/eme/close_session.js +2 -2
- package/dist/commonjs/compat/eme/load_session.js +2 -2
- package/dist/commonjs/compat/patch_webkit_source_buffer.d.ts.map +1 -1
- package/dist/commonjs/compat/patch_webkit_source_buffer.js +0 -3
- package/dist/commonjs/config.d.ts +7 -156
- package/dist/commonjs/config.d.ts.map +1 -1
- package/dist/commonjs/config.js +50 -3
- package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.js +2 -2
- package/dist/commonjs/core/fetchers/segment/segment_fetcher.js +2 -2
- package/dist/commonjs/core/fetchers/utils/schedule_request.js +2 -2
- package/dist/commonjs/core/main/worker/worker_main.d.ts.map +1 -1
- package/dist/commonjs/core/main/worker/worker_main.js +4 -0
- package/dist/commonjs/core/segment_sinks/garbage_collector.js +2 -2
- package/dist/commonjs/core/segment_sinks/implementations/audio_video/audio_video_segment_buffer.js +2 -2
- package/dist/commonjs/core/segment_sinks/implementations/text/text_segment_buffer.js +2 -2
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +20 -9
- package/dist/commonjs/core/stream/adaptation/index.d.ts +1 -1
- package/dist/commonjs/core/stream/adaptation/index.d.ts.map +1 -1
- package/dist/commonjs/core/stream/adaptation/index.js +0 -15
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +2 -2
- package/dist/commonjs/core/stream/period/index.d.ts +1 -1
- package/dist/commonjs/core/stream/period/index.d.ts.map +1 -1
- package/dist/commonjs/core/stream/period/index.js +0 -15
- package/dist/commonjs/core/stream/period/period_stream.js +2 -2
- package/dist/commonjs/core/stream/representation/index.d.ts +1 -1
- package/dist/commonjs/core/stream/representation/index.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/index.js +0 -15
- package/dist/commonjs/core/stream/representation/utils/append_segment_to_buffer.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/utils/append_segment_to_buffer.js +16 -11
- package/dist/commonjs/core/stream/representation/utils/push_init_segment.js +2 -2
- package/dist/commonjs/core/stream/representation/utils/push_media_segment.js +2 -2
- package/dist/commonjs/default_config.js +4 -0
- package/dist/commonjs/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +2 -2
- package/dist/commonjs/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +2 -2
- package/dist/commonjs/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/public_api.js +19 -4
- package/dist/commonjs/main_thread/decrypt/attach_media_keys.js +2 -2
- package/dist/commonjs/main_thread/decrypt/content_decryptor.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/content_decryptor.js +4 -2
- package/dist/commonjs/main_thread/decrypt/create_or_load_session.js +2 -2
- package/dist/commonjs/main_thread/decrypt/create_session.js +2 -2
- package/dist/commonjs/main_thread/decrypt/dispose_decryption_resources.js +2 -2
- package/dist/commonjs/main_thread/decrypt/find_key_system.js +2 -2
- package/dist/commonjs/main_thread/decrypt/get_media_keys.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/get_media_keys.js +3 -2
- package/dist/commonjs/main_thread/decrypt/init_media_keys.js +2 -2
- package/dist/commonjs/main_thread/decrypt/session_events_listener.js +2 -2
- package/dist/commonjs/main_thread/decrypt/set_server_certificate.js +2 -4
- package/dist/commonjs/main_thread/decrypt/utils/clean_old_loaded_sessions.js +2 -2
- package/dist/commonjs/main_thread/decrypt/utils/loaded_sessions_store.js +2 -2
- package/dist/commonjs/main_thread/init/media_source_content_initializer.js +2 -2
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +2 -2
- package/dist/commonjs/multithread_types.d.ts +8 -1
- package/dist/commonjs/multithread_types.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +2 -2
- package/dist/commonjs/parsers/manifest/index.d.ts +1 -1
- package/dist/commonjs/parsers/manifest/index.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/index.js +0 -15
- package/dist/commonjs/transports/dash/integrity_checks.js +2 -2
- package/dist/commonjs/transports/dash/load_chunked_segment_data.js +2 -2
- package/dist/commonjs/transports/dash/segment_loader.js +2 -2
- package/dist/commonjs/transports/dash/text_loader.js +2 -2
- package/dist/commonjs/transports/smooth/segment_loader.js +2 -2
- package/dist/commonjs/utils/request/fetch.js +2 -2
- package/dist/commonjs/utils/retry_promise_with_backoff.js +2 -2
- package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/es2017/compat/patch_webkit_source_buffer.d.ts.map +1 -1
- package/dist/es2017/compat/patch_webkit_source_buffer.js +0 -3
- package/dist/es2017/config.d.ts +7 -156
- package/dist/es2017/config.d.ts.map +1 -1
- package/dist/es2017/config.js +6 -1
- package/dist/es2017/core/main/worker/worker_main.d.ts.map +1 -1
- package/dist/es2017/core/main/worker/worker_main.js +4 -0
- package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.js +18 -7
- package/dist/es2017/core/stream/adaptation/index.d.ts +1 -1
- package/dist/es2017/core/stream/adaptation/index.d.ts.map +1 -1
- package/dist/es2017/core/stream/adaptation/index.js +0 -1
- package/dist/es2017/core/stream/period/index.d.ts +1 -1
- package/dist/es2017/core/stream/period/index.d.ts.map +1 -1
- package/dist/es2017/core/stream/period/index.js +0 -1
- package/dist/es2017/core/stream/representation/index.d.ts +1 -1
- package/dist/es2017/core/stream/representation/index.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/index.js +0 -1
- package/dist/es2017/core/stream/representation/utils/append_segment_to_buffer.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/utils/append_segment_to_buffer.js +6 -2
- package/dist/es2017/default_config.js +4 -0
- package/dist/es2017/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/public_api.js +17 -2
- package/dist/es2017/main_thread/decrypt/content_decryptor.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/content_decryptor.js +2 -0
- package/dist/es2017/main_thread/decrypt/get_media_keys.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/get_media_keys.js +1 -0
- package/dist/es2017/multithread_types.d.ts +8 -1
- package/dist/es2017/multithread_types.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/index.d.ts +1 -1
- package/dist/es2017/parsers/manifest/index.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/index.js +1 -1
- package/dist/rx-player.js +50 -11
- package/dist/rx-player.min.js +14 -14
- package/dist/worker.js +6 -6
- package/package.json +20 -15
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/compat/patch_webkit_source_buffer.ts +0 -3
- package/src/config.ts +10 -2
- package/src/core/main/worker/worker_main.ts +5 -0
- package/src/core/stream/adaptation/adaptation_stream.ts +18 -7
- package/src/core/stream/adaptation/index.ts +1 -1
- package/src/core/stream/period/index.ts +1 -1
- package/src/core/stream/representation/index.ts +1 -1
- package/src/core/stream/representation/utils/append_segment_to_buffer.ts +6 -2
- package/src/default_config.ts +21 -0
- package/src/main_thread/api/public_api.ts +19 -2
- package/src/main_thread/decrypt/content_decryptor.ts +2 -0
- package/src/main_thread/decrypt/get_media_keys.ts +1 -0
- package/src/main_thread/init/multi_thread_content_initializer.ts +0 -18
- package/src/multithread_types.ts +9 -0
- package/src/parsers/manifest/index.ts +1 -1
|
@@ -85,10 +85,8 @@ export default function patchWebkitSourceBuffer(): void {
|
|
|
85
85
|
val: unknown,
|
|
86
86
|
) {
|
|
87
87
|
queueMicrotask(() => {
|
|
88
|
-
// @ts-expect-error: trigger is normally protected
|
|
89
88
|
this.trigger(eventName, val as Event);
|
|
90
89
|
this.updating = false;
|
|
91
|
-
// @ts-expect-error: trigger is normally protected
|
|
92
90
|
this.trigger("updateend", new Event("updateend"));
|
|
93
91
|
});
|
|
94
92
|
};
|
|
@@ -97,7 +95,6 @@ export default function patchWebkitSourceBuffer(): void {
|
|
|
97
95
|
if (this.updating) {
|
|
98
96
|
throw new Error("updating");
|
|
99
97
|
}
|
|
100
|
-
// @ts-expect-error: trigger is normally protected
|
|
101
98
|
this.trigger("updatestart", new Event("updatestart"));
|
|
102
99
|
this.updating = true;
|
|
103
100
|
try {
|
package/src/config.ts
CHANGED
|
@@ -9,13 +9,21 @@
|
|
|
9
9
|
import type { IDefaultConfig } from "./default_config";
|
|
10
10
|
import DEFAULT_CONFIG from "./default_config";
|
|
11
11
|
import deepMerge from "./utils/deep_merge";
|
|
12
|
+
import EventEmitter from "./utils/event_emitter";
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
interface IConfigHandlerEvents {
|
|
15
|
+
update: Partial<IDefaultConfig>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class ConfigHandler extends EventEmitter<IConfigHandlerEvents> {
|
|
19
|
+
public updated = false;
|
|
20
|
+
private _config = DEFAULT_CONFIG;
|
|
15
21
|
|
|
16
22
|
update(config: Partial<IDefaultConfig>) {
|
|
17
23
|
const newConfig = deepMerge(this._config, config);
|
|
18
24
|
this._config = newConfig;
|
|
25
|
+
this.updated = true;
|
|
26
|
+
this.trigger("update", config);
|
|
19
27
|
}
|
|
20
28
|
|
|
21
29
|
getCurrent(): IDefaultConfig {
|
|
@@ -381,7 +381,7 @@ export default function AdaptationStream(
|
|
|
381
381
|
const bufferGoal = createMappedReference(
|
|
382
382
|
wantedBufferAhead,
|
|
383
383
|
(prev) => {
|
|
384
|
-
return
|
|
384
|
+
return getBufferGoal(representation, prev);
|
|
385
385
|
},
|
|
386
386
|
bufferGoalCanceller.signal,
|
|
387
387
|
);
|
|
@@ -406,10 +406,11 @@ export default function AdaptationStream(
|
|
|
406
406
|
const lastBufferGoalRatio = bufferGoalRatioMap.get(representation.id) ?? 1;
|
|
407
407
|
// 70%, 49%, 34.3%, 24%, 16.81%, 11.76%, 8.24% and 5.76%
|
|
408
408
|
const newBufferGoalRatio = lastBufferGoalRatio * 0.7;
|
|
409
|
-
if (newBufferGoalRatio <= 0.05 || wba * newBufferGoalRatio <= 2) {
|
|
410
|
-
throw formattedError;
|
|
411
|
-
}
|
|
412
409
|
bufferGoalRatioMap.set(representation.id, newBufferGoalRatio);
|
|
410
|
+
if (newBufferGoalRatio <= 0.05 || getBufferGoal(representation, wba) <= 2) {
|
|
411
|
+
representationStreamCallbacks.error(formattedError);
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
413
414
|
|
|
414
415
|
// We wait 4 seconds to let the situation evolve by itself before
|
|
415
416
|
// retrying loading segments with a lower buffer goal
|
|
@@ -481,15 +482,25 @@ export default function AdaptationStream(
|
|
|
481
482
|
}
|
|
482
483
|
|
|
483
484
|
/**
|
|
484
|
-
*
|
|
485
|
+
* Returns how much media data should be pre-buffered for this
|
|
486
|
+
* `Representation`, according to the `wantedBufferAhead` setting and previous
|
|
487
|
+
* issues encountered with that `Representation`.
|
|
488
|
+
* @param {Object} representation - The `Representation` you want to buffer.
|
|
489
|
+
* @param {number} wba - The value of `wantedBufferAhead` set by the user.
|
|
485
490
|
* @returns {number}
|
|
486
491
|
*/
|
|
487
|
-
function
|
|
492
|
+
function getBufferGoal(representation: IRepresentation, wba: number): number {
|
|
488
493
|
const oldBufferGoalRatio = bufferGoalRatioMap.get(representation.id);
|
|
489
494
|
const bufferGoalRatio = oldBufferGoalRatio !== undefined ? oldBufferGoalRatio : 1;
|
|
490
495
|
if (oldBufferGoalRatio === undefined) {
|
|
491
496
|
bufferGoalRatioMap.set(representation.id, bufferGoalRatio);
|
|
492
497
|
}
|
|
493
|
-
|
|
498
|
+
if (bufferGoalRatio < 1 && wba === Infinity) {
|
|
499
|
+
// When `wba` is equal to `Infinity`, dividing it will still make it equal
|
|
500
|
+
// to `Infinity`. To make the `bufferGoalRatio` still have an effect, we
|
|
501
|
+
// just starts from a `wba` set to the high value of 5 minutes.
|
|
502
|
+
return 5 * 60 * 1000 * bufferGoalRatio;
|
|
503
|
+
}
|
|
504
|
+
return wba * bufferGoalRatio;
|
|
494
505
|
}
|
|
495
506
|
}
|
|
@@ -72,8 +72,12 @@ export default async function appendSegmentToBuffer<T>(
|
|
|
72
72
|
log.warn("Stream: Running garbage collector");
|
|
73
73
|
const start = Math.max(currentPos - 5, 0);
|
|
74
74
|
const end = currentPos + bufferGoal.getValue() + 12;
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
if (start > 0) {
|
|
76
|
+
await segmentSink.removeBuffer(0, start);
|
|
77
|
+
}
|
|
78
|
+
if (end < Number.MAX_VALUE) {
|
|
79
|
+
await segmentSink.removeBuffer(end, Number.MAX_VALUE);
|
|
80
|
+
}
|
|
77
81
|
await sleep(200);
|
|
78
82
|
if (cancellationSignal.cancellationError !== null) {
|
|
79
83
|
throw cancellationSignal.cancellationError;
|
package/src/default_config.ts
CHANGED
|
@@ -1187,3 +1187,24 @@ const DEFAULT_CONFIG = {
|
|
|
1187
1187
|
|
|
1188
1188
|
export type IDefaultConfig = typeof DEFAULT_CONFIG;
|
|
1189
1189
|
export default DEFAULT_CONFIG;
|
|
1190
|
+
|
|
1191
|
+
// NOTE Because the config may have to be serialized and shared between several
|
|
1192
|
+
// environments, we check here that some strict type is respected:
|
|
1193
|
+
// - only a subset of types are authorized for now, just make it easier to
|
|
1194
|
+
// reason about.
|
|
1195
|
+
// - Needs to make sense in JSON: no `function`, no `Date`, no `undefined`...
|
|
1196
|
+
interface IGenericConfigData {
|
|
1197
|
+
[key: string]:
|
|
1198
|
+
| string
|
|
1199
|
+
| number
|
|
1200
|
+
| boolean
|
|
1201
|
+
| number[]
|
|
1202
|
+
| string[]
|
|
1203
|
+
| Partial<Record<string, string[]>>
|
|
1204
|
+
| IGenericConfigData;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
function checkIsSerializable(_conf: IGenericConfigData): void {
|
|
1208
|
+
// noop
|
|
1209
|
+
}
|
|
1210
|
+
checkIsSerializable(DEFAULT_CONFIG);
|
|
@@ -32,6 +32,7 @@ import getStartDate from "../../compat/get_start_date";
|
|
|
32
32
|
import hasMseInWorker from "../../compat/has_mse_in_worker";
|
|
33
33
|
import hasWorkerApi from "../../compat/has_worker_api";
|
|
34
34
|
import isDebugModeEnabled from "../../compat/is_debug_mode_enabled";
|
|
35
|
+
import config from "../../config";
|
|
35
36
|
import type { ISegmentSinkMetrics } from "../../core/segment_sinks/segment_buffers_store";
|
|
36
37
|
import type {
|
|
37
38
|
IAdaptationChoice,
|
|
@@ -39,6 +40,7 @@ import type {
|
|
|
39
40
|
IABRThrottlers,
|
|
40
41
|
IBufferType,
|
|
41
42
|
} from "../../core/types";
|
|
43
|
+
import type { IDefaultConfig } from "../../default_config";
|
|
42
44
|
import type { IErrorCode, IErrorType } from "../../errors";
|
|
43
45
|
import { ErrorCodes, ErrorTypes, formatError, MediaError } from "../../errors";
|
|
44
46
|
import WorkerInitializationError from "../../errors/worker_initialization_error";
|
|
@@ -409,7 +411,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
409
411
|
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
|
|
410
412
|
videoElement.preload = "auto";
|
|
411
413
|
|
|
412
|
-
this.version = /* PLAYER_VERSION */ "4.2.0-dev.
|
|
414
|
+
this.version = /* PLAYER_VERSION */ "4.2.0-dev.2024092400";
|
|
413
415
|
this.log = log;
|
|
414
416
|
this.state = "STOPPED";
|
|
415
417
|
this.videoElement = videoElement;
|
|
@@ -573,6 +575,21 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
573
575
|
},
|
|
574
576
|
this._destroyCanceller.signal,
|
|
575
577
|
);
|
|
578
|
+
|
|
579
|
+
const sendConfigUpdates = (updates: Partial<IDefaultConfig>) => {
|
|
580
|
+
if (this._priv_worker === null) {
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
log.debug("---> Sending To Worker:", MainThreadMessageType.ConfigUpdate);
|
|
584
|
+
this._priv_worker.postMessage({
|
|
585
|
+
type: MainThreadMessageType.ConfigUpdate,
|
|
586
|
+
value: updates,
|
|
587
|
+
});
|
|
588
|
+
};
|
|
589
|
+
if (config.updated) {
|
|
590
|
+
sendConfigUpdates(config.getCurrent());
|
|
591
|
+
}
|
|
592
|
+
config.addEventListener("update", sendConfigUpdates, this._destroyCanceller.signal);
|
|
576
593
|
});
|
|
577
594
|
}
|
|
578
595
|
|
|
@@ -3313,7 +3330,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
|
|
|
3313
3330
|
}
|
|
3314
3331
|
}
|
|
3315
3332
|
}
|
|
3316
|
-
Player.version = /* PLAYER_VERSION */ "4.2.0-dev.
|
|
3333
|
+
Player.version = /* PLAYER_VERSION */ "4.2.0-dev.2024092400";
|
|
3317
3334
|
|
|
3318
3335
|
/** Every events sent by the RxPlayer's public API. */
|
|
3319
3336
|
interface IPublicAPIEvent {
|
|
@@ -208,6 +208,7 @@ export default class ContentDecryptor extends EventEmitter<IContentDecryptorEven
|
|
|
208
208
|
|
|
209
209
|
this.systemId = systemId;
|
|
210
210
|
if (this._stateData.state === ContentDecryptorState.Initializing) {
|
|
211
|
+
log.debug("DRM: Waiting for attachment.");
|
|
211
212
|
this._stateData = {
|
|
212
213
|
state: ContentDecryptorState.WaitingForAttachment,
|
|
213
214
|
isInitDataQueueLocked: true,
|
|
@@ -260,6 +261,7 @@ export default class ContentDecryptor extends EventEmitter<IContentDecryptorEven
|
|
|
260
261
|
const shouldDisableLock = options.disableMediaKeysAttachmentLock === true;
|
|
261
262
|
|
|
262
263
|
if (shouldDisableLock) {
|
|
264
|
+
log.debug("DRM: disabling MediaKeys attachment lock. Ready for content");
|
|
263
265
|
this._stateData = {
|
|
264
266
|
state: ContentDecryptorState.ReadyForContent,
|
|
265
267
|
isInitDataQueueLocked: true,
|
|
@@ -102,6 +102,7 @@ export default async function getMediaKeysInfos(
|
|
|
102
102
|
currentState !== null &&
|
|
103
103
|
evt.type === "reuse-media-key-system-access"
|
|
104
104
|
) {
|
|
105
|
+
log.debug("DRM: Reusing already created MediaKeys");
|
|
105
106
|
const { mediaKeys, loadedSessionsStore } = currentState;
|
|
106
107
|
|
|
107
108
|
// We might just rely on the currently attached MediaKeys instance.
|
|
@@ -2006,24 +2006,6 @@ type IDecryptionInitializationState =
|
|
|
2006
2006
|
* `HTMLMediaElement` (such as linking a content / `MediaSource` to it).
|
|
2007
2007
|
*/
|
|
2008
2008
|
| { type: "uninitialized"; value: null }
|
|
2009
|
-
/**
|
|
2010
|
-
* The `MediaSource` or media url has to be linked to the `HTMLMediaElement`
|
|
2011
|
-
* before continuing.
|
|
2012
|
-
* Once it has been linked with success (e.g. the `MediaSource` has "opened"),
|
|
2013
|
-
* the `isMediaLinked` `SharedReference` should be set to `true`.
|
|
2014
|
-
*
|
|
2015
|
-
* In the `MediaSource` case, you should wait until the `"initialized"`
|
|
2016
|
-
* state before pushing segment.
|
|
2017
|
-
*
|
|
2018
|
-
* Note that the `"awaiting-media-link"` is an optional state. It can be
|
|
2019
|
-
* skipped to directly `"initialized"` instead.
|
|
2020
|
-
*/
|
|
2021
|
-
| {
|
|
2022
|
-
type: "awaiting-media-link";
|
|
2023
|
-
value: {
|
|
2024
|
-
isMediaLinked: SharedReference<boolean>;
|
|
2025
|
-
};
|
|
2026
|
-
}
|
|
2027
2009
|
/**
|
|
2028
2010
|
* The `MediaSource` or media url can be linked AND segments can be pushed to
|
|
2029
2011
|
* the `HTMLMediaElement` on which decryption capabilities were wanted.
|
package/src/multithread_types.ts
CHANGED
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
IRepresentationsChoice,
|
|
15
15
|
ITrackSwitchingMode,
|
|
16
16
|
} from "./core/types";
|
|
17
|
+
import type { IDefaultConfig } from "./default_config";
|
|
17
18
|
import type {
|
|
18
19
|
ISerializedMediaError,
|
|
19
20
|
ISerializedNetworkError,
|
|
@@ -158,6 +159,12 @@ export interface ILogLevelUpdateMessage {
|
|
|
158
159
|
};
|
|
159
160
|
}
|
|
160
161
|
|
|
162
|
+
/** Message sent by the main thread to update the Worker's global config. */
|
|
163
|
+
export interface IConfigUpdateMessage {
|
|
164
|
+
type: MainThreadMessageType.ConfigUpdate;
|
|
165
|
+
value: Partial<IDefaultConfig>;
|
|
166
|
+
}
|
|
167
|
+
|
|
161
168
|
/**
|
|
162
169
|
* Message sent by the main thread when a new content should be "prepared".
|
|
163
170
|
*
|
|
@@ -542,6 +549,7 @@ export const enum MainThreadMessageType {
|
|
|
542
549
|
RemoveTextDataError = "remove-text-error",
|
|
543
550
|
CodecSupportUpdate = "codec-support-update",
|
|
544
551
|
ContentUrlsUpdate = "urls-update",
|
|
552
|
+
ConfigUpdate = "config-update",
|
|
545
553
|
DecipherabilityStatusUpdate = "decipherability-update",
|
|
546
554
|
LogLevelUpdate = "log-level-update",
|
|
547
555
|
MediaSourceReadyStateChange = "media-source-ready-state-change",
|
|
@@ -560,6 +568,7 @@ export const enum MainThreadMessageType {
|
|
|
560
568
|
export type IMainThreadMessage =
|
|
561
569
|
| IInitMessage
|
|
562
570
|
| ILogLevelUpdateMessage
|
|
571
|
+
| IConfigUpdateMessage
|
|
563
572
|
| IPrepareContentMessage
|
|
564
573
|
| IStopContentMessage
|
|
565
574
|
| IStartPreparedContentMessage
|