mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-06-05 21:49:31 +02:00
p2p-media-loader-core & p2p-media-loader-hlsjs v2.0.1 -> v2.1.0
This commit is contained in:
@@ -1463,9 +1463,9 @@ https://cdn.jsdelivr.net/npm/ngx-bootstrap@18.1.3/datepicker/bs-datepicker.css
|
||||
https://cdn.jsdelivr.net/npm/ngx-bootstrap@6.2.0/datepicker/bs-datepicker.css
|
||||
https://cdn.jsdelivr.net/npm/object-assign@4.1.1/index.js
|
||||
https://cdn.jsdelivr.net/npm/p2p-media-loader-core@0.6.2/build/p2p-media-loader-core.min.js
|
||||
https://cdn.jsdelivr.net/npm/p2p-media-loader-core@2.0.1/dist/p2p-media-loader-core.es.min.js
|
||||
https://cdn.jsdelivr.net/npm/p2p-media-loader-core@2.1.0/dist/p2p-media-loader-core.es.min.js
|
||||
https://cdn.jsdelivr.net/npm/p2p-media-loader-hlsjs@0.6.2/build/p2p-media-loader-hlsjs.min.js
|
||||
https://cdn.jsdelivr.net/npm/p2p-media-loader-hlsjs@2.0.1/dist/p2p-media-loader-hlsjs.es.min.js
|
||||
https://cdn.jsdelivr.net/npm/p2p-media-loader-hlsjs@2.1.0/dist/p2p-media-loader-hlsjs.es.min.js
|
||||
https://cdn.jsdelivr.net/npm/plyr@3.7.8/dist/plyr.css
|
||||
https://cdn.jsdelivr.net/npm/plyr@3.7.8/dist/plyr.min.js
|
||||
https://cdn.jsdelivr.net/npm/raven-js@3.27.2/dist/raven.min.js
|
||||
|
@@ -372,7 +372,7 @@ targets.setLastVersion = function (type, version) {
|
||||
if (type.startsWith('/owl-carousel/2.')) return '2.3.4';
|
||||
if (type.startsWith('/p2p-media-loader-core') || type.startsWith('/p2p-media-loader-hlsjs')) {
|
||||
if (helpers.compareVersion('0.6.2', version)) return '0.6.2'; // <= v0.6.2
|
||||
return '2.0.1';
|
||||
return '2.1.0';
|
||||
}
|
||||
if (type.startsWith('/p5.js/0.')) return '0.10.2';
|
||||
if (type.startsWith('/p5.js/1.')) return '1.11.1';
|
||||
|
@@ -36,6 +36,7 @@
|
||||
<li>libphonenumber-js v1.11.12 -> v1.11.15</li>
|
||||
<li>lightgallery v2.7.2 -> v2.8.1</li>
|
||||
<li>mdb-ui-kit v8.0.0 -> v8.1.0</li>
|
||||
<li>p2p-media-loader-core & p2p-media-loader-hlsjs v2.0.1 -> v2.1.0</li>
|
||||
</ul>
|
||||
<p>Added</p>
|
||||
<ul>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,8 @@ var R = (n) => {
|
||||
throw TypeError(n);
|
||||
};
|
||||
var q = (n, t, e) => t in n ? j(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
||||
var r = (n, t, e) => q(n, typeof t != "symbol" ? t + "" : t, e), A = (n, t, e) => t.has(n) || R("Cannot " + e);
|
||||
var i = (n, t, e) => (A(n, t, "read from private field"), e ? e.call(n) : t.get(n)), l = (n, t, e) => t.has(n) ? R("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), u = (n, t, e, s) => (A(n, t, "write to private field"), s ? s.call(n, e) : t.set(n, e), e), x = (n, t, e) => (A(n, t, "access private method"), e);
|
||||
var r = (n, t, e) => q(n, typeof t != "symbol" ? t + "" : t, e), D = (n, t, e) => t.has(n) || R("Cannot " + e);
|
||||
var i = (n, t, e) => (D(n, t, "read from private field"), e ? e.call(n) : t.get(n)), l = (n, t, e) => t.has(n) ? R("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), u = (n, t, e, s) => (D(n, t, "write to private field"), s ? s.call(n, e) : t.set(n, e), e), x = (n, t, e) => (D(n, t, "access private method"), e);
|
||||
import { CoreRequestError as T, debug as N, Core as z } from "p2p-media-loader-core";
|
||||
function F(n, t) {
|
||||
return t ? `${n}|${t.start}-${t.end}` : n;
|
||||
@@ -12,7 +12,7 @@ function F(n, t) {
|
||||
function J(n, t) {
|
||||
if (n !== void 0 && t !== void 0 && n <= t) return { start: n, end: t };
|
||||
}
|
||||
var H, C, g, v, f, p, b, G, U;
|
||||
var H, M, g, y, p, m, b, G, A;
|
||||
class B {
|
||||
constructor(t, e) {
|
||||
l(this, b);
|
||||
@@ -20,65 +20,64 @@ class B {
|
||||
r(this, "config");
|
||||
r(this, "stats");
|
||||
l(this, H);
|
||||
l(this, C);
|
||||
l(this, M);
|
||||
l(this, g);
|
||||
l(this, v);
|
||||
l(this, f);
|
||||
l(this, y);
|
||||
l(this, p);
|
||||
u(this, v, e), u(this, C, () => new t.loader(t)), this.stats = { aborted: !1, chunkCount: 0, loading: { start: 0, first: 0, end: 0 }, buffering: { start: 0, first: 0, end: 0 }, parsing: { start: 0, end: 0 }, total: 1, loaded: 1, bwEstimate: 0, retry: 0 };
|
||||
l(this, m);
|
||||
u(this, y, e), u(this, M, () => new t.loader(t)), this.stats = { aborted: !1, chunkCount: 0, loading: { start: 0, first: 0, end: 0 }, buffering: { start: 0, first: 0, end: 0 }, parsing: { start: 0, end: 0 }, total: 1, loaded: 1, bwEstimate: 0, retry: 0 };
|
||||
}
|
||||
load(t, e, s) {
|
||||
var L;
|
||||
this.context = t, this.config = e, u(this, H, s);
|
||||
const o = this.stats, { rangeStart: h, rangeEnd: a } = t, y = J(h, a !== void 0 ? a - 1 : void 0);
|
||||
u(this, p, F(t.url, y));
|
||||
const c = i(this, v).isSegmentLoadable(i(this, p));
|
||||
if (!i(this, v).hasSegment(i(this, p)) || c === !1) return u(this, g, i(this, C).call(this)), i(this, g).stats = this.stats, void ((L = i(this, g)) == null ? void 0 : L.load(t, e, s));
|
||||
i(this, v).loadSegment(i(this, p), { onSuccess: (d) => {
|
||||
u(this, f, d);
|
||||
const E = i(this, f).data.byteLength;
|
||||
o.loading = function(I, w, S) {
|
||||
const P = 8e3 * w / I, M = S - P;
|
||||
return { start: M - 10, first: M, end: S };
|
||||
}(i(this, f).bandwidth, E, performance.now()), o.total = o.loaded = E, s.onProgress && s.onProgress(this.stats, t, i(this, f).data, void 0), s.onSuccess({ data: i(this, f).data, url: t.url }, this.stats, t, void 0);
|
||||
}, onError: (d) => {
|
||||
d instanceof T && d.type === "aborted" && this.stats.aborted || x(this, b, G).call(this, d);
|
||||
const { stats: o } = this, { rangeStart: d, rangeEnd: a } = t, E = J(d, a !== void 0 ? a - 1 : void 0);
|
||||
u(this, m, F(t.url, E));
|
||||
const h = i(this, y).isSegmentLoadable(i(this, m));
|
||||
if (!i(this, y).hasSegment(i(this, m)) || !h) return u(this, g, i(this, M).call(this)), i(this, g).stats = this.stats, void i(this, g).load(t, e, s);
|
||||
i(this, y).loadSegment(i(this, m), { onSuccess: (f) => {
|
||||
u(this, p, f);
|
||||
const c = i(this, p).data.byteLength;
|
||||
o.loading = function(L, C, I) {
|
||||
const w = 8e3 * C / L, S = I - w;
|
||||
return { start: S - 10, first: S, end: I };
|
||||
}(i(this, p).bandwidth, c, performance.now()), o.total = c, o.loaded = c, s.onProgress && s.onProgress(this.stats, t, i(this, p).data, void 0), s.onSuccess({ data: i(this, p).data, url: t.url }, this.stats, t, void 0);
|
||||
}, onError: (f) => {
|
||||
f instanceof T && f.type === "aborted" && this.stats.aborted || x(this, b, G).call(this, f);
|
||||
} });
|
||||
}
|
||||
abort() {
|
||||
var t, e;
|
||||
i(this, g) ? i(this, g).abort() : (x(this, b, U).call(this), (e = (t = i(this, H)) == null ? void 0 : t.onAbort) == null || e.call(t, this.stats, this.context, {}));
|
||||
i(this, g) ? i(this, g).abort() : (x(this, b, A).call(this), (e = (t = i(this, H)) == null ? void 0 : t.onAbort) == null || e.call(t, this.stats, this.context, {}));
|
||||
}
|
||||
destroy() {
|
||||
i(this, g) ? i(this, g).destroy() : (this.stats.aborted || x(this, b, U).call(this), u(this, H, null), this.config = null);
|
||||
i(this, g) ? i(this, g).destroy() : (this.stats.aborted || x(this, b, A).call(this), u(this, H, null), this.config = null);
|
||||
}
|
||||
}
|
||||
H = new WeakMap(), C = new WeakMap(), g = new WeakMap(), v = new WeakMap(), f = new WeakMap(), p = new WeakMap(), b = new WeakSet(), G = function(t) {
|
||||
H = new WeakMap(), M = new WeakMap(), g = new WeakMap(), y = new WeakMap(), p = new WeakMap(), m = new WeakMap(), b = new WeakSet(), G = function(t) {
|
||||
var s;
|
||||
const e = { code: 0, text: "" };
|
||||
(t instanceof T && t.type === "failed" || t instanceof Error) && (e.text = t.message), (s = i(this, H)) == null || s.onError(e, this.context, null, this.stats);
|
||||
}, U = function() {
|
||||
!i(this, f) && i(this, p) && (this.stats.aborted = !0, i(this, v).abortSegmentLoading(i(this, p)));
|
||||
}, A = function() {
|
||||
!i(this, p) && i(this, m) && (this.stats.aborted = !0, i(this, y).abortSegmentLoading(i(this, m)));
|
||||
};
|
||||
var m;
|
||||
var v;
|
||||
class X {
|
||||
constructor(t) {
|
||||
l(this, m);
|
||||
l(this, v);
|
||||
r(this, "context");
|
||||
r(this, "stats");
|
||||
u(this, m, new t.loader(t)), this.stats = i(this, m).stats, this.context = i(this, m).context;
|
||||
u(this, v, new t.loader(t)), this.stats = i(this, v).stats, this.context = i(this, v).context;
|
||||
}
|
||||
load(t, e, s) {
|
||||
i(this, m).load(t, e, s);
|
||||
i(this, v).load(t, e, s);
|
||||
}
|
||||
abort() {
|
||||
i(this, m).abort();
|
||||
i(this, v).abort();
|
||||
}
|
||||
destroy() {
|
||||
i(this, m).destroy();
|
||||
i(this, v).destroy();
|
||||
}
|
||||
}
|
||||
m = new WeakMap();
|
||||
v = new WeakMap();
|
||||
class K {
|
||||
constructor(t) {
|
||||
r(this, "core");
|
||||
@@ -86,26 +85,25 @@ class K {
|
||||
}
|
||||
processMainManifest(t) {
|
||||
const { levels: e, audioTracks: s } = t;
|
||||
for (const [o, h] of e.entries()) {
|
||||
const { url: a } = h;
|
||||
for (const [o, d] of e.entries()) {
|
||||
const { url: a } = d;
|
||||
this.core.addStreamIfNoneExists({ runtimeId: Array.isArray(a) ? a[0] : a, type: "main", index: o });
|
||||
}
|
||||
for (const [o, h] of s.entries()) {
|
||||
const { url: a } = h;
|
||||
for (const [o, d] of s.entries()) {
|
||||
const { url: a } = d;
|
||||
this.core.addStreamIfNoneExists({ runtimeId: Array.isArray(a) ? a[0] : a, type: "secondary", index: o });
|
||||
}
|
||||
}
|
||||
updatePlaylist(t) {
|
||||
if (!t.details) return;
|
||||
const { details: { url: e, fragments: s, live: o } } = t, h = this.core.getStream(e);
|
||||
if (!h) return;
|
||||
const a = new Set(h.segments.keys()), y = [];
|
||||
s.forEach((c, L) => {
|
||||
const { url: d, byteRange: E, sn: I, start: w, end: S } = c;
|
||||
if (I === "initSegment") return;
|
||||
const [P, M] = E, k = J(P, M !== void 0 ? M - 1 : void 0), D = F(d, k);
|
||||
a.delete(D), h.segments.has(D) || y.push({ runtimeId: D, url: d, externalId: o ? I : L, byteRange: k, startTime: w, endTime: S });
|
||||
}), (y.length || a.size) && this.core.updateStream(e, y, a.values());
|
||||
const { details: { url: e, fragments: s, live: o } } = t, d = this.core.getStream(e);
|
||||
if (!d) return;
|
||||
const a = new Set(d.segments.keys()), E = [];
|
||||
s.forEach((h, f) => {
|
||||
const { url: c, byteRange: L, sn: C, start: I, end: w } = h;
|
||||
if (C === "initSegment") return;
|
||||
const [S, P] = L, U = J(S, P !== void 0 ? P - 1 : void 0), k = F(c, U);
|
||||
a.delete(k), d.segments.has(k) || E.push({ runtimeId: k, url: c, externalId: o ? C : f, byteRange: U, startTime: I, endTime: w });
|
||||
}), (E.length || a.size) && this.core.updateStream(e, E, a.values());
|
||||
}
|
||||
}
|
||||
class $ {
|
||||
@@ -152,11 +150,11 @@ class $ {
|
||||
var s, o;
|
||||
return e = t, o = class extends e {
|
||||
constructor(...a) {
|
||||
var E;
|
||||
const y = a[0], { p2p: c, ...L } = y ?? {}, d = new $(c);
|
||||
super({ ...L, ...d.getConfigForHlsJs() });
|
||||
var L;
|
||||
const E = a[0], { p2p: h, ...f } = E ?? {}, c = new $(h);
|
||||
super({ ...f, ...c.getConfigForHlsJs() });
|
||||
l(this, s);
|
||||
d.bindHls(this), u(this, s, d), (E = c == null ? void 0 : c.onHlsJsCreated) == null || E.call(c, this);
|
||||
c.bindHls(this), u(this, s, c), (L = h == null ? void 0 : h.onHlsJsCreated) == null || L.call(h, this);
|
||||
}
|
||||
get p2pEngine() {
|
||||
return i(this, s);
|
||||
@@ -194,7 +192,7 @@ class $ {
|
||||
e[s]("hlsManifestLoaded", this.handleManifestLoaded), e[s]("hlsLevelSwitching", this.handleLevelSwitching), e[s]("hlsLevelUpdated", this.handleLevelUpdated), e[s]("hlsAudioTrackLoaded", this.handleLevelUpdated), e[s]("hlsDestroying", this.destroy), e[s]("hlsMediaAttaching", this.destroyCore), e[s]("hlsManifestLoading", this.destroyCore), e[s]("hlsMediaDetached", this.handleMediaDetached), e[s]("hlsMediaAttached", this.handleMediaAttached);
|
||||
}
|
||||
createFragmentLoaderClass() {
|
||||
const t = this.core, e = this;
|
||||
const { core: t } = this, e = this;
|
||||
return class extends B {
|
||||
constructor(s) {
|
||||
super(s, t);
|
Reference in New Issue
Block a user