rx-player 4.2.0-dev.2024090600 → 4.2.0-dev.2024091000
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 +1 -1
- 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/cmcd/cmcd_data_builder.d.ts +12 -0
- package/dist/commonjs/core/cmcd/cmcd_data_builder.d.ts.map +1 -1
- package/dist/commonjs/core/cmcd/cmcd_data_builder.js +27 -1
- package/dist/commonjs/core/fetchers/segment/segment_fetcher.d.ts +24 -0
- package/dist/commonjs/core/fetchers/segment/segment_fetcher.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/segment/segment_queue.d.ts.map +1 -1
- package/dist/commonjs/core/fetchers/segment/segment_queue.js +8 -7
- package/dist/commonjs/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.d.ts.map +1 -1
- package/dist/commonjs/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +2 -2
- package/dist/commonjs/main_thread/api/public_api.js +2 -2
- package/dist/commonjs/parsers/manifest/dash/common/parse_mpd.js +2 -2
- package/dist/commonjs/parsers/manifest/dash/common/resolve_base_urls.js +2 -2
- package/dist/commonjs/parsers/manifest/metaplaylist/metaplaylist_parser.js +2 -2
- package/dist/commonjs/parsers/manifest/smooth/create_parser.js +2 -2
- package/dist/commonjs/transports/dash/construct_segment_url.js +2 -2
- package/dist/commonjs/transports/smooth/utils.js +2 -2
- package/dist/commonjs/utils/{resolve_url.d.ts → url-utils.d.ts} +15 -4
- package/dist/commonjs/utils/url-utils.d.ts.map +1 -0
- package/dist/commonjs/utils/{resolve_url.js → url-utils.js} +71 -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/core/cmcd/cmcd_data_builder.d.ts +12 -0
- package/dist/es2017/core/cmcd/cmcd_data_builder.d.ts.map +1 -1
- package/dist/es2017/core/cmcd/cmcd_data_builder.js +27 -1
- package/dist/es2017/core/fetchers/segment/segment_fetcher.d.ts +24 -0
- package/dist/es2017/core/fetchers/segment/segment_fetcher.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/segment/segment_queue.d.ts.map +1 -1
- package/dist/es2017/core/fetchers/segment/segment_queue.js +8 -7
- package/dist/es2017/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.d.ts.map +1 -1
- package/dist/es2017/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +2 -2
- package/dist/es2017/main_thread/api/public_api.js +2 -2
- package/dist/es2017/parsers/manifest/dash/common/parse_mpd.js +1 -1
- package/dist/es2017/parsers/manifest/dash/common/resolve_base_urls.js +1 -1
- package/dist/es2017/parsers/manifest/metaplaylist/metaplaylist_parser.js +1 -1
- package/dist/es2017/parsers/manifest/smooth/create_parser.js +1 -1
- package/dist/es2017/transports/dash/construct_segment_url.js +1 -1
- package/dist/es2017/transports/smooth/utils.js +1 -1
- package/dist/es2017/utils/{resolve_url.d.ts → url-utils.d.ts} +15 -4
- package/dist/es2017/utils/url-utils.d.ts.map +1 -0
- package/dist/es2017/utils/{resolve_url.js → url-utils.js} +71 -3
- package/dist/rx-player.js +243 -173
- package/dist/rx-player.min.js +15 -15
- package/dist/worker.js +8 -8
- package/package.json +1 -1
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/core/cmcd/cmcd_data_builder.ts +68 -2
- package/src/core/fetchers/segment/segment_fetcher.ts +24 -0
- package/src/core/fetchers/segment/segment_queue.ts +11 -9
- package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +8 -2
- package/src/main_thread/api/public_api.ts +2 -2
- package/src/parsers/manifest/dash/common/parse_mpd.ts +1 -1
- package/src/parsers/manifest/dash/common/resolve_base_urls.ts +1 -1
- package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +1 -1
- package/src/parsers/manifest/smooth/create_parser.ts +1 -1
- package/src/transports/dash/construct_segment_url.ts +1 -1
- package/src/transports/smooth/utils.ts +1 -1
- package/src/utils/__tests__/{resolve_url.test.ts → url-utils.test.ts} +148 -1
- package/src/utils/{resolve_url.ts → url-utils.ts} +83 -5
- package/dist/commonjs/utils/resolve_url.d.ts.map +0 -1
- package/dist/es2017/utils/resolve_url.d.ts.map +0 -1
package/dist/rx-player.js
CHANGED
|
@@ -3374,6 +3374,213 @@
|
|
|
3374
3374
|
});
|
|
3375
3375
|
}
|
|
3376
3376
|
|
|
3377
|
+
// src/utils/starts_with.ts
|
|
3378
|
+
function startsWith(completeString, searchString, position) {
|
|
3379
|
+
if (typeof String.prototype.startsWith === "function") {
|
|
3380
|
+
return completeString.startsWith(searchString, position);
|
|
3381
|
+
}
|
|
3382
|
+
const initialPosition = typeof position === "number" ? Math.max(position, 0) : 0;
|
|
3383
|
+
return completeString.substring(initialPosition, initialPosition + searchString.length) === searchString;
|
|
3384
|
+
}
|
|
3385
|
+
|
|
3386
|
+
// src/utils/url-utils.ts
|
|
3387
|
+
var schemeRe = /^(?:[a-z]+:)?\/\//i;
|
|
3388
|
+
var urlComponentRegex = /^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/;
|
|
3389
|
+
function getFilenameIndexInUrl(url) {
|
|
3390
|
+
const indexOfLastSlash = url.lastIndexOf("/");
|
|
3391
|
+
if (indexOfLastSlash < 0) {
|
|
3392
|
+
return url.length;
|
|
3393
|
+
}
|
|
3394
|
+
if (schemeRe.test(url)) {
|
|
3395
|
+
const firstSlashIndex = url.indexOf("/");
|
|
3396
|
+
if (firstSlashIndex >= 0 && indexOfLastSlash === firstSlashIndex + 1) {
|
|
3397
|
+
return url.length;
|
|
3398
|
+
}
|
|
3399
|
+
}
|
|
3400
|
+
const indexOfQuestionMark = url.indexOf("?");
|
|
3401
|
+
if (indexOfQuestionMark >= 0 && indexOfQuestionMark < indexOfLastSlash) {
|
|
3402
|
+
return getFilenameIndexInUrl(url.substring(0, indexOfQuestionMark));
|
|
3403
|
+
}
|
|
3404
|
+
return indexOfLastSlash + 1;
|
|
3405
|
+
}
|
|
3406
|
+
function getRelativeUrl(baseUrl, newUrl) {
|
|
3407
|
+
const baseParts = parseURL(baseUrl);
|
|
3408
|
+
const newParts = parseURL(newUrl);
|
|
3409
|
+
if (baseParts.scheme !== newParts.scheme || baseParts.authority !== newParts.authority) {
|
|
3410
|
+
return null;
|
|
3411
|
+
}
|
|
3412
|
+
if (
|
|
3413
|
+
// if base and new path are mixed between absolute and relative path, return null
|
|
3414
|
+
baseParts.path[0] !== void 0 && baseParts.path[0] !== "/" && newParts.path[0] === "/" || newParts.path[0] !== void 0 && newParts.path[0] !== "/" && baseParts.path[0] === "/"
|
|
3415
|
+
) {
|
|
3416
|
+
return null;
|
|
3417
|
+
}
|
|
3418
|
+
const baseNormalizedPath = removeDotSegment(baseParts.path);
|
|
3419
|
+
const newNormalizedPath = removeDotSegment(newParts.path);
|
|
3420
|
+
let relativePath;
|
|
3421
|
+
if (baseNormalizedPath === newNormalizedPath) {
|
|
3422
|
+
relativePath = "";
|
|
3423
|
+
} else {
|
|
3424
|
+
const basePathSplitted = baseNormalizedPath.split("/");
|
|
3425
|
+
basePathSplitted.pop();
|
|
3426
|
+
const newPathSplitted = newNormalizedPath.split("/");
|
|
3427
|
+
while (basePathSplitted.length > 0 && newPathSplitted.length > 0 && basePathSplitted[0] === newPathSplitted[0]) {
|
|
3428
|
+
basePathSplitted.shift();
|
|
3429
|
+
newPathSplitted.shift();
|
|
3430
|
+
}
|
|
3431
|
+
while (basePathSplitted.length > 0) {
|
|
3432
|
+
basePathSplitted.shift();
|
|
3433
|
+
newPathSplitted.unshift("..");
|
|
3434
|
+
}
|
|
3435
|
+
let pathJoined = newPathSplitted.join("/");
|
|
3436
|
+
if (pathJoined.endsWith("../") || pathJoined.endsWith("./")) {
|
|
3437
|
+
pathJoined = pathJoined.slice(0, pathJoined.length - 1);
|
|
3438
|
+
}
|
|
3439
|
+
relativePath = pathJoined === "" ? "." : pathJoined;
|
|
3440
|
+
}
|
|
3441
|
+
let result = relativePath;
|
|
3442
|
+
if (relativePath === "" && newParts.query === baseParts.query) {
|
|
3443
|
+
} else if (newParts.query) {
|
|
3444
|
+
result += "?";
|
|
3445
|
+
result += newParts.query;
|
|
3446
|
+
}
|
|
3447
|
+
if (newParts.fragment) {
|
|
3448
|
+
result += "#";
|
|
3449
|
+
result += newParts.fragment;
|
|
3450
|
+
}
|
|
3451
|
+
return result;
|
|
3452
|
+
}
|
|
3453
|
+
function _resolveURL(base, relative) {
|
|
3454
|
+
const baseParts = parseURL(base);
|
|
3455
|
+
const relativeParts = parseURL(relative);
|
|
3456
|
+
if (relativeParts.scheme) {
|
|
3457
|
+
return formatURL(relativeParts);
|
|
3458
|
+
}
|
|
3459
|
+
const target = {
|
|
3460
|
+
scheme: baseParts.scheme,
|
|
3461
|
+
authority: baseParts.authority,
|
|
3462
|
+
path: "",
|
|
3463
|
+
query: relativeParts.query,
|
|
3464
|
+
fragment: relativeParts.fragment
|
|
3465
|
+
};
|
|
3466
|
+
if (relativeParts.authority) {
|
|
3467
|
+
target.authority = relativeParts.authority;
|
|
3468
|
+
target.path = removeDotSegment(relativeParts.path);
|
|
3469
|
+
return formatURL(target);
|
|
3470
|
+
}
|
|
3471
|
+
if (relativeParts.path === "") {
|
|
3472
|
+
target.path = baseParts.path;
|
|
3473
|
+
if (!relativeParts.query) {
|
|
3474
|
+
target.query = baseParts.query;
|
|
3475
|
+
}
|
|
3476
|
+
} else {
|
|
3477
|
+
if (startsWith(relativeParts.path, "/")) {
|
|
3478
|
+
target.path = removeDotSegment(relativeParts.path);
|
|
3479
|
+
} else {
|
|
3480
|
+
target.path = removeDotSegment(mergePaths(baseParts, relativeParts.path));
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
return formatURL(target);
|
|
3484
|
+
}
|
|
3485
|
+
var parsedUrlCache = /* @__PURE__ */ new Map();
|
|
3486
|
+
var MAX_URL_CACHE_ENTRIES = 200;
|
|
3487
|
+
function parseURL(url) {
|
|
3488
|
+
var _a, _b, _c, _d, _e;
|
|
3489
|
+
if (parsedUrlCache.has(url)) {
|
|
3490
|
+
return parsedUrlCache.get(url);
|
|
3491
|
+
}
|
|
3492
|
+
const matches = url.match(urlComponentRegex);
|
|
3493
|
+
let parsed;
|
|
3494
|
+
if (matches === null) {
|
|
3495
|
+
parsed = {
|
|
3496
|
+
scheme: "",
|
|
3497
|
+
authority: "",
|
|
3498
|
+
path: "",
|
|
3499
|
+
query: "",
|
|
3500
|
+
fragment: ""
|
|
3501
|
+
};
|
|
3502
|
+
} else {
|
|
3503
|
+
parsed = {
|
|
3504
|
+
scheme: (_a = matches[1]) != null ? _a : "",
|
|
3505
|
+
authority: (_b = matches[2]) != null ? _b : "",
|
|
3506
|
+
path: (_c = matches[3]) != null ? _c : "",
|
|
3507
|
+
query: (_d = matches[4]) != null ? _d : "",
|
|
3508
|
+
fragment: (_e = matches[5]) != null ? _e : ""
|
|
3509
|
+
};
|
|
3510
|
+
}
|
|
3511
|
+
if (parsedUrlCache.size >= MAX_URL_CACHE_ENTRIES) {
|
|
3512
|
+
parsedUrlCache.clear();
|
|
3513
|
+
}
|
|
3514
|
+
parsedUrlCache.set(url, parsed);
|
|
3515
|
+
return parsed;
|
|
3516
|
+
}
|
|
3517
|
+
function formatURL(parts) {
|
|
3518
|
+
let url = "";
|
|
3519
|
+
if (parts.scheme) {
|
|
3520
|
+
url += parts.scheme + ":";
|
|
3521
|
+
}
|
|
3522
|
+
if (parts.authority) {
|
|
3523
|
+
url += "//" + parts.authority;
|
|
3524
|
+
}
|
|
3525
|
+
url += parts.path;
|
|
3526
|
+
if (parts.query) {
|
|
3527
|
+
url += "?" + parts.query;
|
|
3528
|
+
}
|
|
3529
|
+
if (parts.fragment) {
|
|
3530
|
+
url += "#" + parts.fragment;
|
|
3531
|
+
}
|
|
3532
|
+
return url;
|
|
3533
|
+
}
|
|
3534
|
+
function removeDotSegment(path) {
|
|
3535
|
+
const segments = path.split(/(?=\/)/);
|
|
3536
|
+
const output = [];
|
|
3537
|
+
for (let i = 0; i < segments.length; i++) {
|
|
3538
|
+
const segment = segments[i];
|
|
3539
|
+
if (segment === ".." || segment === "." || segment === "") {
|
|
3540
|
+
continue;
|
|
3541
|
+
}
|
|
3542
|
+
if (segment === "/..") {
|
|
3543
|
+
output.pop();
|
|
3544
|
+
if (i === segments.length - 1) {
|
|
3545
|
+
output.push("/");
|
|
3546
|
+
}
|
|
3547
|
+
continue;
|
|
3548
|
+
}
|
|
3549
|
+
if (segment === "/.") {
|
|
3550
|
+
if (i === segments.length - 1) {
|
|
3551
|
+
output.push("/");
|
|
3552
|
+
}
|
|
3553
|
+
continue;
|
|
3554
|
+
}
|
|
3555
|
+
output.push(segment);
|
|
3556
|
+
}
|
|
3557
|
+
return output.join("");
|
|
3558
|
+
}
|
|
3559
|
+
function mergePaths(baseParts, relativePath) {
|
|
3560
|
+
if (baseParts.authority && baseParts.path === "") {
|
|
3561
|
+
return "/" + relativePath;
|
|
3562
|
+
}
|
|
3563
|
+
const basePath = baseParts.path;
|
|
3564
|
+
return basePath.substring(0, basePath.lastIndexOf("/") + 1) + relativePath;
|
|
3565
|
+
}
|
|
3566
|
+
function resolveURL(...args) {
|
|
3567
|
+
var _a, _b, _c;
|
|
3568
|
+
const filteredArgs = args.filter((val) => val !== "");
|
|
3569
|
+
const len = filteredArgs.length;
|
|
3570
|
+
if (len === 0) {
|
|
3571
|
+
return "";
|
|
3572
|
+
}
|
|
3573
|
+
if (len === 1) {
|
|
3574
|
+
return (_a = filteredArgs[0]) != null ? _a : "";
|
|
3575
|
+
} else {
|
|
3576
|
+
const basePart = (_b = filteredArgs[0]) != null ? _b : "";
|
|
3577
|
+
const relativeParts = (_c = filteredArgs[1]) != null ? _c : "";
|
|
3578
|
+
const resolvedURL = _resolveURL(basePart, relativeParts);
|
|
3579
|
+
const remainingArgs = filteredArgs.slice(2);
|
|
3580
|
+
return resolveURL(resolvedURL, ...remainingArgs);
|
|
3581
|
+
}
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3377
3584
|
// src/core/cmcd/cmcd_data_builder.ts
|
|
3378
3585
|
var RTP_FACTOR = 4;
|
|
3379
3586
|
var CmcdDataBuilder = class {
|
|
@@ -3508,6 +3715,24 @@
|
|
|
3508
3715
|
if (content.segment.isInit) {
|
|
3509
3716
|
props.ot = "i";
|
|
3510
3717
|
}
|
|
3718
|
+
if (!isNullOrUndefined(content.nextSegment) && content.segment.url !== null && content.nextSegment.url !== null) {
|
|
3719
|
+
if (!content.nextSegment.isInit || content.nextSegment.indexRange === void 0) {
|
|
3720
|
+
const currSegmentUrl = content.segment.url;
|
|
3721
|
+
const nextSegmentUrl = content.nextSegment.url;
|
|
3722
|
+
const relativeUrl = getRelativeUrl(currSegmentUrl, nextSegmentUrl);
|
|
3723
|
+
if (relativeUrl !== null) {
|
|
3724
|
+
if (relativeUrl !== ".") {
|
|
3725
|
+
props.nor = encodeURIComponent(relativeUrl);
|
|
3726
|
+
}
|
|
3727
|
+
if (content.nextSegment.range !== void 0) {
|
|
3728
|
+
props.nrr = String(content.nextSegment.range[0]) + "-";
|
|
3729
|
+
if (isFinite(content.nextSegment.range[1])) {
|
|
3730
|
+
props.nrr += String(content.nextSegment.range[1]);
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
}
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3511
3736
|
let precizeBufferLengthMs;
|
|
3512
3737
|
if (lastObservation !== void 0 && (props.ot === "v" || props.ot === "a" || props.ot === "av")) {
|
|
3513
3738
|
const bufferedForType = lastObservation.buffered[content.adaptation.type];
|
|
@@ -3613,6 +3838,8 @@
|
|
|
3613
3838
|
addNumberProperty("d", "object");
|
|
3614
3839
|
addNumberProperty("dl", "request");
|
|
3615
3840
|
addNumberProperty("mtp", "request");
|
|
3841
|
+
addStringProperty("nor", "request");
|
|
3842
|
+
addStringProperty("nrr", "request");
|
|
3616
3843
|
addTokenProperty("ot", "object");
|
|
3617
3844
|
addNumberProperty("pr", "session");
|
|
3618
3845
|
addNumberProperty("rtp", "status");
|
|
@@ -6556,15 +6783,6 @@
|
|
|
6556
6783
|
};
|
|
6557
6784
|
}
|
|
6558
6785
|
|
|
6559
|
-
// src/utils/starts_with.ts
|
|
6560
|
-
function startsWith(completeString, searchString, position) {
|
|
6561
|
-
if (typeof String.prototype.startsWith === "function") {
|
|
6562
|
-
return completeString.startsWith(searchString, position);
|
|
6563
|
-
}
|
|
6564
|
-
const initialPosition = typeof position === "number" ? Math.max(position, 0) : 0;
|
|
6565
|
-
return completeString.substring(initialPosition, initialPosition + searchString.length) === searchString;
|
|
6566
|
-
}
|
|
6567
|
-
|
|
6568
6786
|
// src/utils/byte_parsing.ts
|
|
6569
6787
|
function concat(...args) {
|
|
6570
6788
|
const l = args.length;
|
|
@@ -13289,9 +13507,10 @@
|
|
|
13289
13507
|
contentInfo.mediaSegmentRequest.canceller.cancel();
|
|
13290
13508
|
}
|
|
13291
13509
|
const { downloadQueue, content, initSegmentInfoRef, currentCanceller } = contentInfo;
|
|
13292
|
-
const
|
|
13293
|
-
|
|
13294
|
-
|
|
13510
|
+
const recursivelyRequestSegments = () => {
|
|
13511
|
+
var _a;
|
|
13512
|
+
const { segmentQueue } = downloadQueue.getValue();
|
|
13513
|
+
const startingSegment = segmentQueue[0];
|
|
13295
13514
|
if (currentCanceller !== null && currentCanceller.isUsed()) {
|
|
13296
13515
|
contentInfo.mediaSegmentRequest = null;
|
|
13297
13516
|
return;
|
|
@@ -13304,7 +13523,10 @@
|
|
|
13304
13523
|
const canceller = new TaskCanceller();
|
|
13305
13524
|
const unlinkCanceller = currentCanceller === null ? noop_default : canceller.linkToSignal(currentCanceller.signal);
|
|
13306
13525
|
const { segment, priority } = startingSegment;
|
|
13307
|
-
const context = object_assign_default(
|
|
13526
|
+
const context = object_assign_default(
|
|
13527
|
+
{ segment, nextSegment: (_a = segmentQueue[1]) == null ? void 0 : _a.segment },
|
|
13528
|
+
content
|
|
13529
|
+
);
|
|
13308
13530
|
let isComplete = false;
|
|
13309
13531
|
let isWaitingOnInitSegment = false;
|
|
13310
13532
|
canceller.signal.register(() => {
|
|
@@ -13332,7 +13554,7 @@
|
|
|
13332
13554
|
lastQueue.shift();
|
|
13333
13555
|
}
|
|
13334
13556
|
isComplete = true;
|
|
13335
|
-
recursivelyRequestSegments(
|
|
13557
|
+
recursivelyRequestSegments();
|
|
13336
13558
|
};
|
|
13337
13559
|
const request2 = this._segmentFetcher.createRequest(
|
|
13338
13560
|
context,
|
|
@@ -13418,7 +13640,7 @@
|
|
|
13418
13640
|
});
|
|
13419
13641
|
contentInfo.mediaSegmentRequest = { segment, priority, request: request2, canceller };
|
|
13420
13642
|
};
|
|
13421
|
-
recursivelyRequestSegments(
|
|
13643
|
+
recursivelyRequestSegments();
|
|
13422
13644
|
}
|
|
13423
13645
|
/**
|
|
13424
13646
|
* Internal logic performing initialization segment requests.
|
|
@@ -13436,7 +13658,7 @@
|
|
|
13436
13658
|
const canceller = new TaskCanceller();
|
|
13437
13659
|
const unlinkCanceller = contentInfo.currentCanceller === null ? noop_default : canceller.linkToSignal(contentInfo.currentCanceller.signal);
|
|
13438
13660
|
const { segment, priority } = queuedInitSegment;
|
|
13439
|
-
const context = object_assign_default({ segment }, content);
|
|
13661
|
+
const context = object_assign_default({ segment, nextSegment: void 0 }, content);
|
|
13440
13662
|
let isComplete = false;
|
|
13441
13663
|
const request2 = this._segmentFetcher.createRequest(
|
|
13442
13664
|
context,
|
|
@@ -23407,158 +23629,6 @@
|
|
|
23407
23629
|
// src/parsers/manifest/dash/common/indexes/timeline/index.ts
|
|
23408
23630
|
var timeline_default = TimelineRepresentationIndex;
|
|
23409
23631
|
|
|
23410
|
-
// src/utils/resolve_url.ts
|
|
23411
|
-
var schemeRe = /^(?:[a-z]+:)?\/\//i;
|
|
23412
|
-
var urlComponentRegex = /^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/;
|
|
23413
|
-
function getFilenameIndexInUrl(url) {
|
|
23414
|
-
const indexOfLastSlash = url.lastIndexOf("/");
|
|
23415
|
-
if (indexOfLastSlash < 0) {
|
|
23416
|
-
return url.length;
|
|
23417
|
-
}
|
|
23418
|
-
if (schemeRe.test(url)) {
|
|
23419
|
-
const firstSlashIndex = url.indexOf("/");
|
|
23420
|
-
if (firstSlashIndex >= 0 && indexOfLastSlash === firstSlashIndex + 1) {
|
|
23421
|
-
return url.length;
|
|
23422
|
-
}
|
|
23423
|
-
}
|
|
23424
|
-
const indexOfQuestionMark = url.indexOf("?");
|
|
23425
|
-
if (indexOfQuestionMark >= 0 && indexOfQuestionMark < indexOfLastSlash) {
|
|
23426
|
-
return getFilenameIndexInUrl(url.substring(0, indexOfQuestionMark));
|
|
23427
|
-
}
|
|
23428
|
-
return indexOfLastSlash + 1;
|
|
23429
|
-
}
|
|
23430
|
-
function _resolveURL(base, relative) {
|
|
23431
|
-
const baseParts = parseURL(base);
|
|
23432
|
-
const relativeParts = parseURL(relative);
|
|
23433
|
-
if (relativeParts.scheme) {
|
|
23434
|
-
return formatURL(relativeParts);
|
|
23435
|
-
}
|
|
23436
|
-
const target = {
|
|
23437
|
-
scheme: baseParts.scheme,
|
|
23438
|
-
authority: baseParts.authority,
|
|
23439
|
-
path: "",
|
|
23440
|
-
query: relativeParts.query,
|
|
23441
|
-
fragment: relativeParts.fragment
|
|
23442
|
-
};
|
|
23443
|
-
if (relativeParts.authority) {
|
|
23444
|
-
target.authority = relativeParts.authority;
|
|
23445
|
-
target.path = removeDotSegment(relativeParts.path);
|
|
23446
|
-
return formatURL(target);
|
|
23447
|
-
}
|
|
23448
|
-
if (relativeParts.path === "") {
|
|
23449
|
-
target.path = baseParts.path;
|
|
23450
|
-
if (!relativeParts.query) {
|
|
23451
|
-
target.query = baseParts.query;
|
|
23452
|
-
}
|
|
23453
|
-
} else {
|
|
23454
|
-
if (startsWith(relativeParts.path, "/")) {
|
|
23455
|
-
target.path = removeDotSegment(relativeParts.path);
|
|
23456
|
-
} else {
|
|
23457
|
-
target.path = removeDotSegment(mergePaths(baseParts, relativeParts.path));
|
|
23458
|
-
}
|
|
23459
|
-
}
|
|
23460
|
-
return formatURL(target);
|
|
23461
|
-
}
|
|
23462
|
-
var parsedUrlCache = /* @__PURE__ */ new Map();
|
|
23463
|
-
var MAX_URL_CACHE_ENTRIES = 200;
|
|
23464
|
-
function parseURL(url) {
|
|
23465
|
-
var _a, _b, _c, _d, _e;
|
|
23466
|
-
if (parsedUrlCache.has(url)) {
|
|
23467
|
-
return parsedUrlCache.get(url);
|
|
23468
|
-
}
|
|
23469
|
-
const matches = url.match(urlComponentRegex);
|
|
23470
|
-
let parsed;
|
|
23471
|
-
if (matches === null) {
|
|
23472
|
-
parsed = {
|
|
23473
|
-
scheme: "",
|
|
23474
|
-
authority: "",
|
|
23475
|
-
path: "",
|
|
23476
|
-
query: "",
|
|
23477
|
-
fragment: ""
|
|
23478
|
-
};
|
|
23479
|
-
} else {
|
|
23480
|
-
parsed = {
|
|
23481
|
-
scheme: (_a = matches[1]) != null ? _a : "",
|
|
23482
|
-
authority: (_b = matches[2]) != null ? _b : "",
|
|
23483
|
-
path: (_c = matches[3]) != null ? _c : "",
|
|
23484
|
-
query: (_d = matches[4]) != null ? _d : "",
|
|
23485
|
-
fragment: (_e = matches[5]) != null ? _e : ""
|
|
23486
|
-
};
|
|
23487
|
-
}
|
|
23488
|
-
if (parsedUrlCache.size >= MAX_URL_CACHE_ENTRIES) {
|
|
23489
|
-
parsedUrlCache.clear();
|
|
23490
|
-
}
|
|
23491
|
-
parsedUrlCache.set(url, parsed);
|
|
23492
|
-
return parsed;
|
|
23493
|
-
}
|
|
23494
|
-
function formatURL(parts) {
|
|
23495
|
-
let url = "";
|
|
23496
|
-
if (parts.scheme) {
|
|
23497
|
-
url += parts.scheme + ":";
|
|
23498
|
-
}
|
|
23499
|
-
if (parts.authority) {
|
|
23500
|
-
url += "//" + parts.authority;
|
|
23501
|
-
}
|
|
23502
|
-
url += parts.path;
|
|
23503
|
-
if (parts.query) {
|
|
23504
|
-
url += "?" + parts.query;
|
|
23505
|
-
}
|
|
23506
|
-
if (parts.fragment) {
|
|
23507
|
-
url += "#" + parts.fragment;
|
|
23508
|
-
}
|
|
23509
|
-
return url;
|
|
23510
|
-
}
|
|
23511
|
-
function removeDotSegment(path) {
|
|
23512
|
-
const segments = path.split(/(?=\/)/);
|
|
23513
|
-
const output = [];
|
|
23514
|
-
for (let i = 0; i < segments.length; i++) {
|
|
23515
|
-
const segment = segments[i];
|
|
23516
|
-
if (segment === ".." || segment === "." || segment === "") {
|
|
23517
|
-
continue;
|
|
23518
|
-
}
|
|
23519
|
-
if (segment === "/..") {
|
|
23520
|
-
output.pop();
|
|
23521
|
-
if (i === segments.length - 1) {
|
|
23522
|
-
output.push("/");
|
|
23523
|
-
}
|
|
23524
|
-
continue;
|
|
23525
|
-
}
|
|
23526
|
-
if (segment === "/.") {
|
|
23527
|
-
if (i === segments.length - 1) {
|
|
23528
|
-
output.push("/");
|
|
23529
|
-
}
|
|
23530
|
-
continue;
|
|
23531
|
-
}
|
|
23532
|
-
output.push(segment);
|
|
23533
|
-
}
|
|
23534
|
-
return output.join("");
|
|
23535
|
-
}
|
|
23536
|
-
function mergePaths(baseParts, relativePath) {
|
|
23537
|
-
if (baseParts.authority && baseParts.path === "") {
|
|
23538
|
-
return "/" + relativePath;
|
|
23539
|
-
}
|
|
23540
|
-
const basePath = baseParts.path;
|
|
23541
|
-
return basePath.substring(0, basePath.lastIndexOf("/") + 1) + relativePath;
|
|
23542
|
-
}
|
|
23543
|
-
function resolveURL(...args) {
|
|
23544
|
-
var _a, _b, _c;
|
|
23545
|
-
const filteredArgs = args.filter((val) => val !== "");
|
|
23546
|
-
const len = filteredArgs.length;
|
|
23547
|
-
if (len === 0) {
|
|
23548
|
-
return "";
|
|
23549
|
-
}
|
|
23550
|
-
if (len === 1) {
|
|
23551
|
-
return (_a = filteredArgs[0]) != null ? _a : "";
|
|
23552
|
-
} else {
|
|
23553
|
-
const basePart = (_b = filteredArgs[0]) != null ? _b : "";
|
|
23554
|
-
const relativeParts = (_c = filteredArgs[1]) != null ? _c : "";
|
|
23555
|
-
const resolvedURL = _resolveURL(basePart, relativeParts);
|
|
23556
|
-
const remainingArgs = filteredArgs.slice(2);
|
|
23557
|
-
return resolveURL(resolvedURL, ...remainingArgs);
|
|
23558
|
-
}
|
|
23559
|
-
}
|
|
23560
|
-
var resolve_url_default = resolveURL;
|
|
23561
|
-
|
|
23562
23632
|
// src/parsers/manifest/dash/common/content_protection_parser.ts
|
|
23563
23633
|
var ContentProtectionParser = class {
|
|
23564
23634
|
constructor() {
|
|
@@ -24317,7 +24387,7 @@
|
|
|
24317
24387
|
const curBaseUrl = currentBaseURLs[i];
|
|
24318
24388
|
for (let j = 0; j < newBaseUrls.length; j++) {
|
|
24319
24389
|
const newBaseUrl = newBaseUrls[j];
|
|
24320
|
-
const newUrl =
|
|
24390
|
+
const newUrl = resolveURL(curBaseUrl.url, newBaseUrl.url);
|
|
24321
24391
|
result.push({
|
|
24322
24392
|
url: newUrl,
|
|
24323
24393
|
serviceLocation: (_a = newBaseUrl.serviceLocation) != null ? _a : curBaseUrl.serviceLocation
|
|
@@ -27101,7 +27171,7 @@
|
|
|
27101
27171
|
if (segment.url === null) {
|
|
27102
27172
|
return wantedCdn.baseUrl;
|
|
27103
27173
|
}
|
|
27104
|
-
return
|
|
27174
|
+
return resolveURL(wantedCdn.baseUrl, segment.url);
|
|
27105
27175
|
}
|
|
27106
27176
|
|
|
27107
27177
|
// src/transports/dash/init_segment_loader.ts
|
|
@@ -34174,7 +34244,7 @@
|
|
|
34174
34244
|
if (segment.url === null) {
|
|
34175
34245
|
return wantedCdn.baseUrl;
|
|
34176
34246
|
}
|
|
34177
|
-
return
|
|
34247
|
+
return resolveURL(wantedCdn.baseUrl, segment.url);
|
|
34178
34248
|
}
|
|
34179
34249
|
|
|
34180
34250
|
// src/transports/smooth/pipelines.ts
|
|
@@ -36778,7 +36848,7 @@ ${event}`
|
|
|
36778
36848
|
} = parseConstructorOptions(options);
|
|
36779
36849
|
videoElement.preload = "auto";
|
|
36780
36850
|
this.version = /* PLAYER_VERSION */
|
|
36781
|
-
"4.2.0-dev.
|
|
36851
|
+
"4.2.0-dev.2024091000";
|
|
36782
36852
|
this.log = log_default;
|
|
36783
36853
|
this.state = "STOPPED";
|
|
36784
36854
|
this.videoElement = videoElement;
|
|
@@ -39304,7 +39374,7 @@ ${event}`
|
|
|
39304
39374
|
_Player._priv_currentlyUsedVideoElements = /* @__PURE__ */ new WeakSet();
|
|
39305
39375
|
var Player = _Player;
|
|
39306
39376
|
Player.version = /* PLAYER_VERSION */
|
|
39307
|
-
"4.2.0-dev.
|
|
39377
|
+
"4.2.0-dev.2024091000";
|
|
39308
39378
|
var public_api_default = Player;
|
|
39309
39379
|
|
|
39310
39380
|
// src/main_thread/api/index.ts
|