rx-player 4.5.0-dev.2026021900 → 4.5.0-dev.2026031700
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 -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/cmcd/cmcd_data_builder.js +2 -2
- package/dist/commonjs/core/entry/content_preparer.d.ts +1 -6
- package/dist/commonjs/core/entry/content_preparer.d.ts.map +1 -1
- package/dist/commonjs/core/entry/content_preparer.js +2 -125
- package/dist/commonjs/core/entry/core_entry.d.ts +1 -1
- package/dist/commonjs/core/entry/core_entry.d.ts.map +1 -1
- package/dist/commonjs/core/entry/core_entry.js +2 -7
- package/dist/commonjs/core/entry/core_text_displayer_interface.d.ts.map +1 -1
- package/dist/commonjs/core/entry/core_text_displayer_interface.js +3 -1
- package/dist/commonjs/core/entry/index.d.ts +1 -1
- package/dist/commonjs/core/entry/index.d.ts.map +1 -1
- package/dist/commonjs/core/entry/utils.d.ts +64 -0
- package/dist/commonjs/core/entry/utils.d.ts.map +1 -1
- package/dist/commonjs/core/entry/utils.js +165 -0
- package/dist/commonjs/core/fetchers/segment/segment_queue.d.ts +5 -6
- package/dist/commonjs/core/fetchers/segment/segment_queue.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/thumbnails/thumbnail_fetcher.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/thumbnails/thumbnail_fetcher.js +34 -30
- package/dist/commonjs/experimental/features/worker/index.d.ts +2 -1
- package/dist/commonjs/experimental/features/worker/index.d.ts.map +1 -1
- package/dist/commonjs/experimental/features/worker/index.js +4 -3
- package/dist/commonjs/main_thread/api/public_api.js +3 -3
- package/dist/commonjs/parsers/texttracks/ttml/html/apply_line_height.d.ts.map +1 -1
- package/dist/commonjs/parsers/texttracks/ttml/html/apply_line_height.js +16 -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/cmcd/cmcd_data_builder.js +2 -2
- package/dist/es2017/core/entry/content_preparer.d.ts +1 -6
- package/dist/es2017/core/entry/content_preparer.d.ts.map +1 -1
- package/dist/es2017/core/entry/content_preparer.js +1 -76
- package/dist/es2017/core/entry/core_entry.d.ts +1 -1
- package/dist/es2017/core/entry/core_entry.d.ts.map +1 -1
- package/dist/es2017/core/entry/core_entry.js +2 -7
- package/dist/es2017/core/entry/core_text_displayer_interface.d.ts.map +1 -1
- package/dist/es2017/core/entry/core_text_displayer_interface.js +3 -1
- package/dist/es2017/core/entry/index.d.ts +1 -1
- package/dist/es2017/core/entry/index.d.ts.map +1 -1
- package/dist/es2017/core/entry/utils.d.ts +64 -0
- package/dist/es2017/core/entry/utils.d.ts.map +1 -1
- package/dist/es2017/core/entry/utils.js +98 -0
- package/dist/es2017/core/fetchers/segment/segment_queue.d.ts +5 -6
- package/dist/es2017/core/fetchers/segment/segment_queue.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/thumbnails/thumbnail_fetcher.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/thumbnails/thumbnail_fetcher.js +21 -16
- package/dist/es2017/experimental/features/worker/index.d.ts +2 -1
- package/dist/es2017/experimental/features/worker/index.d.ts.map +1 -1
- package/dist/es2017/experimental/features/worker/index.js +2 -3
- package/dist/es2017/main_thread/api/public_api.js +3 -3
- package/dist/es2017/parsers/texttracks/ttml/html/apply_line_height.d.ts.map +1 -1
- package/dist/es2017/parsers/texttracks/ttml/html/apply_line_height.js +16 -1
- package/dist/mpd-parser.wasm +0 -0
- package/dist/worker.js +8 -8
- package/package.json +19 -22
- package/src/__GENERATED_CODE/embedded_dash_wasm.ts +1 -1
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/core/adaptive/__tests__/adaptive_representation_selector.test.ts +734 -0
- package/src/core/adaptive/__tests__/guess_based_chooser.test.ts +5 -2
- package/src/core/adaptive/utils/__tests__/bandwidth_estimator.test.ts +117 -0
- package/src/core/adaptive/utils/__tests__/last_estimate_storage.test.ts +76 -0
- package/src/core/adaptive/utils/__tests__/pending_requests_store.test.ts +5 -2
- package/src/core/adaptive/utils/__tests__/representation_score_calculator.test.ts +4 -2
- package/src/core/cmcd/__tests__/cmcd_data_builder.test.ts +464 -0
- package/src/core/cmcd/cmcd_data_builder.ts +2 -2
- package/src/core/entry/__tests__/FreezeResolver.test.ts +1 -1
- package/src/core/entry/__tests__/content_time_boundaries_observer.test.ts +1 -2
- package/src/core/entry/__tests__/core_text_displayer_interface.test.ts +205 -0
- package/src/core/entry/__tests__/get_buffered_data_per_media_buffer.test.ts +95 -0
- package/src/core/entry/__tests__/track_choice_setter.test.ts +288 -0
- package/src/core/entry/__tests__/utils.test.ts +309 -0
- package/src/core/entry/content_preparer.ts +7 -118
- package/src/core/entry/core_entry.ts +7 -14
- package/src/core/entry/core_text_displayer_interface.ts +3 -1
- package/src/core/entry/index.ts +1 -1
- package/src/core/entry/utils.ts +151 -0
- package/src/core/fetchers/__tests__/cdn_prioritizer.test.ts +166 -0
- package/src/core/fetchers/manifest/__tests__/manifest_fetcher.test.ts +803 -0
- package/src/core/fetchers/segment/__tests__/segment_fetcher.test.ts +872 -0
- package/src/core/fetchers/segment/__tests__/segment_queue.test.ts +557 -0
- package/src/core/fetchers/segment/segment_queue.ts +5 -6
- package/src/core/fetchers/thumbnails/__tests__/thumbnail_fetcher.test.ts +435 -0
- package/src/core/fetchers/thumbnails/thumbnail_fetcher.ts +28 -20
- package/src/core/fetchers/utils/__tests__/schedule_request.test.ts +331 -0
- package/src/core/stream/adaptation/__tests__/get_representations_switch_strategy.test.ts +4 -3
- package/src/core/stream/representation/utils/__tests__/append_segment_to_buffer.test.ts +1 -1
- package/src/core/stream/representation/utils/__tests__/get_segment_priority.test.ts +1 -1
- package/src/core/stream/representation/utils/__tests__/push_init_segment.test.ts +1 -1
- package/src/core/stream/representation/utils/__tests__/push_media_segment.test.ts +1 -1
- package/src/experimental/features/worker/index.ts +2 -4
- package/src/main_thread/api/public_api.ts +3 -3
- package/src/mse/__tests__/main_media_source_interface.test.ts +846 -0
- package/src/parsers/texttracks/ttml/html/apply_line_height.ts +16 -1
- package/src/utils/__tests__/base64.test.ts +159 -191
|
@@ -82,9 +82,9 @@ cdnPrioritizer) {
|
|
|
82
82
|
*/
|
|
83
83
|
return function fetchThumbnail(thumbnailContext, cancellationSignal) {
|
|
84
84
|
return __awaiter(this, void 0, void 0, function () {
|
|
85
|
-
function
|
|
85
|
+
function fetchThumbnailStep() {
|
|
86
86
|
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
-
var res, err_3
|
|
87
|
+
var res, err_3;
|
|
88
88
|
return __generator(this, function (_a) {
|
|
89
89
|
switch (_a.label) {
|
|
90
90
|
case 0:
|
|
@@ -95,42 +95,37 @@ cdnPrioritizer) {
|
|
|
95
95
|
return [4 /*yield*/, (0, schedule_request_1.scheduleRequestWithCdns)(thumbnailTrack.cdnMetadata, cdnPrioritizer, callLoaderWithUrl, (0, object_assign_1.default)({ onRetry: onRetry }, requestOptions), requestCanceller.signal)];
|
|
96
96
|
case 2:
|
|
97
97
|
res = _a.sent();
|
|
98
|
-
if (cancellationSignal.isCancelled()) {
|
|
99
|
-
return [2 /*return*/, Promise.reject(cancellationSignal.cancellationError)];
|
|
100
|
-
}
|
|
101
98
|
log_1.default.debug("Thumbnails", "Thumbnail request ended with success", {
|
|
102
99
|
time: thumbnail.time,
|
|
103
100
|
});
|
|
104
|
-
|
|
105
|
-
return [3 /*break*/, 4];
|
|
101
|
+
return [2 /*return*/, res];
|
|
106
102
|
case 3:
|
|
107
103
|
err_3 = _a.sent();
|
|
108
|
-
cancellationSignal.deregister(onCancellation);
|
|
109
104
|
if (err_3 instanceof task_canceller_1.CancellationError) {
|
|
110
105
|
log_1.default.debug("Thumbnails", "Thumbnail request aborted", { time: thumbnail.time });
|
|
111
106
|
throw err_3;
|
|
112
107
|
}
|
|
113
108
|
log_1.default.debug("Thumbnails", "Thumbnail request failed", { time: thumbnail.time });
|
|
114
109
|
throw (0, error_selector_1.default)(err_3);
|
|
115
|
-
case 4:
|
|
116
|
-
try {
|
|
117
|
-
parsed = pipeline.parseThumbnail(res.responseData, {
|
|
118
|
-
thumbnail: thumbnail,
|
|
119
|
-
thumbnailTrack: thumbnailTrack,
|
|
120
|
-
});
|
|
121
|
-
return [2 /*return*/, parsed];
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
throw (0, errors_1.formatError)(error, {
|
|
125
|
-
defaultCode: "PIPELINE_PARSE_ERROR",
|
|
126
|
-
defaultReason: "Unknown parsing error",
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
return [2 /*return*/];
|
|
110
|
+
case 4: return [2 /*return*/];
|
|
130
111
|
}
|
|
131
112
|
});
|
|
132
113
|
});
|
|
133
114
|
}
|
|
115
|
+
function parseThumbnailStep(rawResponse) {
|
|
116
|
+
try {
|
|
117
|
+
return pipeline.parseThumbnail(rawResponse.responseData, {
|
|
118
|
+
thumbnail: thumbnail,
|
|
119
|
+
thumbnailTrack: thumbnailTrack,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
throw (0, errors_1.formatError)(error, {
|
|
124
|
+
defaultCode: "PIPELINE_PARSE_ERROR",
|
|
125
|
+
defaultReason: "Unknown parsing error",
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
134
129
|
function onCancellation() {
|
|
135
130
|
log_1.default.debug("Thumbnails", "Thumbnail request cancelled", { time: thumbnail.time });
|
|
136
131
|
var requestIdx = pendingRequestsInfo.indexOf(currRequestInfo);
|
|
@@ -161,11 +156,12 @@ cdnPrioritizer) {
|
|
|
161
156
|
time: thumbnail.time,
|
|
162
157
|
}, formattedErr);
|
|
163
158
|
}
|
|
164
|
-
var currRequestInfo, pendingInfo, response, err_1,
|
|
159
|
+
var thumbnail, thumbnailTrack, currRequestInfo, pendingInfo, response, err_1, requestOptions, connectionTimeout, pipelineRequestOptions, requestCanceller, fetchPromise, clearRequestInfo, fetchResult, err_2;
|
|
165
160
|
return __generator(this, function (_a) {
|
|
166
161
|
switch (_a.label) {
|
|
167
162
|
case 0:
|
|
168
163
|
cancellationSignal.register(onCancellation);
|
|
164
|
+
thumbnail = thumbnailContext.segment, thumbnailTrack = thumbnailContext.track;
|
|
169
165
|
pendingInfo = (0, array_find_1.default)(pendingRequestsInfo, function (_a) {
|
|
170
166
|
var pCtxt = _a.thumbnailContext;
|
|
171
167
|
return (pCtxt.period.id === thumbnailContext.period.id &&
|
|
@@ -192,9 +188,11 @@ cdnPrioritizer) {
|
|
|
192
188
|
throw err_1;
|
|
193
189
|
case 4:
|
|
194
190
|
cancellationSignal.deregister(onCancellation);
|
|
195
|
-
|
|
191
|
+
if (cancellationSignal.isCancelled()) {
|
|
192
|
+
throw cancellationSignal.cancellationError;
|
|
193
|
+
}
|
|
194
|
+
return [2 /*return*/, parseThumbnailStep(response)];
|
|
196
195
|
case 5:
|
|
197
|
-
thumbnail = thumbnailContext.segment, thumbnailTrack = thumbnailContext.track;
|
|
198
196
|
requestOptions = getThumbnailFetcherRequestOptions({});
|
|
199
197
|
if (requestOptions.connectionTimeout === undefined ||
|
|
200
198
|
requestOptions.connectionTimeout < 0) {
|
|
@@ -209,7 +207,7 @@ cdnPrioritizer) {
|
|
|
209
207
|
cmcdPayload: undefined,
|
|
210
208
|
};
|
|
211
209
|
requestCanceller = new task_canceller_1.default("Thumbnail request");
|
|
212
|
-
fetchPromise =
|
|
210
|
+
fetchPromise = fetchThumbnailStep();
|
|
213
211
|
currRequestInfo = {
|
|
214
212
|
thumbnailContext: thumbnailContext,
|
|
215
213
|
promise: fetchPromise,
|
|
@@ -228,13 +226,19 @@ cdnPrioritizer) {
|
|
|
228
226
|
return [4 /*yield*/, fetchPromise];
|
|
229
227
|
case 7:
|
|
230
228
|
fetchResult = _a.sent();
|
|
231
|
-
|
|
232
|
-
return [2 /*return*/, fetchResult];
|
|
229
|
+
return [3 /*break*/, 9];
|
|
233
230
|
case 8:
|
|
234
231
|
err_2 = _a.sent();
|
|
235
232
|
clearRequestInfo();
|
|
233
|
+
cancellationSignal.deregister(onCancellation);
|
|
236
234
|
throw err_2;
|
|
237
|
-
case 9:
|
|
235
|
+
case 9:
|
|
236
|
+
clearRequestInfo();
|
|
237
|
+
cancellationSignal.deregister(onCancellation);
|
|
238
|
+
if (cancellationSignal.isCancelled()) {
|
|
239
|
+
throw cancellationSignal.cancellationError;
|
|
240
|
+
}
|
|
241
|
+
return [2 /*return*/, parseThumbnailStep(fetchResult)];
|
|
238
242
|
}
|
|
239
243
|
});
|
|
240
244
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/features/worker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/features/worker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LOCAL_MANIFEST = exports.DASH_WASM = exports.DASH = void 0;
|
|
3
|
+
exports.METAPLAYLIST = exports.LOCAL_MANIFEST = exports.SMOOTH = exports.DASH_WASM = exports.DASH = void 0;
|
|
4
4
|
var list_1 = require("../../../features/list");
|
|
5
5
|
Object.defineProperty(exports, "DASH", { enumerable: true, get: function () { return list_1.DASH; } });
|
|
6
6
|
Object.defineProperty(exports, "DASH_WASM", { enumerable: true, get: function () { return list_1.DASH_WASM; } });
|
|
7
|
+
Object.defineProperty(exports, "SMOOTH", { enumerable: true, get: function () { return list_1.SMOOTH; } });
|
|
7
8
|
var local_1 = require("../local");
|
|
8
9
|
Object.defineProperty(exports, "LOCAL_MANIFEST", { enumerable: true, get: function () { return local_1.LOCAL_MANIFEST; } });
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
var metaplaylist_1 = require("../metaplaylist");
|
|
11
|
+
Object.defineProperty(exports, "METAPLAYLIST", { enumerable: true, get: function () { return metaplaylist_1.METAPLAYLIST; } });
|
|
@@ -189,7 +189,7 @@ var Player = /** @class */ (function (_super) {
|
|
|
189
189
|
// Workaround to support Firefox autoplay on FF 42.
|
|
190
190
|
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
|
|
191
191
|
videoElement.preload = "auto";
|
|
192
|
-
_this.version = /* PLAYER_VERSION */ "4.5.0-dev.
|
|
192
|
+
_this.version = /* PLAYER_VERSION */ "4.5.0-dev.2026031700";
|
|
193
193
|
_this.log = log_1.default;
|
|
194
194
|
_this.state = "STOPPED";
|
|
195
195
|
_this.videoElement = videoElement;
|
|
@@ -3079,7 +3079,7 @@ var Player = /** @class */ (function (_super) {
|
|
|
3079
3079
|
// TODO: Make it work with multithread?
|
|
3080
3080
|
return false;
|
|
3081
3081
|
}
|
|
3082
|
-
if (options.transport
|
|
3082
|
+
if (options.transport === "directfile") {
|
|
3083
3083
|
return false;
|
|
3084
3084
|
}
|
|
3085
3085
|
if (features_1.default.monothread === null ||
|
|
@@ -3114,5 +3114,5 @@ var Player = /** @class */ (function (_super) {
|
|
|
3114
3114
|
Player._priv_currentlyUsedVideoElements = new WeakSet();
|
|
3115
3115
|
return Player;
|
|
3116
3116
|
}(event_emitter_1.default));
|
|
3117
|
-
Player.version = /* PLAYER_VERSION */ "4.5.0-dev.
|
|
3117
|
+
Player.version = /* PLAYER_VERSION */ "4.5.0-dev.2026031700";
|
|
3118
3118
|
exports.default = Player;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply_line_height.d.ts","sourceRoot":"","sources":["../../../../../../src/parsers/texttracks/ttml/html/apply_line_height.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"apply_line_height.d.ts","sourceRoot":"","sources":["../../../../../../src/parsers/texttracks/ttml/html/apply_line_height.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAsCtF"}
|
|
@@ -34,7 +34,22 @@ function applyLineHeight(element, lineHeight) {
|
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
if (firstLineHeight[2] === "px" ||
|
|
37
|
-
|
|
37
|
+
// TODO: For now, we disable the percentage unit as its rules are complex to
|
|
38
|
+
// implement in our current logic:
|
|
39
|
+
// A percentage `lineHeight` depends on the `fontSize` computed at that point,
|
|
40
|
+
// yet a lineHeight applies to a `p` in TTML and `fontSize` applies to a `span`
|
|
41
|
+
// (below `p`) and our translation applies that same level of style: CSS `lineHeight`
|
|
42
|
+
// is set on the element defining it, but `fontSize` is set at the end on each cue.
|
|
43
|
+
//
|
|
44
|
+
// Thus we cannot easily just rely on CSS' similar behavior for percentage
|
|
45
|
+
// `lineHeight`s because the `fontSize` might not be known at that point by
|
|
46
|
+
// the CSS (yet it might be for TTML). Work-around tricks are not straightforward
|
|
47
|
+
// either (e.g. we cannot just repeat the `fontSize` at both places because
|
|
48
|
+
// the potential percentage values in which they are expressed could coumpound).
|
|
49
|
+
// Seeing other players, it also seems poorly supported, so for now I think
|
|
50
|
+
// we can just ignore those. In a perfect world, it should be implemented
|
|
51
|
+
// though!
|
|
52
|
+
// firstLineHeight[2] === "%" ||
|
|
38
53
|
firstLineHeight[2] === "em") {
|
|
39
54
|
element.style.lineHeight = firstLineHeight[1] + firstLineHeight[2];
|
|
40
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embedded_dash_wasm.d.ts","sourceRoot":"","sources":["../../../src/__GENERATED_CODE/embedded_dash_wasm.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"embedded_dash_wasm.d.ts","sourceRoot":"","sources":["../../../src/__GENERATED_CODE/embedded_dash_wasm.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,eAAe,aAAyn/U,CAAC;AAC/o/U,OAAO,EAAE,eAAe,IAAI,kBAAkB,EAAE,CAAC;AACjD,eAAe,eAAe,CAAC"}
|