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
|
@@ -49,17 +49,33 @@ export default function performInitialSeekAndPlay({ mediaElement, playbackObserv
|
|
|
49
49
|
// So let's divide the two possibilities here.
|
|
50
50
|
if (!isDirectfile || typeof startTime === "number") {
|
|
51
51
|
const initiallySeekedTime = typeof startTime === "number" ? startTime : startTime();
|
|
52
|
-
if (initiallySeekedTime !== 0) {
|
|
52
|
+
if (initiallySeekedTime !== 0 && initiallySeekedTime !== undefined) {
|
|
53
53
|
performInitialSeek(initiallySeekedTime);
|
|
54
54
|
}
|
|
55
55
|
waitForSeekable();
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
58
58
|
playbackObserver.listen((obs, stopListening) => {
|
|
59
|
+
const initiallySeekedTime = typeof startTime === "number" ? startTime : startTime();
|
|
60
|
+
if (initiallySeekedTime === undefined &&
|
|
61
|
+
obs.readyState < HTMLMediaElement.HAVE_CURRENT_DATA) {
|
|
62
|
+
/**
|
|
63
|
+
* On browser, such as Safari, the HTMLMediaElement.duration
|
|
64
|
+
* and HTMLMediaElement.buffered may not be initialized at readyState 1, leading
|
|
65
|
+
* to cases where it can be equal to `Infinity`.
|
|
66
|
+
* If so, the range in which it is possible to seek is not yet known.
|
|
67
|
+
* To solve this, the seek should be done after readyState HAVE_CURRENT_DATA (2),
|
|
68
|
+
* at that time the previously mentioned attributes are correctly initialized and
|
|
69
|
+
* the range in which it is possible to seek is correctly known.
|
|
70
|
+
* If the initiallySeekedTime is still `undefined` when the readyState is >= 2,
|
|
71
|
+
* let assume that the initiallySeekedTime will never be known and continue
|
|
72
|
+
* the logic without seeking.
|
|
73
|
+
*/
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
59
76
|
if (obs.readyState >= 1) {
|
|
60
77
|
stopListening();
|
|
61
|
-
|
|
62
|
-
if (initiallySeekedTime !== 0) {
|
|
78
|
+
if (initiallySeekedTime !== 0 && initiallySeekedTime !== undefined) {
|
|
63
79
|
if (canSeekDirectlyAfterLoadedMetadata) {
|
|
64
80
|
performInitialSeek(initiallySeekedTime);
|
|
65
81
|
}
|
|
@@ -37,6 +37,7 @@ export default class NativeTextDisplayer implements ITextDisplayer {
|
|
|
37
37
|
reset(): void;
|
|
38
38
|
stop(): void;
|
|
39
39
|
private _removeData;
|
|
40
|
+
private _clearTrackElement;
|
|
40
41
|
}
|
|
41
42
|
/** Data of chunks that should be pushed to the NativeTextDisplayer. */
|
|
42
43
|
export interface INativeTextTracksBufferSegmentData {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native_text_displayer.d.ts","sourceRoot":"","sources":["../../../../../src/main_thread/text_displayer/native/native_text_displayer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,aAAa,EACd,MAAM,6CAA6C,CAAC;AAIrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAoB,YAAW,cAAc;IAChE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAC1C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA+B;IAE7D,OAAO,CAAC,SAAS,CAAmB;IAEpC;;OAEG;gBACS,YAAY,EAAE,aAAa;IASvC;;;;OAIG;IACI,YAAY,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,EAAE;IA8FxD;;;;;OAKG;IACI,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE;IAKzD;;;OAGG;IACI,iBAAiB,IAAI,MAAM,EAAE;IAI7B,KAAK,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"native_text_displayer.d.ts","sourceRoot":"","sources":["../../../../../src/main_thread/text_displayer/native/native_text_displayer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,aAAa,EACd,MAAM,6CAA6C,CAAC;AAIrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAoB,YAAW,cAAc;IAChE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAC1C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA+B;IAE7D,OAAO,CAAC,SAAS,CAAmB;IAEpC;;OAEG;gBACS,YAAY,EAAE,aAAa;IASvC;;;;OAIG;IACI,YAAY,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,EAAE;IA8FxD;;;;;OAKG;IACI,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE;IAKzD;;;OAGG;IACI,iBAAiB,IAAI,MAAM,EAAE;IAI7B,KAAK,IAAI,IAAI;IAMb,IAAI,IAAI,IAAI;IAoBnB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,kBAAkB;CAoB3B;AAED,uEAAuE;AACvE,MAAM,WAAW,kCAAkC;IACjD,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,0DAA0D;IAC1D,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B"}
|
|
@@ -129,22 +129,7 @@ export default class NativeTextDisplayer {
|
|
|
129
129
|
reset() {
|
|
130
130
|
log.debug("NTD: Aborting NativeTextDisplayer");
|
|
131
131
|
this._removeData(0, Infinity);
|
|
132
|
-
|
|
133
|
-
if (_trackElement !== undefined && _videoElement.hasChildNodes()) {
|
|
134
|
-
try {
|
|
135
|
-
_videoElement.removeChild(_trackElement);
|
|
136
|
-
}
|
|
137
|
-
catch (_e) {
|
|
138
|
-
log.warn("NTD: Can't remove track element from the video");
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
// Ugly trick to work-around browser bugs by refreshing its mode
|
|
142
|
-
const oldMode = this._track.mode;
|
|
143
|
-
this._track.mode = "disabled";
|
|
144
|
-
this._track.mode = oldMode;
|
|
145
|
-
if (this._trackElement !== undefined) {
|
|
146
|
-
this._trackElement.innerHTML = "";
|
|
147
|
-
}
|
|
132
|
+
this._clearTrackElement();
|
|
148
133
|
}
|
|
149
134
|
stop() {
|
|
150
135
|
log.debug("NTD: Aborting NativeTextDisplayer");
|
|
@@ -178,6 +163,24 @@ export default class NativeTextDisplayer {
|
|
|
178
163
|
}
|
|
179
164
|
this._buffered.remove(start, end);
|
|
180
165
|
}
|
|
166
|
+
_clearTrackElement() {
|
|
167
|
+
const { _trackElement, _videoElement } = this;
|
|
168
|
+
if (_trackElement !== undefined && _videoElement.hasChildNodes()) {
|
|
169
|
+
try {
|
|
170
|
+
_videoElement.removeChild(_trackElement);
|
|
171
|
+
}
|
|
172
|
+
catch (_e) {
|
|
173
|
+
log.warn("NTD: Can't remove track element from the video");
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
// Ugly trick to work-around browser bugs by refreshing its mode
|
|
177
|
+
const oldMode = this._track.mode;
|
|
178
|
+
this._track.mode = "disabled";
|
|
179
|
+
this._track.mode = oldMode;
|
|
180
|
+
if (this._trackElement !== undefined) {
|
|
181
|
+
this._trackElement.innerHTML = "";
|
|
182
|
+
}
|
|
183
|
+
}
|
|
181
184
|
}
|
|
182
185
|
/*
|
|
183
186
|
* The following ugly code is here to provide a compile-time check that an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main_media_source_interface.d.ts","sourceRoot":"","sources":["../../../src/mse/main_media_source_interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAOzF,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAGlD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,2BAA2B,EAC3B,sBAAsB,EAEtB,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAIjB;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,wBACnB,SAAQ,YAAY,CAAC,2BAA2B,CAChD,YAAW,qBAAqB;IAEhC,iCAAiC;IAC1B,EAAE,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACI,MAAM,EAAE,kBAAkB,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CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAa5D,kCAAkC;IAC3B,WAAW,IAAI,MAAM,EAAE;IAa9B,kCAAkC;IAC3B,KAAK,IAAI,IAAI;IASpB,kCAAkC;IAC3B,OAAO,IAAI,IAAI;IAStB,OAAO,CAAC,kBAAkB;IAgB1B,OAAO,CAAC,WAAW;IAiBnB,OAAO,CAAC,qBAAqB;
|
|
1
|
+
{"version":3,"file":"main_media_source_interface.d.ts","sourceRoot":"","sources":["../../../src/mse/main_media_source_interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAOzF,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAGlD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,2BAA2B,EAC3B,sBAAsB,EAEtB,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAIjB;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,wBACnB,SAAQ,YAAY,CAAC,2BAA2B,CAChD,YAAW,qBAAqB;IAEhC,iCAAiC;IAC1B,EAAE,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACI,MAAM,EAAE,kBAAkB,CAAC;IAClC,iCAAiC;IAC1B,aAAa,EAAE,yBAAyB,EAAE,CAAC;IAClD,iCAAiC;IAC1B,UAAU,EAAE,UAAU,CAAC;IAC9B,6EAA6E;IAC7E,OAAO,CAAC,YAAY,CAAe;IACnC;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAA6B;IACrD;;;;OAIG;IACH,OAAO,CAAC,qBAAqB,CAAuB;IACpD;;;OAGG;IACH,OAAO,CAAC,UAAU,CAAgB;IAElC;;;;;;OAMG;gBACS,EAAE,EAAE,MAAM;IAkDtB,iCAAiC;IAC1B,eAAe,CACpB,MAAM,EAAE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
|
336
336
|
op.reject(error);
|
|
337
337
|
});
|
|
338
338
|
this._currentOperations = [];
|
|
339
|
+
// A synchronous error probably will not lead to updateend event, so we need to
|
|
340
|
+
// go to next queue element manually
|
|
341
|
+
//
|
|
342
|
+
// FIXME: This here is needed to ensure that we're not left with a
|
|
343
|
+
// dangling queue of operations.
|
|
344
|
+
// However it can potentially be counter-productive if e.g. the `appendBuffer`
|
|
345
|
+
// error was due to a full buffer and if there are pushing operations awaiting in
|
|
346
|
+
// the queue.
|
|
347
|
+
//
|
|
348
|
+
// A better solution might just be to reject all push operations right away here?
|
|
349
|
+
// Only for a `QuotaExceededError` (to check MSE)?
|
|
350
|
+
// However this is too disruptive for what is now a hotfix
|
|
351
|
+
this._performNextOperation();
|
|
339
352
|
}
|
|
340
353
|
}
|
|
341
354
|
else {
|
|
@@ -351,7 +364,13 @@ export class MainSourceBufferInterface {
|
|
|
351
364
|
? new SourceBufferError(err.name, err.message, false)
|
|
352
365
|
: new SourceBufferError("Error", "Unknown SourceBuffer Error during remove", false);
|
|
353
366
|
nextElem.reject(error);
|
|
367
|
+
this._currentOperations.forEach((op) => {
|
|
368
|
+
op.reject(error);
|
|
369
|
+
});
|
|
354
370
|
this._currentOperations = [];
|
|
371
|
+
// A synchronous error probably will not lead to updateend event, so we need to
|
|
372
|
+
// go to next queue element manually
|
|
373
|
+
this._performNextOperation();
|
|
355
374
|
}
|
|
356
375
|
}
|
|
357
376
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipelines.d.ts","sourceRoot":"","sources":["../../../../src/transports/smooth/pipelines.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,OAAO,KAAK,EAeV,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAUlB,MAAM,CAAC,OAAO,WAAW,gBAAgB,EAAE,iBAAiB,GAAG,mBAAmB,
|
|
1
|
+
{"version":3,"file":"pipelines.d.ts","sourceRoot":"","sources":["../../../../src/transports/smooth/pipelines.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,OAAO,KAAK,EAeV,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAUlB,MAAM,CAAC,OAAO,WAAW,gBAAgB,EAAE,iBAAiB,GAAG,mBAAmB,CA4XjF"}
|
|
@@ -251,6 +251,7 @@ export default function (transportOptions) {
|
|
|
251
251
|
const lcCodec = codecs.toLowerCase();
|
|
252
252
|
if (mimeType === "application/ttml+xml+mp4" ||
|
|
253
253
|
lcCodec === "stpp" ||
|
|
254
|
+
lcCodec === "stpp.ttml" ||
|
|
254
255
|
lcCodec === "stpp.ttml.im1t") {
|
|
255
256
|
_sdType = "ttml";
|
|
256
257
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse_text_track.d.ts","sourceRoot":"","sources":["../../../../src/transports/utils/parse_text_track.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEvF;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAG1E;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"parse_text_track.d.ts","sourceRoot":"","sources":["../../../../src/transports/utils/parse_text_track.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEvF;;;;GAIG;AACH,wBAAgB,2BAA2B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AC,CAAC,CAAC;IAS3C;;;;OAIG;gBACS,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"sync_or_async.d.ts","sourceRoot":"","sources":["../../../src/utils/sync_or_async.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC;;;OAGG;IACH,SAAS,EAAE,CAAC,GAAG,IAAI,CAAC;IACpB;;;;OAIG;IACH,eAAe,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;CAC/B;AAED,QAAA,MAAM,WAAW;IACf;;;;OAIG;eACQ,CAAC,OAAO,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC;IAS3C;;;;OAIG;gBACS,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC;CActD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
package/dist/mpd-parser.wasm
CHANGED
|
Binary file
|
package/dist/rx-player.js
CHANGED
|
@@ -8762,6 +8762,9 @@
|
|
|
8762
8762
|
const session = mediaKeys.createSession();
|
|
8763
8763
|
const initData = generatePlayReadyInitData(DUMMY_PLAY_READY_HEADER);
|
|
8764
8764
|
await session.generateRequest("cenc", initData);
|
|
8765
|
+
session.close().catch(() => {
|
|
8766
|
+
log_default.warn("DRM: Failed to close the dummy session");
|
|
8767
|
+
});
|
|
8765
8768
|
} catch (err) {
|
|
8766
8769
|
log_default.debug("DRM: KeySystemAccess was granted but it is not usable");
|
|
8767
8770
|
throw err;
|
|
@@ -17099,6 +17102,11 @@
|
|
|
17099
17102
|
segmentQueue,
|
|
17100
17103
|
terminate
|
|
17101
17104
|
}, callbacks, parentCancelSignal) {
|
|
17105
|
+
log_default.debug(
|
|
17106
|
+
"Stream: Creating RepresentationStream",
|
|
17107
|
+
content.adaptation.type,
|
|
17108
|
+
content.representation.bitrate
|
|
17109
|
+
);
|
|
17102
17110
|
const { period, adaptation, representation } = content;
|
|
17103
17111
|
const { bufferGoal, maxBufferSize, drmSystemId, fastSwitchThreshold } = options;
|
|
17104
17112
|
const bufferType = adaptation.type;
|
|
@@ -17389,6 +17397,12 @@
|
|
|
17389
17397
|
if (globalCanceller.isUsed() && err instanceof CancellationError) {
|
|
17390
17398
|
return;
|
|
17391
17399
|
}
|
|
17400
|
+
log_default.warn(
|
|
17401
|
+
"Stream: Received fatal buffer error",
|
|
17402
|
+
adaptation.type,
|
|
17403
|
+
representation.bitrate,
|
|
17404
|
+
err instanceof Error ? err : null
|
|
17405
|
+
);
|
|
17392
17406
|
globalCanceller.cancel();
|
|
17393
17407
|
callbacks.error(err);
|
|
17394
17408
|
}
|
|
@@ -17677,6 +17691,7 @@
|
|
|
17677
17691
|
);
|
|
17678
17692
|
}
|
|
17679
17693
|
function createRepresentationStream(representation, terminateCurrentStream, representationStreamCallbacks, fnCancelSignal) {
|
|
17694
|
+
let hasEncounteredError = false;
|
|
17680
17695
|
const bufferGoalCanceller = new TaskCanceller();
|
|
17681
17696
|
bufferGoalCanceller.linkToSignal(fnCancelSignal);
|
|
17682
17697
|
const bufferGoal = createMappedReference(
|
|
@@ -17696,6 +17711,11 @@
|
|
|
17696
17711
|
const updatedCallbacks = object_assign_default({}, representationStreamCallbacks, {
|
|
17697
17712
|
error(err) {
|
|
17698
17713
|
var _a;
|
|
17714
|
+
if (hasEncounteredError) {
|
|
17715
|
+
log_default.warn("Stream: Ignoring RepresentationStream error", err);
|
|
17716
|
+
return;
|
|
17717
|
+
}
|
|
17718
|
+
hasEncounteredError = true;
|
|
17699
17719
|
const formattedError = formatError(err, {
|
|
17700
17720
|
defaultCode: "NONE",
|
|
17701
17721
|
defaultReason: "Unknown `RepresentationStream` error"
|
|
@@ -17703,6 +17723,11 @@
|
|
|
17703
17723
|
if (formattedError.code !== "BUFFER_FULL_ERROR") {
|
|
17704
17724
|
representationStreamCallbacks.error(err);
|
|
17705
17725
|
} else {
|
|
17726
|
+
log_default.warn(
|
|
17727
|
+
"Stream: received BUFFER_FULL_ERROR",
|
|
17728
|
+
adaptation.type,
|
|
17729
|
+
representation.bitrate
|
|
17730
|
+
);
|
|
17706
17731
|
const wba = wantedBufferAhead.getValue();
|
|
17707
17732
|
const lastBufferGoalRatio = (_a = bufferGoalRatioMap.get(representation.id)) != null ? _a : 1;
|
|
17708
17733
|
const newBufferGoalRatio = lastBufferGoalRatio * 0.7;
|
|
@@ -18692,7 +18717,9 @@
|
|
|
18692
18717
|
ret = resolved;
|
|
18693
18718
|
}, noop_default);
|
|
18694
18719
|
return {
|
|
18695
|
-
syncValue
|
|
18720
|
+
get syncValue() {
|
|
18721
|
+
return ret;
|
|
18722
|
+
},
|
|
18696
18723
|
getValueAsAsync() {
|
|
18697
18724
|
return val;
|
|
18698
18725
|
}
|
|
@@ -19459,6 +19486,7 @@
|
|
|
19459
19486
|
op.reject(error);
|
|
19460
19487
|
});
|
|
19461
19488
|
this._currentOperations = [];
|
|
19489
|
+
this._performNextOperation();
|
|
19462
19490
|
}
|
|
19463
19491
|
} else {
|
|
19464
19492
|
this._currentOperations = [nextElem];
|
|
@@ -19473,7 +19501,11 @@
|
|
|
19473
19501
|
false
|
|
19474
19502
|
);
|
|
19475
19503
|
nextElem.reject(error);
|
|
19504
|
+
this._currentOperations.forEach((op) => {
|
|
19505
|
+
op.reject(error);
|
|
19506
|
+
});
|
|
19476
19507
|
this._currentOperations = [];
|
|
19508
|
+
this._performNextOperation();
|
|
19477
19509
|
}
|
|
19478
19510
|
}
|
|
19479
19511
|
}
|
|
@@ -19844,17 +19876,20 @@
|
|
|
19844
19876
|
};
|
|
19845
19877
|
if (!isDirectfile || typeof startTime === "number") {
|
|
19846
19878
|
const initiallySeekedTime = typeof startTime === "number" ? startTime : startTime();
|
|
19847
|
-
if (initiallySeekedTime !== 0) {
|
|
19879
|
+
if (initiallySeekedTime !== 0 && initiallySeekedTime !== void 0) {
|
|
19848
19880
|
performInitialSeek(initiallySeekedTime);
|
|
19849
19881
|
}
|
|
19850
19882
|
waitForSeekable();
|
|
19851
19883
|
} else {
|
|
19852
19884
|
playbackObserver.listen(
|
|
19853
19885
|
(obs, stopListening) => {
|
|
19886
|
+
const initiallySeekedTime = typeof startTime === "number" ? startTime : startTime();
|
|
19887
|
+
if (initiallySeekedTime === void 0 && obs.readyState < HTMLMediaElement.HAVE_CURRENT_DATA) {
|
|
19888
|
+
return;
|
|
19889
|
+
}
|
|
19854
19890
|
if (obs.readyState >= 1) {
|
|
19855
19891
|
stopListening();
|
|
19856
|
-
|
|
19857
|
-
if (initiallySeekedTime !== 0) {
|
|
19892
|
+
if (initiallySeekedTime !== 0 && initiallySeekedTime !== void 0) {
|
|
19858
19893
|
if (can_seek_directly_after_loaded_metadata_default) {
|
|
19859
19894
|
performInitialSeek(initiallySeekedTime);
|
|
19860
19895
|
} else {
|
|
@@ -20721,7 +20756,7 @@
|
|
|
20721
20756
|
*/
|
|
20722
20757
|
constructor(settings) {
|
|
20723
20758
|
super();
|
|
20724
|
-
this.
|
|
20759
|
+
this._initSettings = settings;
|
|
20725
20760
|
this._initCanceller = new TaskCanceller();
|
|
20726
20761
|
this._manifest = null;
|
|
20727
20762
|
this._decryptionCapabilities = { status: "uninitialized", value: null };
|
|
@@ -20796,6 +20831,10 @@
|
|
|
20796
20831
|
dispose() {
|
|
20797
20832
|
this._initCanceller.cancel();
|
|
20798
20833
|
}
|
|
20834
|
+
/**
|
|
20835
|
+
* Callback called when an error interrupting playback arised.
|
|
20836
|
+
* @param {*} err
|
|
20837
|
+
*/
|
|
20799
20838
|
_onFatalError(err) {
|
|
20800
20839
|
if (this._initCanceller.isUsed()) {
|
|
20801
20840
|
return;
|
|
@@ -20803,10 +20842,16 @@
|
|
|
20803
20842
|
this._initCanceller.cancel();
|
|
20804
20843
|
this.trigger("error", err);
|
|
20805
20844
|
}
|
|
20845
|
+
/**
|
|
20846
|
+
* Initialize decryption mechanisms if needed and begin creating and relying
|
|
20847
|
+
* on the initial `MediaSourceInterface` for this content.
|
|
20848
|
+
* @param {HTMLMediaElement|null} mediaElement
|
|
20849
|
+
* @returns {Promise.<Object>}
|
|
20850
|
+
*/
|
|
20806
20851
|
_initializeMediaSourceAndDecryption(mediaElement) {
|
|
20807
20852
|
const initCanceller = this._initCanceller;
|
|
20808
20853
|
return createCancellablePromise(initCanceller.signal, (resolve) => {
|
|
20809
|
-
const { keySystems } = this.
|
|
20854
|
+
const { keySystems } = this._initSettings;
|
|
20810
20855
|
const { statusRef: drmInitRef, contentDecryptor } = initializeContentDecryption(
|
|
20811
20856
|
mediaElement,
|
|
20812
20857
|
keySystems,
|
|
@@ -20923,7 +20968,7 @@
|
|
|
20923
20968
|
startAt,
|
|
20924
20969
|
textTrackOptions,
|
|
20925
20970
|
transport
|
|
20926
|
-
} = this.
|
|
20971
|
+
} = this._initSettings;
|
|
20927
20972
|
const initCanceller = this._initCanceller;
|
|
20928
20973
|
assert(this._manifest !== null);
|
|
20929
20974
|
let manifest;
|
|
@@ -21052,15 +21097,10 @@
|
|
|
21052
21097
|
return this._onFatalError(error);
|
|
21053
21098
|
}
|
|
21054
21099
|
let textDisplayerInterface = null;
|
|
21055
|
-
|
|
21056
|
-
|
|
21057
|
-
|
|
21058
|
-
|
|
21059
|
-
this._settings.textTrackOptions.textTrackElement
|
|
21060
|
-
);
|
|
21061
|
-
} else if (features_default.nativeTextDisplayer !== null) {
|
|
21062
|
-
textDisplayer = new features_default.nativeTextDisplayer(mediaElement);
|
|
21063
|
-
}
|
|
21100
|
+
const textDisplayer = createTextDisplayer(
|
|
21101
|
+
mediaElement,
|
|
21102
|
+
this._initSettings.textTrackOptions
|
|
21103
|
+
);
|
|
21064
21104
|
if (textDisplayer !== null) {
|
|
21065
21105
|
const sender = new MainThreadTextDisplayerInterface(textDisplayer);
|
|
21066
21106
|
textDisplayerInterface = sender;
|
|
@@ -21499,6 +21539,17 @@
|
|
|
21499
21539
|
}
|
|
21500
21540
|
}
|
|
21501
21541
|
};
|
|
21542
|
+
function createTextDisplayer(mediaElement, textTrackOptions) {
|
|
21543
|
+
if (textTrackOptions.textTrackMode === "html" && features_default.htmlTextDisplayer !== null) {
|
|
21544
|
+
return new features_default.htmlTextDisplayer(
|
|
21545
|
+
mediaElement,
|
|
21546
|
+
textTrackOptions.textTrackElement
|
|
21547
|
+
);
|
|
21548
|
+
} else if (features_default.nativeTextDisplayer !== null) {
|
|
21549
|
+
return new features_default.nativeTextDisplayer(mediaElement);
|
|
21550
|
+
}
|
|
21551
|
+
return null;
|
|
21552
|
+
}
|
|
21502
21553
|
function updateKeyIdsDecipherabilityOnManifest(manifest, whitelistedKeyIds, blacklistedKeyIds, delistedKeyIds) {
|
|
21503
21554
|
manifest.updateRepresentationsDeciperability((ctx) => {
|
|
21504
21555
|
const { representation } = ctx;
|
|
@@ -28005,6 +28056,7 @@
|
|
|
28005
28056
|
switch (codecs.toLowerCase()) {
|
|
28006
28057
|
case "stpp":
|
|
28007
28058
|
// stpp === TTML in MP4
|
|
28059
|
+
case "stpp.ttml":
|
|
28008
28060
|
case "stpp.ttml.im1t":
|
|
28009
28061
|
return "ttml";
|
|
28010
28062
|
case "wvtt":
|
|
@@ -28428,25 +28480,33 @@
|
|
|
28428
28480
|
}
|
|
28429
28481
|
const duration = mediaElement.duration;
|
|
28430
28482
|
if (typeof startAt.fromLastPosition === "number") {
|
|
28431
|
-
if (isNullOrUndefined(duration)
|
|
28432
|
-
|
|
28433
|
-
|
|
28434
|
-
|
|
28435
|
-
|
|
28483
|
+
if (!isNullOrUndefined(duration) && isFinite(duration)) {
|
|
28484
|
+
return Math.max(0, duration + startAt.fromLastPosition);
|
|
28485
|
+
}
|
|
28486
|
+
if (mediaElement.seekable.length > 0) {
|
|
28487
|
+
const lastSegmentEnd = mediaElement.seekable.end(mediaElement.seekable.length - 1);
|
|
28488
|
+
if (isFinite(lastSegmentEnd)) {
|
|
28489
|
+
return Math.max(0, lastSegmentEnd + startAt.fromLastPosition);
|
|
28490
|
+
}
|
|
28436
28491
|
}
|
|
28437
|
-
|
|
28492
|
+
log_default.warn(
|
|
28493
|
+
"Init: startAt.fromLastPosition set but no known duration, it may be too soon to seek"
|
|
28494
|
+
);
|
|
28495
|
+
return void 0;
|
|
28438
28496
|
} else if (typeof startAt.fromLivePosition === "number") {
|
|
28439
28497
|
const livePosition = mediaElement.seekable.length > 0 ? mediaElement.seekable.end(0) : duration;
|
|
28440
28498
|
if (isNullOrUndefined(livePosition)) {
|
|
28441
28499
|
log_default.warn(
|
|
28442
|
-
"startAt.fromLivePosition set but no known live position, beginning at 0."
|
|
28500
|
+
"Init: startAt.fromLivePosition set but no known live position, beginning at 0."
|
|
28443
28501
|
);
|
|
28444
28502
|
return 0;
|
|
28445
28503
|
}
|
|
28446
28504
|
return Math.max(0, livePosition + startAt.fromLivePosition);
|
|
28447
28505
|
} else if (!isNullOrUndefined(startAt.percentage)) {
|
|
28448
28506
|
if (isNullOrUndefined(duration) || !isFinite(duration)) {
|
|
28449
|
-
log_default.warn(
|
|
28507
|
+
log_default.warn(
|
|
28508
|
+
"Init: startAt.percentage set but no known duration, beginning at 0."
|
|
28509
|
+
);
|
|
28450
28510
|
return 0;
|
|
28451
28511
|
}
|
|
28452
28512
|
const { percentage } = startAt;
|
|
@@ -31836,20 +31896,7 @@
|
|
|
31836
31896
|
reset() {
|
|
31837
31897
|
log_default.debug("NTD: Aborting NativeTextDisplayer");
|
|
31838
31898
|
this._removeData(0, Infinity);
|
|
31839
|
-
|
|
31840
|
-
if (_trackElement !== void 0 && _videoElement.hasChildNodes()) {
|
|
31841
|
-
try {
|
|
31842
|
-
_videoElement.removeChild(_trackElement);
|
|
31843
|
-
} catch (_e) {
|
|
31844
|
-
log_default.warn("NTD: Can't remove track element from the video");
|
|
31845
|
-
}
|
|
31846
|
-
}
|
|
31847
|
-
const oldMode = this._track.mode;
|
|
31848
|
-
this._track.mode = "disabled";
|
|
31849
|
-
this._track.mode = oldMode;
|
|
31850
|
-
if (this._trackElement !== void 0) {
|
|
31851
|
-
this._trackElement.innerHTML = "";
|
|
31852
|
-
}
|
|
31899
|
+
this._clearTrackElement();
|
|
31853
31900
|
}
|
|
31854
31901
|
stop() {
|
|
31855
31902
|
log_default.debug("NTD: Aborting NativeTextDisplayer");
|
|
@@ -31882,6 +31929,22 @@
|
|
|
31882
31929
|
}
|
|
31883
31930
|
this._buffered.remove(start, end);
|
|
31884
31931
|
}
|
|
31932
|
+
_clearTrackElement() {
|
|
31933
|
+
const { _trackElement, _videoElement } = this;
|
|
31934
|
+
if (_trackElement !== void 0 && _videoElement.hasChildNodes()) {
|
|
31935
|
+
try {
|
|
31936
|
+
_videoElement.removeChild(_trackElement);
|
|
31937
|
+
} catch (_e) {
|
|
31938
|
+
log_default.warn("NTD: Can't remove track element from the video");
|
|
31939
|
+
}
|
|
31940
|
+
}
|
|
31941
|
+
const oldMode = this._track.mode;
|
|
31942
|
+
this._track.mode = "disabled";
|
|
31943
|
+
this._track.mode = oldMode;
|
|
31944
|
+
if (this._trackElement !== void 0) {
|
|
31945
|
+
this._trackElement.innerHTML = "";
|
|
31946
|
+
}
|
|
31947
|
+
}
|
|
31885
31948
|
};
|
|
31886
31949
|
if (define_ENVIRONMENT_default.CURRENT_ENV === define_ENVIRONMENT_default.DEV) {
|
|
31887
31950
|
let _checkType = function(input) {
|
|
@@ -34482,7 +34545,7 @@
|
|
|
34482
34545
|
segmentEnd = chunkInfos.duration !== void 0 ? chunkInfos.time + chunkInfos.duration : segment.end;
|
|
34483
34546
|
}
|
|
34484
34547
|
const lcCodec = codecs.toLowerCase();
|
|
34485
|
-
if (mimeType === "application/ttml+xml+mp4" || lcCodec === "stpp" || lcCodec === "stpp.ttml.im1t") {
|
|
34548
|
+
if (mimeType === "application/ttml+xml+mp4" || lcCodec === "stpp" || lcCodec === "stpp.ttml" || lcCodec === "stpp.ttml.im1t") {
|
|
34486
34549
|
_sdType = "ttml";
|
|
34487
34550
|
} else if (lcCodec === "wvtt") {
|
|
34488
34551
|
_sdType = "vtt";
|
|
@@ -36872,7 +36935,7 @@ ${event}`
|
|
|
36872
36935
|
} = parseConstructorOptions(options);
|
|
36873
36936
|
videoElement.preload = "auto";
|
|
36874
36937
|
this.version = /* PLAYER_VERSION */
|
|
36875
|
-
"4.2.0-dev.
|
|
36938
|
+
"4.2.0-dev.2024101500";
|
|
36876
36939
|
this.log = log_default;
|
|
36877
36940
|
this.state = "STOPPED";
|
|
36878
36941
|
this.videoElement = videoElement;
|
|
@@ -39413,7 +39476,7 @@ ${event}`
|
|
|
39413
39476
|
_Player._priv_currentlyUsedVideoElements = /* @__PURE__ */ new WeakSet();
|
|
39414
39477
|
var Player = _Player;
|
|
39415
39478
|
Player.version = /* PLAYER_VERSION */
|
|
39416
|
-
"4.2.0-dev.
|
|
39479
|
+
"4.2.0-dev.2024101500";
|
|
39417
39480
|
var public_api_default = Player;
|
|
39418
39481
|
|
|
39419
39482
|
// src/main_thread/api/index.ts
|