rx-player 4.2.0-dev.2024092400 → 4.2.0-dev.2024101500
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/.vscode/settings.json +9 -0
- package/CHANGELOG.md +22 -3
- package/VERSION +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.js +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/core/main/worker/worker_main.d.ts.map +1 -1
- package/dist/commonjs/core/main/worker/worker_main.js +3 -0
- package/dist/commonjs/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +15 -0
- package/dist/commonjs/core/stream/representation/representation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.js +2 -0
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.js +85 -8
- package/dist/commonjs/main_thread/api/debug/modules/general_info.js +1 -1
- package/dist/commonjs/main_thread/api/public_api.js +2 -2
- package/dist/commonjs/main_thread/decrypt/find_key_system.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/find_key_system.js +3 -0
- package/dist/commonjs/main_thread/init/directfile_content_initializer.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/directfile_content_initializer.js +14 -6
- package/dist/commonjs/main_thread/init/media_source_content_initializer.d.ts +11 -1
- package/dist/commonjs/main_thread/init/media_source_content_initializer.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/media_source_content_initializer.js +23 -11
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts +15 -1
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +103 -50
- package/dist/commonjs/main_thread/init/utils/initial_seek_and_play.d.ts +1 -1
- package/dist/commonjs/main_thread/init/utils/initial_seek_and_play.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/utils/initial_seek_and_play.js +21 -5
- package/dist/commonjs/main_thread/text_displayer/native/native_text_displayer.d.ts +1 -0
- package/dist/commonjs/main_thread/text_displayer/native/native_text_displayer.d.ts.map +1 -1
- package/dist/commonjs/main_thread/text_displayer/native/native_text_displayer.js +19 -16
- package/dist/commonjs/mse/main_media_source_interface.d.ts.map +1 -1
- package/dist/commonjs/mse/main_media_source_interface.js +21 -2
- package/dist/commonjs/transports/smooth/pipelines.d.ts.map +1 -1
- package/dist/commonjs/transports/smooth/pipelines.js +1 -0
- package/dist/commonjs/transports/utils/parse_text_track.d.ts.map +1 -1
- package/dist/commonjs/transports/utils/parse_text_track.js +1 -0
- package/dist/commonjs/utils/sync_or_async.d.ts.map +1 -1
- package/dist/commonjs/utils/sync_or_async.js +3 -1
- package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
- 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/core/main/worker/worker_main.d.ts.map +1 -1
- package/dist/es2017/core/main/worker/worker_main.js +3 -0
- package/dist/es2017/core/segment_sinks/segment_buffers_store.d.ts.map +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.js +15 -0
- package/dist/es2017/core/stream/representation/representation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.js +2 -0
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.js +36 -7
- package/dist/es2017/main_thread/api/debug/modules/general_info.js +1 -1
- package/dist/es2017/main_thread/api/public_api.js +2 -2
- package/dist/es2017/main_thread/decrypt/find_key_system.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/find_key_system.js +3 -0
- package/dist/es2017/main_thread/init/directfile_content_initializer.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/directfile_content_initializer.js +14 -6
- package/dist/es2017/main_thread/init/media_source_content_initializer.d.ts +11 -1
- package/dist/es2017/main_thread/init/media_source_content_initializer.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/media_source_content_initializer.js +23 -11
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts +15 -1
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.js +87 -46
- package/dist/es2017/main_thread/init/utils/initial_seek_and_play.d.ts +1 -1
- package/dist/es2017/main_thread/init/utils/initial_seek_and_play.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/utils/initial_seek_and_play.js +19 -3
- package/dist/es2017/main_thread/text_displayer/native/native_text_displayer.d.ts +1 -0
- package/dist/es2017/main_thread/text_displayer/native/native_text_displayer.d.ts.map +1 -1
- package/dist/es2017/main_thread/text_displayer/native/native_text_displayer.js +19 -16
- package/dist/es2017/mse/main_media_source_interface.d.ts.map +1 -1
- package/dist/es2017/mse/main_media_source_interface.js +19 -0
- package/dist/es2017/transports/smooth/pipelines.d.ts.map +1 -1
- package/dist/es2017/transports/smooth/pipelines.js +1 -0
- package/dist/es2017/transports/utils/parse_text_track.d.ts.map +1 -1
- package/dist/es2017/transports/utils/parse_text_track.js +1 -0
- package/dist/es2017/utils/sync_or_async.d.ts.map +1 -1
- package/dist/es2017/utils/sync_or_async.js +3 -1
- package/dist/mpd-parser.wasm +0 -0
- package/dist/rx-player.js +104 -41
- package/dist/rx-player.min.js +17 -17
- package/dist/worker.js +5 -5
- package/package.json +19 -7
- package/src/__GENERATED_CODE/embedded_dash_wasm.ts +1 -1
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/core/main/worker/worker_main.ts +3 -0
- package/src/core/segment_sinks/segment_buffers_store.ts +6 -2
- package/src/core/stream/adaptation/adaptation_stream.ts +23 -1
- package/src/core/stream/representation/representation_stream.ts +11 -0
- package/src/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.ts +39 -7
- package/src/main_thread/api/debug/modules/general_info.ts +1 -1
- package/src/main_thread/api/public_api.ts +2 -2
- package/src/main_thread/decrypt/find_key_system.ts +3 -0
- package/src/main_thread/init/directfile_content_initializer.ts +20 -10
- package/src/main_thread/init/media_source_content_initializer.ts +50 -17
- package/src/main_thread/init/multi_thread_content_initializer.ts +109 -50
- package/src/main_thread/init/utils/initial_seek_and_play.ts +24 -5
- package/src/main_thread/text_displayer/native/native_text_displayer.ts +22 -18
- package/src/mse/main_media_source_interface.ts +20 -0
- package/src/transports/smooth/pipelines.ts +1 -0
- package/src/transports/utils/parse_text_track.ts +1 -0
- package/src/utils/sync_or_async.ts +5 -3
|
@@ -158,24 +158,7 @@ export default class NativeTextDisplayer implements ITextDisplayer {
|
|
|
158
158
|
public reset(): void {
|
|
159
159
|
log.debug("NTD: Aborting NativeTextDisplayer");
|
|
160
160
|
this._removeData(0, Infinity);
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
if (_trackElement !== undefined && _videoElement.hasChildNodes()) {
|
|
164
|
-
try {
|
|
165
|
-
_videoElement.removeChild(_trackElement);
|
|
166
|
-
} catch (_e) {
|
|
167
|
-
log.warn("NTD: Can't remove track element from the video");
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// Ugly trick to work-around browser bugs by refreshing its mode
|
|
172
|
-
const oldMode = this._track.mode;
|
|
173
|
-
this._track.mode = "disabled";
|
|
174
|
-
this._track.mode = oldMode;
|
|
175
|
-
|
|
176
|
-
if (this._trackElement !== undefined) {
|
|
177
|
-
this._trackElement.innerHTML = "";
|
|
178
|
-
}
|
|
161
|
+
this._clearTrackElement();
|
|
179
162
|
}
|
|
180
163
|
|
|
181
164
|
public stop(): void {
|
|
@@ -213,6 +196,27 @@ export default class NativeTextDisplayer implements ITextDisplayer {
|
|
|
213
196
|
}
|
|
214
197
|
this._buffered.remove(start, end);
|
|
215
198
|
}
|
|
199
|
+
|
|
200
|
+
private _clearTrackElement(): void {
|
|
201
|
+
const { _trackElement, _videoElement } = this;
|
|
202
|
+
|
|
203
|
+
if (_trackElement !== undefined && _videoElement.hasChildNodes()) {
|
|
204
|
+
try {
|
|
205
|
+
_videoElement.removeChild(_trackElement);
|
|
206
|
+
} catch (_e) {
|
|
207
|
+
log.warn("NTD: Can't remove track element from the video");
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Ugly trick to work-around browser bugs by refreshing its mode
|
|
212
|
+
const oldMode = this._track.mode;
|
|
213
|
+
this._track.mode = "disabled";
|
|
214
|
+
this._track.mode = oldMode;
|
|
215
|
+
|
|
216
|
+
if (this._trackElement !== undefined) {
|
|
217
|
+
this._trackElement.innerHTML = "";
|
|
218
|
+
}
|
|
219
|
+
}
|
|
216
220
|
}
|
|
217
221
|
|
|
218
222
|
/** Data of chunks that should be pushed to the NativeTextDisplayer. */
|
|
@@ -464,6 +464,20 @@ export class MainSourceBufferInterface implements ISourceBufferInterface {
|
|
|
464
464
|
op.reject(error);
|
|
465
465
|
});
|
|
466
466
|
this._currentOperations = [];
|
|
467
|
+
|
|
468
|
+
// A synchronous error probably will not lead to updateend event, so we need to
|
|
469
|
+
// go to next queue element manually
|
|
470
|
+
//
|
|
471
|
+
// FIXME: This here is needed to ensure that we're not left with a
|
|
472
|
+
// dangling queue of operations.
|
|
473
|
+
// However it can potentially be counter-productive if e.g. the `appendBuffer`
|
|
474
|
+
// error was due to a full buffer and if there are pushing operations awaiting in
|
|
475
|
+
// the queue.
|
|
476
|
+
//
|
|
477
|
+
// A better solution might just be to reject all push operations right away here?
|
|
478
|
+
// Only for a `QuotaExceededError` (to check MSE)?
|
|
479
|
+
// However this is too disruptive for what is now a hotfix
|
|
480
|
+
this._performNextOperation();
|
|
467
481
|
}
|
|
468
482
|
} else {
|
|
469
483
|
// TODO merge contiguous removes?
|
|
@@ -482,7 +496,13 @@ export class MainSourceBufferInterface implements ISourceBufferInterface {
|
|
|
482
496
|
false,
|
|
483
497
|
);
|
|
484
498
|
nextElem.reject(error);
|
|
499
|
+
this._currentOperations.forEach((op) => {
|
|
500
|
+
op.reject(error);
|
|
501
|
+
});
|
|
485
502
|
this._currentOperations = [];
|
|
503
|
+
// A synchronous error probably will not lead to updateend event, so we need to
|
|
504
|
+
// go to next queue element manually
|
|
505
|
+
this._performNextOperation();
|
|
486
506
|
}
|
|
487
507
|
}
|
|
488
508
|
}
|
|
@@ -350,6 +350,7 @@ export default function (transportOptions: ITransportOptions): ITransportPipelin
|
|
|
350
350
|
if (
|
|
351
351
|
mimeType === "application/ttml+xml+mp4" ||
|
|
352
352
|
lcCodec === "stpp" ||
|
|
353
|
+
lcCodec === "stpp.ttml" ||
|
|
353
354
|
lcCodec === "stpp.ttml.im1t"
|
|
354
355
|
) {
|
|
355
356
|
_sdType = "ttml";
|
|
@@ -42,6 +42,7 @@ export function getISOBMFFTextTrackFormat(codecs: string | undefined): "ttml" |
|
|
|
42
42
|
}
|
|
43
43
|
switch (codecs.toLowerCase()) {
|
|
44
44
|
case "stpp": // stpp === TTML in MP4
|
|
45
|
+
case "stpp.ttml":
|
|
45
46
|
case "stpp.ttml.im1t":
|
|
46
47
|
return "ttml";
|
|
47
48
|
case "wvtt": // wvtt === WebVTT in MP4
|
|
@@ -78,12 +78,14 @@ const SyncOrAsync = {
|
|
|
78
78
|
* @returns {Object}
|
|
79
79
|
*/
|
|
80
80
|
createAsync<T>(val: Promise<T>): ISyncOrAsyncValue<T> {
|
|
81
|
-
let ret = null;
|
|
82
|
-
val.then((resolved) => {
|
|
81
|
+
let ret: T | null = null;
|
|
82
|
+
val.then((resolved: T) => {
|
|
83
83
|
ret = resolved;
|
|
84
84
|
}, noop);
|
|
85
85
|
return {
|
|
86
|
-
syncValue:
|
|
86
|
+
get syncValue(): T | null {
|
|
87
|
+
return ret;
|
|
88
|
+
},
|
|
87
89
|
getValueAsAsync() {
|
|
88
90
|
return val;
|
|
89
91
|
},
|