rx-player 4.2.0-dev.2024092400 → 4.2.0-dev.2024100200
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 +10 -3
- 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/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/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/main_thread/api/public_api.js +2 -2
- 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/multi_thread_content_initializer.d.ts +13 -0
- 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 +94 -45
- 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/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/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/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/main_thread/api/public_api.js +2 -2
- 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/multi_thread_content_initializer.d.ts +13 -0
- 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 +78 -41
- 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/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/rx-player.js +53 -14
- package/dist/rx-player.min.js +8 -8
- package/dist/worker.js +5 -5
- package/package.json +19 -7
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/core/main/worker/worker_main.ts +3 -0
- package/src/core/stream/adaptation/adaptation_stream.ts +23 -1
- package/src/core/stream/representation/representation_stream.ts +11 -0
- package/src/main_thread/api/public_api.ts +2 -2
- package/src/main_thread/init/directfile_content_initializer.ts +20 -10
- package/src/main_thread/init/multi_thread_content_initializer.ts +94 -43
- package/src/main_thread/init/utils/initial_seek_and_play.ts +24 -5
- 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/dist/rx-player.js
CHANGED
|
@@ -17099,6 +17099,11 @@
|
|
|
17099
17099
|
segmentQueue,
|
|
17100
17100
|
terminate
|
|
17101
17101
|
}, callbacks, parentCancelSignal) {
|
|
17102
|
+
log_default.debug(
|
|
17103
|
+
"Stream: Creating RepresentationStream",
|
|
17104
|
+
content.adaptation.type,
|
|
17105
|
+
content.representation.bitrate
|
|
17106
|
+
);
|
|
17102
17107
|
const { period, adaptation, representation } = content;
|
|
17103
17108
|
const { bufferGoal, maxBufferSize, drmSystemId, fastSwitchThreshold } = options;
|
|
17104
17109
|
const bufferType = adaptation.type;
|
|
@@ -17389,6 +17394,12 @@
|
|
|
17389
17394
|
if (globalCanceller.isUsed() && err instanceof CancellationError) {
|
|
17390
17395
|
return;
|
|
17391
17396
|
}
|
|
17397
|
+
log_default.warn(
|
|
17398
|
+
"Stream: Received fatal buffer error",
|
|
17399
|
+
adaptation.type,
|
|
17400
|
+
representation.bitrate,
|
|
17401
|
+
err instanceof Error ? err : null
|
|
17402
|
+
);
|
|
17392
17403
|
globalCanceller.cancel();
|
|
17393
17404
|
callbacks.error(err);
|
|
17394
17405
|
}
|
|
@@ -17677,6 +17688,7 @@
|
|
|
17677
17688
|
);
|
|
17678
17689
|
}
|
|
17679
17690
|
function createRepresentationStream(representation, terminateCurrentStream, representationStreamCallbacks, fnCancelSignal) {
|
|
17691
|
+
let hasEncounteredError = false;
|
|
17680
17692
|
const bufferGoalCanceller = new TaskCanceller();
|
|
17681
17693
|
bufferGoalCanceller.linkToSignal(fnCancelSignal);
|
|
17682
17694
|
const bufferGoal = createMappedReference(
|
|
@@ -17696,6 +17708,11 @@
|
|
|
17696
17708
|
const updatedCallbacks = object_assign_default({}, representationStreamCallbacks, {
|
|
17697
17709
|
error(err) {
|
|
17698
17710
|
var _a;
|
|
17711
|
+
if (hasEncounteredError) {
|
|
17712
|
+
log_default.warn("Stream: Ignoring RepresentationStream error", err);
|
|
17713
|
+
return;
|
|
17714
|
+
}
|
|
17715
|
+
hasEncounteredError = true;
|
|
17699
17716
|
const formattedError = formatError(err, {
|
|
17700
17717
|
defaultCode: "NONE",
|
|
17701
17718
|
defaultReason: "Unknown `RepresentationStream` error"
|
|
@@ -17703,6 +17720,11 @@
|
|
|
17703
17720
|
if (formattedError.code !== "BUFFER_FULL_ERROR") {
|
|
17704
17721
|
representationStreamCallbacks.error(err);
|
|
17705
17722
|
} else {
|
|
17723
|
+
log_default.warn(
|
|
17724
|
+
"Stream: received BUFFER_FULL_ERROR",
|
|
17725
|
+
adaptation.type,
|
|
17726
|
+
representation.bitrate
|
|
17727
|
+
);
|
|
17706
17728
|
const wba = wantedBufferAhead.getValue();
|
|
17707
17729
|
const lastBufferGoalRatio = (_a = bufferGoalRatioMap.get(representation.id)) != null ? _a : 1;
|
|
17708
17730
|
const newBufferGoalRatio = lastBufferGoalRatio * 0.7;
|
|
@@ -19459,6 +19481,7 @@
|
|
|
19459
19481
|
op.reject(error);
|
|
19460
19482
|
});
|
|
19461
19483
|
this._currentOperations = [];
|
|
19484
|
+
this._performNextOperation();
|
|
19462
19485
|
}
|
|
19463
19486
|
} else {
|
|
19464
19487
|
this._currentOperations = [nextElem];
|
|
@@ -19473,7 +19496,11 @@
|
|
|
19473
19496
|
false
|
|
19474
19497
|
);
|
|
19475
19498
|
nextElem.reject(error);
|
|
19499
|
+
this._currentOperations.forEach((op) => {
|
|
19500
|
+
op.reject(error);
|
|
19501
|
+
});
|
|
19476
19502
|
this._currentOperations = [];
|
|
19503
|
+
this._performNextOperation();
|
|
19477
19504
|
}
|
|
19478
19505
|
}
|
|
19479
19506
|
}
|
|
@@ -19844,17 +19871,20 @@
|
|
|
19844
19871
|
};
|
|
19845
19872
|
if (!isDirectfile || typeof startTime === "number") {
|
|
19846
19873
|
const initiallySeekedTime = typeof startTime === "number" ? startTime : startTime();
|
|
19847
|
-
if (initiallySeekedTime !== 0) {
|
|
19874
|
+
if (initiallySeekedTime !== 0 && initiallySeekedTime !== void 0) {
|
|
19848
19875
|
performInitialSeek(initiallySeekedTime);
|
|
19849
19876
|
}
|
|
19850
19877
|
waitForSeekable();
|
|
19851
19878
|
} else {
|
|
19852
19879
|
playbackObserver.listen(
|
|
19853
19880
|
(obs, stopListening) => {
|
|
19881
|
+
const initiallySeekedTime = typeof startTime === "number" ? startTime : startTime();
|
|
19882
|
+
if (initiallySeekedTime === void 0 && obs.readyState < HTMLMediaElement.HAVE_CURRENT_DATA) {
|
|
19883
|
+
return;
|
|
19884
|
+
}
|
|
19854
19885
|
if (obs.readyState >= 1) {
|
|
19855
19886
|
stopListening();
|
|
19856
|
-
|
|
19857
|
-
if (initiallySeekedTime !== 0) {
|
|
19887
|
+
if (initiallySeekedTime !== 0 && initiallySeekedTime !== void 0) {
|
|
19858
19888
|
if (can_seek_directly_after_loaded_metadata_default) {
|
|
19859
19889
|
performInitialSeek(initiallySeekedTime);
|
|
19860
19890
|
} else {
|
|
@@ -28005,6 +28035,7 @@
|
|
|
28005
28035
|
switch (codecs.toLowerCase()) {
|
|
28006
28036
|
case "stpp":
|
|
28007
28037
|
// stpp === TTML in MP4
|
|
28038
|
+
case "stpp.ttml":
|
|
28008
28039
|
case "stpp.ttml.im1t":
|
|
28009
28040
|
return "ttml";
|
|
28010
28041
|
case "wvtt":
|
|
@@ -28428,25 +28459,33 @@
|
|
|
28428
28459
|
}
|
|
28429
28460
|
const duration = mediaElement.duration;
|
|
28430
28461
|
if (typeof startAt.fromLastPosition === "number") {
|
|
28431
|
-
if (isNullOrUndefined(duration)
|
|
28432
|
-
|
|
28433
|
-
"startAt.fromLastPosition set but no known duration, beginning at 0."
|
|
28434
|
-
);
|
|
28435
|
-
return 0;
|
|
28462
|
+
if (!isNullOrUndefined(duration) && isFinite(duration)) {
|
|
28463
|
+
return Math.max(0, duration + startAt.fromLastPosition);
|
|
28436
28464
|
}
|
|
28437
|
-
|
|
28465
|
+
if (mediaElement.seekable.length > 0) {
|
|
28466
|
+
const lastSegmentEnd = mediaElement.seekable.end(mediaElement.seekable.length - 1);
|
|
28467
|
+
if (isFinite(lastSegmentEnd)) {
|
|
28468
|
+
return Math.max(0, lastSegmentEnd + startAt.fromLastPosition);
|
|
28469
|
+
}
|
|
28470
|
+
}
|
|
28471
|
+
log_default.warn(
|
|
28472
|
+
"Init: startAt.fromLastPosition set but no known duration, it may be too soon to seek"
|
|
28473
|
+
);
|
|
28474
|
+
return void 0;
|
|
28438
28475
|
} else if (typeof startAt.fromLivePosition === "number") {
|
|
28439
28476
|
const livePosition = mediaElement.seekable.length > 0 ? mediaElement.seekable.end(0) : duration;
|
|
28440
28477
|
if (isNullOrUndefined(livePosition)) {
|
|
28441
28478
|
log_default.warn(
|
|
28442
|
-
"startAt.fromLivePosition set but no known live position, beginning at 0."
|
|
28479
|
+
"Init: startAt.fromLivePosition set but no known live position, beginning at 0."
|
|
28443
28480
|
);
|
|
28444
28481
|
return 0;
|
|
28445
28482
|
}
|
|
28446
28483
|
return Math.max(0, livePosition + startAt.fromLivePosition);
|
|
28447
28484
|
} else if (!isNullOrUndefined(startAt.percentage)) {
|
|
28448
28485
|
if (isNullOrUndefined(duration) || !isFinite(duration)) {
|
|
28449
|
-
log_default.warn(
|
|
28486
|
+
log_default.warn(
|
|
28487
|
+
"Init: startAt.percentage set but no known duration, beginning at 0."
|
|
28488
|
+
);
|
|
28450
28489
|
return 0;
|
|
28451
28490
|
}
|
|
28452
28491
|
const { percentage } = startAt;
|
|
@@ -34482,7 +34521,7 @@
|
|
|
34482
34521
|
segmentEnd = chunkInfos.duration !== void 0 ? chunkInfos.time + chunkInfos.duration : segment.end;
|
|
34483
34522
|
}
|
|
34484
34523
|
const lcCodec = codecs.toLowerCase();
|
|
34485
|
-
if (mimeType === "application/ttml+xml+mp4" || lcCodec === "stpp" || lcCodec === "stpp.ttml.im1t") {
|
|
34524
|
+
if (mimeType === "application/ttml+xml+mp4" || lcCodec === "stpp" || lcCodec === "stpp.ttml" || lcCodec === "stpp.ttml.im1t") {
|
|
34486
34525
|
_sdType = "ttml";
|
|
34487
34526
|
} else if (lcCodec === "wvtt") {
|
|
34488
34527
|
_sdType = "vtt";
|
|
@@ -36872,7 +36911,7 @@ ${event}`
|
|
|
36872
36911
|
} = parseConstructorOptions(options);
|
|
36873
36912
|
videoElement.preload = "auto";
|
|
36874
36913
|
this.version = /* PLAYER_VERSION */
|
|
36875
|
-
"4.2.0-dev.
|
|
36914
|
+
"4.2.0-dev.2024100200";
|
|
36876
36915
|
this.log = log_default;
|
|
36877
36916
|
this.state = "STOPPED";
|
|
36878
36917
|
this.videoElement = videoElement;
|
|
@@ -39413,7 +39452,7 @@ ${event}`
|
|
|
39413
39452
|
_Player._priv_currentlyUsedVideoElements = /* @__PURE__ */ new WeakSet();
|
|
39414
39453
|
var Player = _Player;
|
|
39415
39454
|
Player.version = /* PLAYER_VERSION */
|
|
39416
|
-
"4.2.0-dev.
|
|
39455
|
+
"4.2.0-dev.2024100200";
|
|
39417
39456
|
var public_api_default = Player;
|
|
39418
39457
|
|
|
39419
39458
|
// src/main_thread/api/index.ts
|