@das-fed/ui 6.4.0-hot.38 → 6.4.0-hot.39
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@das-fed/ui/packages/components/hls-player/style.css';
|
|
2
|
-
import { defineComponent as
|
|
2
|
+
import { defineComponent as Sa, useCssVars as va, ref as Ze, toRefs as xa, computed as ki, onMounted as Aa, onBeforeUnmount as La, createElementBlock as Pt, openBlock as kt, createElementVNode as wi, withDirectives as Ia, toDisplayString as Oi, unref as pt } from "vue";
|
|
3
3
|
import { withInstall as Ra } from "@das-fed/utils/with-install/index";
|
|
4
4
|
import { t as ms, setI18nRule as ba } from "@das-fed/web/packages/i18n/index";
|
|
5
5
|
import { useModelValue as _a } from "@das-fed/utils/vue";
|
|
@@ -200,7 +200,7 @@ function Xr(a, e) {
|
|
|
200
200
|
const t = Object.keys(a), s = Object.keys(e), i = t.length, r = s.length;
|
|
201
201
|
return !i || !r || i === r && !t.some((n) => s.indexOf(n) === -1);
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function Se(a, e = !1) {
|
|
204
204
|
if (typeof TextDecoder < "u") {
|
|
205
205
|
const l = new TextDecoder("utf-8").decode(a);
|
|
206
206
|
if (e) {
|
|
@@ -286,7 +286,7 @@ function Ga() {
|
|
|
286
286
|
f.netLoc = g[1], f.path = g[2];
|
|
287
287
|
}
|
|
288
288
|
f.netLoc && !f.path && (f.path = "/");
|
|
289
|
-
var
|
|
289
|
+
var E = {
|
|
290
290
|
// 2c) Otherwise, the embedded URL inherits the scheme of
|
|
291
291
|
// the base URL.
|
|
292
292
|
scheme: f.scheme,
|
|
@@ -296,14 +296,14 @@ function Ga() {
|
|
|
296
296
|
query: d.query,
|
|
297
297
|
fragment: d.fragment
|
|
298
298
|
};
|
|
299
|
-
if (!d.netLoc && (
|
|
299
|
+
if (!d.netLoc && (E.netLoc = f.netLoc, d.path[0] !== "/"))
|
|
300
300
|
if (!d.path)
|
|
301
|
-
|
|
301
|
+
E.path = f.path, d.params || (E.params = f.params, d.query || (E.query = f.query));
|
|
302
302
|
else {
|
|
303
|
-
var
|
|
304
|
-
|
|
303
|
+
var p = f.path, y = p.substring(0, p.lastIndexOf("/") + 1) + d.path;
|
|
304
|
+
E.path = o.normalizePath(y);
|
|
305
305
|
}
|
|
306
|
-
return
|
|
306
|
+
return E.path === null && (E.path = h.alwaysNormalize ? o.normalizePath(d.path) : d.path), o.buildURLFromParts(E);
|
|
307
307
|
},
|
|
308
308
|
parseURL: function(c) {
|
|
309
309
|
var l = s.exec(c);
|
|
@@ -667,18 +667,18 @@ function tn(a) {
|
|
|
667
667
|
const d = le(u.subarray(8, 12)), f = {
|
|
668
668
|
soun: ie.AUDIO,
|
|
669
669
|
vide: ie.VIDEO
|
|
670
|
-
}[d], g = W(r, ["mdia", "minf", "stbl", "stsd"])[0],
|
|
670
|
+
}[d], g = W(r, ["mdia", "minf", "stbl", "stsd"])[0], E = qa(g);
|
|
671
671
|
f ? (e[c] = {
|
|
672
672
|
timescale: h,
|
|
673
673
|
type: f,
|
|
674
|
-
stsd:
|
|
674
|
+
stsd: E
|
|
675
675
|
}, e[f] = te({
|
|
676
676
|
timescale: h,
|
|
677
677
|
id: c
|
|
678
|
-
},
|
|
678
|
+
}, E)) : e[c] = {
|
|
679
679
|
timescale: h,
|
|
680
680
|
type: d,
|
|
681
|
-
stsd:
|
|
681
|
+
stsd: E
|
|
682
682
|
};
|
|
683
683
|
}
|
|
684
684
|
}
|
|
@@ -748,14 +748,14 @@ function qa(a) {
|
|
|
748
748
|
case "hev1": {
|
|
749
749
|
const c = W(t, ["hvcC"])[0];
|
|
750
750
|
if (c && c.length > 12) {
|
|
751
|
-
const l = c[1], h = ["", "A", "B", "C"][l >> 6], u = l & 31, d = K(c, 2), f = (l & 32) >> 5 ? "H" : "L", g = c[12],
|
|
751
|
+
const l = c[1], h = ["", "A", "B", "C"][l >> 6], u = l & 31, d = K(c, 2), f = (l & 32) >> 5 ? "H" : "L", g = c[12], E = c.subarray(6, 12);
|
|
752
752
|
i += "." + h + u, i += "." + d.toString(16).toUpperCase(), i += "." + f + g;
|
|
753
|
-
let
|
|
754
|
-
for (let y =
|
|
755
|
-
const
|
|
756
|
-
(
|
|
753
|
+
let p = "";
|
|
754
|
+
for (let y = E.length; y--; ) {
|
|
755
|
+
const S = E[y];
|
|
756
|
+
(S || p) && (p = "." + S.toString(16).toUpperCase() + p);
|
|
757
757
|
}
|
|
758
|
-
i +=
|
|
758
|
+
i += p;
|
|
759
759
|
}
|
|
760
760
|
r = wt(o == "hev1" ? "dvhe" : "dvh1", t);
|
|
761
761
|
break;
|
|
@@ -779,8 +779,8 @@ function qa(a) {
|
|
|
779
779
|
case "av01": {
|
|
780
780
|
const c = W(t, ["av1C"])[0];
|
|
781
781
|
if (c && c.length > 2) {
|
|
782
|
-
const l = c[1] >>> 5, h = c[1] & 31, u = c[2] >>> 7 ? "H" : "M", d = (c[2] & 64) >> 6, f = (c[2] & 32) >> 5, g = l === 2 && d ? f ? 12 : 10 : d ? 10 : 8,
|
|
783
|
-
i += "." + l + "." + De(h) + u + "." + De(g) + "." +
|
|
782
|
+
const l = c[1] >>> 5, h = c[1] & 31, u = c[2] >>> 7 ? "H" : "M", d = (c[2] & 64) >> 6, f = (c[2] & 32) >> 5, g = l === 2 && d ? f ? 12 : 10 : d ? 10 : 8, E = (c[2] & 16) >> 4, p = (c[2] & 8) >> 3, y = (c[2] & 4) >> 2, S = c[2] & 3;
|
|
783
|
+
i += "." + l + "." + De(h) + u + "." + De(g) + "." + E + "." + p + y + S + "." + De(1) + "." + De(1) + "." + De(1) + "." + 0, r = wt("dav1", t);
|
|
784
784
|
}
|
|
785
785
|
break;
|
|
786
786
|
}
|
|
@@ -824,7 +824,7 @@ function ja(a, e) {
|
|
|
824
824
|
const f = sn(d);
|
|
825
825
|
if (f) {
|
|
826
826
|
const g = f.subarray(8, 24);
|
|
827
|
-
g.some((
|
|
827
|
+
g.some((E) => E !== 0) || (Q.log(`[eme] Patching keyId in 'enc${c ? "a" : "v"}>sinf>>tenc' box: ${Ce.hexDump(g)} -> ${Ce.hexDump(t)}`), f.set(t, 8));
|
|
828
828
|
}
|
|
829
829
|
});
|
|
830
830
|
});
|
|
@@ -869,10 +869,10 @@ function za(a, e) {
|
|
|
869
869
|
const u = h.default, d = K(c, 0) | (u == null ? void 0 : u.flags);
|
|
870
870
|
let f = u == null ? void 0 : u.duration;
|
|
871
871
|
d & 8 && (d & 2 ? f = K(c, 12) : f = K(c, 8));
|
|
872
|
-
const g = h.timescale || 9e4,
|
|
873
|
-
for (let
|
|
874
|
-
if (t = Qa(p
|
|
875
|
-
const y = K(p
|
|
872
|
+
const g = h.timescale || 9e4, E = W(o, ["trun"]);
|
|
873
|
+
for (let p = 0; p < E.length; p++) {
|
|
874
|
+
if (t = Qa(E[p]), !t && f) {
|
|
875
|
+
const y = K(E[p], 4);
|
|
876
876
|
t = f * y;
|
|
877
877
|
}
|
|
878
878
|
h.type === ie.VIDEO ? s += t / g : h.type === ie.AUDIO && (i += t / g);
|
|
@@ -954,24 +954,24 @@ function Ui(a, e) {
|
|
|
954
954
|
W(c, ["traf"]).map((u) => {
|
|
955
955
|
const d = W(u, ["tfdt"]).map((f) => {
|
|
956
956
|
const g = f[0];
|
|
957
|
-
let
|
|
958
|
-
return g === 1 && (
|
|
957
|
+
let E = K(f, 4);
|
|
958
|
+
return g === 1 && (E *= Math.pow(2, 32), E += K(f, 8)), E / i;
|
|
959
959
|
})[0];
|
|
960
960
|
return d !== void 0 && (a = d), W(u, ["tfhd"]).map((f) => {
|
|
961
|
-
const g = K(f, 4),
|
|
961
|
+
const g = K(f, 4), E = K(f, 0) & 16777215, p = (E & 1) !== 0, y = (E & 2) !== 0, S = (E & 8) !== 0;
|
|
962
962
|
let T = 0;
|
|
963
|
-
const
|
|
963
|
+
const v = (E & 16) !== 0;
|
|
964
964
|
let x = 0;
|
|
965
|
-
const _ = (
|
|
966
|
-
let
|
|
967
|
-
g === r && (
|
|
968
|
-
const D = R[0],
|
|
965
|
+
const _ = (E & 32) !== 0;
|
|
966
|
+
let A = 8;
|
|
967
|
+
g === r && (p && (A += 8), y && (A += 4), S && (T = K(f, A), A += 4), v && (x = K(f, A), A += 4), _ && (A += 4), e.type === "video" && (n = us(e.codec)), W(u, ["trun"]).map((R) => {
|
|
968
|
+
const D = R[0], L = K(R, 0) & 16777215, P = (L & 1) !== 0;
|
|
969
969
|
let O = 0;
|
|
970
|
-
const X = (
|
|
970
|
+
const X = (L & 4) !== 0, V = (L & 256) !== 0;
|
|
971
971
|
let $ = 0;
|
|
972
|
-
const M = (
|
|
972
|
+
const M = (L & 512) !== 0;
|
|
973
973
|
let G = 0;
|
|
974
|
-
const B = (
|
|
974
|
+
const B = (L & 1024) !== 0, k = (L & 2048) !== 0;
|
|
975
975
|
let w = 0;
|
|
976
976
|
const Y = K(R, 4);
|
|
977
977
|
let H = 8;
|
|
@@ -1044,11 +1044,11 @@ function ai(a, e, t, s) {
|
|
|
1044
1044
|
if (h += 4, f === 1195456820) {
|
|
1045
1045
|
const g = i[h++];
|
|
1046
1046
|
if (g === 3) {
|
|
1047
|
-
const
|
|
1047
|
+
const E = i[h++], p = 31 & E, y = 64 & E, S = y ? 2 + p * 3 : 0, T = new Uint8Array(S);
|
|
1048
1048
|
if (y) {
|
|
1049
|
-
T[0] =
|
|
1050
|
-
for (let
|
|
1051
|
-
T[
|
|
1049
|
+
T[0] = E;
|
|
1050
|
+
for (let v = 1; v < S; v++)
|
|
1051
|
+
T[v] = i[h++];
|
|
1052
1052
|
}
|
|
1053
1053
|
s.push({
|
|
1054
1054
|
type: g,
|
|
@@ -1063,8 +1063,8 @@ function ai(a, e, t, s) {
|
|
|
1063
1063
|
} else if (n === 5 && o > 16) {
|
|
1064
1064
|
const u = [];
|
|
1065
1065
|
for (let g = 0; g < 16; g++) {
|
|
1066
|
-
const
|
|
1067
|
-
u.push(
|
|
1066
|
+
const E = i[h++].toString(16);
|
|
1067
|
+
u.push(E.length == 1 ? "0" + E : E), (g === 3 || g === 5 || g === 7 || g === 9) && u.push("-");
|
|
1068
1068
|
}
|
|
1069
1069
|
const d = o - 16, f = new Uint8Array(d);
|
|
1070
1070
|
for (let g = 0; g < d; g++)
|
|
@@ -1073,7 +1073,7 @@ function ai(a, e, t, s) {
|
|
|
1073
1073
|
payloadType: n,
|
|
1074
1074
|
pts: t,
|
|
1075
1075
|
uuid: u.join(""),
|
|
1076
|
-
userData:
|
|
1076
|
+
userData: Se(f),
|
|
1077
1077
|
userDataBytes: f
|
|
1078
1078
|
});
|
|
1079
1079
|
}
|
|
@@ -1325,10 +1325,10 @@ function ts(a) {
|
|
|
1325
1325
|
return r ? (r * 2 + t) / (t ? 3 : 2) : (ut.audio[s] + t) / (t ? 2 : 1);
|
|
1326
1326
|
}, 0);
|
|
1327
1327
|
}
|
|
1328
|
-
const
|
|
1328
|
+
const Ss = {};
|
|
1329
1329
|
function ao(a, e = !0) {
|
|
1330
|
-
if (
|
|
1331
|
-
return
|
|
1330
|
+
if (Ss[a])
|
|
1331
|
+
return Ss[a];
|
|
1332
1332
|
const t = {
|
|
1333
1333
|
// Idealy fLaC and Opus would be first (spec-compliant) but
|
|
1334
1334
|
// some browsers will report that fLaC is supported then fail.
|
|
@@ -1342,7 +1342,7 @@ function ao(a, e = !0) {
|
|
|
1342
1342
|
for (let i = 0; i < t.length; i++) {
|
|
1343
1343
|
var s;
|
|
1344
1344
|
if (on(t[i], "audio", e))
|
|
1345
|
-
return
|
|
1345
|
+
return Ss[a] = t[i], t[i];
|
|
1346
1346
|
if (t[i] === "mp3" && (s = qe(e)) != null && s.isTypeSupported("audio/mpeg"))
|
|
1347
1347
|
return "";
|
|
1348
1348
|
}
|
|
@@ -1669,9 +1669,9 @@ const yo = (a) => {
|
|
|
1669
1669
|
}, ae = (a, e) => JSON.stringify(a, yo(e));
|
|
1670
1670
|
function To(a, e, t, s, i) {
|
|
1671
1671
|
const r = Object.keys(a), n = s == null ? void 0 : s.channels, o = s == null ? void 0 : s.audioCodec, c = i == null ? void 0 : i.videoCodec, l = n && parseInt(n) === 2;
|
|
1672
|
-
let h = !1, u = !1, d = 1 / 0, f = 1 / 0, g = 1 / 0,
|
|
1672
|
+
let h = !1, u = !1, d = 1 / 0, f = 1 / 0, g = 1 / 0, E = 1 / 0, p = 0, y = [];
|
|
1673
1673
|
const {
|
|
1674
|
-
preferHDR:
|
|
1674
|
+
preferHDR: S,
|
|
1675
1675
|
allowedVideoRanges: T
|
|
1676
1676
|
} = Eo(e, i);
|
|
1677
1677
|
for (let R = r.length; R--; ) {
|
|
@@ -1679,44 +1679,44 @@ function To(a, e, t, s, i) {
|
|
|
1679
1679
|
h || (h = D.channels[2] > 0), d = Math.min(d, D.minHeight), f = Math.min(f, D.minFramerate), g = Math.min(g, D.minBitrate), T.filter((P) => D.videoRanges[P] > 0).length > 0 && (u = !0);
|
|
1680
1680
|
}
|
|
1681
1681
|
d = F(d) ? d : 0, f = F(f) ? f : 0;
|
|
1682
|
-
const
|
|
1682
|
+
const v = Math.max(1080, d), x = Math.max(30, f);
|
|
1683
1683
|
g = F(g) ? g : t, t = Math.max(g, t), u || (e = void 0);
|
|
1684
1684
|
const _ = r.length > 1;
|
|
1685
1685
|
return {
|
|
1686
1686
|
codecSet: r.reduce((R, D) => {
|
|
1687
|
-
const
|
|
1687
|
+
const L = a[D];
|
|
1688
1688
|
if (D === R)
|
|
1689
1689
|
return R;
|
|
1690
|
-
if (y = u ? T.filter((P) =>
|
|
1691
|
-
if (
|
|
1692
|
-
return _e(D, `min bitrate of ${
|
|
1693
|
-
if (!
|
|
1690
|
+
if (y = u ? T.filter((P) => L.videoRanges[P] > 0) : [], _) {
|
|
1691
|
+
if (L.minBitrate > t)
|
|
1692
|
+
return _e(D, `min bitrate of ${L.minBitrate} > current estimate of ${t}`), R;
|
|
1693
|
+
if (!L.hasDefaultAudio)
|
|
1694
1694
|
return _e(D, "no renditions with default or auto-select sound found"), R;
|
|
1695
1695
|
if (o && D.indexOf(o.substring(0, 4)) % 5 !== 0)
|
|
1696
1696
|
return _e(D, `audio codec preference "${o}" not found`), R;
|
|
1697
1697
|
if (n && !l) {
|
|
1698
|
-
if (!
|
|
1699
|
-
return _e(D, `no renditions with ${n} channel sound found (channels options: ${Object.keys(
|
|
1700
|
-
} else if ((!o || l) && h &&
|
|
1698
|
+
if (!L.channels[n])
|
|
1699
|
+
return _e(D, `no renditions with ${n} channel sound found (channels options: ${Object.keys(L.channels)})`), R;
|
|
1700
|
+
} else if ((!o || l) && h && L.channels[2] === 0)
|
|
1701
1701
|
return _e(D, "no renditions with stereo sound found"), R;
|
|
1702
|
-
if (
|
|
1703
|
-
return _e(D, `min resolution of ${
|
|
1704
|
-
if (
|
|
1705
|
-
return _e(D, `min framerate of ${
|
|
1706
|
-
if (!y.some((P) =>
|
|
1702
|
+
if (L.minHeight > v)
|
|
1703
|
+
return _e(D, `min resolution of ${L.minHeight} > maximum of ${v}`), R;
|
|
1704
|
+
if (L.minFramerate > x)
|
|
1705
|
+
return _e(D, `min framerate of ${L.minFramerate} > maximum of ${x}`), R;
|
|
1706
|
+
if (!y.some((P) => L.videoRanges[P] > 0))
|
|
1707
1707
|
return _e(D, `no variants with VIDEO-RANGE of ${ae(y)} found`), R;
|
|
1708
1708
|
if (c && D.indexOf(c.substring(0, 4)) % 5 !== 0)
|
|
1709
1709
|
return _e(D, `video codec preference "${c}" not found`), R;
|
|
1710
|
-
if (
|
|
1711
|
-
return _e(D, `max score of ${
|
|
1710
|
+
if (L.maxScore < p)
|
|
1711
|
+
return _e(D, `max score of ${L.maxScore} < selected max of ${p}`), R;
|
|
1712
1712
|
}
|
|
1713
|
-
return R && (ts(D) >= ts(R) ||
|
|
1713
|
+
return R && (ts(D) >= ts(R) || L.fragmentError > a[R].fragmentError) ? R : (E = L.minIndex, p = L.maxScore, D);
|
|
1714
1714
|
}, void 0),
|
|
1715
1715
|
videoRanges: y,
|
|
1716
|
-
preferHDR:
|
|
1716
|
+
preferHDR: S,
|
|
1717
1717
|
minFramerate: f,
|
|
1718
1718
|
minBitrate: g,
|
|
1719
|
-
minIndex:
|
|
1719
|
+
minIndex: E
|
|
1720
1720
|
};
|
|
1721
1721
|
}
|
|
1722
1722
|
function _e(a, e) {
|
|
@@ -1741,7 +1741,7 @@ function dn(a) {
|
|
|
1741
1741
|
groups: {}
|
|
1742
1742
|
});
|
|
1743
1743
|
}
|
|
1744
|
-
function
|
|
1744
|
+
function So(a, e, t, s) {
|
|
1745
1745
|
return a.slice(t, s + 1).reduce((i, r, n) => {
|
|
1746
1746
|
if (!r.codecSet)
|
|
1747
1747
|
return i;
|
|
@@ -1812,9 +1812,9 @@ function et(a, e, t) {
|
|
|
1812
1812
|
assocLang: n,
|
|
1813
1813
|
default: o
|
|
1814
1814
|
} = a, c = a.forced;
|
|
1815
|
-
return (s === void 0 || e.groupId === s) && (i === void 0 || e.name === i) && (r === void 0 ||
|
|
1815
|
+
return (s === void 0 || e.groupId === s) && (i === void 0 || e.name === i) && (r === void 0 || vo(r, e.lang)) && (r === void 0 || e.assocLang === n) && (o === void 0 || e.default === o) && (c === void 0 || e.forced === c) && (!("characteristics" in a) || xo(a.characteristics || "", e.characteristics)) && (t === void 0 || t(a, e));
|
|
1816
1816
|
}
|
|
1817
|
-
function
|
|
1817
|
+
function vo(a, e = "--") {
|
|
1818
1818
|
return a.length === e.length ? a === e : a.startsWith(e) || e.startsWith(a);
|
|
1819
1819
|
}
|
|
1820
1820
|
function xo(a, e = "") {
|
|
@@ -1830,18 +1830,18 @@ function Je(a, e) {
|
|
|
1830
1830
|
}
|
|
1831
1831
|
function Ao(a, e, t, s, i) {
|
|
1832
1832
|
const r = e[s], o = e.reduce((d, f, g) => {
|
|
1833
|
-
const
|
|
1834
|
-
return (d[
|
|
1833
|
+
const E = f.uri;
|
|
1834
|
+
return (d[E] || (d[E] = [])).push(g), d;
|
|
1835
1835
|
}, {})[r.uri];
|
|
1836
1836
|
o.length > 1 && (s = Math.max.apply(Math, o));
|
|
1837
1837
|
const c = r.videoRange, l = r.frameRate, h = r.codecSet.substring(0, 4), u = qi(e, s, (d) => {
|
|
1838
1838
|
if (d.videoRange !== c || d.frameRate !== l || d.codecSet.substring(0, 4) !== h)
|
|
1839
1839
|
return !1;
|
|
1840
|
-
const f = d.audioGroups, g = t.filter((
|
|
1840
|
+
const f = d.audioGroups, g = t.filter((E) => !f || f.indexOf(E.groupId) !== -1);
|
|
1841
1841
|
return ke(a, g, i) > -1;
|
|
1842
1842
|
});
|
|
1843
1843
|
return u > -1 ? u : qi(e, s, (d) => {
|
|
1844
|
-
const f = d.audioGroups, g = t.filter((
|
|
1844
|
+
const f = d.audioGroups, g = t.filter((E) => !f || f.indexOf(E.groupId) !== -1);
|
|
1845
1845
|
return ke(a, g, i) > -1;
|
|
1846
1846
|
});
|
|
1847
1847
|
}
|
|
@@ -1872,26 +1872,26 @@ class Lo extends Ge {
|
|
|
1872
1872
|
} = n;
|
|
1873
1873
|
if (!i || !c)
|
|
1874
1874
|
return;
|
|
1875
|
-
const l = performance.now(), h = r ? r.stats : i.stats, u = r ? r.duration : i.duration, d = l - h.loading.start, f = n.minAutoLevel, g = i.level,
|
|
1875
|
+
const l = performance.now(), h = r ? r.stats : i.stats, u = r ? r.duration : i.duration, d = l - h.loading.start, f = n.minAutoLevel, g = i.level, E = this._nextAutoLevel;
|
|
1876
1876
|
if (h.aborted || h.loaded && h.loaded === h.total || g <= f) {
|
|
1877
1877
|
this.clearTimer(), this._nextAutoLevel = -1;
|
|
1878
1878
|
return;
|
|
1879
1879
|
}
|
|
1880
1880
|
if (!o)
|
|
1881
1881
|
return;
|
|
1882
|
-
const
|
|
1882
|
+
const p = E > -1 && E !== g, y = !!t || p;
|
|
1883
1883
|
if (!y && (c.paused || !c.playbackRate || !c.readyState))
|
|
1884
1884
|
return;
|
|
1885
|
-
const
|
|
1886
|
-
if (!y &&
|
|
1885
|
+
const S = n.mainForwardBufferInfo;
|
|
1886
|
+
if (!y && S === null)
|
|
1887
1887
|
return;
|
|
1888
|
-
const T = this.bwEstimator.getEstimateTTFB(),
|
|
1889
|
-
if (d <= Math.max(T, 1e3 * (u / (
|
|
1888
|
+
const T = this.bwEstimator.getEstimateTTFB(), v = Math.abs(c.playbackRate);
|
|
1889
|
+
if (d <= Math.max(T, 1e3 * (u / (v * 2))))
|
|
1890
1890
|
return;
|
|
1891
|
-
const x =
|
|
1892
|
-
let O =
|
|
1893
|
-
O < 1 &&
|
|
1894
|
-
const X =
|
|
1891
|
+
const x = S ? S.len / v : 0, _ = h.loading.first ? h.loading.first - h.loading.start : -1, A = h.loaded && _ > -1, R = this.getBwEstimate(), D = n.levels, L = D[g], P = Math.max(h.loaded, Math.round(u * (i.bitrate || L.averageBitrate) / 8));
|
|
1892
|
+
let O = A ? d - _ : d;
|
|
1893
|
+
O < 1 && A && (O = Math.min(d, h.loaded * 8 / R));
|
|
1894
|
+
const X = A ? h.loaded * 1e3 / O : 0, V = T / 1e3, $ = X ? (P - h.loaded) / X : P * 8 / R + V;
|
|
1895
1895
|
if ($ <= x)
|
|
1896
1896
|
return;
|
|
1897
1897
|
const M = X ? X * 8 : R, G = ((s = (t == null ? void 0 : t.details) || this.hls.latestLevelDetails) == null ? void 0 : s.live) === !0, B = this.hls.config.abrBandWidthUpFactor;
|
|
@@ -1903,7 +1903,7 @@ class Lo extends Ge {
|
|
|
1903
1903
|
}
|
|
1904
1904
|
if (k >= $ || k > u * 10)
|
|
1905
1905
|
return;
|
|
1906
|
-
|
|
1906
|
+
A ? this.bwEstimator.sample(d - Math.min(T, _), h.loaded) : this.bwEstimator.sampleTTFB(d);
|
|
1907
1907
|
const Y = D[w].maxBitrate;
|
|
1908
1908
|
this.getBwEstimate() * B > Y && this.resetEstimator(Y);
|
|
1909
1909
|
const H = this.findBestLevel(Y, f, w, 0, x, 1, 1);
|
|
@@ -1927,7 +1927,7 @@ class Lo extends Ge {
|
|
|
1927
1927
|
}
|
|
1928
1928
|
}
|
|
1929
1929
|
};
|
|
1930
|
-
|
|
1930
|
+
p || $ > k * 2 ? j() : this.timer = self.setInterval(j, k * 1e3), n.trigger(m.FRAG_LOAD_EMERGENCY_ABORTED, {
|
|
1931
1931
|
frag: i,
|
|
1932
1932
|
part: r,
|
|
1933
1933
|
stats: h
|
|
@@ -2097,20 +2097,20 @@ class Lo extends Ge {
|
|
|
2097
2097
|
} = s, o = t ? t.duration : e ? e.duration : 0, c = this.getBwEstimate(), l = this.getStarvationDelay();
|
|
2098
2098
|
let h = r.abrBandWidthFactor, u = r.abrBandWidthUpFactor;
|
|
2099
2099
|
if (l) {
|
|
2100
|
-
const
|
|
2101
|
-
if (
|
|
2102
|
-
return this.rebufferNotice = -1,
|
|
2100
|
+
const p = this.findBestLevel(c, n, i, l, 0, h, u);
|
|
2101
|
+
if (p >= 0)
|
|
2102
|
+
return this.rebufferNotice = -1, p;
|
|
2103
2103
|
}
|
|
2104
2104
|
let d = o ? Math.min(o, r.maxStarvationDelay) : r.maxStarvationDelay;
|
|
2105
2105
|
if (!l) {
|
|
2106
|
-
const
|
|
2107
|
-
|
|
2106
|
+
const p = this.bitrateTestDelay;
|
|
2107
|
+
p && (d = (o ? Math.min(o, r.maxLoadingDelay) : r.maxLoadingDelay) - p, this.info(`bitrate test took ${Math.round(1e3 * p)}ms, set first fragment max fetchDuration to ${Math.round(1e3 * d)} ms`), h = u = 1);
|
|
2108
2108
|
}
|
|
2109
2109
|
const f = this.findBestLevel(c, n, i, l, d, h, u);
|
|
2110
2110
|
if (this.rebufferNotice !== f && (this.rebufferNotice = f, this.info(`${l ? "rebuffering expected" : "buffer is empty"}, optimal quality level ${f}`)), f > -1)
|
|
2111
2111
|
return f;
|
|
2112
|
-
const g = s.levels[n],
|
|
2113
|
-
return
|
|
2112
|
+
const g = s.levels[n], E = s.loadLevelObj;
|
|
2113
|
+
return E && (g == null ? void 0 : g.bitrate) < E.bitrate ? n : s.loadLevel;
|
|
2114
2114
|
}
|
|
2115
2115
|
getStarvationDelay() {
|
|
2116
2116
|
const e = this.hls, t = e.media;
|
|
@@ -2129,23 +2129,23 @@ class Lo extends Ge {
|
|
|
2129
2129
|
partCurrent: f
|
|
2130
2130
|
} = this, {
|
|
2131
2131
|
levels: g,
|
|
2132
|
-
allAudioTracks:
|
|
2133
|
-
loadLevel:
|
|
2132
|
+
allAudioTracks: E,
|
|
2133
|
+
loadLevel: p,
|
|
2134
2134
|
config: y
|
|
2135
2135
|
} = this.hls;
|
|
2136
2136
|
if (g.length === 1)
|
|
2137
2137
|
return 0;
|
|
2138
|
-
const
|
|
2139
|
-
let x, _ = "SDR",
|
|
2138
|
+
const S = g[u], T = !!((c = this.hls.latestLevelDetails) != null && c.live), v = p === -1 || h === -1;
|
|
2139
|
+
let x, _ = "SDR", A = (S == null ? void 0 : S.frameRate) || 0;
|
|
2140
2140
|
const {
|
|
2141
2141
|
audioPreference: R,
|
|
2142
2142
|
videoPreference: D
|
|
2143
|
-
} = y,
|
|
2143
|
+
} = y, L = this.audioTracksByGroup || (this.audioTracksByGroup = dn(E));
|
|
2144
2144
|
let P = -1;
|
|
2145
|
-
if (
|
|
2145
|
+
if (v) {
|
|
2146
2146
|
if (this.firstSelection !== -1)
|
|
2147
2147
|
return this.firstSelection;
|
|
2148
|
-
const M = this.codecTiers || (this.codecTiers =
|
|
2148
|
+
const M = this.codecTiers || (this.codecTiers = So(g, L, t, s)), G = To(M, _, e, R, D), {
|
|
2149
2149
|
codecSet: B,
|
|
2150
2150
|
videoRanges: k,
|
|
2151
2151
|
minFramerate: w,
|
|
@@ -2153,9 +2153,9 @@ class Lo extends Ge {
|
|
|
2153
2153
|
minIndex: H,
|
|
2154
2154
|
preferHDR: j
|
|
2155
2155
|
} = G;
|
|
2156
|
-
P = H, x = B, _ = j ? k[k.length - 1] : k[0],
|
|
2156
|
+
P = H, x = B, _ = j ? k[k.length - 1] : k[0], A = w, e = Math.max(e, Y), this.log(`picked start tier ${ae(G)}`);
|
|
2157
2157
|
} else
|
|
2158
|
-
x =
|
|
2158
|
+
x = S == null ? void 0 : S.codecSet, _ = S == null ? void 0 : S.videoRange;
|
|
2159
2159
|
const O = f ? f.duration : d ? d.duration : 0, X = this.bwEstimator.getEstimateTTFB() / 1e3, V = [];
|
|
2160
2160
|
for (let M = s; M >= t; M--) {
|
|
2161
2161
|
var $;
|
|
@@ -2164,7 +2164,7 @@ class Lo extends Ge {
|
|
|
2164
2164
|
continue;
|
|
2165
2165
|
if (y.useMediaCapabilities && !G.supportedResult && !G.supportedPromise) {
|
|
2166
2166
|
const ee = navigator.mediaCapabilities;
|
|
2167
|
-
typeof (ee == null ? void 0 : ee.decodingInfo) == "function" && (uo(G,
|
|
2167
|
+
typeof (ee == null ? void 0 : ee.decodingInfo) == "function" && (uo(G, L, _, A, e, R) || us(G.videoCodec)) ? (G.supportedPromise = un(G, L, ee), G.supportedPromise.then((ne) => {
|
|
2168
2168
|
if (!this.hls)
|
|
2169
2169
|
return;
|
|
2170
2170
|
G.supportedResult = ne;
|
|
@@ -2172,7 +2172,7 @@ class Lo extends Ge {
|
|
|
2172
2172
|
ne.error ? this.warn(`MediaCapabilities decodingInfo error: "${ne.error}" for level ${me} ${ae(ne)}`) : ne.supported || (this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${me} ${ae(ne)}`), me > -1 && ge.length > 1 && (this.log(`Removing unsupported level ${me}`), this.hls.removeLevel(me), this.hls.loadLevel === -1 && (this.hls.nextLoadLevel = 0)));
|
|
2173
2173
|
})) : G.supportedResult = cn;
|
|
2174
2174
|
}
|
|
2175
|
-
if ((x && G.codecSet !== x || _ && G.videoRange !== _ || B &&
|
|
2175
|
+
if ((x && G.codecSet !== x || _ && G.videoRange !== _ || B && A > G.frameRate || !B && A > 0 && A < G.frameRate || G.supportedResult && !(($ = G.supportedResult.decodingInfoResults) != null && $[0].smooth)) && (!v || M !== P)) {
|
|
2176
2176
|
V.push(M);
|
|
2177
2177
|
continue;
|
|
2178
2178
|
}
|
|
@@ -2189,7 +2189,7 @@ class Lo extends Ge {
|
|
|
2189
2189
|
(j <= X || !F(j) || T && !this.bitrateTestDelay || j < l)
|
|
2190
2190
|
) {
|
|
2191
2191
|
const ee = this.forcedAutoLevel;
|
|
2192
|
-
return M !==
|
|
2192
|
+
return M !== p && (ee === -1 || ee !== p) && (V.length && this.trace(`Skipped level(s) ${V.join(",")} of ${s} max with CODECS and VIDEO-RANGE:"${g[V[0]].codecs}" ${g[V[0]].videoRange}; not compatible with "${x}" ${_}`), this.info(`switch candidate:${u}->${M} adjustedbw(${Math.round(Y)})-bitrate=${Math.round(Y - H)} ttfb:${X.toFixed(1)} avgDuration:${w.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${j.toFixed(1)} firstSelection:${v} codecSet:${G.codecSet} videoRange:${G.videoRange} hls.loadLevel:${p}`)), v && (this.firstSelection = M), M;
|
|
2193
2193
|
}
|
|
2194
2194
|
}
|
|
2195
2195
|
return -1;
|
|
@@ -2495,34 +2495,34 @@ class Co extends Ge {
|
|
|
2495
2495
|
maxAutoLevel: g
|
|
2496
2496
|
} = s;
|
|
2497
2497
|
s.autoLevelEnabled || (s.loadLevel = -1);
|
|
2498
|
-
const
|
|
2498
|
+
const E = (r = e.frag) == null ? void 0 : r.type, y = (E === N.AUDIO && l === b.FRAG_PARSING_ERROR || e.sourceBufferName === "audio" && (l === b.BUFFER_ADD_CODEC_ERROR || l === b.BUFFER_APPEND_ERROR)) && u.some(({
|
|
2499
2499
|
audioCodec: _
|
|
2500
2500
|
}) => i.audioCodec !== _), T = e.sourceBufferName === "video" && (l === b.BUFFER_ADD_CODEC_ERROR || l === b.BUFFER_APPEND_ERROR) && u.some(({
|
|
2501
2501
|
codecSet: _,
|
|
2502
|
-
audioCodec:
|
|
2503
|
-
}) => i.codecSet !== _ && i.audioCodec ===
|
|
2504
|
-
type:
|
|
2502
|
+
audioCodec: A
|
|
2503
|
+
}) => i.codecSet !== _ && i.audioCodec === A), {
|
|
2504
|
+
type: v,
|
|
2505
2505
|
groupId: x
|
|
2506
2506
|
} = (n = e.context) != null ? n : {};
|
|
2507
2507
|
for (let _ = u.length; _--; ) {
|
|
2508
|
-
const
|
|
2509
|
-
if (
|
|
2508
|
+
const A = (_ + d) % u.length;
|
|
2509
|
+
if (A !== d && A >= f && A <= g && u[A].loadError === 0) {
|
|
2510
2510
|
var o, c;
|
|
2511
|
-
const R = u[
|
|
2512
|
-
if (l === b.FRAG_GAP &&
|
|
2513
|
-
const D = u[
|
|
2511
|
+
const R = u[A];
|
|
2512
|
+
if (l === b.FRAG_GAP && E === N.MAIN && e.frag) {
|
|
2513
|
+
const D = u[A].details;
|
|
2514
2514
|
if (D) {
|
|
2515
|
-
const
|
|
2516
|
-
if (
|
|
2515
|
+
const L = tt(e.frag, D.fragments, e.frag.start);
|
|
2516
|
+
if (L != null && L.gap)
|
|
2517
2517
|
continue;
|
|
2518
2518
|
}
|
|
2519
2519
|
} else {
|
|
2520
|
-
if (
|
|
2520
|
+
if (v === z.AUDIO_TRACK && R.hasAudioGroup(x) || v === z.SUBTITLE_TRACK && R.hasSubtitleGroup(x))
|
|
2521
2521
|
continue;
|
|
2522
|
-
if (
|
|
2522
|
+
if (E === N.AUDIO && (o = i.audioGroups) != null && o.some((D) => R.hasAudioGroup(D)) || E === N.SUBTITLE && (c = i.subtitleGroups) != null && c.some((D) => R.hasSubtitleGroup(D)) || y && i.audioCodec === R.audioCodec || !y && i.audioCodec !== R.audioCodec || T && i.codecSet === R.codecSet)
|
|
2523
2523
|
continue;
|
|
2524
2524
|
}
|
|
2525
|
-
h =
|
|
2525
|
+
h = A;
|
|
2526
2526
|
break;
|
|
2527
2527
|
}
|
|
2528
2528
|
}
|
|
@@ -2916,15 +2916,15 @@ class Oo {
|
|
|
2916
2916
|
}
|
|
2917
2917
|
initTable() {
|
|
2918
2918
|
const e = this.sBox, t = this.invSBox, s = this.subMix, i = s[0], r = s[1], n = s[2], o = s[3], c = this.invSubMix, l = c[0], h = c[1], u = c[2], d = c[3], f = new Uint32Array(256);
|
|
2919
|
-
let g = 0,
|
|
2920
|
-
for (
|
|
2921
|
-
|
|
2922
|
-
for (
|
|
2923
|
-
let y =
|
|
2919
|
+
let g = 0, E = 0, p = 0;
|
|
2920
|
+
for (p = 0; p < 256; p++)
|
|
2921
|
+
p < 128 ? f[p] = p << 1 : f[p] = p << 1 ^ 283;
|
|
2922
|
+
for (p = 0; p < 256; p++) {
|
|
2923
|
+
let y = E ^ E << 1 ^ E << 2 ^ E << 3 ^ E << 4;
|
|
2924
2924
|
y = y >>> 8 ^ y & 255 ^ 99, e[g] = y, t[y] = g;
|
|
2925
|
-
const
|
|
2925
|
+
const S = f[g], T = f[S], v = f[T];
|
|
2926
2926
|
let x = f[y] * 257 ^ y * 16843008;
|
|
2927
|
-
i[g] = x << 24 | x >>> 8, r[g] = x << 16 | x >>> 16, n[g] = x << 8 | x >>> 24, o[g] = x, x =
|
|
2927
|
+
i[g] = x << 24 | x >>> 8, r[g] = x << 16 | x >>> 16, n[g] = x << 8 | x >>> 24, o[g] = x, x = v * 16843009 ^ T * 65537 ^ S * 257 ^ g * 16843008, l[y] = x << 24 | x >>> 8, h[y] = x << 16 | x >>> 16, u[y] = x << 8 | x >>> 24, d[y] = x, g ? (g = S ^ f[f[f[v ^ S]]], E ^= f[f[E]]) : g = E = 1;
|
|
2928
2928
|
}
|
|
2929
2929
|
}
|
|
2930
2930
|
expandKey(e) {
|
|
@@ -2940,17 +2940,17 @@ class Oo {
|
|
|
2940
2940
|
throw new Error("Invalid aes key size=" + r);
|
|
2941
2941
|
const n = this.ksRows = (r + 6 + 1) * 4;
|
|
2942
2942
|
let o, c;
|
|
2943
|
-
const l = this.keySchedule = new Uint32Array(n), h = this.invKeySchedule = new Uint32Array(n), u = this.sBox, d = this.rcon, f = this.invSubMix, g = f[0],
|
|
2944
|
-
let
|
|
2943
|
+
const l = this.keySchedule = new Uint32Array(n), h = this.invKeySchedule = new Uint32Array(n), u = this.sBox, d = this.rcon, f = this.invSubMix, g = f[0], E = f[1], p = f[2], y = f[3];
|
|
2944
|
+
let S, T;
|
|
2945
2945
|
for (o = 0; o < n; o++) {
|
|
2946
2946
|
if (o < r) {
|
|
2947
|
-
|
|
2947
|
+
S = l[o] = t[o];
|
|
2948
2948
|
continue;
|
|
2949
2949
|
}
|
|
2950
|
-
T =
|
|
2950
|
+
T = S, o % r === 0 ? (T = T << 8 | T >>> 24, T = u[T >>> 24] << 24 | u[T >>> 16 & 255] << 16 | u[T >>> 8 & 255] << 8 | u[T & 255], T ^= d[o / r | 0] << 24) : r > 6 && o % r === 4 && (T = u[T >>> 24] << 24 | u[T >>> 16 & 255] << 16 | u[T >>> 8 & 255] << 8 | u[T & 255]), l[o] = S = (l[o - r] ^ T) >>> 0;
|
|
2951
2951
|
}
|
|
2952
2952
|
for (c = 0; c < n; c++)
|
|
2953
|
-
o = n - c, c & 3 ? T = l[o] : T = l[o - 4], c < 4 || o <= 4 ? h[c] = T : h[c] = g[u[T >>> 24]] ^
|
|
2953
|
+
o = n - c, c & 3 ? T = l[o] : T = l[o - 4], c < 4 || o <= 4 ? h[c] = T : h[c] = g[u[T >>> 24]] ^ E[u[T >>> 16 & 255]] ^ p[u[T >>> 8 & 255]] ^ y[u[T & 255]], h[c] = h[c] >>> 0;
|
|
2954
2954
|
}
|
|
2955
2955
|
// Adding this as a method greatly improves performance.
|
|
2956
2956
|
networkToHostOrderSwap(e) {
|
|
@@ -2958,16 +2958,16 @@ class Oo {
|
|
|
2958
2958
|
}
|
|
2959
2959
|
decrypt(e, t, s) {
|
|
2960
2960
|
const i = this.keySize + 6, r = this.invKeySchedule, n = this.invSBox, o = this.invSubMix, c = o[0], l = o[1], h = o[2], u = o[3], d = this.uint8ArrayToUint32Array_(s);
|
|
2961
|
-
let f = d[0], g = d[1],
|
|
2962
|
-
const y = new Int32Array(e),
|
|
2963
|
-
let T,
|
|
2961
|
+
let f = d[0], g = d[1], E = d[2], p = d[3];
|
|
2962
|
+
const y = new Int32Array(e), S = new Int32Array(y.length);
|
|
2963
|
+
let T, v, x, _, A, R, D, L, P, O, X, V, $, M;
|
|
2964
2964
|
const G = this.networkToHostOrderSwap;
|
|
2965
2965
|
for (; t < y.length; ) {
|
|
2966
|
-
for (P = G(y[t]), O = G(y[t + 1]), X = G(y[t + 2]), V = G(y[t + 3]),
|
|
2967
|
-
T = c[
|
|
2968
|
-
T = n[
|
|
2966
|
+
for (P = G(y[t]), O = G(y[t + 1]), X = G(y[t + 2]), V = G(y[t + 3]), A = P ^ r[0], R = V ^ r[1], D = X ^ r[2], L = O ^ r[3], $ = 4, M = 1; M < i; M++)
|
|
2967
|
+
T = c[A >>> 24] ^ l[R >> 16 & 255] ^ h[D >> 8 & 255] ^ u[L & 255] ^ r[$], v = c[R >>> 24] ^ l[D >> 16 & 255] ^ h[L >> 8 & 255] ^ u[A & 255] ^ r[$ + 1], x = c[D >>> 24] ^ l[L >> 16 & 255] ^ h[A >> 8 & 255] ^ u[R & 255] ^ r[$ + 2], _ = c[L >>> 24] ^ l[A >> 16 & 255] ^ h[R >> 8 & 255] ^ u[D & 255] ^ r[$ + 3], A = T, R = v, D = x, L = _, $ = $ + 4;
|
|
2968
|
+
T = n[A >>> 24] << 24 ^ n[R >> 16 & 255] << 16 ^ n[D >> 8 & 255] << 8 ^ n[L & 255] ^ r[$], v = n[R >>> 24] << 24 ^ n[D >> 16 & 255] << 16 ^ n[L >> 8 & 255] << 8 ^ n[A & 255] ^ r[$ + 1], x = n[D >>> 24] << 24 ^ n[L >> 16 & 255] << 16 ^ n[A >> 8 & 255] << 8 ^ n[R & 255] ^ r[$ + 2], _ = n[L >>> 24] << 24 ^ n[A >> 16 & 255] << 16 ^ n[R >> 8 & 255] << 8 ^ n[D & 255] ^ r[$ + 3], S[t] = G(T ^ f), S[t + 1] = G(_ ^ g), S[t + 2] = G(x ^ E), S[t + 3] = G(v ^ p), f = P, g = O, E = X, p = V, t = t + 4;
|
|
2969
2969
|
}
|
|
2970
|
-
return
|
|
2970
|
+
return S.buffer;
|
|
2971
2971
|
}
|
|
2972
2972
|
}
|
|
2973
2973
|
class Fo {
|
|
@@ -3121,17 +3121,17 @@ class Bo {
|
|
|
3121
3121
|
};
|
|
3122
3122
|
e.stats = l.stats;
|
|
3123
3123
|
const f = {
|
|
3124
|
-
onSuccess: (g,
|
|
3124
|
+
onSuccess: (g, E, p, y) => {
|
|
3125
3125
|
this.resetLoader(e, l);
|
|
3126
|
-
let
|
|
3127
|
-
|
|
3126
|
+
let S = g.data;
|
|
3127
|
+
p.resetIV && e.decryptdata && (e.decryptdata.iv = new Uint8Array(S.slice(0, 16)), S = S.slice(16)), o({
|
|
3128
3128
|
frag: e,
|
|
3129
3129
|
part: null,
|
|
3130
|
-
payload:
|
|
3130
|
+
payload: S,
|
|
3131
3131
|
networkDetails: y
|
|
3132
3132
|
});
|
|
3133
3133
|
},
|
|
3134
|
-
onError: (g,
|
|
3134
|
+
onError: (g, E, p, y) => {
|
|
3135
3135
|
this.resetLoader(e, l), c(new Be({
|
|
3136
3136
|
type: U.NETWORK_ERROR,
|
|
3137
3137
|
details: b.FRAG_LOAD_ERROR,
|
|
@@ -3142,37 +3142,37 @@ class Bo {
|
|
|
3142
3142
|
data: void 0
|
|
3143
3143
|
}, g),
|
|
3144
3144
|
error: new Error(`HTTP Error ${g.code} ${g.text}`),
|
|
3145
|
-
networkDetails:
|
|
3145
|
+
networkDetails: p,
|
|
3146
3146
|
stats: y
|
|
3147
3147
|
}));
|
|
3148
3148
|
},
|
|
3149
|
-
onAbort: (g,
|
|
3149
|
+
onAbort: (g, E, p) => {
|
|
3150
3150
|
this.resetLoader(e, l), c(new Be({
|
|
3151
3151
|
type: U.NETWORK_ERROR,
|
|
3152
3152
|
details: b.INTERNAL_ABORTED,
|
|
3153
3153
|
fatal: !1,
|
|
3154
3154
|
frag: e,
|
|
3155
3155
|
error: new Error("Aborted"),
|
|
3156
|
-
networkDetails:
|
|
3156
|
+
networkDetails: p,
|
|
3157
3157
|
stats: g
|
|
3158
3158
|
}));
|
|
3159
3159
|
},
|
|
3160
|
-
onTimeout: (g,
|
|
3160
|
+
onTimeout: (g, E, p) => {
|
|
3161
3161
|
this.resetLoader(e, l), c(new Be({
|
|
3162
3162
|
type: U.NETWORK_ERROR,
|
|
3163
3163
|
details: b.FRAG_LOAD_TIMEOUT,
|
|
3164
3164
|
fatal: !1,
|
|
3165
3165
|
frag: e,
|
|
3166
3166
|
error: new Error(`Timeout after ${d.timeout}ms`),
|
|
3167
|
-
networkDetails:
|
|
3167
|
+
networkDetails: p,
|
|
3168
3168
|
stats: g
|
|
3169
3169
|
}));
|
|
3170
3170
|
}
|
|
3171
3171
|
};
|
|
3172
|
-
t && (f.onProgress = (g,
|
|
3172
|
+
t && (f.onProgress = (g, E, p, y) => t({
|
|
3173
3173
|
frag: e,
|
|
3174
3174
|
part: null,
|
|
3175
|
-
payload:
|
|
3175
|
+
payload: p,
|
|
3176
3176
|
networkDetails: y
|
|
3177
3177
|
})), l.load(h, d, f);
|
|
3178
3178
|
});
|
|
@@ -3196,17 +3196,17 @@ class Bo {
|
|
|
3196
3196
|
highWaterMark: Zi
|
|
3197
3197
|
};
|
|
3198
3198
|
t.stats = l.stats, l.load(h, d, {
|
|
3199
|
-
onSuccess: (f, g,
|
|
3199
|
+
onSuccess: (f, g, E, p) => {
|
|
3200
3200
|
this.resetLoader(e, l), this.updateStatsFromPart(e, t);
|
|
3201
3201
|
const y = {
|
|
3202
3202
|
frag: e,
|
|
3203
3203
|
part: t,
|
|
3204
3204
|
payload: f.data,
|
|
3205
|
-
networkDetails:
|
|
3205
|
+
networkDetails: p
|
|
3206
3206
|
};
|
|
3207
3207
|
s(y), o(y);
|
|
3208
3208
|
},
|
|
3209
|
-
onError: (f, g,
|
|
3209
|
+
onError: (f, g, E, p) => {
|
|
3210
3210
|
this.resetLoader(e, l), c(new Be({
|
|
3211
3211
|
type: U.NETWORK_ERROR,
|
|
3212
3212
|
details: b.FRAG_LOAD_ERROR,
|
|
@@ -3218,11 +3218,11 @@ class Bo {
|
|
|
3218
3218
|
data: void 0
|
|
3219
3219
|
}, f),
|
|
3220
3220
|
error: new Error(`HTTP Error ${f.code} ${f.text}`),
|
|
3221
|
-
networkDetails:
|
|
3222
|
-
stats:
|
|
3221
|
+
networkDetails: E,
|
|
3222
|
+
stats: p
|
|
3223
3223
|
}));
|
|
3224
3224
|
},
|
|
3225
|
-
onAbort: (f, g,
|
|
3225
|
+
onAbort: (f, g, E) => {
|
|
3226
3226
|
e.stats.aborted = t.stats.aborted, this.resetLoader(e, l), c(new Be({
|
|
3227
3227
|
type: U.NETWORK_ERROR,
|
|
3228
3228
|
details: b.INTERNAL_ABORTED,
|
|
@@ -3230,11 +3230,11 @@ class Bo {
|
|
|
3230
3230
|
frag: e,
|
|
3231
3231
|
part: t,
|
|
3232
3232
|
error: new Error("Aborted"),
|
|
3233
|
-
networkDetails:
|
|
3233
|
+
networkDetails: E,
|
|
3234
3234
|
stats: f
|
|
3235
3235
|
}));
|
|
3236
3236
|
},
|
|
3237
|
-
onTimeout: (f, g,
|
|
3237
|
+
onTimeout: (f, g, E) => {
|
|
3238
3238
|
this.resetLoader(e, l), c(new Be({
|
|
3239
3239
|
type: U.NETWORK_ERROR,
|
|
3240
3240
|
details: b.FRAG_LOAD_TIMEOUT,
|
|
@@ -3242,7 +3242,7 @@ class Bo {
|
|
|
3242
3242
|
frag: e,
|
|
3243
3243
|
part: t,
|
|
3244
3244
|
error: new Error(`Timeout after ${d.timeout}ms`),
|
|
3245
|
-
networkDetails:
|
|
3245
|
+
networkDetails: E,
|
|
3246
3246
|
stats: f
|
|
3247
3247
|
}));
|
|
3248
3248
|
}
|
|
@@ -3826,7 +3826,7 @@ var se = {
|
|
|
3826
3826
|
PLAYREADY: "com.microsoft.playready",
|
|
3827
3827
|
WIDEVINE: "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"
|
|
3828
3828
|
};
|
|
3829
|
-
function
|
|
3829
|
+
function vs(a) {
|
|
3830
3830
|
switch (a) {
|
|
3831
3831
|
case Ee.FAIRPLAY:
|
|
3832
3832
|
return se.FAIRPLAY;
|
|
@@ -4100,7 +4100,7 @@ class we {
|
|
|
4100
4100
|
if (h) {
|
|
4101
4101
|
const u = o[h], d = r[h] || [];
|
|
4102
4102
|
r[h] = d;
|
|
4103
|
-
const f = l.LANGUAGE, g = l["ASSOC-LANGUAGE"],
|
|
4103
|
+
const f = l.LANGUAGE, g = l["ASSOC-LANGUAGE"], E = l.CHANNELS, p = l.CHARACTERISTICS, y = l["INSTREAM-ID"], S = {
|
|
4104
4104
|
attrs: l,
|
|
4105
4105
|
bitrate: 0,
|
|
4106
4106
|
id: c++,
|
|
@@ -4113,11 +4113,11 @@ class we {
|
|
|
4113
4113
|
lang: f,
|
|
4114
4114
|
url: l.URI ? we.resolve(l.URI, t) : ""
|
|
4115
4115
|
};
|
|
4116
|
-
if (g && (
|
|
4117
|
-
const T = we.findGroup(u,
|
|
4118
|
-
hr(
|
|
4116
|
+
if (g && (S.assocLang = g), E && (S.channels = E), p && (S.characteristics = p), y && (S.instreamId = y), u != null && u.length) {
|
|
4117
|
+
const T = we.findGroup(u, S.groupId) || u[0];
|
|
4118
|
+
hr(S, T, "audioCodec"), hr(S, T, "textCodec");
|
|
4119
4119
|
}
|
|
4120
|
-
d.push(
|
|
4120
|
+
d.push(S);
|
|
4121
4121
|
}
|
|
4122
4122
|
}
|
|
4123
4123
|
return r;
|
|
@@ -4127,45 +4127,45 @@ class we {
|
|
|
4127
4127
|
const c = {
|
|
4128
4128
|
url: t
|
|
4129
4129
|
}, l = new Wo(t), h = l.fragments, u = [];
|
|
4130
|
-
let d = null, f = 0, g = 0,
|
|
4130
|
+
let d = null, f = 0, g = 0, E = 0, p = 0, y = 0, S = null, T = new Es(i, c), v, x, _, A = -1, R = !1, D = null, L;
|
|
4131
4131
|
if (Ls.lastIndex = 0, l.m3u8 = e, l.hasVariableRefs = sr(e), ((o = Ls.exec(e)) == null ? void 0 : o[0]) !== "#EXTM3U")
|
|
4132
4132
|
return l.playlistParsingError = new Error("Missing format identifier #EXTM3U"), l;
|
|
4133
|
-
for (; (
|
|
4134
|
-
R && (R = !1, T = new Es(i, c), T.playlistOffset =
|
|
4135
|
-
const V =
|
|
4133
|
+
for (; (v = Ls.exec(e)) !== null; ) {
|
|
4134
|
+
R && (R = !1, T = new Es(i, c), T.playlistOffset = E, T.start = E, T.sn = f, T.cc = p, y && (T.bitrate = y), T.level = s, d && (T.initSegment = d, d.rawProgramDateTime && (T.rawProgramDateTime = d.rawProgramDateTime, d.rawProgramDateTime = null), D && (T.setByteRange(D), D = null)));
|
|
4135
|
+
const V = v[1];
|
|
4136
4136
|
if (V) {
|
|
4137
4137
|
T.duration = parseFloat(V);
|
|
4138
|
-
const $ = (" " +
|
|
4138
|
+
const $ = (" " + v[2]).slice(1);
|
|
4139
4139
|
T.title = $ || null, T.tagList.push($ ? ["INF", V, $] : ["INF", V]);
|
|
4140
|
-
} else if (
|
|
4140
|
+
} else if (v[3]) {
|
|
4141
4141
|
if (F(T.duration)) {
|
|
4142
|
-
T.playlistOffset =
|
|
4143
|
-
const $ = (" " +
|
|
4144
|
-
T.relurl = Hs(l, $), Ws(T,
|
|
4142
|
+
T.playlistOffset = E, T.start = E, _ && dr(T, _, l), T.sn = f, T.level = s, T.cc = p, h.push(T);
|
|
4143
|
+
const $ = (" " + v[3]).slice(1);
|
|
4144
|
+
T.relurl = Hs(l, $), Ws(T, S, u), S = T, E += T.duration, f++, g = 0, R = !0;
|
|
4145
4145
|
}
|
|
4146
4146
|
} else {
|
|
4147
|
-
if (
|
|
4147
|
+
if (v = v[0].match(tl), !v) {
|
|
4148
4148
|
Q.warn("No matches on slow regex match for level playlist!");
|
|
4149
4149
|
continue;
|
|
4150
4150
|
}
|
|
4151
|
-
for (x = 1; x <
|
|
4151
|
+
for (x = 1; x < v.length && v[x] === void 0; x++)
|
|
4152
4152
|
;
|
|
4153
|
-
const $ = (" " +
|
|
4153
|
+
const $ = (" " + v[x]).slice(1), M = (" " + v[x + 1]).slice(1), G = v[x + 2] ? (" " + v[x + 2]).slice(1) : null;
|
|
4154
4154
|
switch ($) {
|
|
4155
4155
|
case "BYTERANGE":
|
|
4156
|
-
|
|
4156
|
+
S ? T.setByteRange(M, S) : T.setByteRange(M);
|
|
4157
4157
|
break;
|
|
4158
4158
|
case "PROGRAM-DATE-TIME":
|
|
4159
|
-
T.rawProgramDateTime = M, T.tagList.push(["PROGRAM-DATE-TIME", M]),
|
|
4159
|
+
T.rawProgramDateTime = M, T.tagList.push(["PROGRAM-DATE-TIME", M]), A === -1 && (A = h.length);
|
|
4160
4160
|
break;
|
|
4161
4161
|
case "PLAYLIST-TYPE":
|
|
4162
|
-
l.type && Me(l, $,
|
|
4162
|
+
l.type && Me(l, $, v), l.type = M.toUpperCase();
|
|
4163
4163
|
break;
|
|
4164
4164
|
case "MEDIA-SEQUENCE":
|
|
4165
|
-
l.startSN !== 0 ? Me(l, $,
|
|
4165
|
+
l.startSN !== 0 ? Me(l, $, v) : h.length > 0 && fr(l, $, v), f = l.startSN = parseInt(M);
|
|
4166
4166
|
break;
|
|
4167
4167
|
case "SKIP": {
|
|
4168
|
-
l.skippedSegments && Me(l, $,
|
|
4168
|
+
l.skippedSegments && Me(l, $, v);
|
|
4169
4169
|
const B = new oe(M, l), k = B.decimalInteger("SKIPPED-SEGMENTS");
|
|
4170
4170
|
if (F(k)) {
|
|
4171
4171
|
l.skippedSegments += k;
|
|
@@ -4178,21 +4178,21 @@ class we {
|
|
|
4178
4178
|
break;
|
|
4179
4179
|
}
|
|
4180
4180
|
case "TARGETDURATION":
|
|
4181
|
-
l.targetduration !== 0 && Me(l, $,
|
|
4181
|
+
l.targetduration !== 0 && Me(l, $, v), l.targetduration = Math.max(parseInt(M), 1);
|
|
4182
4182
|
break;
|
|
4183
4183
|
case "VERSION":
|
|
4184
|
-
l.version !== null && Me(l, $,
|
|
4184
|
+
l.version !== null && Me(l, $, v), l.version = parseInt(M);
|
|
4185
4185
|
break;
|
|
4186
4186
|
case "INDEPENDENT-SEGMENTS":
|
|
4187
4187
|
break;
|
|
4188
4188
|
case "ENDLIST":
|
|
4189
|
-
l.live || Me(l, $,
|
|
4189
|
+
l.live || Me(l, $, v), l.live = !1;
|
|
4190
4190
|
break;
|
|
4191
4191
|
case "#":
|
|
4192
4192
|
(M || G) && T.tagList.push(G ? [M, G] : [M]);
|
|
4193
4193
|
break;
|
|
4194
4194
|
case "DISCONTINUITY":
|
|
4195
|
-
|
|
4195
|
+
p++, T.tagList.push(["DIS"]);
|
|
4196
4196
|
break;
|
|
4197
4197
|
case "GAP":
|
|
4198
4198
|
T.gap = !0, T.tagList.push([$]);
|
|
@@ -4213,7 +4213,7 @@ class we {
|
|
|
4213
4213
|
break;
|
|
4214
4214
|
}
|
|
4215
4215
|
case "DISCONTINUITY-SEQUENCE":
|
|
4216
|
-
l.startCC !== 0 ? Me(l, $,
|
|
4216
|
+
l.startCC !== 0 ? Me(l, $, v) : h.length > 0 && fr(l, $, v), l.startCC = p = parseInt(M);
|
|
4217
4217
|
break;
|
|
4218
4218
|
case "KEY": {
|
|
4219
4219
|
const B = or(M, t, l);
|
|
@@ -4244,15 +4244,15 @@ class we {
|
|
|
4244
4244
|
D = null;
|
|
4245
4245
|
ur(T, B, s, _), d = T, R = !0;
|
|
4246
4246
|
}
|
|
4247
|
-
d.cc =
|
|
4247
|
+
d.cc = p;
|
|
4248
4248
|
break;
|
|
4249
4249
|
}
|
|
4250
4250
|
case "SERVER-CONTROL": {
|
|
4251
|
-
|
|
4251
|
+
L && Me(l, $, v), L = new oe(M), l.canBlockReload = L.bool("CAN-BLOCK-RELOAD"), l.canSkipUntil = L.optionalFloat("CAN-SKIP-UNTIL", 0), l.canSkipDateRanges = l.canSkipUntil > 0 && L.bool("CAN-SKIP-DATERANGES"), l.partHoldBack = L.optionalFloat("PART-HOLD-BACK", 0), l.holdBack = L.optionalFloat("HOLD-BACK", 0);
|
|
4252
4252
|
break;
|
|
4253
4253
|
}
|
|
4254
4254
|
case "PART-INF": {
|
|
4255
|
-
l.partTarget && Me(l, $,
|
|
4255
|
+
l.partTarget && Me(l, $, v);
|
|
4256
4256
|
const B = new oe(M);
|
|
4257
4257
|
l.partTarget = B.decimalFloatingPoint("PART-TARGET");
|
|
4258
4258
|
break;
|
|
@@ -4275,20 +4275,20 @@ class we {
|
|
|
4275
4275
|
break;
|
|
4276
4276
|
}
|
|
4277
4277
|
default:
|
|
4278
|
-
Q.warn(`line parsed but not handled: ${
|
|
4278
|
+
Q.warn(`line parsed but not handled: ${v}`);
|
|
4279
4279
|
break;
|
|
4280
4280
|
}
|
|
4281
4281
|
}
|
|
4282
4282
|
}
|
|
4283
|
-
|
|
4283
|
+
S && !S.relurl ? (h.pop(), E -= S.duration, l.partList && (l.fragmentHint = S)) : l.partList && (Ws(T, S, u), T.cc = p, l.fragmentHint = T, _ && dr(T, _, l)), l.targetduration || (l.playlistParsingError = new Error("#EXT-X-TARGETDURATION is required"));
|
|
4284
4284
|
const P = h.length, O = h[0], X = h[P - 1];
|
|
4285
|
-
if (
|
|
4286
|
-
l.averagetargetduration =
|
|
4285
|
+
if (E += l.skippedSegments * l.targetduration, E > 0 && P && X) {
|
|
4286
|
+
l.averagetargetduration = E / P;
|
|
4287
4287
|
const V = X.sn;
|
|
4288
|
-
l.endSN = V !== "initSegment" ? V : 0, l.live || (X.endList = !0), O && l.startCC === void 0 && (l.startCC = O.cc),
|
|
4288
|
+
l.endSN = V !== "initSegment" ? V : 0, l.live || (X.endList = !0), O && l.startCC === void 0 && (l.startCC = O.cc), A > 0 && (il(h, A), O && u.unshift(O));
|
|
4289
4289
|
} else
|
|
4290
4290
|
l.endSN = 0, l.startCC = 0;
|
|
4291
|
-
return l.fragmentHint && (
|
|
4291
|
+
return l.fragmentHint && (E += l.fragmentHint.duration), l.totalduration = E, u.length && l.dateRangeTagCount && O && Tn(u, l), l.endCC = p, l;
|
|
4292
4292
|
}
|
|
4293
4293
|
}
|
|
4294
4294
|
function Tn(a, e) {
|
|
@@ -4385,13 +4385,13 @@ function Is(a, e) {
|
|
|
4385
4385
|
e.sn > a.sn ? (s = t - a.start, i = a) : (s = a.start - t, i = e), i.duration !== s && i.setDuration(s);
|
|
4386
4386
|
} else e.sn > a.sn ? a.cc === e.cc && a.minEndPTS ? e.setStart(a.start + (a.minEndPTS - a.start)) : e.setStart(a.start + a.duration) : e.setStart(Math.max(a.start - e.duration, 0));
|
|
4387
4387
|
}
|
|
4388
|
-
function
|
|
4388
|
+
function Sn(a, e, t, s, i, r) {
|
|
4389
4389
|
s - t <= 0 && (Q.warn("Fragment should have a positive duration", e), s = t + e.duration, r = i + e.duration);
|
|
4390
4390
|
let o = t, c = s;
|
|
4391
4391
|
const l = e.startPTS, h = e.endPTS;
|
|
4392
4392
|
if (F(l)) {
|
|
4393
|
-
const
|
|
4394
|
-
F(e.deltaPTS) ? e.deltaPTS = Math.max(
|
|
4393
|
+
const p = Math.abs(l - t);
|
|
4394
|
+
F(e.deltaPTS) ? e.deltaPTS = Math.max(p, e.deltaPTS) : e.deltaPTS = p, o = Math.max(t, l), t = Math.min(t, l), i = Math.min(i, e.startDTS), c = Math.min(s, h), s = Math.max(s, h), r = Math.max(r, e.endDTS);
|
|
4395
4395
|
}
|
|
4396
4396
|
const u = t - e.start;
|
|
4397
4397
|
e.start !== 0 && e.setStart(t), e.setDuration(s - e.start), e.startPTS = t, e.maxStartPTS = o, e.startDTS = i, e.endPTS = s, e.minEndPTS = c, e.endDTS = r;
|
|
@@ -4399,12 +4399,12 @@ function vn(a, e, t, s, i, r) {
|
|
|
4399
4399
|
if (!a || d < a.startSN || d > a.endSN)
|
|
4400
4400
|
return 0;
|
|
4401
4401
|
let f;
|
|
4402
|
-
const g = d - a.startSN,
|
|
4403
|
-
for (
|
|
4404
|
-
Is(
|
|
4405
|
-
for (f = g; f <
|
|
4406
|
-
Is(
|
|
4407
|
-
return a.fragmentHint && Is(
|
|
4402
|
+
const g = d - a.startSN, E = a.fragments;
|
|
4403
|
+
for (E[g] = e, f = g; f > 0; f--)
|
|
4404
|
+
Is(E[f], E[f - 1]);
|
|
4405
|
+
for (f = g; f < E.length - 1; f++)
|
|
4406
|
+
Is(E[f], E[f + 1]);
|
|
4407
|
+
return a.fragmentHint && Is(E[E.length - 1], a.fragmentHint), a.PTSKnown = a.alignedSliding = !0, u;
|
|
4408
4408
|
}
|
|
4409
4409
|
function rl(a, e) {
|
|
4410
4410
|
if (a === e)
|
|
@@ -4424,8 +4424,8 @@ function rl(a, e) {
|
|
|
4424
4424
|
if (!e.startCC && l.cc !== c.cc) {
|
|
4425
4425
|
var d, f;
|
|
4426
4426
|
const g = c.cc - l.cc;
|
|
4427
|
-
for (let
|
|
4428
|
-
u[
|
|
4427
|
+
for (let E = h; E < u.length; E++)
|
|
4428
|
+
u[E].cc += g;
|
|
4429
4429
|
e.startCC = (d = (f = An(a, e.startSN - 1)) == null ? void 0 : f.cc) != null ? d : u[0].cc, e.endCC = u[u.length - 1].cc;
|
|
4430
4430
|
}
|
|
4431
4431
|
F(c.startPTS) && F(c.endPTS) && (l.setStart(l.startPTS = c.startPTS), l.startDTS = c.startDTS, l.maxStartPTS = c.maxStartPTS, l.endPTS = c.endPTS, l.endDTS = c.endDTS, l.minEndPTS = c.minEndPTS, l.setDuration(c.endPTS - c.startPTS), l.duration && (i = l), e.PTSKnown = e.alignedSliding = !0), c.hasStreams && (l.elementaryStreams = c.elementaryStreams), l.loader = c.loader, c.hasStats && (l.stats = c.stats), c.initSegment && (l.initSegment = c.initSegment, t = c.initSegment);
|
|
@@ -4450,7 +4450,7 @@ function rl(a, e) {
|
|
|
4450
4450
|
}
|
|
4451
4451
|
al(a.partList, e.partList, (c, l) => {
|
|
4452
4452
|
l.elementaryStreams = c.elementaryStreams, l.stats = c.stats;
|
|
4453
|
-
}), i ?
|
|
4453
|
+
}), i ? Sn(e, i, i.startPTS, i.endPTS, i.startDTS, i.endDTS) : vn(a, e), r.length && (e.totalduration = e.edge - r[0].start), e.driftStartTime = a.driftStartTime, e.driftStart = a.driftStart;
|
|
4454
4454
|
const o = e.advancedDateTime;
|
|
4455
4455
|
if (e.advanced && o) {
|
|
4456
4456
|
const c = e.edge;
|
|
@@ -4506,7 +4506,7 @@ ${e.m3u8}
|
|
|
4506
4506
|
Playlist starting @${t.startSN}
|
|
4507
4507
|
${t.m3u8}`);
|
|
4508
4508
|
}
|
|
4509
|
-
function
|
|
4509
|
+
function vn(a, e, t = !0) {
|
|
4510
4510
|
const s = e.startSN + e.skippedSegments - a.startSN, i = a.fragments, r = s >= 0;
|
|
4511
4511
|
let n = 0;
|
|
4512
4512
|
if (r && s < i.length)
|
|
@@ -4591,7 +4591,7 @@ function Rn(a, e) {
|
|
|
4591
4591
|
e.fragmentHint && pr(e.fragmentHint, a), e.alignedSliding = !0;
|
|
4592
4592
|
}
|
|
4593
4593
|
function cl(a, e) {
|
|
4594
|
-
a && (bn(e, a), !e.alignedSliding && a && ls(e, a), !e.alignedSliding && a && !e.skippedSegments &&
|
|
4594
|
+
a && (bn(e, a), !e.alignedSliding && a && ls(e, a), !e.alignedSliding && a && !e.skippedSegments && vn(a, e, !1));
|
|
4595
4595
|
}
|
|
4596
4596
|
function bn(a, e) {
|
|
4597
4597
|
if (!ll(e, a))
|
|
@@ -4653,18 +4653,18 @@ class fi extends gn {
|
|
|
4653
4653
|
if (this.log(`media seeking to ${F(u) ? u.toFixed(3) : u}, state: ${h}`), this.state === C.ENDED)
|
|
4654
4654
|
this.resetLoadingState();
|
|
4655
4655
|
else if (o) {
|
|
4656
|
-
const f = n.maxFragLookUpTolerance, g = o.start - f,
|
|
4657
|
-
if (!d.len ||
|
|
4658
|
-
const
|
|
4659
|
-
(u < g ||
|
|
4656
|
+
const f = n.maxFragLookUpTolerance, g = o.start - f, E = o.start + o.duration + f;
|
|
4657
|
+
if (!d.len || E < d.start || g > d.end) {
|
|
4658
|
+
const p = u > E;
|
|
4659
|
+
(u < g || p) && (p && o.loader && (this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"), o.abortRequests(), this.resetLoadingState()), this.fragPrevious = null);
|
|
4660
4660
|
}
|
|
4661
4661
|
}
|
|
4662
4662
|
if (c) {
|
|
4663
4663
|
this.fragmentTracker.removeFragmentsInRange(u, 1 / 0, this.playlistType, !0);
|
|
4664
4664
|
const f = this.lastCurrentTime;
|
|
4665
4665
|
if (u > f && (this.lastCurrentTime = u), !this.loadingParts) {
|
|
4666
|
-
const g = Math.max(d.end, u),
|
|
4667
|
-
|
|
4666
|
+
const g = Math.max(d.end, u), E = this.shouldLoadParts(this.getLevelDetails(), g);
|
|
4667
|
+
E && (this.log(`LL-Part loading ON after seeking to ${u.toFixed(2)} with buffer @${g.toFixed(2)}`), this.loadingParts = E);
|
|
4668
4668
|
}
|
|
4669
4669
|
}
|
|
4670
4670
|
!this.hls.hasEnoughToStart && !d.len && (this.log(`setting startPosition to ${u} because of seek before start`), this.nextLoadPosition = this.startPosition = u), this.tickImmediate();
|
|
@@ -4961,7 +4961,7 @@ class fi extends gn {
|
|
|
4961
4961
|
const f = u[d];
|
|
4962
4962
|
e = this.fragCurrent = f.fragment, this.log(`Loading ${e.type} sn: ${e.sn} part: ${f.index} (${d}/${u.length - 1}) of ${this.fragInfo(e, !1, f)}) cc: ${e.cc} [${n.startSN}-${n.endSN}], target: ${parseFloat(s.toFixed(3))}`), this.nextLoadPosition = f.start + f.duration, this.state = C.FRAG_LOADING;
|
|
4963
4963
|
let g;
|
|
4964
|
-
return o ? g = o.then((
|
|
4964
|
+
return o ? g = o.then((E) => !E || this.fragContextChanged(E.frag) ? null : this.doFragPartsLoad(e, f, t, i)).catch((E) => this.handleFragLoadError(E)) : g = this.doFragPartsLoad(e, f, t, i).catch((E) => this.handleFragLoadError(E)), this.hls.trigger(m.FRAG_LOADING, {
|
|
4965
4965
|
frag: e,
|
|
4966
4966
|
part: f,
|
|
4967
4967
|
targetBufferTime: s
|
|
@@ -5277,13 +5277,13 @@ class fi extends gn {
|
|
|
5277
5277
|
let d;
|
|
5278
5278
|
if (e < t) {
|
|
5279
5279
|
var f;
|
|
5280
|
-
const
|
|
5281
|
-
d = tt(r, n, e,
|
|
5280
|
+
const E = e < this.lastCurrentTime || e > t - l || (f = this.media) != null && f.paused || !this.startFragRequested ? 0 : l;
|
|
5281
|
+
d = tt(r, n, e, E);
|
|
5282
5282
|
} else
|
|
5283
5283
|
d = n[n.length - 1];
|
|
5284
5284
|
if (d) {
|
|
5285
|
-
const g = d.sn - s.startSN,
|
|
5286
|
-
if ((
|
|
5285
|
+
const g = d.sn - s.startSN, E = this.fragmentTracker.getState(d);
|
|
5286
|
+
if ((E === ce.OK || E === ce.PARTIAL && d.gap) && (r = d), r && d.sn === r.sn && (!u || h[0].fragment.sn > d.sn || !s.live && !u) && r && d.level === r.level) {
|
|
5287
5287
|
const y = n[g + 1];
|
|
5288
5288
|
d.sn < o && this.fragmentTracker.getState(y) !== ce.OK ? d = y : d = null;
|
|
5289
5289
|
}
|
|
@@ -5412,7 +5412,7 @@ class fi extends gn {
|
|
|
5412
5412
|
const u = h.endPTS - h.startPTS;
|
|
5413
5413
|
if (u <= 0)
|
|
5414
5414
|
return this.warn(`Could not parse fragment ${e.sn} ${l} duration reliably (${u})`), c || !1;
|
|
5415
|
-
const d = i ? 0 :
|
|
5415
|
+
const d = i ? 0 : Sn(r, e, h.startPTS, h.endPTS, h.startDTS, h.endDTS);
|
|
5416
5416
|
return this.hls.trigger(m.LEVEL_PTS_UPDATED, {
|
|
5417
5417
|
details: r,
|
|
5418
5418
|
level: s,
|
|
@@ -5543,47 +5543,47 @@ function dl() {
|
|
|
5543
5543
|
var h = t ? t + l : l, u = this._events[h];
|
|
5544
5544
|
return u ? u.fn ? 1 : u.length : 0;
|
|
5545
5545
|
}, o.prototype.emit = function(l, h, u, d, f, g) {
|
|
5546
|
-
var
|
|
5547
|
-
if (!this._events[
|
|
5548
|
-
var
|
|
5549
|
-
if (
|
|
5550
|
-
switch (
|
|
5546
|
+
var E = t ? t + l : l;
|
|
5547
|
+
if (!this._events[E]) return !1;
|
|
5548
|
+
var p = this._events[E], y = arguments.length, S, T;
|
|
5549
|
+
if (p.fn) {
|
|
5550
|
+
switch (p.once && this.removeListener(l, p.fn, void 0, !0), y) {
|
|
5551
5551
|
case 1:
|
|
5552
|
-
return
|
|
5552
|
+
return p.fn.call(p.context), !0;
|
|
5553
5553
|
case 2:
|
|
5554
|
-
return
|
|
5554
|
+
return p.fn.call(p.context, h), !0;
|
|
5555
5555
|
case 3:
|
|
5556
|
-
return
|
|
5556
|
+
return p.fn.call(p.context, h, u), !0;
|
|
5557
5557
|
case 4:
|
|
5558
|
-
return
|
|
5558
|
+
return p.fn.call(p.context, h, u, d), !0;
|
|
5559
5559
|
case 5:
|
|
5560
|
-
return
|
|
5560
|
+
return p.fn.call(p.context, h, u, d, f), !0;
|
|
5561
5561
|
case 6:
|
|
5562
|
-
return
|
|
5562
|
+
return p.fn.call(p.context, h, u, d, f, g), !0;
|
|
5563
5563
|
}
|
|
5564
|
-
for (T = 1,
|
|
5565
|
-
|
|
5566
|
-
|
|
5564
|
+
for (T = 1, S = new Array(y - 1); T < y; T++)
|
|
5565
|
+
S[T - 1] = arguments[T];
|
|
5566
|
+
p.fn.apply(p.context, S);
|
|
5567
5567
|
} else {
|
|
5568
|
-
var
|
|
5569
|
-
for (T = 0; T <
|
|
5570
|
-
switch (
|
|
5568
|
+
var v = p.length, x;
|
|
5569
|
+
for (T = 0; T < v; T++)
|
|
5570
|
+
switch (p[T].once && this.removeListener(l, p[T].fn, void 0, !0), y) {
|
|
5571
5571
|
case 1:
|
|
5572
|
-
|
|
5572
|
+
p[T].fn.call(p[T].context);
|
|
5573
5573
|
break;
|
|
5574
5574
|
case 2:
|
|
5575
|
-
|
|
5575
|
+
p[T].fn.call(p[T].context, h);
|
|
5576
5576
|
break;
|
|
5577
5577
|
case 3:
|
|
5578
|
-
|
|
5578
|
+
p[T].fn.call(p[T].context, h, u);
|
|
5579
5579
|
break;
|
|
5580
5580
|
case 4:
|
|
5581
|
-
|
|
5581
|
+
p[T].fn.call(p[T].context, h, u, d);
|
|
5582
5582
|
break;
|
|
5583
5583
|
default:
|
|
5584
|
-
if (!
|
|
5585
|
-
|
|
5586
|
-
|
|
5584
|
+
if (!S) for (x = 1, S = new Array(y - 1); x < y; x++)
|
|
5585
|
+
S[x - 1] = arguments[x];
|
|
5586
|
+
p[T].fn.apply(p[T].context, S);
|
|
5587
5587
|
}
|
|
5588
5588
|
}
|
|
5589
5589
|
return !0;
|
|
@@ -5600,9 +5600,9 @@ function dl() {
|
|
|
5600
5600
|
if (g.fn)
|
|
5601
5601
|
g.fn === h && (!d || g.once) && (!u || g.context === u) && n(this, f);
|
|
5602
5602
|
else {
|
|
5603
|
-
for (var
|
|
5604
|
-
(g[
|
|
5605
|
-
|
|
5603
|
+
for (var E = 0, p = [], y = g.length; E < y; E++)
|
|
5604
|
+
(g[E].fn !== h || d && !g[E].once || u && g[E].context !== u) && p.push(g[E]);
|
|
5605
|
+
p.length ? this._events[f] = p.length === 1 ? p[0] : p : n(this, f);
|
|
5606
5606
|
}
|
|
5607
5607
|
return this;
|
|
5608
5608
|
}, o.prototype.removeAllListeners = function(l) {
|
|
@@ -5712,10 +5712,10 @@ function Tl(a, e) {
|
|
|
5712
5712
|
function cs(a, e) {
|
|
5713
5713
|
return e + 1 < a.length && Cn(a, e);
|
|
5714
5714
|
}
|
|
5715
|
-
function
|
|
5715
|
+
function Sl(a, e) {
|
|
5716
5716
|
return Tl(a, e) && Cn(a, e) && pi(a, e) <= a.length - e;
|
|
5717
5717
|
}
|
|
5718
|
-
function
|
|
5718
|
+
function vl(a, e) {
|
|
5719
5719
|
if (cs(a, e)) {
|
|
5720
5720
|
const t = Pn(a, e);
|
|
5721
5721
|
if (e + t >= a.length)
|
|
@@ -5759,12 +5759,12 @@ function On(a, e, t, s, i) {
|
|
|
5759
5759
|
headerLength: d
|
|
5760
5760
|
} = o, f = d + u, g = Math.max(0, t + f - e.length);
|
|
5761
5761
|
g ? (c = new Uint8Array(f - d), c.set(e.subarray(t + d, e.length), 0)) : c = e.subarray(t + d, t + f);
|
|
5762
|
-
const
|
|
5762
|
+
const E = {
|
|
5763
5763
|
unit: c,
|
|
5764
5764
|
pts: n
|
|
5765
5765
|
};
|
|
5766
|
-
return g || a.samples.push(
|
|
5767
|
-
sample:
|
|
5766
|
+
return g || a.samples.push(E), {
|
|
5767
|
+
sample: E,
|
|
5768
5768
|
length: f,
|
|
5769
5769
|
missing: g
|
|
5770
5770
|
};
|
|
@@ -5785,7 +5785,7 @@ function Al(a, e) {
|
|
|
5785
5785
|
function Ll(a) {
|
|
5786
5786
|
if (a.size < 2)
|
|
5787
5787
|
return;
|
|
5788
|
-
const e =
|
|
5788
|
+
const e = Se(a.data, !0), t = new Uint8Array(a.data.subarray(e.length + 1));
|
|
5789
5789
|
return {
|
|
5790
5790
|
key: a.type,
|
|
5791
5791
|
info: e,
|
|
@@ -5797,16 +5797,16 @@ function Il(a) {
|
|
|
5797
5797
|
return;
|
|
5798
5798
|
if (a.type === "TXXX") {
|
|
5799
5799
|
let t = 1;
|
|
5800
|
-
const s =
|
|
5800
|
+
const s = Se(a.data.subarray(t), !0);
|
|
5801
5801
|
t += s.length + 1;
|
|
5802
|
-
const i =
|
|
5802
|
+
const i = Se(a.data.subarray(t));
|
|
5803
5803
|
return {
|
|
5804
5804
|
key: a.type,
|
|
5805
5805
|
info: s,
|
|
5806
5806
|
data: i
|
|
5807
5807
|
};
|
|
5808
5808
|
}
|
|
5809
|
-
const e =
|
|
5809
|
+
const e = Se(a.data.subarray(1));
|
|
5810
5810
|
return {
|
|
5811
5811
|
key: a.type,
|
|
5812
5812
|
info: "",
|
|
@@ -5818,16 +5818,16 @@ function Rl(a) {
|
|
|
5818
5818
|
if (a.size < 2)
|
|
5819
5819
|
return;
|
|
5820
5820
|
let t = 1;
|
|
5821
|
-
const s =
|
|
5821
|
+
const s = Se(a.data.subarray(t), !0);
|
|
5822
5822
|
t += s.length + 1;
|
|
5823
|
-
const i =
|
|
5823
|
+
const i = Se(a.data.subarray(t));
|
|
5824
5824
|
return {
|
|
5825
5825
|
key: a.type,
|
|
5826
5826
|
info: s,
|
|
5827
5827
|
data: i
|
|
5828
5828
|
};
|
|
5829
5829
|
}
|
|
5830
|
-
const e =
|
|
5830
|
+
const e = Se(a.data);
|
|
5831
5831
|
return {
|
|
5832
5832
|
key: a.type,
|
|
5833
5833
|
info: "",
|
|
@@ -5906,12 +5906,12 @@ function Ol(a) {
|
|
|
5906
5906
|
const s = a.data.subarray(1).indexOf(0);
|
|
5907
5907
|
if (s === -1)
|
|
5908
5908
|
return;
|
|
5909
|
-
const i =
|
|
5909
|
+
const i = Se(bs(a.data, 1, s)), r = a.data[2 + s], n = a.data.subarray(3 + s).indexOf(0);
|
|
5910
5910
|
if (n === -1)
|
|
5911
5911
|
return;
|
|
5912
|
-
const o =
|
|
5912
|
+
const o = Se(bs(a.data, 3 + s, n));
|
|
5913
5913
|
let c;
|
|
5914
|
-
return i === "-->" ? c =
|
|
5914
|
+
return i === "-->" ? c = Se(bs(a.data, 4 + s + n)) : c = Cl(a.data.subarray(4 + s + n)), e.mimeType = i, e.pictureType = r, e.description = o, e.data = c, e;
|
|
5915
5915
|
}
|
|
5916
5916
|
function Fl(a) {
|
|
5917
5917
|
return a.type === "PRIV" ? Ll(a) : a.type[0] === "W" ? Rl(a) : a.type === "APIC" ? Ol(a) : Il(a);
|
|
@@ -6130,7 +6130,7 @@ function Bn(a, e, t, s, i) {
|
|
|
6130
6130
|
function Un(a, e) {
|
|
6131
6131
|
const t = a[e + 1] >> 3 & 3, s = a[e + 1] >> 1 & 3, i = a[e + 2] >> 4 & 15, r = a[e + 2] >> 2 & 3;
|
|
6132
6132
|
if (t !== 1 && i !== 0 && i !== 15 && r !== 3) {
|
|
6133
|
-
const n = a[e + 2] >> 1 & 1, o = a[e + 3] >> 6, c = t === 3 ? 3 - s : s === 3 ? 3 : 4, l = $l[c * 14 + i - 1] * 1e3, u = Gl[(t === 3 ? 0 : t === 2 ? 1 : 2) * 3 + r], d = o === 3 ? 1 : 2, f = Kl[t][s], g = Vl[s],
|
|
6133
|
+
const n = a[e + 2] >> 1 & 1, o = a[e + 3] >> 6, c = t === 3 ? 3 - s : s === 3 ? 3 : 4, l = $l[c * 14 + i - 1] * 1e3, u = Gl[(t === 3 ? 0 : t === 2 ? 1 : 2) * 3 + r], d = o === 3 ? 1 : 2, f = Kl[t][s], g = Vl[s], E = f * 8 * g, p = Math.floor(f * l / u + n) * g;
|
|
6134
6134
|
if (Gt === null) {
|
|
6135
6135
|
const T = (navigator.userAgent || "").match(/Chrome\/(\d+)/i);
|
|
6136
6136
|
Gt = T ? parseInt(T[1]) : 0;
|
|
@@ -6138,8 +6138,8 @@ function Un(a, e) {
|
|
|
6138
6138
|
return !!Gt && Gt <= 87 && s === 2 && l >= 224e3 && o === 0 && (a[e + 3] = a[e + 3] | 128), {
|
|
6139
6139
|
sampleRate: u,
|
|
6140
6140
|
channelCount: d,
|
|
6141
|
-
frameLength:
|
|
6142
|
-
samplesPerFrame:
|
|
6141
|
+
frameLength: p,
|
|
6142
|
+
samplesPerFrame: E
|
|
6143
6143
|
};
|
|
6144
6144
|
}
|
|
6145
6145
|
}
|
|
@@ -6190,12 +6190,12 @@ class Yl extends yi {
|
|
|
6190
6190
|
if (Gn(e, i))
|
|
6191
6191
|
return !1;
|
|
6192
6192
|
for (let r = e.length; i < r; i++)
|
|
6193
|
-
if (
|
|
6193
|
+
if (vl(e, i))
|
|
6194
6194
|
return t.log("ADTS sync word found !"), !0;
|
|
6195
6195
|
return !1;
|
|
6196
6196
|
}
|
|
6197
6197
|
canParse(e, t) {
|
|
6198
|
-
return
|
|
6198
|
+
return Sl(e, t);
|
|
6199
6199
|
}
|
|
6200
6200
|
appendFrame(e, t, s) {
|
|
6201
6201
|
kn(e, this.observer, t, s, e.manifestCodec);
|
|
@@ -6269,10 +6269,10 @@ function Vn(a, e, t, s, i) {
|
|
|
6269
6269
|
const u = e[t + 6] >> 5;
|
|
6270
6270
|
let d = 0;
|
|
6271
6271
|
u === 2 ? d += 2 : (u & 1 && u !== 1 && (d += 2), u & 4 && (d += 2));
|
|
6272
|
-
const f = (e[t + 6] << 8 | e[t + 7]) >> 12 - d & 1,
|
|
6273
|
-
return a.config =
|
|
6272
|
+
const f = (e[t + 6] << 8 | e[t + 7]) >> 12 - d & 1, E = [2, 1, 2, 3, 3, 4, 4, 5][u] + f, p = e[t + 5] >> 3, y = e[t + 5] & 7, S = new Uint8Array([r << 6 | p << 1 | y >> 2, (y & 3) << 6 | u << 3 | f << 2 | c >> 4, c << 4 & 224]), T = 1536 / o * 9e4, v = s + i * T, x = e.subarray(t, t + h);
|
|
6273
|
+
return a.config = S, a.channelCount = E, a.samplerate = o, a.samples.push({
|
|
6274
6274
|
unit: x,
|
|
6275
|
-
pts:
|
|
6275
|
+
pts: v
|
|
6276
6276
|
}), h;
|
|
6277
6277
|
}
|
|
6278
6278
|
class ql extends yi {
|
|
@@ -6574,7 +6574,7 @@ class Hn {
|
|
|
6574
6574
|
return e.naluState = r, o;
|
|
6575
6575
|
}
|
|
6576
6576
|
}
|
|
6577
|
-
class
|
|
6577
|
+
class St {
|
|
6578
6578
|
constructor(e) {
|
|
6579
6579
|
this.data = void 0, this.bytesAvailable = void 0, this.word = void 0, this.bitsAvailable = void 0, this.data = e, this.bytesAvailable = e.byteLength, this.word = 0, this.bitsAvailable = 0;
|
|
6580
6580
|
}
|
|
@@ -6646,7 +6646,7 @@ class vt {
|
|
|
6646
6646
|
return this.readBits(32);
|
|
6647
6647
|
}
|
|
6648
6648
|
}
|
|
6649
|
-
class
|
|
6649
|
+
class Sr extends Hn {
|
|
6650
6650
|
parsePES(e, t, s, i) {
|
|
6651
6651
|
const r = this.parseNALu(e, s.data, i);
|
|
6652
6652
|
let n = this.VideoSample, o, c = !1;
|
|
@@ -6654,18 +6654,18 @@ class vr extends Hn {
|
|
|
6654
6654
|
var h, u;
|
|
6655
6655
|
switch (l.type) {
|
|
6656
6656
|
case 1: {
|
|
6657
|
-
let
|
|
6657
|
+
let E = !1;
|
|
6658
6658
|
o = !0;
|
|
6659
|
-
const
|
|
6660
|
-
if (c &&
|
|
6661
|
-
const y = this.readSliceType(
|
|
6662
|
-
(y === 2 || y === 4 || y === 7 || y === 9) && (
|
|
6659
|
+
const p = l.data;
|
|
6660
|
+
if (c && p.length > 4) {
|
|
6661
|
+
const y = this.readSliceType(p);
|
|
6662
|
+
(y === 2 || y === 4 || y === 7 || y === 9) && (E = !0);
|
|
6663
6663
|
}
|
|
6664
|
-
if (
|
|
6664
|
+
if (E) {
|
|
6665
6665
|
var d;
|
|
6666
6666
|
(d = n) != null && d.frame && !n.key && (this.pushAccessUnit(n, e), n = this.VideoSample = null);
|
|
6667
6667
|
}
|
|
6668
|
-
n || (n = this.VideoSample = this.createVideoSample(!0, s.pts, s.dts)), n.frame = !0, n.key =
|
|
6668
|
+
n || (n = this.VideoSample = this.createVideoSample(!0, s.pts, s.dts)), n.frame = !0, n.key = E;
|
|
6669
6669
|
break;
|
|
6670
6670
|
}
|
|
6671
6671
|
case 5:
|
|
@@ -6678,16 +6678,16 @@ class vr extends Hn {
|
|
|
6678
6678
|
case 7: {
|
|
6679
6679
|
var f, g;
|
|
6680
6680
|
o = !0, c = !0;
|
|
6681
|
-
const
|
|
6682
|
-
if (!e.sps || e.width !==
|
|
6683
|
-
e.width =
|
|
6684
|
-
const y =
|
|
6685
|
-
let
|
|
6681
|
+
const E = l.data, p = this.readSPS(E);
|
|
6682
|
+
if (!e.sps || e.width !== p.width || e.height !== p.height || ((f = e.pixelRatio) == null ? void 0 : f[0]) !== p.pixelRatio[0] || ((g = e.pixelRatio) == null ? void 0 : g[1]) !== p.pixelRatio[1]) {
|
|
6683
|
+
e.width = p.width, e.height = p.height, e.pixelRatio = p.pixelRatio, e.sps = [E];
|
|
6684
|
+
const y = E.subarray(1, 4);
|
|
6685
|
+
let S = "avc1.";
|
|
6686
6686
|
for (let T = 0; T < 3; T++) {
|
|
6687
|
-
let
|
|
6688
|
-
|
|
6687
|
+
let v = y[T].toString(16);
|
|
6688
|
+
v.length < 2 && (v = "0" + v), S += v;
|
|
6689
6689
|
}
|
|
6690
|
-
e.codec =
|
|
6690
|
+
e.codec = S;
|
|
6691
6691
|
}
|
|
6692
6692
|
break;
|
|
6693
6693
|
}
|
|
@@ -6711,7 +6711,7 @@ class vr extends Hn {
|
|
|
6711
6711
|
return e[t] & 31;
|
|
6712
6712
|
}
|
|
6713
6713
|
readSliceType(e) {
|
|
6714
|
-
const t = new
|
|
6714
|
+
const t = new St(e);
|
|
6715
6715
|
return t.readUByte(), t.readUEG(), t.readUEG();
|
|
6716
6716
|
}
|
|
6717
6717
|
/**
|
|
@@ -6734,91 +6734,91 @@ class vr extends Hn {
|
|
|
6734
6734
|
* associated video frames.
|
|
6735
6735
|
*/
|
|
6736
6736
|
readSPS(e) {
|
|
6737
|
-
const t = new
|
|
6737
|
+
const t = new St(e);
|
|
6738
6738
|
let s = 0, i = 0, r = 0, n = 0, o, c, l;
|
|
6739
|
-
const h = t.readUByte.bind(t), u = t.readBits.bind(t), d = t.readUEG.bind(t), f = t.readBoolean.bind(t), g = t.skipBits.bind(t),
|
|
6739
|
+
const h = t.readUByte.bind(t), u = t.readBits.bind(t), d = t.readUEG.bind(t), f = t.readBoolean.bind(t), g = t.skipBits.bind(t), E = t.skipEG.bind(t), p = t.skipUEG.bind(t), y = this.skipScalingList.bind(this);
|
|
6740
6740
|
h();
|
|
6741
|
-
const
|
|
6742
|
-
if (u(5), g(3), h(),
|
|
6741
|
+
const S = h();
|
|
6742
|
+
if (u(5), g(3), h(), p(), S === 100 || S === 110 || S === 122 || S === 244 || S === 44 || S === 83 || S === 86 || S === 118 || S === 128) {
|
|
6743
6743
|
const R = d();
|
|
6744
|
-
if (R === 3 && g(1),
|
|
6744
|
+
if (R === 3 && g(1), p(), p(), g(1), f())
|
|
6745
6745
|
for (c = R !== 3 ? 8 : 12, l = 0; l < c; l++)
|
|
6746
6746
|
f() && (l < 6 ? y(16, t) : y(64, t));
|
|
6747
6747
|
}
|
|
6748
|
-
|
|
6748
|
+
p();
|
|
6749
6749
|
const T = d();
|
|
6750
6750
|
if (T === 0)
|
|
6751
6751
|
d();
|
|
6752
6752
|
else if (T === 1)
|
|
6753
|
-
for (g(1),
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
const
|
|
6753
|
+
for (g(1), E(), E(), o = d(), l = 0; l < o; l++)
|
|
6754
|
+
E();
|
|
6755
|
+
p(), g(1);
|
|
6756
|
+
const v = d(), x = d(), _ = u(1);
|
|
6757
6757
|
_ === 0 && g(1), g(1), f() && (s = d(), i = d(), r = d(), n = d());
|
|
6758
|
-
let
|
|
6758
|
+
let A = [1, 1];
|
|
6759
6759
|
if (f() && f())
|
|
6760
6760
|
switch (h()) {
|
|
6761
6761
|
case 1:
|
|
6762
|
-
|
|
6762
|
+
A = [1, 1];
|
|
6763
6763
|
break;
|
|
6764
6764
|
case 2:
|
|
6765
|
-
|
|
6765
|
+
A = [12, 11];
|
|
6766
6766
|
break;
|
|
6767
6767
|
case 3:
|
|
6768
|
-
|
|
6768
|
+
A = [10, 11];
|
|
6769
6769
|
break;
|
|
6770
6770
|
case 4:
|
|
6771
|
-
|
|
6771
|
+
A = [16, 11];
|
|
6772
6772
|
break;
|
|
6773
6773
|
case 5:
|
|
6774
|
-
|
|
6774
|
+
A = [40, 33];
|
|
6775
6775
|
break;
|
|
6776
6776
|
case 6:
|
|
6777
|
-
|
|
6777
|
+
A = [24, 11];
|
|
6778
6778
|
break;
|
|
6779
6779
|
case 7:
|
|
6780
|
-
|
|
6780
|
+
A = [20, 11];
|
|
6781
6781
|
break;
|
|
6782
6782
|
case 8:
|
|
6783
|
-
|
|
6783
|
+
A = [32, 11];
|
|
6784
6784
|
break;
|
|
6785
6785
|
case 9:
|
|
6786
|
-
|
|
6786
|
+
A = [80, 33];
|
|
6787
6787
|
break;
|
|
6788
6788
|
case 10:
|
|
6789
|
-
|
|
6789
|
+
A = [18, 11];
|
|
6790
6790
|
break;
|
|
6791
6791
|
case 11:
|
|
6792
|
-
|
|
6792
|
+
A = [15, 11];
|
|
6793
6793
|
break;
|
|
6794
6794
|
case 12:
|
|
6795
|
-
|
|
6795
|
+
A = [64, 33];
|
|
6796
6796
|
break;
|
|
6797
6797
|
case 13:
|
|
6798
|
-
|
|
6798
|
+
A = [160, 99];
|
|
6799
6799
|
break;
|
|
6800
6800
|
case 14:
|
|
6801
|
-
|
|
6801
|
+
A = [4, 3];
|
|
6802
6802
|
break;
|
|
6803
6803
|
case 15:
|
|
6804
|
-
|
|
6804
|
+
A = [3, 2];
|
|
6805
6805
|
break;
|
|
6806
6806
|
case 16:
|
|
6807
|
-
|
|
6807
|
+
A = [2, 1];
|
|
6808
6808
|
break;
|
|
6809
6809
|
case 255: {
|
|
6810
|
-
|
|
6810
|
+
A = [h() << 8 | h(), h() << 8 | h()];
|
|
6811
6811
|
break;
|
|
6812
6812
|
}
|
|
6813
6813
|
}
|
|
6814
6814
|
return {
|
|
6815
|
-
width: Math.ceil((
|
|
6815
|
+
width: Math.ceil((v + 1) * 16 - s * 2 - i * 2),
|
|
6816
6816
|
height: (2 - _) * (x + 1) * 16 - (_ ? 2 : 4) * (r + n),
|
|
6817
|
-
pixelRatio:
|
|
6817
|
+
pixelRatio: A
|
|
6818
6818
|
};
|
|
6819
6819
|
}
|
|
6820
6820
|
}
|
|
6821
|
-
class
|
|
6821
|
+
class vr extends Hn {
|
|
6822
6822
|
constructor(...e) {
|
|
6823
6823
|
super(...e), this.initVPS = null;
|
|
6824
6824
|
}
|
|
@@ -6913,7 +6913,7 @@ class Sr extends Hn {
|
|
|
6913
6913
|
super.pushAccessUnit(e, t), this.initVPS && (this.initVPS = null);
|
|
6914
6914
|
}
|
|
6915
6915
|
readVPS(e) {
|
|
6916
|
-
const t = new
|
|
6916
|
+
const t = new St(e);
|
|
6917
6917
|
t.readUByte(), t.readUByte(), t.readBits(4), t.skipBits(2), t.readBits(6);
|
|
6918
6918
|
const s = t.readBits(3), i = t.readBoolean();
|
|
6919
6919
|
return {
|
|
@@ -6922,30 +6922,30 @@ class Sr extends Hn {
|
|
|
6922
6922
|
};
|
|
6923
6923
|
}
|
|
6924
6924
|
readSPS(e) {
|
|
6925
|
-
const t = new
|
|
6925
|
+
const t = new St(this.ebsp2rbsp(e));
|
|
6926
6926
|
t.readUByte(), t.readUByte(), t.readBits(4);
|
|
6927
6927
|
const s = t.readBits(3);
|
|
6928
6928
|
t.readBoolean();
|
|
6929
|
-
const i = t.readBits(2), r = t.readBoolean(), n = t.readBits(5), o = t.readUByte(), c = t.readUByte(), l = t.readUByte(), h = t.readUByte(), u = t.readUByte(), d = t.readUByte(), f = t.readUByte(), g = t.readUByte(),
|
|
6929
|
+
const i = t.readBits(2), r = t.readBoolean(), n = t.readBits(5), o = t.readUByte(), c = t.readUByte(), l = t.readUByte(), h = t.readUByte(), u = t.readUByte(), d = t.readUByte(), f = t.readUByte(), g = t.readUByte(), E = t.readUByte(), p = t.readUByte(), y = t.readUByte(), S = [], T = [];
|
|
6930
6930
|
for (let J = 0; J < s; J++)
|
|
6931
|
-
|
|
6931
|
+
S.push(t.readBoolean()), T.push(t.readBoolean());
|
|
6932
6932
|
if (s > 0)
|
|
6933
6933
|
for (let J = s; J < 8; J++)
|
|
6934
6934
|
t.readBits(2);
|
|
6935
6935
|
for (let J = 0; J < s; J++)
|
|
6936
|
-
|
|
6936
|
+
S[J] && (t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte()), T[J] && t.readUByte();
|
|
6937
6937
|
t.readUEG();
|
|
6938
|
-
const
|
|
6939
|
-
|
|
6940
|
-
const x = t.readUEG(), _ = t.readUEG(),
|
|
6941
|
-
let R = 0, D = 0,
|
|
6942
|
-
|
|
6938
|
+
const v = t.readUEG();
|
|
6939
|
+
v == 3 && t.skipBits(1);
|
|
6940
|
+
const x = t.readUEG(), _ = t.readUEG(), A = t.readBoolean();
|
|
6941
|
+
let R = 0, D = 0, L = 0, P = 0;
|
|
6942
|
+
A && (R += t.readUEG(), D += t.readUEG(), L += t.readUEG(), P += t.readUEG());
|
|
6943
6943
|
const O = t.readUEG(), X = t.readUEG(), V = t.readUEG(), $ = t.readBoolean();
|
|
6944
6944
|
for (let J = $ ? 0 : s; J <= s; J++)
|
|
6945
6945
|
t.skipUEG(), t.skipUEG(), t.skipUEG();
|
|
6946
6946
|
if (t.skipUEG(), t.skipUEG(), t.skipUEG(), t.skipUEG(), t.skipUEG(), t.skipUEG(), t.readBoolean() && t.readBoolean())
|
|
6947
6947
|
for (let de = 0; de < 4; de++)
|
|
6948
|
-
for (let
|
|
6948
|
+
for (let ve = 0; ve < (de === 3 ? 2 : 6); ve++)
|
|
6949
6949
|
if (!t.readBoolean())
|
|
6950
6950
|
t.readUEG();
|
|
6951
6951
|
else {
|
|
@@ -6961,17 +6961,17 @@ class Sr extends Hn {
|
|
|
6961
6961
|
let de = !1;
|
|
6962
6962
|
if (J !== 0 && (de = t.readBoolean()), de) {
|
|
6963
6963
|
J === B && t.readUEG(), t.readBoolean(), t.readUEG();
|
|
6964
|
-
let
|
|
6964
|
+
let ve = 0;
|
|
6965
6965
|
for (let Xe = 0; Xe <= k; Xe++) {
|
|
6966
6966
|
const Ie = t.readBoolean();
|
|
6967
6967
|
let st = !1;
|
|
6968
|
-
Ie || (st = t.readBoolean()), (Ie || st) &&
|
|
6968
|
+
Ie || (st = t.readBoolean()), (Ie || st) && ve++;
|
|
6969
6969
|
}
|
|
6970
|
-
k =
|
|
6970
|
+
k = ve;
|
|
6971
6971
|
} else {
|
|
6972
|
-
const
|
|
6973
|
-
k =
|
|
6974
|
-
for (let Ie = 0; Ie <
|
|
6972
|
+
const ve = t.readUEG(), Xe = t.readUEG();
|
|
6973
|
+
k = ve + Xe;
|
|
6974
|
+
for (let Ie = 0; Ie < ve; Ie++)
|
|
6975
6975
|
t.readUEG(), t.readBoolean();
|
|
6976
6976
|
for (let Ie = 0; Ie < Xe; Ie++)
|
|
6977
6977
|
t.readUEG(), t.readBoolean();
|
|
@@ -6980,7 +6980,7 @@ class Sr extends Hn {
|
|
|
6980
6980
|
if (t.readBoolean()) {
|
|
6981
6981
|
const J = t.readUEG();
|
|
6982
6982
|
for (let de = 0; de < J; de++) {
|
|
6983
|
-
for (let
|
|
6983
|
+
for (let ve = 0; ve < V + 4; ve++)
|
|
6984
6984
|
t.readBits(1);
|
|
6985
6985
|
t.readBits(1);
|
|
6986
6986
|
}
|
|
@@ -6993,7 +6993,7 @@ class Sr extends Hn {
|
|
|
6993
6993
|
const ze = t.readUByte(), bi = [1, 12, 10, 16, 40, 24, 20, 32, 80, 18, 15, 64, 160, 4, 3, 2], Ct = [1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1];
|
|
6994
6994
|
ze > 0 && ze < 16 ? (H = bi[ze - 1], j = Ct[ze - 1]) : ze === 255 && (H = t.readBits(16), j = t.readBits(16));
|
|
6995
6995
|
}
|
|
6996
|
-
if (t.readBoolean() && t.readBoolean(), t.readBoolean() && (t.readBits(3), t.readBoolean(), t.readBoolean() && (t.readUByte(), t.readUByte(), t.readUByte())), t.readBoolean() && (t.readUEG(), t.readUEG()), t.readBoolean(), t.readBoolean(), t.readBoolean(), ge = t.readBoolean(), ge && (R += t.readUEG(), D += t.readUEG(),
|
|
6996
|
+
if (t.readBoolean() && t.readBoolean(), t.readBoolean() && (t.readBits(3), t.readBoolean(), t.readBoolean() && (t.readUByte(), t.readUByte(), t.readUByte())), t.readBoolean() && (t.readUEG(), t.readUEG()), t.readBoolean(), t.readBoolean(), t.readBoolean(), ge = t.readBoolean(), ge && (R += t.readUEG(), D += t.readUEG(), L += t.readUEG(), P += t.readUEG()), t.readBoolean() && (ee = t.readBits(32), ne = t.readBits(32), t.readBoolean() && t.readUEG(), t.readBoolean())) {
|
|
6997
6997
|
const Ct = t.readBoolean(), _i = t.readBoolean();
|
|
6998
6998
|
let gt = !1;
|
|
6999
6999
|
(Ct || _i) && (gt = t.readBoolean(), gt && (t.readUByte(), t.readBits(5), t.readBoolean(), t.readBits(5)), t.readBits(4), t.readBits(4), gt && t.readBits(4), t.readBits(5), t.readBits(5), t.readBits(5));
|
|
@@ -7014,9 +7014,9 @@ class Sr extends Hn {
|
|
|
7014
7014
|
t.readBoolean() && (t.readBoolean(), t.readBoolean(), t.readBoolean(), Y = t.readUEG());
|
|
7015
7015
|
}
|
|
7016
7016
|
let Ke = x, Ri = _;
|
|
7017
|
-
if (
|
|
7017
|
+
if (A || ge) {
|
|
7018
7018
|
let J = 1, de = 1;
|
|
7019
|
-
|
|
7019
|
+
v === 1 ? J = de = 2 : v == 2 && (J = 2), Ke = x - J * D - J * R, Ri = _ - de * P - de * L;
|
|
7020
7020
|
}
|
|
7021
7021
|
const Ea = i ? ["A", "B", "C"][i] : "", ya = o << 24 | c << 16 | l << 8 | h;
|
|
7022
7022
|
let fs = 0;
|
|
@@ -7030,13 +7030,13 @@ class Sr extends Hn {
|
|
|
7030
7030
|
general_profile_idc: n,
|
|
7031
7031
|
general_profile_space: i,
|
|
7032
7032
|
general_profile_compatibility_flags: [o, c, l, h],
|
|
7033
|
-
general_constraint_indicator_flags: [u, d, f, g,
|
|
7033
|
+
general_constraint_indicator_flags: [u, d, f, g, E, p],
|
|
7034
7034
|
general_level_idc: y,
|
|
7035
7035
|
bit_depth: O + 8,
|
|
7036
7036
|
bit_depth_luma_minus8: O,
|
|
7037
7037
|
bit_depth_chroma_minus8: X,
|
|
7038
7038
|
min_spatial_segmentation_idc: Y,
|
|
7039
|
-
chroma_format_idc:
|
|
7039
|
+
chroma_format_idc: v,
|
|
7040
7040
|
frame_rate: {
|
|
7041
7041
|
fixed: Z,
|
|
7042
7042
|
fps: ne / ee
|
|
@@ -7048,7 +7048,7 @@ class Sr extends Hn {
|
|
|
7048
7048
|
};
|
|
7049
7049
|
}
|
|
7050
7050
|
readPPS(e) {
|
|
7051
|
-
const t = new
|
|
7051
|
+
const t = new St(this.ebsp2rbsp(e));
|
|
7052
7052
|
t.readUByte(), t.readUByte(), t.skipUEG(), t.skipUEG(), t.skipBits(2), t.skipBits(3), t.skipBits(2), t.skipUEG(), t.skipUEG(), t.skipEG(), t.skipBits(2), t.readBoolean() && t.skipUEG(), t.skipEG(), t.skipEG(), t.skipBits(4);
|
|
7053
7053
|
const i = t.readBoolean(), r = t.readBoolean();
|
|
7054
7054
|
let n = 1;
|
|
@@ -7124,7 +7124,7 @@ class We {
|
|
|
7124
7124
|
s || (this.sampleAes = null);
|
|
7125
7125
|
let r;
|
|
7126
7126
|
const n = this._videoTrack, o = this._audioTrack, c = this._id3Track, l = this._txtTrack;
|
|
7127
|
-
let h = n.pid, u = n.pesData, d = o.pid, f = c.pid, g = o.pesData,
|
|
7127
|
+
let h = n.pid, u = n.pesData, d = o.pid, f = c.pid, g = o.pesData, E = c.pesData, p = null, y = this.pmtParsed, S = this._pmtId, T = e.length;
|
|
7128
7128
|
if (this.remainderData && (e = Le(this.remainderData, e), T = e.length, this.remainderData = null), T < he && !i)
|
|
7129
7129
|
return this.remainderData = e, {
|
|
7130
7130
|
audioTrack: o,
|
|
@@ -7132,18 +7132,18 @@ class We {
|
|
|
7132
7132
|
id3Track: c,
|
|
7133
7133
|
textTrack: l
|
|
7134
7134
|
};
|
|
7135
|
-
const
|
|
7136
|
-
T -= (T -
|
|
7135
|
+
const v = Math.max(0, We.syncOffset(e));
|
|
7136
|
+
T -= (T - v) % he, T < e.byteLength && !i && (this.remainderData = new Uint8Array(e.buffer, T, e.buffer.byteLength - T));
|
|
7137
7137
|
let x = 0;
|
|
7138
|
-
for (let
|
|
7139
|
-
if (e[
|
|
7140
|
-
const R = !!(e[
|
|
7138
|
+
for (let A = v; A < T; A += he)
|
|
7139
|
+
if (e[A] === 71) {
|
|
7140
|
+
const R = !!(e[A + 1] & 64), D = js(e, A), L = (e[A + 3] & 48) >> 4;
|
|
7141
7141
|
let P;
|
|
7142
|
-
if (
|
|
7143
|
-
if (P =
|
|
7142
|
+
if (L > 1) {
|
|
7143
|
+
if (P = A + 5 + e[A + 4], P === A + he)
|
|
7144
7144
|
continue;
|
|
7145
7145
|
} else
|
|
7146
|
-
P =
|
|
7146
|
+
P = A + 4;
|
|
7147
7147
|
switch (D) {
|
|
7148
7148
|
case h:
|
|
7149
7149
|
if (R) {
|
|
@@ -7151,10 +7151,10 @@ class We {
|
|
|
7151
7151
|
if (this.videoParser === null)
|
|
7152
7152
|
switch (n.segmentCodec) {
|
|
7153
7153
|
case "avc":
|
|
7154
|
-
this.videoParser = new
|
|
7154
|
+
this.videoParser = new Sr();
|
|
7155
7155
|
break;
|
|
7156
7156
|
case "hevc":
|
|
7157
|
-
this.videoParser = new
|
|
7157
|
+
this.videoParser = new vr();
|
|
7158
7158
|
break;
|
|
7159
7159
|
}
|
|
7160
7160
|
this.videoParser !== null && this.videoParser.parsePES(n, l, r, !1);
|
|
@@ -7164,7 +7164,7 @@ class We {
|
|
|
7164
7164
|
size: 0
|
|
7165
7165
|
};
|
|
7166
7166
|
}
|
|
7167
|
-
u && (u.data.push(e.subarray(P,
|
|
7167
|
+
u && (u.data.push(e.subarray(P, A + he)), u.size += A + he - P);
|
|
7168
7168
|
break;
|
|
7169
7169
|
case d:
|
|
7170
7170
|
if (R) {
|
|
@@ -7185,33 +7185,33 @@ class We {
|
|
|
7185
7185
|
size: 0
|
|
7186
7186
|
};
|
|
7187
7187
|
}
|
|
7188
|
-
g && (g.data.push(e.subarray(P,
|
|
7188
|
+
g && (g.data.push(e.subarray(P, A + he)), g.size += A + he - P);
|
|
7189
7189
|
break;
|
|
7190
7190
|
case f:
|
|
7191
|
-
R && (
|
|
7191
|
+
R && (E && (r = nt(E, this.logger)) && this.parseID3PES(c, r), E = {
|
|
7192
7192
|
data: [],
|
|
7193
7193
|
size: 0
|
|
7194
|
-
}),
|
|
7194
|
+
}), E && (E.data.push(e.subarray(P, A + he)), E.size += A + he - P);
|
|
7195
7195
|
break;
|
|
7196
7196
|
case 0:
|
|
7197
|
-
R && (P += e[P] + 1),
|
|
7197
|
+
R && (P += e[P] + 1), S = this._pmtId = Ql(e, P);
|
|
7198
7198
|
break;
|
|
7199
|
-
case
|
|
7199
|
+
case S: {
|
|
7200
7200
|
R && (P += e[P] + 1);
|
|
7201
7201
|
const O = Zl(e, P, this.typeSupported, s, this.observer, this.logger);
|
|
7202
|
-
h = O.videoPid, h > 0 && (n.pid = h, n.segmentCodec = O.segmentVideoCodec), d = O.audioPid, d > 0 && (o.pid = d, o.segmentCodec = O.segmentAudioCodec), f = O.id3Pid, f > 0 && (c.pid = f),
|
|
7202
|
+
h = O.videoPid, h > 0 && (n.pid = h, n.segmentCodec = O.segmentVideoCodec), d = O.audioPid, d > 0 && (o.pid = d, o.segmentCodec = O.segmentAudioCodec), f = O.id3Pid, f > 0 && (c.pid = f), p !== null && !y && (this.logger.warn(`MPEG-TS PMT found at ${A} after unknown PID '${p}'. Backtracking to sync byte @${v} to parse all TS packets.`), p = null, A = v - 188), y = this.pmtParsed = !0;
|
|
7203
7203
|
break;
|
|
7204
7204
|
}
|
|
7205
7205
|
case 17:
|
|
7206
7206
|
case 8191:
|
|
7207
7207
|
break;
|
|
7208
7208
|
default:
|
|
7209
|
-
|
|
7209
|
+
p = D;
|
|
7210
7210
|
break;
|
|
7211
7211
|
}
|
|
7212
7212
|
} else
|
|
7213
7213
|
x++;
|
|
7214
|
-
x > 0 && Xs(this.observer, new Error(`Found ${x} TS packet/s that do not start with 0x47`), void 0, this.logger), n.pesData = u, o.pesData = g, c.pesData =
|
|
7214
|
+
x > 0 && Xs(this.observer, new Error(`Found ${x} TS packet/s that do not start with 0x47`), void 0, this.logger), n.pesData = u, o.pesData = g, c.pesData = E;
|
|
7215
7215
|
const _ = {
|
|
7216
7216
|
audioTrack: o,
|
|
7217
7217
|
videoTrack: n,
|
|
@@ -7245,10 +7245,10 @@ class We {
|
|
|
7245
7245
|
if (this.videoParser === null)
|
|
7246
7246
|
switch (s.segmentCodec) {
|
|
7247
7247
|
case "avc":
|
|
7248
|
-
this.videoParser = new
|
|
7248
|
+
this.videoParser = new Sr();
|
|
7249
7249
|
break;
|
|
7250
7250
|
case "hevc":
|
|
7251
|
-
this.videoParser = new
|
|
7251
|
+
this.videoParser = new vr();
|
|
7252
7252
|
break;
|
|
7253
7253
|
}
|
|
7254
7254
|
this.videoParser !== null && (this.videoParser.parsePES(s, r, l, !0), s.pesData = null);
|
|
@@ -7436,8 +7436,8 @@ function Zl(a, e, t, s, i, r) {
|
|
|
7436
7436
|
t.ac3 !== !0 ? r.log("AC-3 audio found, not supported in this browser for now") : (n.audioPid = h, n.segmentAudioCodec = "ac3");
|
|
7437
7437
|
break;
|
|
7438
7438
|
}
|
|
7439
|
-
const
|
|
7440
|
-
d +=
|
|
7439
|
+
const E = a[d + 1] + 2;
|
|
7440
|
+
d += E, f -= E;
|
|
7441
7441
|
}
|
|
7442
7442
|
}
|
|
7443
7443
|
break;
|
|
@@ -7492,14 +7492,14 @@ function nt(a, e) {
|
|
|
7492
7492
|
const d = new Uint8Array(a.size);
|
|
7493
7493
|
for (let f = 0, g = c.length; f < g; f++) {
|
|
7494
7494
|
s = c[f];
|
|
7495
|
-
let
|
|
7495
|
+
let E = s.byteLength;
|
|
7496
7496
|
if (u)
|
|
7497
|
-
if (u >
|
|
7498
|
-
u -=
|
|
7497
|
+
if (u > E) {
|
|
7498
|
+
u -= E;
|
|
7499
7499
|
continue;
|
|
7500
7500
|
} else
|
|
7501
|
-
s = s.subarray(u),
|
|
7502
|
-
d.set(s, t), t +=
|
|
7501
|
+
s = s.subarray(u), E -= u, u = 0;
|
|
7502
|
+
d.set(s, t), t += E;
|
|
7503
7503
|
}
|
|
7504
7504
|
return i && (i -= r + 3), {
|
|
7505
7505
|
data: d,
|
|
@@ -8559,16 +8559,16 @@ class I {
|
|
|
8559
8559
|
let n = r.length;
|
|
8560
8560
|
for (let g = 0; g < s.length; g += 1) {
|
|
8561
8561
|
n += 3;
|
|
8562
|
-
for (let
|
|
8563
|
-
n += 2 + s[g][
|
|
8562
|
+
for (let E = 0; E < s[g].length; E += 1)
|
|
8563
|
+
n += 2 + s[g][E].length;
|
|
8564
8564
|
}
|
|
8565
8565
|
const o = new Uint8Array(n);
|
|
8566
8566
|
o.set(r, 0), n = r.length;
|
|
8567
8567
|
const c = s.length - 1;
|
|
8568
8568
|
for (let g = 0; g < s.length; g += 1) {
|
|
8569
8569
|
o.set(new Uint8Array([32 + g | (g === c ? 128 : 0), 0, s[g].length]), n), n += 3;
|
|
8570
|
-
for (let
|
|
8571
|
-
o.set(new Uint8Array([s[g][
|
|
8570
|
+
for (let E = 0; E < s[g].length; E += 1)
|
|
8571
|
+
o.set(new Uint8Array([s[g][E].length >> 8, s[g][E].length & 255]), n), n += 2, o.set(s[g][E], n), n += s[g][E].length;
|
|
8572
8572
|
}
|
|
8573
8573
|
const l = I.box(I.types.hvcC, o), h = e.width, u = e.height, d = e.pixelRatio[0], f = e.pixelRatio[1];
|
|
8574
8574
|
return I.box(
|
|
@@ -8714,18 +8714,18 @@ I.STSD = void 0;
|
|
|
8714
8714
|
I.FTYP = void 0;
|
|
8715
8715
|
I.DINF = void 0;
|
|
8716
8716
|
const Yn = 9e4;
|
|
8717
|
-
function
|
|
8717
|
+
function Si(a, e, t = 1, s = !1) {
|
|
8718
8718
|
const i = a * e * t;
|
|
8719
8719
|
return s ? Math.round(i) : i;
|
|
8720
8720
|
}
|
|
8721
8721
|
function ec(a, e, t = 1, s = !1) {
|
|
8722
|
-
return
|
|
8722
|
+
return Si(a, e, 1 / t, s);
|
|
8723
8723
|
}
|
|
8724
8724
|
function Et(a, e = !1) {
|
|
8725
|
-
return
|
|
8725
|
+
return Si(a, 1e3, 1 / Yn, e);
|
|
8726
8726
|
}
|
|
8727
8727
|
function tc(a, e = 1) {
|
|
8728
|
-
return
|
|
8728
|
+
return Si(a, Yn, 1 / e);
|
|
8729
8729
|
}
|
|
8730
8730
|
const sc = 10 * 1e3, ic = 1024, rc = 1152, nc = 1536;
|
|
8731
8731
|
let at = null, Ds = null;
|
|
@@ -8776,13 +8776,13 @@ class Xt {
|
|
|
8776
8776
|
return t && this.logger.debug("PTS rollover detected"), i;
|
|
8777
8777
|
}
|
|
8778
8778
|
remux(e, t, s, i, r, n, o, c) {
|
|
8779
|
-
let l, h, u, d, f, g,
|
|
8780
|
-
const y = e.pid > -1,
|
|
8781
|
-
if ((!y ||
|
|
8779
|
+
let l, h, u, d, f, g, E = r, p = r;
|
|
8780
|
+
const y = e.pid > -1, S = t.pid > -1, T = t.samples.length, v = e.samples.length > 0, x = o && T > 0 || T > 1;
|
|
8781
|
+
if ((!y || v) && (!S || x) || this.ISGenerated || o) {
|
|
8782
8782
|
if (this.ISGenerated) {
|
|
8783
|
-
var
|
|
8783
|
+
var A, R, D, L;
|
|
8784
8784
|
const V = this.videoTrackConfig;
|
|
8785
|
-
(V && (t.width !== V.width || t.height !== V.height || ((
|
|
8785
|
+
(V && (t.width !== V.width || t.height !== V.height || ((A = t.pixelRatio) == null ? void 0 : A[0]) !== ((R = V.pixelRatio) == null ? void 0 : R[0]) || ((D = t.pixelRatio) == null ? void 0 : D[1]) !== ((L = V.pixelRatio) == null ? void 0 : L[1])) || !V && x || this.nextAudioPts === null && v) && this.resetInitSegment();
|
|
8786
8786
|
}
|
|
8787
8787
|
this.ISGenerated || (u = this.generateIS(e, t, r, n));
|
|
8788
8788
|
const P = this.isVideoContiguous;
|
|
@@ -8791,19 +8791,19 @@ class Xt {
|
|
|
8791
8791
|
if (g = !0, O > 0) {
|
|
8792
8792
|
this.logger.warn(`[mp4-remuxer]: Dropped ${O} out of ${T} video samples due to a missing keyframe`);
|
|
8793
8793
|
const V = this.getVideoStartPts(t.samples);
|
|
8794
|
-
t.samples = t.samples.slice(O), t.dropped += O,
|
|
8794
|
+
t.samples = t.samples.slice(O), t.dropped += O, p += (t.samples[0].pts - V) / t.inputTimeScale, X = p;
|
|
8795
8795
|
} else O === -1 && (this.logger.warn(`[mp4-remuxer]: No keyframe found out of ${T} video samples`), g = !1);
|
|
8796
8796
|
if (this.ISGenerated) {
|
|
8797
|
-
if (
|
|
8797
|
+
if (v && x) {
|
|
8798
8798
|
const V = this.getVideoStartPts(t.samples), M = (Ae(e.samples[0].pts, V) - V) / t.inputTimeScale;
|
|
8799
|
-
|
|
8799
|
+
E += Math.max(0, M), p += Math.max(0, -M);
|
|
8800
8800
|
}
|
|
8801
|
-
if (
|
|
8802
|
-
if (e.samplerate || (this.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"), u = this.generateIS(e, t, r, n)), h = this.remuxAudio(e,
|
|
8801
|
+
if (v) {
|
|
8802
|
+
if (e.samplerate || (this.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"), u = this.generateIS(e, t, r, n)), h = this.remuxAudio(e, E, this.isAudioContiguous, n, S || x || c === N.AUDIO ? p : void 0), x) {
|
|
8803
8803
|
const V = h ? h.endPTS - h.startPTS : 0;
|
|
8804
|
-
t.inputTimeScale || (this.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"), u = this.generateIS(e, t, r, n)), l = this.remuxVideo(t,
|
|
8804
|
+
t.inputTimeScale || (this.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"), u = this.generateIS(e, t, r, n)), l = this.remuxVideo(t, p, P, V);
|
|
8805
8805
|
}
|
|
8806
|
-
} else x && (l = this.remuxVideo(t,
|
|
8806
|
+
} else x && (l = this.remuxVideo(t, p, P, 0));
|
|
8807
8807
|
l && (l.firstKeyFrame = O, l.independent = O !== -1, l.firstKeyFramePTS = X);
|
|
8808
8808
|
}
|
|
8809
8809
|
}
|
|
@@ -8850,8 +8850,8 @@ class Xt {
|
|
|
8850
8850
|
}
|
|
8851
8851
|
}, h)
|
|
8852
8852
|
if (g = t.inputTimeScale, !l || g !== l.timescale) {
|
|
8853
|
-
const
|
|
8854
|
-
f = Math.min(f, Ae(n[0].dts,
|
|
8853
|
+
const E = this.getVideoStartPts(n), p = Math.round(g * s);
|
|
8854
|
+
f = Math.min(f, Ae(n[0].dts, E) - p), d = Math.min(d, E - p);
|
|
8855
8855
|
} else
|
|
8856
8856
|
h = !1;
|
|
8857
8857
|
this.videoTrackConfig = {
|
|
@@ -8875,23 +8875,23 @@ class Xt {
|
|
|
8875
8875
|
}
|
|
8876
8876
|
remuxVideo(e, t, s, i) {
|
|
8877
8877
|
const r = e.inputTimeScale, n = e.samples, o = [], c = n.length, l = this._initPTS;
|
|
8878
|
-
let h = this.nextAvcDts, u = 8, d = this.videoSampleDuration, f, g,
|
|
8878
|
+
let h = this.nextAvcDts, u = 8, d = this.videoSampleDuration, f, g, E = Number.POSITIVE_INFINITY, p = Number.NEGATIVE_INFINITY, y = !1;
|
|
8879
8879
|
if (!s || h === null) {
|
|
8880
8880
|
const k = t * r, w = n[0].pts - Ae(n[0].dts, n[0].pts);
|
|
8881
8881
|
at && h !== null && Math.abs(k - w - h) < 15e3 ? s = !0 : h = k - w;
|
|
8882
8882
|
}
|
|
8883
|
-
const
|
|
8883
|
+
const S = l.baseTime * r / l.timescale;
|
|
8884
8884
|
for (let k = 0; k < c; k++) {
|
|
8885
8885
|
const w = n[k];
|
|
8886
|
-
w.pts = Ae(w.pts -
|
|
8886
|
+
w.pts = Ae(w.pts - S, h), w.dts = Ae(w.dts - S, h), w.dts < n[k > 0 ? k - 1 : k].dts && (y = !0);
|
|
8887
8887
|
}
|
|
8888
8888
|
y && n.sort(function(k, w) {
|
|
8889
8889
|
const Y = k.dts - w.dts, H = k.pts - w.pts;
|
|
8890
8890
|
return Y || H;
|
|
8891
8891
|
}), f = n[0].dts, g = n[n.length - 1].dts;
|
|
8892
|
-
const T = g - f,
|
|
8892
|
+
const T = g - f, v = T ? Math.round(T / (c - 1)) : d || e.inputTimeScale / 30;
|
|
8893
8893
|
if (s) {
|
|
8894
|
-
const k = f - h, w = k >
|
|
8894
|
+
const k = f - h, w = k > v, Y = k < -1;
|
|
8895
8895
|
if ((w || Y) && (w ? this.logger.warn(`${(e.segmentCodec || "").toUpperCase()}: ${Et(k, !0)} ms (${k}dts) hole between fragments detected at ${t.toFixed(3)}`) : this.logger.warn(`${(e.segmentCodec || "").toUpperCase()}: ${Et(-k, !0)} ms (${k}dts) overlapping between fragments detected at ${t.toFixed(3)}`), !Y || h >= n[0].pts || at)) {
|
|
8896
8896
|
f = h;
|
|
8897
8897
|
const H = n[0].pts - k;
|
|
@@ -8911,13 +8911,13 @@ class Xt {
|
|
|
8911
8911
|
}
|
|
8912
8912
|
}
|
|
8913
8913
|
f = Math.max(0, f);
|
|
8914
|
-
let x = 0, _ = 0,
|
|
8914
|
+
let x = 0, _ = 0, A = f;
|
|
8915
8915
|
for (let k = 0; k < c; k++) {
|
|
8916
8916
|
const w = n[k], Y = w.units, H = Y.length;
|
|
8917
8917
|
let j = 0;
|
|
8918
8918
|
for (let Z = 0; Z < H; Z++)
|
|
8919
8919
|
j += Y[Z].data.length;
|
|
8920
|
-
_ += j, x += H, w.length = j, w.dts <
|
|
8920
|
+
_ += j, x += H, w.length = j, w.dts < A ? (w.dts = A, A += v / 4 | 0 || 1) : A = w.dts, E = Math.min(w.pts, E), p = Math.max(w.pts, p);
|
|
8921
8921
|
}
|
|
8922
8922
|
g = n[c - 1].dts;
|
|
8923
8923
|
const R = _ + 4 * x + 8;
|
|
@@ -8935,23 +8935,23 @@ class Xt {
|
|
|
8935
8935
|
});
|
|
8936
8936
|
return;
|
|
8937
8937
|
}
|
|
8938
|
-
const
|
|
8939
|
-
|
|
8938
|
+
const L = new DataView(D.buffer);
|
|
8939
|
+
L.setUint32(0, R), D.set(I.types.mdat, 4);
|
|
8940
8940
|
let P = !1, O = Number.POSITIVE_INFINITY, X = Number.POSITIVE_INFINITY, V = Number.NEGATIVE_INFINITY, $ = Number.NEGATIVE_INFINITY;
|
|
8941
8941
|
for (let k = 0; k < c; k++) {
|
|
8942
8942
|
const w = n[k], Y = w.units;
|
|
8943
8943
|
let H = 0;
|
|
8944
8944
|
for (let ee = 0, ne = Y.length; ee < ne; ee++) {
|
|
8945
8945
|
const ge = Y[ee], me = ge.data, Ke = ge.data.byteLength;
|
|
8946
|
-
|
|
8946
|
+
L.setUint32(u, Ke), u += 4, D.set(me, u), u += Ke, H += 4 + Ke;
|
|
8947
8947
|
}
|
|
8948
8948
|
let j;
|
|
8949
8949
|
if (k < c - 1)
|
|
8950
8950
|
d = n[k + 1].dts - w.dts, j = n[k + 1].pts - w.pts;
|
|
8951
8951
|
else {
|
|
8952
|
-
const ee = this.config, ne = k > 0 ? w.dts - n[k - 1].dts :
|
|
8953
|
-
if (j = k > 0 ? w.pts - n[k - 1].pts :
|
|
8954
|
-
const ge = Math.floor(ee.maxBufferHole * r), me = (i ?
|
|
8952
|
+
const ee = this.config, ne = k > 0 ? w.dts - n[k - 1].dts : v;
|
|
8953
|
+
if (j = k > 0 ? w.pts - n[k - 1].pts : v, ee.stretchShortVideoTrack && this.nextAudioPts !== null) {
|
|
8954
|
+
const ge = Math.floor(ee.maxBufferHole * r), me = (i ? E + i * r : this.nextAudioPts) - w.pts;
|
|
8955
8955
|
me > ge ? (d = me - ne, d < 0 ? d = ne : P = !0, this.logger.log(`[mp4-remuxer]: It is approximately ${me / 90} ms to the next segment; using duration ${d / 90} ms for the last video frame.`)) : d = ne;
|
|
8956
8956
|
} else
|
|
8957
8957
|
d = ne;
|
|
@@ -8965,7 +8965,7 @@ class Xt {
|
|
|
8965
8965
|
const k = o[0].flags;
|
|
8966
8966
|
k.dependsOn = 2, k.isNonSync = 0;
|
|
8967
8967
|
}
|
|
8968
|
-
} else if (Ds && $ - X < V - O &&
|
|
8968
|
+
} else if (Ds && $ - X < V - O && v / V < 0.025 && o[0].cts === 0) {
|
|
8969
8969
|
this.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");
|
|
8970
8970
|
let k = f;
|
|
8971
8971
|
for (let w = 0, Y = o.length; w < Y; w++) {
|
|
@@ -8974,19 +8974,19 @@ class Xt {
|
|
|
8974
8974
|
const Z = H + o[w + 1].cts;
|
|
8975
8975
|
o[w].duration = Z - j;
|
|
8976
8976
|
} else
|
|
8977
|
-
o[w].duration = w ? o[w - 1].duration :
|
|
8977
|
+
o[w].duration = w ? o[w - 1].duration : v;
|
|
8978
8978
|
o[w].cts = 0, k = H;
|
|
8979
8979
|
}
|
|
8980
8980
|
}
|
|
8981
8981
|
}
|
|
8982
|
-
d = P || !d ?
|
|
8982
|
+
d = P || !d ? v : d, this.nextAvcDts = h = g + d, this.videoSampleDuration = d, this.isVideoContiguous = !0;
|
|
8983
8983
|
const B = {
|
|
8984
8984
|
data1: I.moof(e.sequenceNumber++, f, re(e, {
|
|
8985
8985
|
samples: o
|
|
8986
8986
|
})),
|
|
8987
8987
|
data2: D,
|
|
8988
|
-
startPTS:
|
|
8989
|
-
endPTS: (
|
|
8988
|
+
startPTS: E / r,
|
|
8989
|
+
endPTS: (p + d) / r,
|
|
8990
8990
|
startDTS: f / r,
|
|
8991
8991
|
endDTS: h / r,
|
|
8992
8992
|
type: "video",
|
|
@@ -9009,19 +9009,19 @@ class Xt {
|
|
|
9009
9009
|
}
|
|
9010
9010
|
remuxAudio(e, t, s, i, r) {
|
|
9011
9011
|
const n = e.inputTimeScale, o = e.samplerate ? e.samplerate : n, c = n / o, l = this.getSamplesPerFrame(e), h = l * c, u = this._initPTS, d = e.segmentCodec === "mp3" && this.typeSupported.mpeg, f = [], g = r !== void 0;
|
|
9012
|
-
let
|
|
9013
|
-
const
|
|
9014
|
-
if (this.isAudioContiguous = s = s ||
|
|
9015
|
-
M.pts = Ae(M.pts - T,
|
|
9012
|
+
let E = e.samples, p = d ? 0 : 8, y = this.nextAudioPts || -1;
|
|
9013
|
+
const S = t * n, T = u.baseTime * n / u.timescale;
|
|
9014
|
+
if (this.isAudioContiguous = s = s || E.length && y > 0 && (i && Math.abs(S - y) < 9e3 || Math.abs(Ae(E[0].pts - T, S) - y) < 20 * h), E.forEach(function(M) {
|
|
9015
|
+
M.pts = Ae(M.pts - T, S);
|
|
9016
9016
|
}), !s || y < 0) {
|
|
9017
|
-
if (
|
|
9017
|
+
if (E = E.filter((M) => M.pts >= 0), !E.length)
|
|
9018
9018
|
return;
|
|
9019
|
-
r === 0 ? y = 0 : i && !g ? y = Math.max(0,
|
|
9019
|
+
r === 0 ? y = 0 : i && !g ? y = Math.max(0, S) : y = E[0].pts;
|
|
9020
9020
|
}
|
|
9021
9021
|
if (e.segmentCodec === "aac") {
|
|
9022
9022
|
const M = this.config.maxAudioFramesDrift;
|
|
9023
|
-
for (let G = 0, B = y; G <
|
|
9024
|
-
const k =
|
|
9023
|
+
for (let G = 0, B = y; G < E.length; G++) {
|
|
9024
|
+
const k = E[G], w = k.pts, Y = w - B, H = Math.abs(1e3 * Y / n);
|
|
9025
9025
|
if (Y <= -M * h && g)
|
|
9026
9026
|
G === 0 && (this.logger.warn(`Audio frame @ ${(w / n).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3 * Y / n)} ms.`), this.nextAudioPts = y = B = w);
|
|
9027
9027
|
else if (Y >= M * h && H < sc && g) {
|
|
@@ -9030,7 +9030,7 @@ class Xt {
|
|
|
9030
9030
|
for (let Z = 0; Z < j; Z++) {
|
|
9031
9031
|
const ee = Math.max(B, 0);
|
|
9032
9032
|
let ne = Jl.getSilentFrame(e.parsedCodec || e.manifestCodec || e.codec, e.channelCount);
|
|
9033
|
-
ne || (this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."), ne = k.unit.subarray()),
|
|
9033
|
+
ne || (this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."), ne = k.unit.subarray()), E.splice(G, 0, {
|
|
9034
9034
|
unit: ne,
|
|
9035
9035
|
pts: ee
|
|
9036
9036
|
}), B += h, G++;
|
|
@@ -9039,47 +9039,47 @@ class Xt {
|
|
|
9039
9039
|
k.pts = B, B += h;
|
|
9040
9040
|
}
|
|
9041
9041
|
}
|
|
9042
|
-
let
|
|
9042
|
+
let v = null, x = null, _, A = 0, R = E.length;
|
|
9043
9043
|
for (; R--; )
|
|
9044
|
-
|
|
9045
|
-
for (let M = 0, G =
|
|
9046
|
-
const B =
|
|
9044
|
+
A += E[R].unit.byteLength;
|
|
9045
|
+
for (let M = 0, G = E.length; M < G; M++) {
|
|
9046
|
+
const B = E[M], k = B.unit;
|
|
9047
9047
|
let w = B.pts;
|
|
9048
9048
|
if (x !== null) {
|
|
9049
9049
|
const H = f[M - 1];
|
|
9050
9050
|
H.duration = Math.round((w - x) / c);
|
|
9051
|
-
} else if (s && e.segmentCodec === "aac" && (w = y),
|
|
9052
|
-
|
|
9051
|
+
} else if (s && e.segmentCodec === "aac" && (w = y), v = w, A > 0) {
|
|
9052
|
+
A += p;
|
|
9053
9053
|
try {
|
|
9054
|
-
_ = new Uint8Array(
|
|
9054
|
+
_ = new Uint8Array(A);
|
|
9055
9055
|
} catch (H) {
|
|
9056
9056
|
this.observer.emit(m.ERROR, m.ERROR, {
|
|
9057
9057
|
type: U.MUX_ERROR,
|
|
9058
9058
|
details: b.REMUX_ALLOC_ERROR,
|
|
9059
9059
|
fatal: !1,
|
|
9060
9060
|
error: H,
|
|
9061
|
-
bytes:
|
|
9062
|
-
reason: `fail allocating audio mdat ${
|
|
9061
|
+
bytes: A,
|
|
9062
|
+
reason: `fail allocating audio mdat ${A}`
|
|
9063
9063
|
});
|
|
9064
9064
|
return;
|
|
9065
9065
|
}
|
|
9066
|
-
d || (new DataView(_.buffer).setUint32(0,
|
|
9066
|
+
d || (new DataView(_.buffer).setUint32(0, A), _.set(I.types.mdat, 4));
|
|
9067
9067
|
} else
|
|
9068
9068
|
return;
|
|
9069
|
-
_.set(k,
|
|
9069
|
+
_.set(k, p);
|
|
9070
9070
|
const Y = k.byteLength;
|
|
9071
|
-
|
|
9071
|
+
p += Y, f.push(xr(!0, l, Y, 0)), x = w;
|
|
9072
9072
|
}
|
|
9073
9073
|
const D = f.length;
|
|
9074
9074
|
if (!D)
|
|
9075
9075
|
return;
|
|
9076
|
-
const
|
|
9077
|
-
this.nextAudioPts = y = x + c *
|
|
9078
|
-
const P = d ? new Uint8Array(0) : I.moof(e.sequenceNumber++,
|
|
9076
|
+
const L = f[f.length - 1];
|
|
9077
|
+
this.nextAudioPts = y = x + c * L.duration;
|
|
9078
|
+
const P = d ? new Uint8Array(0) : I.moof(e.sequenceNumber++, v / c, re({}, e, {
|
|
9079
9079
|
samples: f
|
|
9080
9080
|
}));
|
|
9081
9081
|
e.samples = [];
|
|
9082
|
-
const O =
|
|
9082
|
+
const O = v / n, X = y / n, $ = {
|
|
9083
9083
|
data1: P,
|
|
9084
9084
|
data2: _,
|
|
9085
9085
|
startPTS: O,
|
|
@@ -9208,29 +9208,29 @@ class oc {
|
|
|
9208
9208
|
if ((o = g) != null && o.length || (this.generateInitSegment(d), g = this.initData), !((c = g) != null && c.length))
|
|
9209
9209
|
return this.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."), u;
|
|
9210
9210
|
this.emitInitSegment && (f.tracks = this.initTracks, this.emitInitSegment = !1);
|
|
9211
|
-
const
|
|
9212
|
-
(n || !l) && (lc(l, y, r,
|
|
9211
|
+
const E = za(d, g), p = Xa(g, d), y = p === null ? r : p;
|
|
9212
|
+
(n || !l) && (lc(l, y, r, E) || f.timescale !== l.timescale) && (f.initPTS = y - r, l && l.timescale === 1 && this.logger.warn(`Adjusting initPTS @${r} from ${l.baseTime / l.timescale} to ${f.initPTS}`), this.initPTS = l = {
|
|
9213
9213
|
baseTime: f.initPTS,
|
|
9214
9214
|
timescale: 1
|
|
9215
9215
|
});
|
|
9216
|
-
const
|
|
9217
|
-
Za(g, d, l.baseTime / l.timescale),
|
|
9218
|
-
const
|
|
9216
|
+
const S = e ? y - l.baseTime / l.timescale : h, T = S + E;
|
|
9217
|
+
Za(g, d, l.baseTime / l.timescale), E > 0 ? this.lastEndTime = T : (this.logger.warn("Duration parsed from mp4 should be greater than zero"), this.resetNextTimestamp());
|
|
9218
|
+
const v = !!g.audio, x = !!g.video;
|
|
9219
9219
|
let _ = "";
|
|
9220
|
-
|
|
9221
|
-
const
|
|
9220
|
+
v && (_ += "audio"), x && (_ += "video");
|
|
9221
|
+
const A = {
|
|
9222
9222
|
data1: d,
|
|
9223
|
-
startPTS:
|
|
9224
|
-
startDTS:
|
|
9223
|
+
startPTS: S,
|
|
9224
|
+
startDTS: S,
|
|
9225
9225
|
endPTS: T,
|
|
9226
9226
|
endDTS: T,
|
|
9227
9227
|
type: _,
|
|
9228
|
-
hasAudio:
|
|
9228
|
+
hasAudio: v,
|
|
9229
9229
|
hasVideo: x,
|
|
9230
9230
|
nb: 1,
|
|
9231
9231
|
dropped: 0
|
|
9232
9232
|
};
|
|
9233
|
-
return u.audio =
|
|
9233
|
+
return u.audio = A.type === "audio" ? A : void 0, u.video = A.type !== "audio" ? A : void 0, u.initSegment = f, u.id3 = Wn(s, r, l, l), i.samples.length && (u.text = qn(i, r, l)), u;
|
|
9234
9234
|
}
|
|
9235
9235
|
}
|
|
9236
9236
|
function lc(a, e, t, s) {
|
|
@@ -9290,26 +9290,26 @@ class Lr {
|
|
|
9290
9290
|
timeOffset: f,
|
|
9291
9291
|
initSegmentChange: g
|
|
9292
9292
|
} = i || o, {
|
|
9293
|
-
audioCodec:
|
|
9294
|
-
videoCodec:
|
|
9293
|
+
audioCodec: E,
|
|
9294
|
+
videoCodec: p,
|
|
9295
9295
|
defaultInitPts: y,
|
|
9296
|
-
duration:
|
|
9296
|
+
duration: S,
|
|
9297
9297
|
initSegmentData: T
|
|
9298
|
-
} = c,
|
|
9299
|
-
if (
|
|
9300
|
-
const R = this.getDecrypter(), D = ui(
|
|
9298
|
+
} = c, v = cc(n, t);
|
|
9299
|
+
if (v && lt(v.method)) {
|
|
9300
|
+
const R = this.getDecrypter(), D = ui(v.method);
|
|
9301
9301
|
if (R.isSync()) {
|
|
9302
|
-
let
|
|
9302
|
+
let L = R.softwareDecrypt(n, v.key.buffer, v.iv.buffer, D);
|
|
9303
9303
|
if (s.part > -1) {
|
|
9304
9304
|
const O = R.flush();
|
|
9305
|
-
|
|
9305
|
+
L = O && O.buffer;
|
|
9306
9306
|
}
|
|
9307
|
-
if (!
|
|
9307
|
+
if (!L)
|
|
9308
9308
|
return r.executeEnd = Ue(), Cs(s);
|
|
9309
|
-
n = new Uint8Array(
|
|
9309
|
+
n = new Uint8Array(L);
|
|
9310
9310
|
} else
|
|
9311
|
-
return this.asyncResult = !0, this.decryptionPromise = R.webCryptoDecrypt(n,
|
|
9312
|
-
const P = this.push(
|
|
9311
|
+
return this.asyncResult = !0, this.decryptionPromise = R.webCryptoDecrypt(n, v.key.buffer, v.iv.buffer, D).then((L) => {
|
|
9312
|
+
const P = this.push(L, null, s);
|
|
9313
9313
|
return this.decryptionPromise = null, P;
|
|
9314
9314
|
}), this.decryptionPromise;
|
|
9315
9315
|
}
|
|
@@ -9325,11 +9325,11 @@ class Lr {
|
|
|
9325
9325
|
reason: R.message
|
|
9326
9326
|
}), r.executeEnd = Ue(), Cs(s);
|
|
9327
9327
|
}
|
|
9328
|
-
(h || u || g || x) && this.resetInitSegment(T,
|
|
9329
|
-
const _ = this.transmux(n,
|
|
9328
|
+
(h || u || g || x) && this.resetInitSegment(T, E, p, S, t), (h || g || x) && this.resetInitialTimestamp(y), l || this.resetContiguity();
|
|
9329
|
+
const _ = this.transmux(n, v, f, d, s);
|
|
9330
9330
|
this.asyncResult = _t(_);
|
|
9331
|
-
const
|
|
9332
|
-
return
|
|
9331
|
+
const A = this.currentTransmuxState;
|
|
9332
|
+
return A.contiguous = !0, A.discontinuity = !1, A.trackSwitch = !1, r.executeEnd = Ue(), _;
|
|
9333
9333
|
}
|
|
9334
9334
|
// Due to data caching, flush calls can produce more than one TransmuxerResult (hence the Array type)
|
|
9335
9335
|
flush(e) {
|
|
@@ -9583,16 +9583,16 @@ class jn {
|
|
|
9583
9583
|
const {
|
|
9584
9584
|
instanceNo: f,
|
|
9585
9585
|
transmuxer: g
|
|
9586
|
-
} = this,
|
|
9587
|
-
(T ||
|
|
9588
|
-
const D = !(y && ((u = r.initSegment) == null ? void 0 : u.url) === ((d = y.initSegment) == null ? void 0 : d.url)),
|
|
9589
|
-
if (!
|
|
9586
|
+
} = this, E = n ? n.start : r.start, p = r.decryptdata, y = this.frag, S = !(y && r.cc === y.cc), T = !(y && l.level === y.level), v = y ? l.sn - y.sn : -1, x = this.part ? l.part - this.part.index : -1, _ = v === 0 && l.id > 1 && l.id === (y == null ? void 0 : y.stats.chunkCount), A = !T && (v === 1 || v === 0 && (x === 1 || _ && x <= 0)), R = self.performance.now();
|
|
9587
|
+
(T || v || r.stats.parsing.start === 0) && (r.stats.parsing.start = R), n && (x || !A) && (n.stats.parsing.start = R);
|
|
9588
|
+
const D = !(y && ((u = r.initSegment) == null ? void 0 : u.url) === ((d = y.initSegment) == null ? void 0 : d.url)), L = new uc(S, A, c, T, E, D);
|
|
9589
|
+
if (!A || S || D) {
|
|
9590
9590
|
this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${l.sn}${l.part > -1 ? " part: " + l.part : ""} ${this.id === N.MAIN ? "level" : "track"}: ${l.level} id: ${l.id}
|
|
9591
|
-
discontinuity: ${
|
|
9591
|
+
discontinuity: ${S}
|
|
9592
9592
|
trackSwitch: ${T}
|
|
9593
|
-
contiguous: ${
|
|
9593
|
+
contiguous: ${A}
|
|
9594
9594
|
accurateTimeOffset: ${c}
|
|
9595
|
-
timeOffset: ${
|
|
9595
|
+
timeOffset: ${E}
|
|
9596
9596
|
initSegmentChange: ${D}`);
|
|
9597
9597
|
const P = new hc(s, i, t, o, h);
|
|
9598
9598
|
this.configureTransmuxer(P);
|
|
@@ -9602,12 +9602,12 @@ class jn {
|
|
|
9602
9602
|
instanceNo: f,
|
|
9603
9603
|
cmd: "demux",
|
|
9604
9604
|
data: e,
|
|
9605
|
-
decryptdata:
|
|
9605
|
+
decryptdata: p,
|
|
9606
9606
|
chunkMeta: l,
|
|
9607
|
-
state:
|
|
9607
|
+
state: L
|
|
9608
9608
|
}, e instanceof ArrayBuffer ? [e] : []);
|
|
9609
9609
|
else if (g) {
|
|
9610
|
-
const P = g.push(e,
|
|
9610
|
+
const P = g.push(e, p, l, L);
|
|
9611
9611
|
_t(P) ? P.then((O) => {
|
|
9612
9612
|
this.handleTransmuxComplete(O);
|
|
9613
9613
|
}).catch((O) => {
|
|
@@ -9816,31 +9816,31 @@ class dc extends fi {
|
|
|
9816
9816
|
}), this.state = C.ENDED;
|
|
9817
9817
|
return;
|
|
9818
9818
|
}
|
|
9819
|
-
const u = h.len, d = t.maxBufferLength, f = c.fragments, g = f[0].start,
|
|
9819
|
+
const u = h.len, d = t.maxBufferLength, f = c.fragments, g = f[0].start, E = this.getLoadPosition(), p = this.flushing ? E : h.end;
|
|
9820
9820
|
if (this.switchingTrack && i) {
|
|
9821
|
-
const T =
|
|
9821
|
+
const T = E;
|
|
9822
9822
|
c.PTSKnown && T < g && (h.end > g || h.nextStart) && (this.log("Alt audio track ahead of main track, seek to start of alt audio track"), i.currentTime = g + 0.05);
|
|
9823
9823
|
}
|
|
9824
|
-
if (u >= d && !this.switchingTrack &&
|
|
9824
|
+
if (u >= d && !this.switchingTrack && p < f[f.length - 1].start)
|
|
9825
9825
|
return;
|
|
9826
|
-
let y = this.getNextFragment(
|
|
9827
|
-
if (y && this.isLoopLoading(y,
|
|
9826
|
+
let y = this.getNextFragment(p, c);
|
|
9827
|
+
if (y && this.isLoopLoading(y, p) && (y = this.getNextFragmentLoopLoading(y, c, h, N.MAIN, d)), !y) {
|
|
9828
9828
|
this.bufferFlushed = !0;
|
|
9829
9829
|
return;
|
|
9830
9830
|
}
|
|
9831
|
-
let
|
|
9832
|
-
if (!this.audioOnly && this.startFragRequested &&
|
|
9833
|
-
if (y.start >
|
|
9834
|
-
const
|
|
9835
|
-
|
|
9836
|
-
frag:
|
|
9831
|
+
let S = ((e = this.mainFragLoading) == null ? void 0 : e.frag) || null;
|
|
9832
|
+
if (!this.audioOnly && this.startFragRequested && S && ue(y) && !y.endList && (!c.live || !this.loadingParts && p < this.hls.liveSyncPosition) && (this.fragmentTracker.getState(S) === ce.OK && (this.mainFragLoading = S = null), S && ue(S))) {
|
|
9833
|
+
if (y.start > S.end) {
|
|
9834
|
+
const v = this.fragmentTracker.getFragAtPos(p, N.MAIN);
|
|
9835
|
+
v && v.end > S.end && (S = v, this.mainFragLoading = {
|
|
9836
|
+
frag: v,
|
|
9837
9837
|
targetBufferTime: null
|
|
9838
9838
|
});
|
|
9839
9839
|
}
|
|
9840
|
-
if (y.start >
|
|
9840
|
+
if (y.start > S.end)
|
|
9841
9841
|
return;
|
|
9842
9842
|
}
|
|
9843
|
-
this.loadFragment(y, o,
|
|
9843
|
+
this.loadFragment(y, o, p);
|
|
9844
9844
|
}
|
|
9845
9845
|
onMediaDetaching(e, t) {
|
|
9846
9846
|
this.bufferFlushed = this.flushing = !1, super.onMediaDetaching(e, t);
|
|
@@ -9932,19 +9932,19 @@ class dc extends fi {
|
|
|
9932
9932
|
d || (d = this.transmuxer = new jn(this.hls, N.AUDIO, this._handleTransmuxComplete.bind(this), this._handleTransmuxerFlush.bind(this)));
|
|
9933
9933
|
const f = this.initPTS[s.cc], g = (t = s.initSegment) == null ? void 0 : t.data;
|
|
9934
9934
|
if (f !== void 0) {
|
|
9935
|
-
const
|
|
9936
|
-
d.push(r, g, u, "", s, i, h.totalduration, !1,
|
|
9935
|
+
const p = i ? i.index : -1, y = p !== -1, S = new hi(s.level, s.sn, s.stats.chunkCount, r.byteLength, p, y);
|
|
9936
|
+
d.push(r, g, u, "", s, i, h.totalduration, !1, S, f);
|
|
9937
9937
|
} else {
|
|
9938
9938
|
this.log(`Unknown video PTS for cc ${s.cc}, waiting for video PTS before demuxing audio frag ${s.sn} of [${h.startSN} ,${h.endSN}],track ${o}`);
|
|
9939
9939
|
const {
|
|
9940
|
-
cache:
|
|
9940
|
+
cache: E
|
|
9941
9941
|
} = this.waitingData = this.waitingData || {
|
|
9942
9942
|
frag: s,
|
|
9943
9943
|
part: i,
|
|
9944
9944
|
cache: new _n(),
|
|
9945
9945
|
complete: !1
|
|
9946
9946
|
};
|
|
9947
|
-
|
|
9947
|
+
E.push(new Uint8Array(r)), this.state !== C.STOPPED && (this.state = C.WAITING_INIT_PTS);
|
|
9948
9948
|
}
|
|
9949
9949
|
}
|
|
9950
9950
|
_handleFragmentLoadComplete(e) {
|
|
@@ -10058,49 +10058,49 @@ class dc extends fi {
|
|
|
10058
10058
|
audio: d,
|
|
10059
10059
|
text: f,
|
|
10060
10060
|
id3: g,
|
|
10061
|
-
initSegment:
|
|
10061
|
+
initSegment: E
|
|
10062
10062
|
} = r;
|
|
10063
10063
|
if (this.fragContextChanged(c) || !u) {
|
|
10064
10064
|
this.fragmentTracker.removeFragment(c);
|
|
10065
10065
|
return;
|
|
10066
10066
|
}
|
|
10067
|
-
if (this.state = C.PARSING, this.switchingTrack && d && this.completeAudioSwitch(this.switchingTrack),
|
|
10068
|
-
const
|
|
10069
|
-
this._bufferInitSegment(h,
|
|
10070
|
-
frag:
|
|
10067
|
+
if (this.state = C.PARSING, this.switchingTrack && d && this.completeAudioSwitch(this.switchingTrack), E != null && E.tracks) {
|
|
10068
|
+
const p = c.initSegment || c;
|
|
10069
|
+
this._bufferInitSegment(h, E.tracks, p, n), i.trigger(m.FRAG_PARSING_INIT_SEGMENT, {
|
|
10070
|
+
frag: p,
|
|
10071
10071
|
id: s,
|
|
10072
|
-
tracks:
|
|
10072
|
+
tracks: E.tracks
|
|
10073
10073
|
});
|
|
10074
10074
|
}
|
|
10075
10075
|
if (d) {
|
|
10076
10076
|
const {
|
|
10077
|
-
startPTS:
|
|
10077
|
+
startPTS: p,
|
|
10078
10078
|
endPTS: y,
|
|
10079
|
-
startDTS:
|
|
10079
|
+
startDTS: S,
|
|
10080
10080
|
endDTS: T
|
|
10081
10081
|
} = d;
|
|
10082
10082
|
l && (l.elementaryStreams[ie.AUDIO] = {
|
|
10083
|
-
startPTS:
|
|
10083
|
+
startPTS: p,
|
|
10084
10084
|
endPTS: y,
|
|
10085
|
-
startDTS:
|
|
10085
|
+
startDTS: S,
|
|
10086
10086
|
endDTS: T
|
|
10087
|
-
}), c.setElementaryStreamInfo(ie.AUDIO,
|
|
10087
|
+
}), c.setElementaryStreamInfo(ie.AUDIO, p, y, S, T), this.bufferFragmentData(d, c, l, n);
|
|
10088
10088
|
}
|
|
10089
10089
|
if (g != null && (t = g.samples) != null && t.length) {
|
|
10090
|
-
const
|
|
10090
|
+
const p = re({
|
|
10091
10091
|
id: s,
|
|
10092
10092
|
frag: c,
|
|
10093
10093
|
details: u
|
|
10094
10094
|
}, g);
|
|
10095
|
-
i.trigger(m.FRAG_PARSING_METADATA,
|
|
10095
|
+
i.trigger(m.FRAG_PARSING_METADATA, p);
|
|
10096
10096
|
}
|
|
10097
10097
|
if (f) {
|
|
10098
|
-
const
|
|
10098
|
+
const p = re({
|
|
10099
10099
|
id: s,
|
|
10100
10100
|
frag: c,
|
|
10101
10101
|
details: u
|
|
10102
10102
|
}, f);
|
|
10103
|
-
i.trigger(m.FRAG_PARSING_USERDATA,
|
|
10103
|
+
i.trigger(m.FRAG_PARSING_USERDATA, p);
|
|
10104
10104
|
}
|
|
10105
10105
|
}
|
|
10106
10106
|
_bufferInitSegment(e, t, s, i) {
|
|
@@ -10166,7 +10166,7 @@ class dc extends fi {
|
|
|
10166
10166
|
this.flushAudioIfNeeded(e), this.bufferedTrack = e, this.switchingTrack = null, t.trigger(m.AUDIO_TRACK_SWITCHED, te({}, e));
|
|
10167
10167
|
}
|
|
10168
10168
|
}
|
|
10169
|
-
class
|
|
10169
|
+
class vi extends Ge {
|
|
10170
10170
|
constructor(e, t) {
|
|
10171
10171
|
super(t, e.logger), this.hls = void 0, this.canLoad = !1, this.timer = -1, this.hls = e;
|
|
10172
10172
|
}
|
|
@@ -10246,25 +10246,25 @@ class Si extends Ge {
|
|
|
10246
10246
|
const h = "levelInfo" in t ? t.levelInfo : t.track;
|
|
10247
10247
|
if (i.reloaded(s), s && i.fragments.length > 0) {
|
|
10248
10248
|
rl(s, i);
|
|
10249
|
-
const
|
|
10250
|
-
if (
|
|
10251
|
-
this.warn(
|
|
10249
|
+
const S = i.playlistParsingError;
|
|
10250
|
+
if (S) {
|
|
10251
|
+
this.warn(S);
|
|
10252
10252
|
const T = this.hls;
|
|
10253
10253
|
if (!T.config.ignorePlaylistParsingErrors) {
|
|
10254
10254
|
var l;
|
|
10255
10255
|
const {
|
|
10256
|
-
networkDetails:
|
|
10256
|
+
networkDetails: v
|
|
10257
10257
|
} = t;
|
|
10258
10258
|
T.trigger(m.ERROR, {
|
|
10259
10259
|
type: U.NETWORK_ERROR,
|
|
10260
10260
|
details: b.LEVEL_PARSING_ERROR,
|
|
10261
10261
|
fatal: !1,
|
|
10262
10262
|
url: i.url,
|
|
10263
|
-
error:
|
|
10264
|
-
reason:
|
|
10263
|
+
error: S,
|
|
10264
|
+
reason: S.message,
|
|
10265
10265
|
level: t.level || void 0,
|
|
10266
10266
|
parent: (l = i.fragments[0]) == null ? void 0 : l.type,
|
|
10267
|
-
networkDetails:
|
|
10267
|
+
networkDetails: v,
|
|
10268
10268
|
stats: r
|
|
10269
10269
|
});
|
|
10270
10270
|
return;
|
|
@@ -10276,33 +10276,33 @@ class Si extends Ge {
|
|
|
10276
10276
|
const u = this.hls.mainForwardBufferInfo, d = u ? u.end - u.len : 0, f = (i.edge - d) * 1e3, g = xn(i, f);
|
|
10277
10277
|
if (i.requestScheduled + g < n ? i.requestScheduled = n : i.requestScheduled += g, this.log(`live playlist ${e} ${i.advanced ? "REFRESHED " + i.lastPartSn + "-" + i.lastPartIndex : i.updated ? "UPDATED" : "MISSED"}`), !this.canLoad || !i.live)
|
|
10278
10278
|
return;
|
|
10279
|
-
let
|
|
10279
|
+
let E, p, y;
|
|
10280
10280
|
if (i.canBlockReload && i.endSN && i.advanced) {
|
|
10281
|
-
const
|
|
10282
|
-
_ ?
|
|
10281
|
+
const S = this.hls.config.lowLatencyMode, T = i.lastPartSn, v = i.endSN, x = i.lastPartIndex, _ = x !== -1, A = T === v;
|
|
10282
|
+
_ ? A ? (p = v + 1, y = S ? 0 : x) : (p = T, y = S ? x + 1 : i.maxPartIndex) : p = v + 1;
|
|
10283
10283
|
const R = i.age, D = R + i.ageHeader;
|
|
10284
|
-
let
|
|
10285
|
-
if (
|
|
10284
|
+
let L = Math.min(D - i.partTarget, i.targetduration * 1.5);
|
|
10285
|
+
if (L > 0) {
|
|
10286
10286
|
if (D > i.targetduration * 3)
|
|
10287
|
-
this.log(`Playlist last advanced ${R.toFixed(2)}s ago. Omitting segment and part directives.`),
|
|
10287
|
+
this.log(`Playlist last advanced ${R.toFixed(2)}s ago. Omitting segment and part directives.`), p = void 0, y = void 0;
|
|
10288
10288
|
else if (s != null && s.tuneInGoal && D - i.partTarget > s.tuneInGoal)
|
|
10289
|
-
this.warn(`CDN Tune-in goal increased from: ${s.tuneInGoal} to: ${
|
|
10289
|
+
this.warn(`CDN Tune-in goal increased from: ${s.tuneInGoal} to: ${L} with playlist age: ${i.age}`), L = 0;
|
|
10290
10290
|
else {
|
|
10291
|
-
const P = Math.floor(
|
|
10292
|
-
if (
|
|
10293
|
-
const O = Math.round(
|
|
10291
|
+
const P = Math.floor(L / i.targetduration);
|
|
10292
|
+
if (p += P, y !== void 0) {
|
|
10293
|
+
const O = Math.round(L % i.targetduration / i.partTarget);
|
|
10294
10294
|
y += O;
|
|
10295
10295
|
}
|
|
10296
|
-
this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${R.toFixed(2)}s goal: ${
|
|
10296
|
+
this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${R.toFixed(2)}s goal: ${L} skip sn ${P} to part ${y}`);
|
|
10297
10297
|
}
|
|
10298
|
-
i.tuneInGoal =
|
|
10298
|
+
i.tuneInGoal = L;
|
|
10299
10299
|
}
|
|
10300
|
-
if (
|
|
10301
|
-
i.requestScheduled = n, this.loadingPlaylist(h,
|
|
10300
|
+
if (E = this.getDeliveryDirectives(i, t.deliveryDirectives, p, y), S || !A) {
|
|
10301
|
+
i.requestScheduled = n, this.loadingPlaylist(h, E);
|
|
10302
10302
|
return;
|
|
10303
10303
|
}
|
|
10304
|
-
} else (i.canBlockReload || i.canSkipUntil) && (
|
|
10305
|
-
|
|
10304
|
+
} else (i.canBlockReload || i.canSkipUntil) && (E = this.getDeliveryDirectives(i, t.deliveryDirectives, p, y));
|
|
10305
|
+
E && p !== void 0 && i.canBlockReload && (i.requestScheduled = r.loading.first + Math.max(g - o * 2, g / 2)), this.scheduleLoading(h, E, i);
|
|
10306
10306
|
} else
|
|
10307
10307
|
this.clearTimer();
|
|
10308
10308
|
}
|
|
@@ -10360,7 +10360,7 @@ function Dt(a, e, t) {
|
|
|
10360
10360
|
function zs(a, e) {
|
|
10361
10361
|
return e.label.toLowerCase() === a.name.toLowerCase() && (!e.language || e.language.toLowerCase() === (a.lang || "").toLowerCase());
|
|
10362
10362
|
}
|
|
10363
|
-
class fc extends
|
|
10363
|
+
class fc extends vi {
|
|
10364
10364
|
constructor(e) {
|
|
10365
10365
|
super(e, "audio-track-controller"), this.tracks = [], this.groupIds = null, this.tracksInGroup = [], this.trackId = -1, this.currentTrack = null, this.selectDefaultTrack = !0, this.registerListeners();
|
|
10366
10366
|
}
|
|
@@ -10826,11 +10826,11 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !Xr(i,
|
|
|
10826
10826
|
if (u) {
|
|
10827
10827
|
const d = this.fragmentTracker, f = h.id;
|
|
10828
10828
|
if (d.hasFragments(f) || d.hasParts(f)) {
|
|
10829
|
-
const
|
|
10830
|
-
d.detectEvictedFragments(l,
|
|
10829
|
+
const p = q.getBuffered(u);
|
|
10830
|
+
d.detectEvictedFragments(l, p, f, null, !0);
|
|
10831
10831
|
}
|
|
10832
|
-
const g = Ps(l),
|
|
10833
|
-
this.sourceBuffers[g] =
|
|
10832
|
+
const g = Ps(l), E = [l, u];
|
|
10833
|
+
this.sourceBuffers[g] = E, u.updating && this.operationQueue && this.operationQueue.prependBlocker(l), this.trackSourceBuffer(l, h);
|
|
10834
10834
|
}
|
|
10835
10835
|
}
|
|
10836
10836
|
}), o(), this.bufferCreated();
|
|
@@ -10912,26 +10912,26 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !Xr(i,
|
|
|
10912
10912
|
id: d,
|
|
10913
10913
|
codec: f,
|
|
10914
10914
|
levelCodec: g,
|
|
10915
|
-
container:
|
|
10916
|
-
metadata:
|
|
10915
|
+
container: E,
|
|
10916
|
+
metadata: p,
|
|
10917
10917
|
supplemental: y
|
|
10918
10918
|
} = u;
|
|
10919
|
-
let
|
|
10920
|
-
const T = (c = this.transferData) == null || (l = c.tracks) == null ? void 0 : l[o],
|
|
10921
|
-
|
|
10919
|
+
let S = s[o];
|
|
10920
|
+
const T = (c = this.transferData) == null || (l = c.tracks) == null ? void 0 : l[o], v = T != null && T.buffer ? T : S, x = (v == null ? void 0 : v.pendingCodec) || (v == null ? void 0 : v.codec), _ = v == null ? void 0 : v.levelCodec;
|
|
10921
|
+
S || (S = s[o] = {
|
|
10922
10922
|
buffer: void 0,
|
|
10923
10923
|
listeners: [],
|
|
10924
10924
|
codec: f,
|
|
10925
10925
|
supplemental: y,
|
|
10926
|
-
container:
|
|
10926
|
+
container: E,
|
|
10927
10927
|
levelCodec: g,
|
|
10928
|
-
metadata:
|
|
10928
|
+
metadata: p,
|
|
10929
10929
|
id: d
|
|
10930
10930
|
});
|
|
10931
|
-
const
|
|
10931
|
+
const A = qt(x, _), R = A == null ? void 0 : A.replace(br, "$1");
|
|
10932
10932
|
let D = qt(f, g);
|
|
10933
|
-
const
|
|
10934
|
-
D &&
|
|
10933
|
+
const L = (h = D) == null ? void 0 : h.replace(br, "$1");
|
|
10934
|
+
D && A && R !== L && (o.slice(0, 5) === "audio" && (D = ss(D, this.appendSource)), this.log(`switching codec ${x} to ${D}`), D !== (S.pendingCodec || S.codec) && (S.pendingCodec = D), S.container = E, this.appendChangeType(o, E, D));
|
|
10935
10935
|
}), (this.tracksReady || this.sourceBufferCount) && (t.tracks = this.sourceBufferTracks), !this.sourceBufferCount && this.mediaSourceOpenOrEnded && this.checkPendingTracks();
|
|
10936
10936
|
}
|
|
10937
10937
|
get sourceBufferTracks() {
|
|
@@ -11012,34 +11012,34 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !Xr(i,
|
|
|
11012
11012
|
h.start = d;
|
|
11013
11013
|
const f = o.stats.buffering, g = c ? c.stats.buffering : null;
|
|
11014
11014
|
f.start === 0 && (f.start = d), g && g.start === 0 && (g.start = d);
|
|
11015
|
-
const
|
|
11016
|
-
let
|
|
11017
|
-
r === "audio" && (
|
|
11018
|
-
const y = this.tracks.video,
|
|
11019
|
-
if (
|
|
11015
|
+
const E = s.audio;
|
|
11016
|
+
let p = !1;
|
|
11017
|
+
r === "audio" && (E == null ? void 0 : E.container) === "audio/mpeg" && (p = !this.lastMpegAudioChunk || l.id === 1 || this.lastMpegAudioChunk.sn !== l.sn, this.lastMpegAudioChunk = l);
|
|
11018
|
+
const y = this.tracks.video, S = y == null ? void 0 : y.buffer;
|
|
11019
|
+
if (S && u !== "initSegment") {
|
|
11020
11020
|
const x = c || o, _ = this.blockedAudioAppend;
|
|
11021
11021
|
if (r === "audio" && n !== "main" && !this.blockedAudioAppend) {
|
|
11022
|
-
const R = x.start + x.duration * 0.05, D =
|
|
11023
|
-
!D.length && !
|
|
11022
|
+
const R = x.start + x.duration * 0.05, D = S.buffered, L = this.currentOp("video");
|
|
11023
|
+
!D.length && !L ? this.blockAudio(x) : !L && !q.isBuffered(S, R) && this.lastVideoAppendEnd < R && this.blockAudio(x);
|
|
11024
11024
|
} else if (r === "video") {
|
|
11025
|
-
const
|
|
11025
|
+
const A = x.end;
|
|
11026
11026
|
if (_) {
|
|
11027
11027
|
const R = _.frag.start;
|
|
11028
|
-
(
|
|
11028
|
+
(A > R || A < this.lastVideoAppendEnd || q.isBuffered(S, R)) && this.unblockAudio();
|
|
11029
11029
|
}
|
|
11030
|
-
this.lastVideoAppendEnd =
|
|
11030
|
+
this.lastVideoAppendEnd = A;
|
|
11031
11031
|
}
|
|
11032
11032
|
}
|
|
11033
|
-
const T = (c || o).start,
|
|
11033
|
+
const T = (c || o).start, v = {
|
|
11034
11034
|
label: `append-${r}`,
|
|
11035
11035
|
execute: () => {
|
|
11036
|
-
if (h.executeStart = self.performance.now(),
|
|
11036
|
+
if (h.executeStart = self.performance.now(), p) {
|
|
11037
11037
|
const x = this.tracks[r];
|
|
11038
11038
|
if (x) {
|
|
11039
11039
|
const _ = x.buffer;
|
|
11040
11040
|
if (_) {
|
|
11041
|
-
const
|
|
11042
|
-
Math.abs(
|
|
11041
|
+
const A = T - _.timestampOffset;
|
|
11042
|
+
Math.abs(A) >= 0.1 && (this.log(`Updating audio SourceBuffer timestampOffset to ${T} (delta: ${A}) sn: ${u})`), _.timestampOffset = T);
|
|
11043
11043
|
}
|
|
11044
11044
|
}
|
|
11045
11045
|
}
|
|
@@ -11051,8 +11051,8 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !Xr(i,
|
|
|
11051
11051
|
const x = self.performance.now();
|
|
11052
11052
|
h.executeEnd = h.end = x, f.first === 0 && (f.first = x), g && g.first === 0 && (g.first = x);
|
|
11053
11053
|
const _ = {};
|
|
11054
|
-
this.sourceBuffers.forEach(([
|
|
11055
|
-
|
|
11054
|
+
this.sourceBuffers.forEach(([A, R]) => {
|
|
11055
|
+
A && (_[A] = q.getBuffered(R));
|
|
11056
11056
|
}), this.appendErrors[r] = 0, r === "audio" || r === "video" ? this.appendErrors.audiovideo = 0 : (this.appendErrors.audio = 0, this.appendErrors.video = 0), this.hls.trigger(m.BUFFER_APPENDED, {
|
|
11057
11057
|
type: r,
|
|
11058
11058
|
frag: o,
|
|
@@ -11064,7 +11064,7 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !Xr(i,
|
|
|
11064
11064
|
},
|
|
11065
11065
|
onError: (x) => {
|
|
11066
11066
|
var _;
|
|
11067
|
-
const
|
|
11067
|
+
const A = {
|
|
11068
11068
|
type: U.MEDIA_ERROR,
|
|
11069
11069
|
parent: o.type,
|
|
11070
11070
|
details: b.BUFFER_APPEND_ERROR,
|
|
@@ -11077,19 +11077,19 @@ transfer tracks: ${ae(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !Xr(i,
|
|
|
11077
11077
|
fatal: !1
|
|
11078
11078
|
}, R = (_ = this.media) == null ? void 0 : _.error;
|
|
11079
11079
|
if (x.code === DOMException.QUOTA_EXCEEDED_ERR)
|
|
11080
|
-
|
|
11080
|
+
A.details = b.BUFFER_FULL_ERROR;
|
|
11081
11081
|
else if (x.code === DOMException.INVALID_STATE_ERR && this.mediaSourceOpenOrEnded && !R)
|
|
11082
|
-
|
|
11082
|
+
A.errorAction = Lt(!0);
|
|
11083
11083
|
else if (x.name === zn && this.sourceBufferCount === 0)
|
|
11084
|
-
|
|
11084
|
+
A.errorAction = Lt(!0);
|
|
11085
11085
|
else {
|
|
11086
11086
|
const D = ++this.appendErrors[r];
|
|
11087
|
-
this.warn(`Failed ${D}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${R || "no media error"})`), (D >= this.hls.config.appendErrorMaxRetry || R) && (
|
|
11087
|
+
this.warn(`Failed ${D}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${R || "no media error"})`), (D >= this.hls.config.appendErrorMaxRetry || R) && (A.fatal = !0);
|
|
11088
11088
|
}
|
|
11089
|
-
this.hls.trigger(m.ERROR,
|
|
11089
|
+
this.hls.trigger(m.ERROR, A);
|
|
11090
11090
|
}
|
|
11091
11091
|
};
|
|
11092
|
-
this.append(
|
|
11092
|
+
this.append(v, r, this.isPending(this.tracks[r]));
|
|
11093
11093
|
}
|
|
11094
11094
|
getFlushOp(e, t, s) {
|
|
11095
11095
|
return this.log(`queuing "${e}" remove ${t}-${s}`), {
|
|
@@ -11742,11 +11742,11 @@ const yc = {
|
|
|
11742
11742
|
* HTTP Live Streaming (HLS)
|
|
11743
11743
|
*/
|
|
11744
11744
|
HLS: "h"
|
|
11745
|
-
},
|
|
11745
|
+
}, Sc = Tc, vc = "CMCD-Object", xc = "CMCD-Request", Ac = "CMCD-Session", Lc = "CMCD-Status", yt = {
|
|
11746
11746
|
/**
|
|
11747
11747
|
* keys whose values vary with the object being requested.
|
|
11748
11748
|
*/
|
|
11749
|
-
OBJECT:
|
|
11749
|
+
OBJECT: vc,
|
|
11750
11750
|
/**
|
|
11751
11751
|
* keys whose values vary with each request.
|
|
11752
11752
|
*/
|
|
@@ -12041,7 +12041,7 @@ class ih {
|
|
|
12041
12041
|
var e;
|
|
12042
12042
|
return {
|
|
12043
12043
|
v: 1,
|
|
12044
|
-
sf:
|
|
12044
|
+
sf: Sc.HLS,
|
|
12045
12045
|
sid: this.sid,
|
|
12046
12046
|
cid: this.cid,
|
|
12047
12047
|
pr: (e = this.media) == null ? void 0 : e.playbackRate,
|
|
@@ -12323,7 +12323,7 @@ class nh extends Ge {
|
|
|
12323
12323
|
u["PATHWAY-ID"] = n;
|
|
12324
12324
|
const d = u.AUDIO && `${u.AUDIO}_clone_${n}`, f = u.SUBTITLES && `${u.SUBTITLES}_clone_${n}`;
|
|
12325
12325
|
d && (s[u.AUDIO] = d, u.AUDIO = d), f && (i[u.SUBTITLES] = f, u.SUBTITLES = f);
|
|
12326
|
-
const g = ta(h.uri, u["STABLE-VARIANT-ID"], "PER-VARIANT-URIS", c),
|
|
12326
|
+
const g = ta(h.uri, u["STABLE-VARIANT-ID"], "PER-VARIANT-URIS", c), E = new At({
|
|
12327
12327
|
attrs: u,
|
|
12328
12328
|
audioCodec: h.audioCodec,
|
|
12329
12329
|
bitrate: h.bitrate,
|
|
@@ -12334,12 +12334,12 @@ class nh extends Ge {
|
|
|
12334
12334
|
width: h.width
|
|
12335
12335
|
});
|
|
12336
12336
|
if (h.audioGroups)
|
|
12337
|
-
for (let
|
|
12338
|
-
|
|
12337
|
+
for (let p = 1; p < h.audioGroups.length; p++)
|
|
12338
|
+
E.addGroupId("audio", `${h.audioGroups[p]}_clone_${n}`);
|
|
12339
12339
|
if (h.subtitleGroups)
|
|
12340
|
-
for (let
|
|
12341
|
-
|
|
12342
|
-
return
|
|
12340
|
+
for (let p = 1; p < h.subtitleGroups.length; p++)
|
|
12341
|
+
E.addGroupId("text", `${h.subtitleGroups[p]}_clone_${n}`);
|
|
12342
|
+
return E;
|
|
12343
12343
|
});
|
|
12344
12344
|
t.push(...l), kr(this.audioTracks, s, c, n), kr(this.subtitleTracks, i, c, n);
|
|
12345
12345
|
});
|
|
@@ -12377,23 +12377,23 @@ class nh extends Ge {
|
|
|
12377
12377
|
}
|
|
12378
12378
|
this.updated = performance.now(), this.timeToLoad = g.TTL;
|
|
12379
12379
|
const {
|
|
12380
|
-
"RELOAD-URI":
|
|
12381
|
-
"PATHWAY-CLONES":
|
|
12380
|
+
"RELOAD-URI": E,
|
|
12381
|
+
"PATHWAY-CLONES": p,
|
|
12382
12382
|
"PATHWAY-PRIORITY": y
|
|
12383
12383
|
} = g;
|
|
12384
|
-
if (
|
|
12384
|
+
if (E)
|
|
12385
12385
|
try {
|
|
12386
|
-
this.uri = new self.URL(
|
|
12386
|
+
this.uri = new self.URL(E, i).href;
|
|
12387
12387
|
} catch {
|
|
12388
|
-
this.enabled = !1, this.log(`Failed to parse Steering Manifest RELOAD-URI: ${
|
|
12388
|
+
this.enabled = !1, this.log(`Failed to parse Steering Manifest RELOAD-URI: ${E}`);
|
|
12389
12389
|
return;
|
|
12390
12390
|
}
|
|
12391
|
-
this.scheduleRefresh(this.uri || d.url),
|
|
12392
|
-
const
|
|
12391
|
+
this.scheduleRefresh(this.uri || d.url), p && this.clonePathways(p);
|
|
12392
|
+
const S = {
|
|
12393
12393
|
steeringManifest: g,
|
|
12394
12394
|
url: i.toString()
|
|
12395
12395
|
};
|
|
12396
|
-
this.hls.trigger(m.STEERING_MANIFEST_LOADED,
|
|
12396
|
+
this.hls.trigger(m.STEERING_MANIFEST_LOADED, S), y && this.updatePathwayPriority(y);
|
|
12397
12397
|
},
|
|
12398
12398
|
onError: (h, u, d, f) => {
|
|
12399
12399
|
if (this.log(`Error loading steering manifest: ${h.code} ${h.text} (${u.url})`), this.stopLoad(), h.code === 410) {
|
|
@@ -12402,10 +12402,10 @@ class nh extends Ge {
|
|
|
12402
12402
|
}
|
|
12403
12403
|
let g = this.timeToLoad * 1e3;
|
|
12404
12404
|
if (h.code === 429) {
|
|
12405
|
-
const
|
|
12406
|
-
if (typeof (
|
|
12407
|
-
const
|
|
12408
|
-
|
|
12405
|
+
const E = this.loader;
|
|
12406
|
+
if (typeof (E == null ? void 0 : E.getResponseHeader) == "function") {
|
|
12407
|
+
const p = E.getResponseHeader("Retry-After");
|
|
12408
|
+
p && (g = parseFloat(p) * 1e3);
|
|
12409
12409
|
}
|
|
12410
12410
|
this.log(`Steering manifest ${u.url} rate limited`);
|
|
12411
12411
|
return;
|
|
@@ -12467,7 +12467,7 @@ class ct extends Ge {
|
|
|
12467
12467
|
this.keyFormatPromise = this.getKeyFormatPromise(o);
|
|
12468
12468
|
}
|
|
12469
12469
|
this.keyFormatPromise.then((n) => {
|
|
12470
|
-
const o =
|
|
12470
|
+
const o = vs(n);
|
|
12471
12471
|
let c, l;
|
|
12472
12472
|
if (s === "sinf") {
|
|
12473
12473
|
if (o !== se.FAIRPLAY) {
|
|
@@ -12476,12 +12476,12 @@ class ct extends Ge {
|
|
|
12476
12476
|
}
|
|
12477
12477
|
const g = le(new Uint8Array(i));
|
|
12478
12478
|
try {
|
|
12479
|
-
const
|
|
12480
|
-
if (!
|
|
12479
|
+
const E = di(JSON.parse(g).sinf), p = sn(E);
|
|
12480
|
+
if (!p)
|
|
12481
12481
|
throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");
|
|
12482
|
-
c = new Uint8Array(
|
|
12483
|
-
} catch (
|
|
12484
|
-
this.warn(`${r} Failed to parse sinf: ${
|
|
12482
|
+
c = new Uint8Array(p.subarray(8, 24)), l = se.FAIRPLAY;
|
|
12483
|
+
} catch (E) {
|
|
12484
|
+
this.warn(`${r} Failed to parse sinf: ${E}`);
|
|
12485
12485
|
return;
|
|
12486
12486
|
}
|
|
12487
12487
|
} else {
|
|
@@ -12489,18 +12489,18 @@ class ct extends Ge {
|
|
|
12489
12489
|
this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${s}" for selected key-system ${o}`);
|
|
12490
12490
|
return;
|
|
12491
12491
|
}
|
|
12492
|
-
const g = ro(i),
|
|
12493
|
-
|
|
12494
|
-
const
|
|
12495
|
-
if (!
|
|
12492
|
+
const g = ro(i), E = g.filter((y) => !!y.systemId && xs(y.systemId) === o);
|
|
12493
|
+
E.length > 1 && this.warn(`${r} Using first of ${E.length} pssh found for selected key-system ${o}`);
|
|
12494
|
+
const p = E[0];
|
|
12495
|
+
if (!p) {
|
|
12496
12496
|
g.length === 0 || g.some((y) => !y.systemId) ? this.warn(`${r} contains incomplete or invalid pssh data`) : this.log(`ignoring ${r} for ${g.map((y) => xs(y.systemId)).join(",")} pssh data in favor of playlist keys`);
|
|
12497
12497
|
return;
|
|
12498
12498
|
}
|
|
12499
|
-
if (l = xs(
|
|
12499
|
+
if (l = xs(p.systemId), p.version === 0 && p.data)
|
|
12500
12500
|
if (l === se.WIDEVINE) {
|
|
12501
|
-
const y =
|
|
12502
|
-
c = new Uint8Array(
|
|
12503
|
-
} else l === se.PLAYREADY && (c = yn(
|
|
12501
|
+
const y = p.data.length - 22;
|
|
12502
|
+
c = new Uint8Array(p.data.subarray(y, y + 16));
|
|
12503
|
+
} else l === se.PLAYREADY && (c = yn(p.data));
|
|
12504
12504
|
}
|
|
12505
12505
|
if (!l || !c)
|
|
12506
12506
|
return;
|
|
@@ -12510,14 +12510,14 @@ class ct extends Ge {
|
|
|
12510
12510
|
} = this;
|
|
12511
12511
|
let f = u[h];
|
|
12512
12512
|
for (let g = 0; g < d.length; g++) {
|
|
12513
|
-
const
|
|
12514
|
-
if (!
|
|
12513
|
+
const E = d[g], p = E.decryptdata;
|
|
12514
|
+
if (!p.keyId)
|
|
12515
12515
|
continue;
|
|
12516
|
-
const y = Ce.hexDump(
|
|
12517
|
-
if (h === y ||
|
|
12518
|
-
if (f = u[y],
|
|
12516
|
+
const y = Ce.hexDump(p.keyId);
|
|
12517
|
+
if (h === y || p.uri.replace(/-/g, "").indexOf(h) !== -1) {
|
|
12518
|
+
if (f = u[y], p.pssh)
|
|
12519
12519
|
break;
|
|
12520
|
-
delete u[y],
|
|
12520
|
+
delete u[y], p.pssh = new Uint8Array(i), p.keyId = c, f = u[h] = f.then(() => this.generateRequestWithPreferredKeySession(E, s, i, "encrypted-event-key-match")), f.catch((S) => this.handleError(S));
|
|
12521
12521
|
break;
|
|
12522
12522
|
}
|
|
12523
12523
|
}
|
|
@@ -12528,19 +12528,19 @@ class ct extends Ge {
|
|
|
12528
12528
|
}
|
|
12529
12529
|
f = u[h] = this.getKeySystemSelectionPromise([l]).then(({
|
|
12530
12530
|
keySystem: g,
|
|
12531
|
-
mediaKeys:
|
|
12531
|
+
mediaKeys: E
|
|
12532
12532
|
}) => {
|
|
12533
|
-
var
|
|
12533
|
+
var p;
|
|
12534
12534
|
this.throwIfDestroyed();
|
|
12535
|
-
const y = new It("ISO-23001-7", h, (
|
|
12536
|
-
return y.pssh = new Uint8Array(i), y.keyId = c, this.attemptSetMediaKeys(g,
|
|
12535
|
+
const y = new It("ISO-23001-7", h, (p = As(g)) != null ? p : "");
|
|
12536
|
+
return y.pssh = new Uint8Array(i), y.keyId = c, this.attemptSetMediaKeys(g, E).then(() => {
|
|
12537
12537
|
this.throwIfDestroyed();
|
|
12538
|
-
const
|
|
12538
|
+
const S = this.createMediaKeySessionContext({
|
|
12539
12539
|
decryptdata: y,
|
|
12540
12540
|
keySystem: g,
|
|
12541
|
-
mediaKeys:
|
|
12541
|
+
mediaKeys: E
|
|
12542
12542
|
});
|
|
12543
|
-
return this.generateRequestWithPreferredKeySession(
|
|
12543
|
+
return this.generateRequestWithPreferredKeySession(S, s, i, "encrypted-event-no-match");
|
|
12544
12544
|
});
|
|
12545
12545
|
}), f.catch((g) => this.handleError(g));
|
|
12546
12546
|
}
|
|
@@ -12679,7 +12679,7 @@ class ct extends Ge {
|
|
|
12679
12679
|
}
|
|
12680
12680
|
getKeyFormatPromise(e) {
|
|
12681
12681
|
return new Promise((t, s) => {
|
|
12682
|
-
const i = Bt(this.config), r = e.map(
|
|
12682
|
+
const i = Bt(this.config), r = e.map(vs).filter((n) => !!n && i.indexOf(n) !== -1);
|
|
12683
12683
|
return this.getKeySystemSelectionPromise(r).then(({
|
|
12684
12684
|
keySystem: n
|
|
12685
12685
|
}) => {
|
|
@@ -12719,7 +12719,7 @@ class ct extends Ge {
|
|
|
12719
12719
|
getKeySystemForKeyPromise(e) {
|
|
12720
12720
|
const t = this.getKeyIdString(e), s = this.keyIdToKeySessionPromise[t];
|
|
12721
12721
|
if (!s) {
|
|
12722
|
-
const i =
|
|
12722
|
+
const i = vs(e.keyFormat), r = i ? [i] : Bt(this.config);
|
|
12723
12723
|
return this.attemptKeySystemAccess(r);
|
|
12724
12724
|
}
|
|
12725
12725
|
return s;
|
|
@@ -12766,39 +12766,39 @@ class ct extends Ge {
|
|
|
12766
12766
|
const l = this.getKeyIdString(e.decryptdata);
|
|
12767
12767
|
this.log(`Generating key-session request for "${i}": ${l} (init data type: ${t} length: ${s ? s.byteLength : null})`);
|
|
12768
12768
|
const h = new gi(), u = e._onmessage = (g) => {
|
|
12769
|
-
const
|
|
12770
|
-
if (!
|
|
12769
|
+
const E = e.mediaKeysSession;
|
|
12770
|
+
if (!E) {
|
|
12771
12771
|
h.emit("error", new Error("invalid state"));
|
|
12772
12772
|
return;
|
|
12773
12773
|
}
|
|
12774
12774
|
const {
|
|
12775
|
-
messageType:
|
|
12775
|
+
messageType: p,
|
|
12776
12776
|
message: y
|
|
12777
12777
|
} = g;
|
|
12778
|
-
this.log(`"${
|
|
12779
|
-
h.eventNames().length ? h.emit("error",
|
|
12780
|
-
}) :
|
|
12778
|
+
this.log(`"${p}" message event for session "${E.sessionId}" message size: ${y.byteLength}`), p === "license-request" || p === "license-renewal" ? this.renewLicense(e, y).catch((S) => {
|
|
12779
|
+
h.eventNames().length ? h.emit("error", S) : this.handleError(S);
|
|
12780
|
+
}) : p === "license-release" ? e.keySystem === se.FAIRPLAY && (this.updateKeySession(e, Ys("acknowledged")), this.removeSession(e)) : this.warn(`unhandled media key message type "${p}"`);
|
|
12781
12781
|
}, d = e._onkeystatuseschange = (g) => {
|
|
12782
12782
|
if (!e.mediaKeysSession) {
|
|
12783
12783
|
h.emit("error", new Error("invalid state"));
|
|
12784
12784
|
return;
|
|
12785
12785
|
}
|
|
12786
12786
|
this.onKeyStatusChange(e);
|
|
12787
|
-
const
|
|
12788
|
-
h.emit("keyStatus",
|
|
12787
|
+
const p = e.keyStatus;
|
|
12788
|
+
h.emit("keyStatus", p), p === "expired" && (this.warn(`${e.keySystem} expired for key ${l}`), this.renewKeySession(e));
|
|
12789
12789
|
};
|
|
12790
12790
|
e.mediaKeysSession.addEventListener("message", u), e.mediaKeysSession.addEventListener("keystatuseschange", d);
|
|
12791
|
-
const f = new Promise((g,
|
|
12792
|
-
h.on("error",
|
|
12793
|
-
|
|
12791
|
+
const f = new Promise((g, E) => {
|
|
12792
|
+
h.on("error", E), h.on("keyStatus", (p) => {
|
|
12793
|
+
p.startsWith("usable") ? g() : p === "output-restricted" ? E(new xe({
|
|
12794
12794
|
type: U.KEY_SYSTEM_ERROR,
|
|
12795
12795
|
details: b.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,
|
|
12796
12796
|
fatal: !1
|
|
12797
|
-
}, "HDCP level output restricted")) :
|
|
12797
|
+
}, "HDCP level output restricted")) : p === "internal-error" ? E(new xe({
|
|
12798
12798
|
type: U.KEY_SYSTEM_ERROR,
|
|
12799
12799
|
details: b.KEY_SYSTEM_STATUS_INTERNAL_ERROR,
|
|
12800
12800
|
fatal: !0
|
|
12801
|
-
}, `key status changed to "${
|
|
12801
|
+
}, `key status changed to "${p}"`)) : p === "expired" ? E(new Error("key expired while generating request")) : this.warn(`unhandled key status change "${p}"`);
|
|
12802
12802
|
});
|
|
12803
12803
|
});
|
|
12804
12804
|
return e.mediaKeysSession.generateRequest(t, s).then(() => {
|
|
@@ -12837,10 +12837,10 @@ class ct extends Ge {
|
|
|
12837
12837
|
retryDelay: 0,
|
|
12838
12838
|
maxRetryDelay: 0
|
|
12839
12839
|
}, u = {
|
|
12840
|
-
onSuccess: (d, f, g,
|
|
12840
|
+
onSuccess: (d, f, g, E) => {
|
|
12841
12841
|
n(d.data);
|
|
12842
12842
|
},
|
|
12843
|
-
onError: (d, f, g,
|
|
12843
|
+
onError: (d, f, g, E) => {
|
|
12844
12844
|
o(new xe({
|
|
12845
12845
|
type: U.KEY_SYSTEM_ERROR,
|
|
12846
12846
|
details: b.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,
|
|
@@ -13202,7 +13202,7 @@ function Zt(a) {
|
|
|
13202
13202
|
}
|
|
13203
13203
|
return e;
|
|
13204
13204
|
}
|
|
13205
|
-
class ch extends
|
|
13205
|
+
class ch extends vi {
|
|
13206
13206
|
constructor(e) {
|
|
13207
13207
|
super(e, "subtitle-track-controller"), this.media = null, this.tracks = [], this.groupIds = null, this.tracksInGroup = [], this.trackId = -1, this.currentTrack = null, this.selectDefaultTrack = !0, this.queuedDefaultTrack = -1, this.useTextTrackPolling = !1, this.subtitlePollingInterval = -1, this._subtitleDisplay = !0, this.asyncPollTrackChange = () => this.pollTrackChange(0), this.onTextTracksChanged = () => {
|
|
13208
13208
|
if (this.useTextTrackPolling || self.clearInterval(this.subtitlePollingInterval), !this.media || !this.hls.config.renderTextTracksNatively)
|
|
@@ -13473,7 +13473,7 @@ class ch extends Si {
|
|
|
13473
13473
|
this.loadPlaylist(u);
|
|
13474
13474
|
}
|
|
13475
13475
|
}
|
|
13476
|
-
function
|
|
13476
|
+
function vt(a) {
|
|
13477
13477
|
let e = 5381, t = a.length;
|
|
13478
13478
|
for (; t; )
|
|
13479
13479
|
e = e * 33 ^ a.charCodeAt(--t);
|
|
@@ -13484,7 +13484,7 @@ let hs = /* @__PURE__ */ function(a) {
|
|
|
13484
13484
|
return a[a.Point = 0] = "Point", a[a.Range = 1] = "Range", a;
|
|
13485
13485
|
}({});
|
|
13486
13486
|
function hh(a, e, t) {
|
|
13487
|
-
return `${a.identifier}-${t + 1}-${
|
|
13487
|
+
return `${a.identifier}-${t + 1}-${vt(e)}`;
|
|
13488
13488
|
}
|
|
13489
13489
|
class uh {
|
|
13490
13490
|
constructor(e, t) {
|
|
@@ -13864,9 +13864,9 @@ class gh extends Ge {
|
|
|
13864
13864
|
if (g && !d)
|
|
13865
13865
|
return -1;
|
|
13866
13866
|
if (!u && !f && !d && !g) {
|
|
13867
|
-
const
|
|
13868
|
-
if (
|
|
13869
|
-
return
|
|
13867
|
+
const E = l.startTime, p = h.startTime;
|
|
13868
|
+
if (E !== p)
|
|
13869
|
+
return E - p;
|
|
13870
13870
|
}
|
|
13871
13871
|
return l.dateRange.tagOrder - h.dateRange.tagOrder;
|
|
13872
13872
|
}), this.events = n, c.forEach((l) => {
|
|
@@ -13898,11 +13898,11 @@ class gh extends Ge {
|
|
|
13898
13898
|
this.resolveOffsets(e, t);
|
|
13899
13899
|
let c = 0, l = 0;
|
|
13900
13900
|
if (e.forEach((h, u) => {
|
|
13901
|
-
const d = h.cue.pre, f = h.cue.post, g = e[u - 1] || null,
|
|
13902
|
-
let _ =
|
|
13903
|
-
if (d || !f &&
|
|
13901
|
+
const d = h.cue.pre, f = h.cue.post, g = e[u - 1] || null, E = h.appendInPlace, p = f ? r : h.startOffset, y = h.duration, S = h.timelineOccupancy === hs.Range ? y : 0, T = h.resumptionOffset, v = (g == null ? void 0 : g.startTime) === p, x = p + h.cumulativeDuration;
|
|
13902
|
+
let _ = E ? x + y : p + T;
|
|
13903
|
+
if (d || !f && p <= 0) {
|
|
13904
13904
|
const R = l;
|
|
13905
|
-
l +=
|
|
13905
|
+
l += S, h.timelineStart = x;
|
|
13906
13906
|
const D = n;
|
|
13907
13907
|
n += y, s.push({
|
|
13908
13908
|
event: h,
|
|
@@ -13917,19 +13917,19 @@ class gh extends Ge {
|
|
|
13917
13917
|
end: l
|
|
13918
13918
|
}
|
|
13919
13919
|
});
|
|
13920
|
-
} else if (
|
|
13921
|
-
if (!
|
|
13922
|
-
const
|
|
13923
|
-
if (
|
|
13920
|
+
} else if (p <= r) {
|
|
13921
|
+
if (!v) {
|
|
13922
|
+
const L = p - c;
|
|
13923
|
+
if (L > wr) {
|
|
13924
13924
|
const P = c, O = l;
|
|
13925
|
-
l +=
|
|
13925
|
+
l += L;
|
|
13926
13926
|
const X = n;
|
|
13927
|
-
n +=
|
|
13927
|
+
n += L;
|
|
13928
13928
|
const V = {
|
|
13929
13929
|
previousEvent: e[u - 1] || null,
|
|
13930
13930
|
nextEvent: h,
|
|
13931
13931
|
start: P,
|
|
13932
|
-
end: P +
|
|
13932
|
+
end: P + L,
|
|
13933
13933
|
playout: {
|
|
13934
13934
|
start: X,
|
|
13935
13935
|
end: n
|
|
@@ -13940,11 +13940,11 @@ class gh extends Ge {
|
|
|
13940
13940
|
}
|
|
13941
13941
|
};
|
|
13942
13942
|
s.push(V);
|
|
13943
|
-
} else
|
|
13943
|
+
} else L > 0 && g && (g.cumulativeDuration += L, s[s.length - 1].end = p);
|
|
13944
13944
|
}
|
|
13945
13945
|
f && (_ = x), h.timelineStart = x;
|
|
13946
13946
|
const R = l;
|
|
13947
|
-
l +=
|
|
13947
|
+
l += S;
|
|
13948
13948
|
const D = n;
|
|
13949
13949
|
n += y, s.push({
|
|
13950
13950
|
event: h,
|
|
@@ -13961,8 +13961,8 @@ class gh extends Ge {
|
|
|
13961
13961
|
});
|
|
13962
13962
|
} else
|
|
13963
13963
|
return;
|
|
13964
|
-
const
|
|
13965
|
-
f ||
|
|
13964
|
+
const A = h.resumeTime;
|
|
13965
|
+
f || A > r ? c = r : c = A;
|
|
13966
13966
|
}), c < r) {
|
|
13967
13967
|
var o;
|
|
13968
13968
|
const h = c, u = l, d = r - c;
|
|
@@ -14078,26 +14078,26 @@ class mh {
|
|
|
14078
14078
|
retryDelay: 0,
|
|
14079
14079
|
maxRetryDelay: 0
|
|
14080
14080
|
}, u = {
|
|
14081
|
-
onSuccess: (d, f, g,
|
|
14082
|
-
const
|
|
14081
|
+
onSuccess: (d, f, g, E) => {
|
|
14082
|
+
const p = d.data, y = p == null ? void 0 : p.ASSETS;
|
|
14083
14083
|
if (!Array.isArray(y)) {
|
|
14084
|
-
const
|
|
14085
|
-
this.hls.trigger(m.ERROR,
|
|
14084
|
+
const S = this.assignAssetListError(e, b.ASSET_LIST_PARSING_ERROR, new Error("Invalid interstitial asset list"), g.url, f, E);
|
|
14085
|
+
this.hls.trigger(m.ERROR, S);
|
|
14086
14086
|
return;
|
|
14087
14087
|
}
|
|
14088
|
-
e.assetListResponse =
|
|
14088
|
+
e.assetListResponse = p, this.hls.trigger(m.ASSET_LIST_LOADED, {
|
|
14089
14089
|
event: e,
|
|
14090
|
-
assetListResponse:
|
|
14091
|
-
networkDetails:
|
|
14090
|
+
assetListResponse: p,
|
|
14091
|
+
networkDetails: E
|
|
14092
14092
|
});
|
|
14093
14093
|
},
|
|
14094
|
-
onError: (d, f, g,
|
|
14095
|
-
const
|
|
14096
|
-
this.hls.trigger(m.ERROR,
|
|
14094
|
+
onError: (d, f, g, E) => {
|
|
14095
|
+
const p = this.assignAssetListError(e, b.ASSET_LIST_LOAD_ERROR, new Error(`Error loading X-ASSET-LIST: HTTP status ${d.code} ${d.text} (${f.url})`), f.url, E, g);
|
|
14096
|
+
this.hls.trigger(m.ERROR, p);
|
|
14097
14097
|
},
|
|
14098
14098
|
onTimeout: (d, f, g) => {
|
|
14099
|
-
const
|
|
14100
|
-
this.hls.trigger(m.ERROR,
|
|
14099
|
+
const E = this.assignAssetListError(e, b.ASSET_LIST_LOAD_TIMEOUT, new Error(`Timeout loading X-ASSET-LIST (${f.url})`), f.url, d, g);
|
|
14100
|
+
this.hls.trigger(m.ERROR, E);
|
|
14101
14101
|
}
|
|
14102
14102
|
};
|
|
14103
14103
|
return o.load(c, h, u), this.hls.trigger(m.ASSET_LIST_LOADING, {
|
|
@@ -14199,12 +14199,12 @@ class ph extends Ge {
|
|
|
14199
14199
|
if (u && this.log(`INTERSTITIALS_UPDATED (${o.length}): ${o}
|
|
14200
14200
|
Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`), this.playerQueue.forEach((f) => {
|
|
14201
14201
|
if (f.interstitial.appendInPlace) {
|
|
14202
|
-
const g = f.assetItem.timelineStart,
|
|
14203
|
-
if (
|
|
14202
|
+
const g = f.assetItem.timelineStart, E = f.timelineOffset - g;
|
|
14203
|
+
if (E)
|
|
14204
14204
|
try {
|
|
14205
14205
|
f.timelineOffset = g;
|
|
14206
|
-
} catch (
|
|
14207
|
-
Math.abs(
|
|
14206
|
+
} catch (p) {
|
|
14207
|
+
Math.abs(E) > ht && this.warn(`${p} ("${f.assetId}" ${f.timelineOffset}->${g})`);
|
|
14208
14208
|
}
|
|
14209
14209
|
}
|
|
14210
14210
|
}), n) {
|
|
@@ -14295,29 +14295,29 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
14295
14295
|
if (!this.manager) {
|
|
14296
14296
|
if (!this.hls)
|
|
14297
14297
|
return null;
|
|
14298
|
-
const e = this, t = () => e.bufferingItem || e.waitingItem, s = (u) => u && e.getAssetPlayer(u.identifier), i = (u, d, f, g,
|
|
14298
|
+
const e = this, t = () => e.bufferingItem || e.waitingItem, s = (u) => u && e.getAssetPlayer(u.identifier), i = (u, d, f, g, E) => {
|
|
14299
14299
|
if (u) {
|
|
14300
|
-
let
|
|
14300
|
+
let p = u[d].start;
|
|
14301
14301
|
const y = u.event;
|
|
14302
14302
|
if (y) {
|
|
14303
14303
|
if (d === "playout" || y.timelineOccupancy !== hs.Point) {
|
|
14304
|
-
const
|
|
14305
|
-
(
|
|
14304
|
+
const S = s(f);
|
|
14305
|
+
(S == null ? void 0 : S.interstitial) === y && (p += S.assetItem.startOffset + S[E]);
|
|
14306
14306
|
}
|
|
14307
14307
|
} else {
|
|
14308
|
-
const
|
|
14309
|
-
|
|
14308
|
+
const S = g === "bufferedPos" ? n() : e[g];
|
|
14309
|
+
p += S - u.start;
|
|
14310
14310
|
}
|
|
14311
|
-
return
|
|
14311
|
+
return p;
|
|
14312
14312
|
}
|
|
14313
14313
|
return 0;
|
|
14314
14314
|
}, r = (u, d) => {
|
|
14315
14315
|
if (u !== 0 && d !== "primary" && e.schedule.length) {
|
|
14316
14316
|
var f;
|
|
14317
|
-
const g = e.schedule.findItemIndexAtTime(u),
|
|
14318
|
-
if (
|
|
14319
|
-
const
|
|
14320
|
-
return u +
|
|
14317
|
+
const g = e.schedule.findItemIndexAtTime(u), E = (f = e.schedule.items) == null ? void 0 : f[g];
|
|
14318
|
+
if (E) {
|
|
14319
|
+
const p = E[d].start - E.start;
|
|
14320
|
+
return u + p;
|
|
14321
14321
|
}
|
|
14322
14322
|
}
|
|
14323
14323
|
return u;
|
|
@@ -14329,36 +14329,36 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
14329
14329
|
return (d = e.primaryDetails) != null && d.live ? e.primaryDetails.edge : e.schedule.durations[u];
|
|
14330
14330
|
}, c = (u, d) => {
|
|
14331
14331
|
var f, g;
|
|
14332
|
-
const
|
|
14333
|
-
if (
|
|
14332
|
+
const E = e.effectivePlayingItem;
|
|
14333
|
+
if (E != null && (f = E.event) != null && f.restrictions.skip)
|
|
14334
14334
|
return;
|
|
14335
14335
|
e.log(`seek to ${u} "${d}"`);
|
|
14336
|
-
const
|
|
14337
|
-
if (
|
|
14336
|
+
const p = e.effectivePlayingItem, y = e.schedule.findItemIndexAtTime(u, d), S = (g = e.schedule.items) == null ? void 0 : g[y], T = e.getBufferingPlayer(), v = T == null ? void 0 : T.interstitial, x = v == null ? void 0 : v.appendInPlace, _ = p && e.itemsMatch(p, S);
|
|
14337
|
+
if (p && (x || _)) {
|
|
14338
14338
|
const R = s(e.playingAsset), D = (R == null ? void 0 : R.media) || e.primaryMedia;
|
|
14339
14339
|
if (D) {
|
|
14340
|
-
const
|
|
14340
|
+
const L = d === "primary" ? D.currentTime : i(p, d, e.playingAsset, "timelinePos", "currentTime"), P = u - L, O = (x ? L : D.currentTime) + P;
|
|
14341
14341
|
if (O >= 0 && (!R || x || O <= R.duration)) {
|
|
14342
14342
|
D.currentTime = O;
|
|
14343
14343
|
return;
|
|
14344
14344
|
}
|
|
14345
14345
|
}
|
|
14346
14346
|
}
|
|
14347
|
-
if (
|
|
14347
|
+
if (S) {
|
|
14348
14348
|
let R = u;
|
|
14349
14349
|
if (d !== "primary") {
|
|
14350
|
-
const
|
|
14351
|
-
R =
|
|
14350
|
+
const L = S[d].start, P = u - L;
|
|
14351
|
+
R = S.start + P;
|
|
14352
14352
|
}
|
|
14353
|
-
const D = !e.isInterstitial(
|
|
14354
|
-
if ((!e.isInterstitial(
|
|
14355
|
-
const
|
|
14356
|
-
|
|
14357
|
-
} else if (
|
|
14358
|
-
const
|
|
14359
|
-
if (y >
|
|
14360
|
-
const O = e.schedule.findJumpRestrictedIndex(
|
|
14361
|
-
if (O >
|
|
14353
|
+
const D = !e.isInterstitial(S);
|
|
14354
|
+
if ((!e.isInterstitial(p) || p.event.appendInPlace) && (D || S.event.appendInPlace)) {
|
|
14355
|
+
const L = e.media || (x ? T == null ? void 0 : T.media : null);
|
|
14356
|
+
L && (L.currentTime = R);
|
|
14357
|
+
} else if (p) {
|
|
14358
|
+
const L = e.findItemIndex(p);
|
|
14359
|
+
if (y > L) {
|
|
14360
|
+
const O = e.schedule.findJumpRestrictedIndex(L + 1, y);
|
|
14361
|
+
if (O > L) {
|
|
14362
14362
|
e.setSchedulePosition(O);
|
|
14363
14363
|
return;
|
|
14364
14364
|
}
|
|
@@ -14367,10 +14367,10 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
14367
14367
|
if (D)
|
|
14368
14368
|
e.timelinePos = R, e.checkBuffer();
|
|
14369
14369
|
else {
|
|
14370
|
-
var
|
|
14371
|
-
const O =
|
|
14370
|
+
var A;
|
|
14371
|
+
const O = S == null || (A = S.event) == null ? void 0 : A.assetList;
|
|
14372
14372
|
if (O) {
|
|
14373
|
-
const X = u - (
|
|
14373
|
+
const X = u - (S[d] || S).start;
|
|
14374
14374
|
for (let V = O.length; V--; ) {
|
|
14375
14375
|
const $ = O[V];
|
|
14376
14376
|
if ($.duration && X >= $.startOffset && X < $.startOffset + $.duration) {
|
|
@@ -14577,8 +14577,8 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
14577
14577
|
const f = this.playerQueue;
|
|
14578
14578
|
f.length > 1 && f.forEach((g) => {
|
|
14579
14579
|
if (o && g.interstitial.appendInPlace !== c) {
|
|
14580
|
-
const
|
|
14581
|
-
this.clearInterstitial(g.interstitial, null),
|
|
14580
|
+
const E = g.interstitial;
|
|
14581
|
+
this.clearInterstitial(g.interstitial, null), E.appendInPlace = !1, E.appendInPlace && this.warn(`Could not change append strategy for queued assets ${E}`);
|
|
14582
14582
|
}
|
|
14583
14583
|
}), this.hls.detachMedia(), this.detachedData = {
|
|
14584
14584
|
media: t
|
|
@@ -15055,8 +15055,8 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
15055
15055
|
if (this.primaryLive || e.appendInPlace) {
|
|
15056
15056
|
const T = this.timelinePos - t.timelineStart;
|
|
15057
15057
|
if (T > 1) {
|
|
15058
|
-
const
|
|
15059
|
-
|
|
15058
|
+
const v = t.duration;
|
|
15059
|
+
v && T < v && (h = T);
|
|
15060
15060
|
}
|
|
15061
15061
|
}
|
|
15062
15062
|
const u = t.identifier, d = te(te({}, r), {}, {
|
|
@@ -15076,81 +15076,81 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
15076
15076
|
e.appendInPlace && (e.appendInPlaceStarted = !0, t.timelineStart && (d.timelineOffset = t.timelineStart));
|
|
15077
15077
|
const f = d.cmcd;
|
|
15078
15078
|
f != null && f.sessionId && f.contentId && (d.cmcd = re({}, f, {
|
|
15079
|
-
contentId:
|
|
15079
|
+
contentId: vt(t.uri)
|
|
15080
15080
|
})), this.getAssetPlayer(u) && this.warn(`Duplicate date range identifier ${e} and asset ${u}`);
|
|
15081
15081
|
const g = new fh(this.HlsPlayerClass, d, e, t);
|
|
15082
15082
|
this.playerQueue.push(g), e.assetList[s] = t;
|
|
15083
|
-
const
|
|
15083
|
+
const E = (T) => {
|
|
15084
15084
|
if (T.live) {
|
|
15085
|
-
const _ = new Error(`Interstitials MUST be VOD assets ${e}`),
|
|
15085
|
+
const _ = new Error(`Interstitials MUST be VOD assets ${e}`), A = {
|
|
15086
15086
|
fatal: !0,
|
|
15087
15087
|
type: U.OTHER_ERROR,
|
|
15088
15088
|
details: b.INTERSTITIAL_ASSET_ITEM_ERROR,
|
|
15089
15089
|
error: _
|
|
15090
15090
|
};
|
|
15091
|
-
this.handleAssetItemError(
|
|
15091
|
+
this.handleAssetItemError(A, e, this.schedule.findEventIndex(e.identifier), s, _.message);
|
|
15092
15092
|
return;
|
|
15093
15093
|
}
|
|
15094
|
-
const
|
|
15095
|
-
(x === null ||
|
|
15094
|
+
const v = T.edge - T.fragmentStart, x = t.duration;
|
|
15095
|
+
(x === null || v > x) && (this.log(`Interstitial asset "${u}" duration change ${x} > ${v}`), t.duration = v, this.updateSchedule());
|
|
15096
15096
|
};
|
|
15097
15097
|
g.on(m.LEVEL_UPDATED, (T, {
|
|
15098
|
-
details:
|
|
15099
|
-
}) =>
|
|
15100
|
-
details:
|
|
15101
|
-
}) =>
|
|
15102
|
-
const
|
|
15098
|
+
details: v
|
|
15099
|
+
}) => E(v)), g.on(m.LEVEL_PTS_UPDATED, (T, {
|
|
15100
|
+
details: v
|
|
15101
|
+
}) => E(v));
|
|
15102
|
+
const p = (T, v) => {
|
|
15103
15103
|
const x = this.getAssetPlayer(u);
|
|
15104
|
-
if (x &&
|
|
15105
|
-
x.off(m.BUFFER_CODECS,
|
|
15104
|
+
if (x && v.tracks) {
|
|
15105
|
+
x.off(m.BUFFER_CODECS, p), x.tracks = v.tracks;
|
|
15106
15106
|
const _ = this.primaryMedia;
|
|
15107
15107
|
this.bufferingAsset === x.assetItem && _ && !x.media && this.bufferAssetPlayer(x, _);
|
|
15108
15108
|
}
|
|
15109
15109
|
};
|
|
15110
|
-
g.on(m.BUFFER_CODECS,
|
|
15110
|
+
g.on(m.BUFFER_CODECS, p);
|
|
15111
15111
|
const y = () => {
|
|
15112
15112
|
var T;
|
|
15113
|
-
const
|
|
15114
|
-
if (this.log(`buffered to end of asset ${
|
|
15113
|
+
const v = this.getAssetPlayer(u);
|
|
15114
|
+
if (this.log(`buffered to end of asset ${v}`), !v)
|
|
15115
15115
|
return;
|
|
15116
|
-
const x = this.schedule.findEventIndex(e.identifier), _ = e.findAssetIndex(t),
|
|
15116
|
+
const x = this.schedule.findEventIndex(e.identifier), _ = e.findAssetIndex(t), A = _ + 1, R = (T = this.schedule.items) == null ? void 0 : T[x];
|
|
15117
15117
|
if (this.isInterstitial(R))
|
|
15118
|
-
if (_ !== -1 && !e.isAssetPastPlayoutLimit(
|
|
15119
|
-
this.bufferedToItem(R,
|
|
15118
|
+
if (_ !== -1 && !e.isAssetPastPlayoutLimit(A) && !e.assetList[A].error)
|
|
15119
|
+
this.bufferedToItem(R, A);
|
|
15120
15120
|
else {
|
|
15121
15121
|
var D;
|
|
15122
|
-
const
|
|
15123
|
-
|
|
15122
|
+
const L = (D = this.schedule.items) == null ? void 0 : D[x + 1];
|
|
15123
|
+
L && this.bufferedToItem(L);
|
|
15124
15124
|
}
|
|
15125
15125
|
};
|
|
15126
15126
|
g.on(m.BUFFERED_TO_END, y);
|
|
15127
|
-
const
|
|
15127
|
+
const S = (T) => () => {
|
|
15128
15128
|
if (!this.getAssetPlayer(u))
|
|
15129
15129
|
return;
|
|
15130
15130
|
this.shouldPlay = !0;
|
|
15131
15131
|
const x = this.schedule.findEventIndex(e.identifier);
|
|
15132
15132
|
this.advanceAfterAssetEnded(e, x, T);
|
|
15133
15133
|
};
|
|
15134
|
-
return g.once(m.MEDIA_ENDED,
|
|
15134
|
+
return g.once(m.MEDIA_ENDED, S(s)), g.once(m.PLAYOUT_LIMIT_REACHED, S(1 / 0)), g.on(m.ERROR, (T, v) => {
|
|
15135
15135
|
const x = this.getAssetPlayer(u);
|
|
15136
|
-
if (
|
|
15136
|
+
if (v.details === b.BUFFER_STALLED_ERROR) {
|
|
15137
15137
|
if (x != null && x.media) {
|
|
15138
|
-
const _ = x.currentTime,
|
|
15139
|
-
_ && e.appendInPlace &&
|
|
15138
|
+
const _ = x.currentTime, A = x.duration - _;
|
|
15139
|
+
_ && e.appendInPlace && A / x.media.playbackRate < 0.5 ? (this.log(`Advancing buffer past end of asset ${u} ${e} at ${x.media.currentTime}`), y()) : (this.warn(`Stalled at ${_} of ${_ + A} in asset ${u} ${e}`), this.onTimeupdate(), this.checkBuffer(!0));
|
|
15140
15140
|
}
|
|
15141
15141
|
return;
|
|
15142
15142
|
}
|
|
15143
|
-
this.handleAssetItemError(
|
|
15143
|
+
this.handleAssetItemError(v, e, this.schedule.findEventIndex(e.identifier), s, `Asset player error ${v.error} ${e}`);
|
|
15144
15144
|
}), g.on(m.DESTROYING, () => {
|
|
15145
15145
|
if (!this.getAssetPlayer(u))
|
|
15146
15146
|
return;
|
|
15147
|
-
const
|
|
15147
|
+
const v = new Error(`Asset player destroyed unexpectedly ${u}`), x = {
|
|
15148
15148
|
fatal: !0,
|
|
15149
15149
|
type: U.OTHER_ERROR,
|
|
15150
15150
|
details: b.INTERSTITIAL_ASSET_ITEM_ERROR,
|
|
15151
|
-
error:
|
|
15151
|
+
error: v
|
|
15152
15152
|
};
|
|
15153
|
-
this.handleAssetItemError(x, e, this.schedule.findEventIndex(e.identifier), s,
|
|
15153
|
+
this.handleAssetItemError(x, e, this.schedule.findEventIndex(e.identifier), s, v.message);
|
|
15154
15154
|
}), this.hls.trigger(m.INTERSTITIAL_ASSET_PLAYER_CREATED, {
|
|
15155
15155
|
asset: t,
|
|
15156
15156
|
assetListIndex: s,
|
|
@@ -15218,8 +15218,8 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
15218
15218
|
type: U.OTHER_ERROR,
|
|
15219
15219
|
details: b.INTERSTITIAL_ASSET_ITEM_ERROR,
|
|
15220
15220
|
error: f
|
|
15221
|
-
},
|
|
15222
|
-
this.handleAssetItemError(g, r, c,
|
|
15221
|
+
}, E = r.findAssetIndex(n);
|
|
15222
|
+
this.handleAssetItemError(g, r, c, E, f.message);
|
|
15223
15223
|
return;
|
|
15224
15224
|
}
|
|
15225
15225
|
}
|
|
@@ -15273,27 +15273,27 @@ Schedule: ${c.map((f) => He(f))}`), h.length && this.log(`Removed events ${h}`),
|
|
|
15273
15273
|
return;
|
|
15274
15274
|
const o = i.timelineStart, c = i.duration;
|
|
15275
15275
|
let l = 0;
|
|
15276
|
-
n.forEach((g,
|
|
15277
|
-
const
|
|
15278
|
-
this.createAsset(i,
|
|
15276
|
+
n.forEach((g, E) => {
|
|
15277
|
+
const p = parseFloat(g.DURATION);
|
|
15278
|
+
this.createAsset(i, E, l, o + l, p, g.URI), l += p;
|
|
15279
15279
|
}), i.duration = l, this.log(`Loaded asset-list with duration: ${l} (was: ${c}) ${i}`);
|
|
15280
15280
|
const h = this.waitingItem, u = (h == null ? void 0 : h.event.identifier) === r;
|
|
15281
15281
|
this.updateSchedule();
|
|
15282
15282
|
const d = (s = this.bufferingItem) == null ? void 0 : s.event;
|
|
15283
15283
|
if (u) {
|
|
15284
15284
|
var f;
|
|
15285
|
-
const g = this.schedule.findEventIndex(r),
|
|
15286
|
-
if (
|
|
15287
|
-
if (!this.playingItem && this.timelinePos >
|
|
15285
|
+
const g = this.schedule.findEventIndex(r), E = (f = this.schedule.items) == null ? void 0 : f[g];
|
|
15286
|
+
if (E) {
|
|
15287
|
+
if (!this.playingItem && this.timelinePos > E.end && this.schedule.findItemIndexAtTime(this.timelinePos) !== g) {
|
|
15288
15288
|
i.error = new Error(`Interstitial no longer within playback range ${this.timelinePos} ${i}`), this.primaryFallback(i);
|
|
15289
15289
|
return;
|
|
15290
15290
|
}
|
|
15291
|
-
this.setBufferingItem(
|
|
15291
|
+
this.setBufferingItem(E);
|
|
15292
15292
|
}
|
|
15293
15293
|
this.setSchedulePosition(g);
|
|
15294
15294
|
} else if ((d == null ? void 0 : d.identifier) === r && d.appendInPlace) {
|
|
15295
|
-
const g = i.assetList[0],
|
|
15296
|
-
g &&
|
|
15295
|
+
const g = i.assetList[0], E = this.getAssetPlayer(g.identifier), p = this.primaryMedia;
|
|
15296
|
+
g && E && p && this.bufferAssetPlayer(E, p);
|
|
15297
15297
|
}
|
|
15298
15298
|
}
|
|
15299
15299
|
onError(e, t) {
|
|
@@ -15509,18 +15509,18 @@ class Eh extends fi {
|
|
|
15509
15509
|
return;
|
|
15510
15510
|
const u = l.fragments, d = u.length, f = l.edge;
|
|
15511
15511
|
let g = null;
|
|
15512
|
-
const
|
|
15512
|
+
const E = this.fragPrevious;
|
|
15513
15513
|
if (o < f) {
|
|
15514
|
-
const
|
|
15515
|
-
g = tt(
|
|
15514
|
+
const S = i.maxFragLookUpTolerance, T = o > f - S ? 0 : S;
|
|
15515
|
+
g = tt(E, u, Math.max(u[0].start, o), T), !g && E && E.start < u[0].start && (g = u[0]);
|
|
15516
15516
|
} else
|
|
15517
15517
|
g = u[d - 1];
|
|
15518
15518
|
if (g = this.filterReplacedPrimary(g, s.details), !g)
|
|
15519
15519
|
return;
|
|
15520
|
-
const
|
|
15520
|
+
const p = g.sn - l.startSN, y = u[p - 1];
|
|
15521
15521
|
if (y && y.cc === g.cc && this.fragmentTracker.getState(y) === ce.NOT_LOADED && (g = y), this.fragmentTracker.getState(g) === ce.NOT_LOADED) {
|
|
15522
|
-
const
|
|
15523
|
-
|
|
15522
|
+
const S = this.mapToInitFragWhenRequired(g);
|
|
15523
|
+
S && this.loadFragment(S, s, o);
|
|
15524
15524
|
}
|
|
15525
15525
|
}
|
|
15526
15526
|
}
|
|
@@ -15740,7 +15740,7 @@ const Th = {
|
|
|
15740
15740
|
// Box drawings heavy up and right
|
|
15741
15741
|
207: 9499
|
|
15742
15742
|
// Box drawings heavy up and left
|
|
15743
|
-
}, na = (a) => String.fromCharCode(Th[a] || a), Re = 15, Ne = 100,
|
|
15743
|
+
}, na = (a) => String.fromCharCode(Th[a] || a), Re = 15, Ne = 100, Sh = {
|
|
15744
15744
|
17: 1,
|
|
15745
15745
|
18: 3,
|
|
15746
15746
|
21: 5,
|
|
@@ -15749,7 +15749,7 @@ const Th = {
|
|
|
15749
15749
|
16: 11,
|
|
15750
15750
|
19: 12,
|
|
15751
15751
|
20: 14
|
|
15752
|
-
},
|
|
15752
|
+
}, vh = {
|
|
15753
15753
|
17: 2,
|
|
15754
15754
|
18: 4,
|
|
15755
15755
|
21: 6,
|
|
@@ -16213,7 +16213,7 @@ class Nr {
|
|
|
16213
16213
|
if (!(i || r))
|
|
16214
16214
|
return !1;
|
|
16215
16215
|
const n = e <= 23 ? 1 : 2;
|
|
16216
|
-
t >= 64 && t <= 95 ? s = n === 1 ?
|
|
16216
|
+
t >= 64 && t <= 95 ? s = n === 1 ? Sh[e] : xh[e] : s = n === 1 ? vh[e] : Ah[e];
|
|
16217
16217
|
const o = this.channels[n];
|
|
16218
16218
|
return o ? (o.setPAC(this.interpretPAC(s, t)), this.currentChannel = n, !0) : !1;
|
|
16219
16219
|
}
|
|
@@ -16320,85 +16320,85 @@ var Li = function() {
|
|
|
16320
16320
|
enumerable: !0
|
|
16321
16321
|
};
|
|
16322
16322
|
h.hasBeenReset = !1;
|
|
16323
|
-
let d = "", f = !1, g = o,
|
|
16323
|
+
let d = "", f = !1, g = o, E = c, p = l, y = null, S = "", T = !0, v = "auto", x = "start", _ = 50, A = "middle", R = 50, D = "middle";
|
|
16324
16324
|
Object.defineProperty(h, "id", r({}, u, {
|
|
16325
16325
|
get: function() {
|
|
16326
16326
|
return d;
|
|
16327
16327
|
},
|
|
16328
|
-
set: function(
|
|
16329
|
-
d = "" +
|
|
16328
|
+
set: function(L) {
|
|
16329
|
+
d = "" + L;
|
|
16330
16330
|
}
|
|
16331
16331
|
})), Object.defineProperty(h, "pauseOnExit", r({}, u, {
|
|
16332
16332
|
get: function() {
|
|
16333
16333
|
return f;
|
|
16334
16334
|
},
|
|
16335
|
-
set: function(
|
|
16336
|
-
f = !!
|
|
16335
|
+
set: function(L) {
|
|
16336
|
+
f = !!L;
|
|
16337
16337
|
}
|
|
16338
16338
|
})), Object.defineProperty(h, "startTime", r({}, u, {
|
|
16339
16339
|
get: function() {
|
|
16340
16340
|
return g;
|
|
16341
16341
|
},
|
|
16342
|
-
set: function(
|
|
16343
|
-
if (typeof
|
|
16342
|
+
set: function(L) {
|
|
16343
|
+
if (typeof L != "number")
|
|
16344
16344
|
throw new TypeError("Start time must be set to a number.");
|
|
16345
|
-
g =
|
|
16345
|
+
g = L, this.hasBeenReset = !0;
|
|
16346
16346
|
}
|
|
16347
16347
|
})), Object.defineProperty(h, "endTime", r({}, u, {
|
|
16348
16348
|
get: function() {
|
|
16349
|
-
return
|
|
16349
|
+
return E;
|
|
16350
16350
|
},
|
|
16351
|
-
set: function(
|
|
16352
|
-
if (typeof
|
|
16351
|
+
set: function(L) {
|
|
16352
|
+
if (typeof L != "number")
|
|
16353
16353
|
throw new TypeError("End time must be set to a number.");
|
|
16354
|
-
|
|
16354
|
+
E = L, this.hasBeenReset = !0;
|
|
16355
16355
|
}
|
|
16356
16356
|
})), Object.defineProperty(h, "text", r({}, u, {
|
|
16357
16357
|
get: function() {
|
|
16358
|
-
return
|
|
16358
|
+
return p;
|
|
16359
16359
|
},
|
|
16360
|
-
set: function(
|
|
16361
|
-
|
|
16360
|
+
set: function(L) {
|
|
16361
|
+
p = "" + L, this.hasBeenReset = !0;
|
|
16362
16362
|
}
|
|
16363
16363
|
})), Object.defineProperty(h, "region", r({}, u, {
|
|
16364
16364
|
get: function() {
|
|
16365
16365
|
return y;
|
|
16366
16366
|
},
|
|
16367
|
-
set: function(
|
|
16368
|
-
y =
|
|
16367
|
+
set: function(L) {
|
|
16368
|
+
y = L, this.hasBeenReset = !0;
|
|
16369
16369
|
}
|
|
16370
16370
|
})), Object.defineProperty(h, "vertical", r({}, u, {
|
|
16371
16371
|
get: function() {
|
|
16372
|
-
return
|
|
16372
|
+
return S;
|
|
16373
16373
|
},
|
|
16374
|
-
set: function(
|
|
16375
|
-
const P = s(
|
|
16374
|
+
set: function(L) {
|
|
16375
|
+
const P = s(L);
|
|
16376
16376
|
if (P === !1)
|
|
16377
16377
|
throw new SyntaxError("An invalid or illegal string was specified.");
|
|
16378
|
-
|
|
16378
|
+
S = P, this.hasBeenReset = !0;
|
|
16379
16379
|
}
|
|
16380
16380
|
})), Object.defineProperty(h, "snapToLines", r({}, u, {
|
|
16381
16381
|
get: function() {
|
|
16382
16382
|
return T;
|
|
16383
16383
|
},
|
|
16384
|
-
set: function(
|
|
16385
|
-
T = !!
|
|
16384
|
+
set: function(L) {
|
|
16385
|
+
T = !!L, this.hasBeenReset = !0;
|
|
16386
16386
|
}
|
|
16387
16387
|
})), Object.defineProperty(h, "line", r({}, u, {
|
|
16388
16388
|
get: function() {
|
|
16389
|
-
return
|
|
16389
|
+
return v;
|
|
16390
16390
|
},
|
|
16391
|
-
set: function(
|
|
16392
|
-
if (typeof
|
|
16391
|
+
set: function(L) {
|
|
16392
|
+
if (typeof L != "number" && L !== "auto")
|
|
16393
16393
|
throw new SyntaxError("An invalid number or illegal string was specified.");
|
|
16394
|
-
|
|
16394
|
+
v = L, this.hasBeenReset = !0;
|
|
16395
16395
|
}
|
|
16396
16396
|
})), Object.defineProperty(h, "lineAlign", r({}, u, {
|
|
16397
16397
|
get: function() {
|
|
16398
16398
|
return x;
|
|
16399
16399
|
},
|
|
16400
|
-
set: function(
|
|
16401
|
-
const P = i(
|
|
16400
|
+
set: function(L) {
|
|
16401
|
+
const P = i(L);
|
|
16402
16402
|
if (!P)
|
|
16403
16403
|
throw new SyntaxError("An invalid or illegal string was specified.");
|
|
16404
16404
|
x = P, this.hasBeenReset = !0;
|
|
@@ -16407,36 +16407,36 @@ var Li = function() {
|
|
|
16407
16407
|
get: function() {
|
|
16408
16408
|
return _;
|
|
16409
16409
|
},
|
|
16410
|
-
set: function(
|
|
16411
|
-
if (
|
|
16410
|
+
set: function(L) {
|
|
16411
|
+
if (L < 0 || L > 100)
|
|
16412
16412
|
throw new Error("Position must be between 0 and 100.");
|
|
16413
|
-
_ =
|
|
16413
|
+
_ = L, this.hasBeenReset = !0;
|
|
16414
16414
|
}
|
|
16415
16415
|
})), Object.defineProperty(h, "positionAlign", r({}, u, {
|
|
16416
16416
|
get: function() {
|
|
16417
|
-
return
|
|
16417
|
+
return A;
|
|
16418
16418
|
},
|
|
16419
|
-
set: function(
|
|
16420
|
-
const P = i(
|
|
16419
|
+
set: function(L) {
|
|
16420
|
+
const P = i(L);
|
|
16421
16421
|
if (!P)
|
|
16422
16422
|
throw new SyntaxError("An invalid or illegal string was specified.");
|
|
16423
|
-
|
|
16423
|
+
A = P, this.hasBeenReset = !0;
|
|
16424
16424
|
}
|
|
16425
16425
|
})), Object.defineProperty(h, "size", r({}, u, {
|
|
16426
16426
|
get: function() {
|
|
16427
16427
|
return R;
|
|
16428
16428
|
},
|
|
16429
|
-
set: function(
|
|
16430
|
-
if (
|
|
16429
|
+
set: function(L) {
|
|
16430
|
+
if (L < 0 || L > 100)
|
|
16431
16431
|
throw new Error("Size must be between 0 and 100.");
|
|
16432
|
-
R =
|
|
16432
|
+
R = L, this.hasBeenReset = !0;
|
|
16433
16433
|
}
|
|
16434
16434
|
})), Object.defineProperty(h, "align", r({}, u, {
|
|
16435
16435
|
get: function() {
|
|
16436
16436
|
return D;
|
|
16437
16437
|
},
|
|
16438
|
-
set: function(
|
|
16439
|
-
const P = i(
|
|
16438
|
+
set: function(L) {
|
|
16439
|
+
const P = i(L);
|
|
16440
16440
|
if (!P)
|
|
16441
16441
|
throw new SyntaxError("An invalid or illegal string was specified.");
|
|
16442
16442
|
D = P, this.hasBeenReset = !0;
|
|
@@ -16532,9 +16532,9 @@ function kh(a, e, t) {
|
|
|
16532
16532
|
let g;
|
|
16533
16533
|
switch (d) {
|
|
16534
16534
|
case "region":
|
|
16535
|
-
for (let
|
|
16536
|
-
if (t[
|
|
16537
|
-
l.set(d, t[
|
|
16535
|
+
for (let E = t.length - 1; E >= 0; E--)
|
|
16536
|
+
if (t[E].id === f) {
|
|
16537
|
+
l.set(d, t[E].region);
|
|
16538
16538
|
break;
|
|
16539
16539
|
}
|
|
16540
16540
|
break;
|
|
@@ -16684,7 +16684,7 @@ const Oh = /\r\n|\n\r|\n|\r/g, Os = function(e, t, s = 0) {
|
|
|
16684
16684
|
return t += 1e3 * s, t += 60 * 1e3 * i, t += 60 * 60 * 1e3 * r, t;
|
|
16685
16685
|
};
|
|
16686
16686
|
function Ii(a, e, t) {
|
|
16687
|
-
return
|
|
16687
|
+
return vt(a.toString()) + vt(e.toString()) + vt(t);
|
|
16688
16688
|
}
|
|
16689
16689
|
const Mh = function(e, t, s) {
|
|
16690
16690
|
let i = e[t], r = e[i.prevCC];
|
|
@@ -16699,37 +16699,37 @@ const Mh = function(e, t, s) {
|
|
|
16699
16699
|
e.presentationOffset = s;
|
|
16700
16700
|
};
|
|
16701
16701
|
function Nh(a, e, t, s, i, r, n) {
|
|
16702
|
-
const o = new wh(), c =
|
|
16702
|
+
const o = new wh(), c = Se(new Uint8Array(a)).trim().replace(Oh, `
|
|
16703
16703
|
`).split(`
|
|
16704
16704
|
`), l = [], h = e ? tc(e.baseTime, e.timescale) : 0;
|
|
16705
|
-
let u = "00:00.000", d = 0, f = 0, g,
|
|
16706
|
-
o.oncue = function(
|
|
16705
|
+
let u = "00:00.000", d = 0, f = 0, g, E = !0;
|
|
16706
|
+
o.oncue = function(p) {
|
|
16707
16707
|
const y = t[s];
|
|
16708
|
-
let
|
|
16708
|
+
let S = t.ccOffset;
|
|
16709
16709
|
const T = (d - h) / 9e4;
|
|
16710
|
-
if (y != null && y.new && (f !== void 0 ?
|
|
16710
|
+
if (y != null && y.new && (f !== void 0 ? S = t.ccOffset = y.start : Mh(t, s, T)), T) {
|
|
16711
16711
|
if (!e) {
|
|
16712
16712
|
g = new Error("Missing initPTS for VTT MPEGTS");
|
|
16713
16713
|
return;
|
|
16714
16714
|
}
|
|
16715
|
-
|
|
16715
|
+
S = T - t.presentationOffset;
|
|
16716
16716
|
}
|
|
16717
|
-
const
|
|
16718
|
-
|
|
16719
|
-
const _ =
|
|
16720
|
-
|
|
16721
|
-
}, o.onparsingerror = function(
|
|
16722
|
-
g =
|
|
16717
|
+
const v = p.endTime - p.startTime, x = Ae((p.startTime + S - f) * 9e4, i * 9e4) / 9e4;
|
|
16718
|
+
p.startTime = Math.max(x, 0), p.endTime = Math.max(x + v, 0);
|
|
16719
|
+
const _ = p.text.trim();
|
|
16720
|
+
p.text = decodeURIComponent(encodeURIComponent(_)), p.id || (p.id = Ii(p.startTime, p.endTime, _)), p.endTime > 0 && l.push(p);
|
|
16721
|
+
}, o.onparsingerror = function(p) {
|
|
16722
|
+
g = p;
|
|
16723
16723
|
}, o.onflush = function() {
|
|
16724
16724
|
if (g) {
|
|
16725
16725
|
n(g);
|
|
16726
16726
|
return;
|
|
16727
16727
|
}
|
|
16728
16728
|
r(l);
|
|
16729
|
-
}, c.forEach((
|
|
16730
|
-
if (
|
|
16731
|
-
if (Os(
|
|
16732
|
-
|
|
16729
|
+
}, c.forEach((p) => {
|
|
16730
|
+
if (E)
|
|
16731
|
+
if (Os(p, "X-TIMESTAMP-MAP=")) {
|
|
16732
|
+
E = !1, p.slice(16).split(",").forEach((y) => {
|
|
16733
16733
|
Os(y, "LOCAL:") ? u = y.slice(6) : Os(y, "MPEGTS:") && (d = parseInt(y.slice(7)));
|
|
16734
16734
|
});
|
|
16735
16735
|
try {
|
|
@@ -16738,8 +16738,8 @@ function Nh(a, e, t, s, i, r, n) {
|
|
|
16738
16738
|
g = y;
|
|
16739
16739
|
}
|
|
16740
16740
|
return;
|
|
16741
|
-
} else
|
|
16742
|
-
o.parse(
|
|
16741
|
+
} else p === "" && (E = !1);
|
|
16742
|
+
o.parse(p + `
|
|
16743
16743
|
`);
|
|
16744
16744
|
}), o.flush();
|
|
16745
16745
|
}
|
|
@@ -16756,7 +16756,7 @@ function Br(a, e, t, s) {
|
|
|
16756
16756
|
s(new Error("Could not parse IMSC1 mdat"));
|
|
16757
16757
|
return;
|
|
16758
16758
|
}
|
|
16759
|
-
const r = i.map((o) =>
|
|
16759
|
+
const r = i.map((o) => Se(o)), n = ec(e.baseTime, 1, e.timescale);
|
|
16760
16760
|
try {
|
|
16761
16761
|
r.forEach((o) => t(Uh(o, n)));
|
|
16762
16762
|
} catch (o) {
|
|
@@ -16778,24 +16778,24 @@ function Uh(a, e) {
|
|
|
16778
16778
|
if (!d || !u.hasAttribute("begin"))
|
|
16779
16779
|
return null;
|
|
16780
16780
|
const f = Bs(u.getAttribute("begin"), n), g = Bs(u.getAttribute("dur"), n);
|
|
16781
|
-
let
|
|
16781
|
+
let E = Bs(u.getAttribute("end"), n);
|
|
16782
16782
|
if (f === null)
|
|
16783
16783
|
throw $r(u);
|
|
16784
|
-
if (
|
|
16784
|
+
if (E === null) {
|
|
16785
16785
|
if (g === null)
|
|
16786
16786
|
throw $r(u);
|
|
16787
|
-
|
|
16787
|
+
E = f + g;
|
|
16788
16788
|
}
|
|
16789
|
-
const
|
|
16790
|
-
|
|
16791
|
-
const y = l[u.getAttribute("region")],
|
|
16792
|
-
textAlign:
|
|
16789
|
+
const p = new Li(f - e, E - e, d);
|
|
16790
|
+
p.id = Ii(p.startTime, p.endTime, p.text);
|
|
16791
|
+
const y = l[u.getAttribute("region")], S = c[u.getAttribute("style")], T = $h(y, S, c), {
|
|
16792
|
+
textAlign: v
|
|
16793
16793
|
} = T;
|
|
16794
|
-
if (
|
|
16795
|
-
const x = Bh[
|
|
16796
|
-
x && (
|
|
16794
|
+
if (v) {
|
|
16795
|
+
const x = Bh[v];
|
|
16796
|
+
x && (p.lineAlign = x), p.align = v;
|
|
16797
16797
|
}
|
|
16798
|
-
return re(
|
|
16798
|
+
return re(p, T), p;
|
|
16799
16799
|
}).filter((u) => u !== null);
|
|
16800
16800
|
}
|
|
16801
16801
|
function Ms(a, e, t) {
|
|
@@ -17294,8 +17294,8 @@ const Yh = /\s/, Wh = {
|
|
|
17294
17294
|
for (let d = 0; d < s.rows.length; d++)
|
|
17295
17295
|
if (r = s.rows[d], o = !0, c = 0, l = "", !r.isEmpty()) {
|
|
17296
17296
|
var u;
|
|
17297
|
-
for (let
|
|
17298
|
-
Yh.test(r.chars[
|
|
17297
|
+
for (let E = 0; E < r.chars.length; E++)
|
|
17298
|
+
Yh.test(r.chars[E].uchar) && o ? c++ : (l += r.chars[E].uchar, o = !1);
|
|
17299
17299
|
r.cueStartTime = e, e === t && (t += 1e-4), c >= 16 ? c-- : c++;
|
|
17300
17300
|
const f = ca(l.trim()), g = Ii(e, t, f);
|
|
17301
17301
|
a != null && (u = a.cues) != null && u.getCueById(g) || (n = new h(e, t, f), n.id = g, n.line = d + 1, n.align = "left", n.position = 10 + Math.min(80, Math.floor(c * 8 / 32) * 10), i.push(n));
|
|
@@ -17348,10 +17348,10 @@ class Vr {
|
|
|
17348
17348
|
this.callbacks && (this.abortInternal(), this.callbacks.onTimeout(i, e, this.response));
|
|
17349
17349
|
}, l - (f - i.loading.start)), !u.ok) {
|
|
17350
17350
|
const {
|
|
17351
|
-
status:
|
|
17352
|
-
statusText:
|
|
17351
|
+
status: E,
|
|
17352
|
+
statusText: p
|
|
17353
17353
|
} = u;
|
|
17354
|
-
throw new Jh(
|
|
17354
|
+
throw new Jh(p || "fetch, bad network response", E, u);
|
|
17355
17355
|
}
|
|
17356
17356
|
i.loading.first = f, i.total = Qh(u.headers) || i.total;
|
|
17357
17357
|
const g = (d = this.callbacks) == null ? void 0 : d.onProgress;
|
|
@@ -17362,14 +17362,14 @@ class Vr {
|
|
|
17362
17362
|
if (!g)
|
|
17363
17363
|
throw new Error("loader destroyed");
|
|
17364
17364
|
self.clearTimeout(this.requestTimeout), i.loading.end = Math.max(self.performance.now(), i.loading.first);
|
|
17365
|
-
const
|
|
17366
|
-
|
|
17367
|
-
const
|
|
17365
|
+
const E = u[o];
|
|
17366
|
+
E && (i.loaded = i.total = E);
|
|
17367
|
+
const p = {
|
|
17368
17368
|
url: g.url,
|
|
17369
17369
|
data: u,
|
|
17370
17370
|
code: g.status
|
|
17371
17371
|
}, y = (d = this.callbacks) == null ? void 0 : d.onProgress;
|
|
17372
|
-
y && !F(t.highWaterMark) && y(i, e, u, g), (f = this.callbacks) == null || f.onSuccess(
|
|
17372
|
+
y && !F(t.highWaterMark) && y(i, e, u, g), (f = this.callbacks) == null || f.onSuccess(p, i, e, g);
|
|
17373
17373
|
}).catch((u) => {
|
|
17374
17374
|
var d;
|
|
17375
17375
|
if (self.clearTimeout(this.requestTimeout), i.aborted)
|
|
@@ -17511,10 +17511,10 @@ class ga {
|
|
|
17511
17511
|
if (g != null) {
|
|
17512
17512
|
var n, o;
|
|
17513
17513
|
s.loading.end = Math.max(self.performance.now(), s.loading.first);
|
|
17514
|
-
const
|
|
17515
|
-
s.loaded = s.total =
|
|
17516
|
-
const
|
|
17517
|
-
|
|
17514
|
+
const E = t.responseType === "arraybuffer" ? g.byteLength : g.length;
|
|
17515
|
+
s.loaded = s.total = E, s.bwEstimate = s.total * 8e3 / (s.loading.end - s.loading.first);
|
|
17516
|
+
const p = (n = this.callbacks) == null ? void 0 : n.onProgress;
|
|
17517
|
+
p && p(s, e, g, t);
|
|
17518
17518
|
const y = {
|
|
17519
17519
|
url: t.responseURL,
|
|
17520
17520
|
data: g,
|
|
@@ -18022,30 +18022,30 @@ class cu extends gn {
|
|
|
18022
18022
|
}
|
|
18023
18023
|
const d = q.bufferInfo(n, e, 0), f = d.nextStart || 0, g = this.fragmentTracker;
|
|
18024
18024
|
if (c && g && this.hls) {
|
|
18025
|
-
const _ = Hr(this.hls.inFlightFragments, e),
|
|
18026
|
-
if (
|
|
18025
|
+
const _ = Hr(this.hls.inFlightFragments, e), A = d.len > Jt, R = !f || _ || f - e > Jt && !g.getPartialFragment(e);
|
|
18026
|
+
if (A || R)
|
|
18027
18027
|
return;
|
|
18028
18028
|
this.moved = !1;
|
|
18029
18029
|
}
|
|
18030
|
-
const
|
|
18030
|
+
const E = (i = this.hls) == null ? void 0 : i.latestLevelDetails;
|
|
18031
18031
|
if (!this.moved && this.stalled !== null && g) {
|
|
18032
18032
|
if (!(d.len > 0) && !f)
|
|
18033
18033
|
return;
|
|
18034
|
-
const
|
|
18035
|
-
if (
|
|
18036
|
-
n.paused || this._trySkipBufferHole(
|
|
18034
|
+
const A = Math.max(f, d.start || 0) - e, D = !!(E != null && E.live) ? E.targetduration * 2 : Jt, L = g.getPartialFragment(e);
|
|
18035
|
+
if (A > 0 && (A <= D || L)) {
|
|
18036
|
+
n.paused || this._trySkipBufferHole(L);
|
|
18037
18037
|
return;
|
|
18038
18038
|
}
|
|
18039
18039
|
}
|
|
18040
|
-
const
|
|
18040
|
+
const p = r.detectStallWithCurrentTimeMs, y = self.performance.now(), S = this.waiting;
|
|
18041
18041
|
if (o === null) {
|
|
18042
|
-
|
|
18042
|
+
S > 0 && y - S < p ? this.stalled = S : this.stalled = y;
|
|
18043
18043
|
return;
|
|
18044
18044
|
}
|
|
18045
18045
|
const T = y - o;
|
|
18046
|
-
if (!c && (T >=
|
|
18047
|
-
var
|
|
18048
|
-
if (((
|
|
18046
|
+
if (!c && (T >= p || S) && this.hls) {
|
|
18047
|
+
var v;
|
|
18048
|
+
if (((v = this.mediaSource) == null ? void 0 : v.readyState) === "ended" && !(E != null && E.live) && Math.abs(e - ((E == null ? void 0 : E.edge) || 0)) < 1) {
|
|
18049
18049
|
if (this.ended)
|
|
18050
18050
|
return;
|
|
18051
18051
|
this.ended = e || 1, this.hls.trigger(m.MEDIA_ENDED, {
|
|
@@ -18163,20 +18163,20 @@ class cu extends gn {
|
|
|
18163
18163
|
if (d > r.maxBufferHole) {
|
|
18164
18164
|
let g = !1;
|
|
18165
18165
|
if (n === 0) {
|
|
18166
|
-
const
|
|
18167
|
-
|
|
18166
|
+
const E = s.getAppendedFrag(0, N.MAIN);
|
|
18167
|
+
E && c < E.end && (g = !0);
|
|
18168
18168
|
}
|
|
18169
18169
|
if (!g) {
|
|
18170
|
-
const
|
|
18171
|
-
if (
|
|
18170
|
+
const E = e || s.getAppendedFrag(n, N.MAIN);
|
|
18171
|
+
if (E) {
|
|
18172
18172
|
var l;
|
|
18173
18173
|
if (!((l = this.hls.loadLevelObj) != null && l.details) || Hr(this.hls.inFlightFragments, c))
|
|
18174
18174
|
return 0;
|
|
18175
|
-
let y = !1,
|
|
18176
|
-
for (;
|
|
18177
|
-
const T = s.getPartialFragment(
|
|
18175
|
+
let y = !1, S = E.end;
|
|
18176
|
+
for (; S < c; ) {
|
|
18177
|
+
const T = s.getPartialFragment(S);
|
|
18178
18178
|
if (T)
|
|
18179
|
-
|
|
18179
|
+
S += T.duration;
|
|
18180
18180
|
else {
|
|
18181
18181
|
y = !0;
|
|
18182
18182
|
break;
|
|
@@ -18371,8 +18371,8 @@ class du {
|
|
|
18371
18371
|
const g = l[f];
|
|
18372
18372
|
if (!Nn(g)) {
|
|
18373
18373
|
this.updateId3CueEnds(h, c);
|
|
18374
|
-
const
|
|
18375
|
-
|
|
18374
|
+
const E = Wr(n, h, u, g, c);
|
|
18375
|
+
E && this.id3Track.addCue(E);
|
|
18376
18376
|
}
|
|
18377
18377
|
}
|
|
18378
18378
|
}
|
|
@@ -18434,8 +18434,8 @@ class du {
|
|
|
18434
18434
|
const d = h[u], f = n[d].cues;
|
|
18435
18435
|
delete n[d], Object.keys(f).forEach((g) => {
|
|
18436
18436
|
try {
|
|
18437
|
-
const
|
|
18438
|
-
|
|
18437
|
+
const E = f[g];
|
|
18438
|
+
E.removeEventListener("enter", this.onEventCueEnter), s.removeCue(E);
|
|
18439
18439
|
} catch {
|
|
18440
18440
|
}
|
|
18441
18441
|
});
|
|
@@ -18449,47 +18449,47 @@ class du {
|
|
|
18449
18449
|
this.id3Track || (this.id3Track = this.createTrack(this.media));
|
|
18450
18450
|
const l = ii();
|
|
18451
18451
|
for (let h = 0; h < r.length; h++) {
|
|
18452
|
-
const u = r[h], d = i[u], f = d.startTime, g = n[u],
|
|
18453
|
-
let
|
|
18452
|
+
const u = r[h], d = i[u], f = d.startTime, g = n[u], E = (g == null ? void 0 : g.cues) || {};
|
|
18453
|
+
let p = (g == null ? void 0 : g.durationKnown) || !1, y = Wt;
|
|
18454
18454
|
const {
|
|
18455
|
-
duration:
|
|
18455
|
+
duration: S,
|
|
18456
18456
|
endDate: T
|
|
18457
18457
|
} = d;
|
|
18458
|
-
if (T &&
|
|
18459
|
-
y = f +
|
|
18460
|
-
else if (d.endOnNext && !
|
|
18461
|
-
const x = r.reduce((_,
|
|
18462
|
-
if (
|
|
18463
|
-
const R = i[
|
|
18458
|
+
if (T && S !== null)
|
|
18459
|
+
y = f + S, p = !0;
|
|
18460
|
+
else if (d.endOnNext && !p) {
|
|
18461
|
+
const x = r.reduce((_, A) => {
|
|
18462
|
+
if (A !== d.id) {
|
|
18463
|
+
const R = i[A];
|
|
18464
18464
|
if (R.class === d.class && R.startDate > d.startDate && (!_ || d.startDate < _.startDate))
|
|
18465
18465
|
return R;
|
|
18466
18466
|
}
|
|
18467
18467
|
return _;
|
|
18468
18468
|
}, null);
|
|
18469
|
-
x && (y = x.startTime,
|
|
18469
|
+
x && (y = x.startTime, p = !0);
|
|
18470
18470
|
}
|
|
18471
|
-
const
|
|
18472
|
-
for (let x = 0; x <
|
|
18473
|
-
const _ =
|
|
18471
|
+
const v = Object.keys(d.attr);
|
|
18472
|
+
for (let x = 0; x < v.length; x++) {
|
|
18473
|
+
const _ = v[x];
|
|
18474
18474
|
if (!Vo(_))
|
|
18475
18475
|
continue;
|
|
18476
|
-
const
|
|
18477
|
-
if (
|
|
18478
|
-
|
|
18476
|
+
const A = E[_];
|
|
18477
|
+
if (A)
|
|
18478
|
+
p && !g.durationKnown ? A.endTime = y : Math.abs(A.startTime - f) > 0.01 && (A.startTime = f, A.endTime = y);
|
|
18479
18479
|
else if (l) {
|
|
18480
18480
|
let R = d.attr[_];
|
|
18481
18481
|
Ho(_) && (R = uu(R));
|
|
18482
|
-
const
|
|
18482
|
+
const L = Wr(l, f, y, {
|
|
18483
18483
|
key: _,
|
|
18484
18484
|
data: R
|
|
18485
18485
|
}, ye.dateRange);
|
|
18486
|
-
|
|
18486
|
+
L && (L.id = u, this.id3Track.addCue(L), E[_] = L, this.hls.config.interstitialsController && (_ === "X-ASSET-LIST" || _ === "X-ASSET-URL") && L.addEventListener("enter", this.onEventCueEnter));
|
|
18487
18487
|
}
|
|
18488
18488
|
}
|
|
18489
18489
|
n[u] = {
|
|
18490
|
-
cues:
|
|
18490
|
+
cues: E,
|
|
18491
18491
|
dateRange: d,
|
|
18492
|
-
durationKnown:
|
|
18492
|
+
durationKnown: p
|
|
18493
18493
|
};
|
|
18494
18494
|
}
|
|
18495
18495
|
}
|
|
@@ -18636,7 +18636,7 @@ class fu {
|
|
|
18636
18636
|
return e === null ? null : e - this.currentTime;
|
|
18637
18637
|
}
|
|
18638
18638
|
}
|
|
18639
|
-
class gu extends
|
|
18639
|
+
class gu extends vi {
|
|
18640
18640
|
constructor(e, t) {
|
|
18641
18641
|
super(e, "level-controller"), this._levels = [], this._firstLevel = -1, this._maxAutoLevel = -1, this._startLevel = void 0, this.currentLevel = null, this.currentLevelIndex = -1, this.manualLevelIndex = -1, this.steering = void 0, this.onParsedComplete = void 0, this.steering = t, this._registerListeners();
|
|
18642
18642
|
}
|
|
@@ -18678,39 +18678,39 @@ class gu extends Si {
|
|
|
18678
18678
|
} = h;
|
|
18679
18679
|
f && (h.audioCodec = f = ss(f, s) || void 0), ((u = g) == null ? void 0 : u.indexOf("avc1")) === 0 && (g = h.videoCodec = co(g));
|
|
18680
18680
|
const {
|
|
18681
|
-
width:
|
|
18682
|
-
height:
|
|
18681
|
+
width: E,
|
|
18682
|
+
height: p,
|
|
18683
18683
|
unknownCodecs: y
|
|
18684
18684
|
} = h;
|
|
18685
|
-
let
|
|
18685
|
+
let S = y ? y.length : 0;
|
|
18686
18686
|
if (y)
|
|
18687
|
-
for (let P =
|
|
18687
|
+
for (let P = S; P--; ) {
|
|
18688
18688
|
const O = y[P];
|
|
18689
|
-
this.isAudioSupported(O) ? (h.audioCodec = f = f ? `${f},${O}` : O,
|
|
18689
|
+
this.isAudioSupported(O) ? (h.audioCodec = f = f ? `${f},${O}` : O, S--, ut.audio[f.substring(0, 4)] = 2) : this.isVideoSupported(O) && (h.videoCodec = g = g ? `${g},${O}` : O, S--, ut.video[g.substring(0, 4)] = 2);
|
|
18690
18690
|
}
|
|
18691
|
-
if (o || (o = !!(
|
|
18691
|
+
if (o || (o = !!(E && p)), c || (c = !!g), l || (l = !!f), S || f && !this.isAudioSupported(f) || g && !this.isVideoSupported(g)) {
|
|
18692
18692
|
this.log(`Some or all CODECS not supported "${d.CODECS}"`);
|
|
18693
18693
|
return;
|
|
18694
18694
|
}
|
|
18695
18695
|
const {
|
|
18696
18696
|
CODECS: T,
|
|
18697
|
-
"FRAME-RATE":
|
|
18697
|
+
"FRAME-RATE": v,
|
|
18698
18698
|
"HDCP-LEVEL": x,
|
|
18699
18699
|
"PATHWAY-ID": _,
|
|
18700
|
-
RESOLUTION:
|
|
18700
|
+
RESOLUTION: A,
|
|
18701
18701
|
"VIDEO-RANGE": R
|
|
18702
|
-
} = d,
|
|
18703
|
-
if (r[
|
|
18704
|
-
if (r[
|
|
18705
|
-
const P = n[
|
|
18702
|
+
} = d, L = `${`${_ || "."}-`}${h.bitrate}-${A}-${v}-${T}-${R}-${x}`;
|
|
18703
|
+
if (r[L])
|
|
18704
|
+
if (r[L].uri !== h.url && !h.attrs["PATHWAY-ID"]) {
|
|
18705
|
+
const P = n[L] += 1;
|
|
18706
18706
|
h.attrs["PATHWAY-ID"] = new Array(P + 1).join(".");
|
|
18707
18707
|
const O = this.createLevel(h);
|
|
18708
|
-
r[
|
|
18708
|
+
r[L] = O, i.push(O);
|
|
18709
18709
|
} else
|
|
18710
|
-
r[
|
|
18710
|
+
r[L].addGroupId("audio", d.AUDIO), r[L].addGroupId("text", d.SUBTITLES);
|
|
18711
18711
|
else {
|
|
18712
18712
|
const P = this.createLevel(h);
|
|
18713
|
-
r[
|
|
18713
|
+
r[L] = P, n[L] = 1, i.push(P);
|
|
18714
18714
|
}
|
|
18715
18715
|
}), this.filterAndSortMediaOptions(i, t, o, c, l);
|
|
18716
18716
|
}
|
|
@@ -18731,72 +18731,72 @@ class gu extends Si {
|
|
|
18731
18731
|
filterAndSortMediaOptions(e, t, s, i, r) {
|
|
18732
18732
|
let n = [], o = [], c = e;
|
|
18733
18733
|
if ((s || i) && r && (c = c.filter(({
|
|
18734
|
-
videoCodec:
|
|
18734
|
+
videoCodec: p,
|
|
18735
18735
|
videoRange: y,
|
|
18736
|
-
width:
|
|
18736
|
+
width: S,
|
|
18737
18737
|
height: T
|
|
18738
|
-
}) => (!!
|
|
18738
|
+
}) => (!!p || !!(S && T)) && mo(y))), c.length === 0) {
|
|
18739
18739
|
Promise.resolve().then(() => {
|
|
18740
18740
|
if (this.hls) {
|
|
18741
|
-
let
|
|
18742
|
-
t.levels.length && (y = `one or more CODECS in variant not supported: ${ae(t.levels.map((T) => T.attrs.CODECS).filter((T,
|
|
18743
|
-
const
|
|
18741
|
+
let p = "no level with compatible codecs found in manifest", y = p;
|
|
18742
|
+
t.levels.length && (y = `one or more CODECS in variant not supported: ${ae(t.levels.map((T) => T.attrs.CODECS).filter((T, v, x) => x.indexOf(T) === v))}`, this.warn(y), p += ` (${y})`);
|
|
18743
|
+
const S = new Error(p);
|
|
18744
18744
|
this.hls.trigger(m.ERROR, {
|
|
18745
18745
|
type: U.MEDIA_ERROR,
|
|
18746
18746
|
details: b.MANIFEST_INCOMPATIBLE_CODECS_ERROR,
|
|
18747
18747
|
fatal: !0,
|
|
18748
18748
|
url: t.url,
|
|
18749
|
-
error:
|
|
18749
|
+
error: S,
|
|
18750
18750
|
reason: y
|
|
18751
18751
|
});
|
|
18752
18752
|
}
|
|
18753
18753
|
});
|
|
18754
18754
|
return;
|
|
18755
18755
|
}
|
|
18756
|
-
t.audioTracks && (n = t.audioTracks.filter((
|
|
18756
|
+
t.audioTracks && (n = t.audioTracks.filter((p) => !p.audioCodec || this.isAudioSupported(p.audioCodec)), qr(n)), t.subtitles && (o = t.subtitles, qr(o));
|
|
18757
18757
|
const l = c.slice(0);
|
|
18758
|
-
c.sort((
|
|
18759
|
-
if (
|
|
18760
|
-
return (
|
|
18761
|
-
if (s &&
|
|
18762
|
-
return
|
|
18763
|
-
if (
|
|
18764
|
-
return
|
|
18765
|
-
if (
|
|
18766
|
-
return is.indexOf(
|
|
18767
|
-
if (
|
|
18768
|
-
const
|
|
18769
|
-
if (
|
|
18770
|
-
return T -
|
|
18771
|
-
}
|
|
18772
|
-
if (
|
|
18773
|
-
const
|
|
18774
|
-
if (
|
|
18775
|
-
return T -
|
|
18776
|
-
}
|
|
18777
|
-
return
|
|
18758
|
+
c.sort((p, y) => {
|
|
18759
|
+
if (p.attrs["HDCP-LEVEL"] !== y.attrs["HDCP-LEVEL"])
|
|
18760
|
+
return (p.attrs["HDCP-LEVEL"] || "") > (y.attrs["HDCP-LEVEL"] || "") ? 1 : -1;
|
|
18761
|
+
if (s && p.height !== y.height)
|
|
18762
|
+
return p.height - y.height;
|
|
18763
|
+
if (p.frameRate !== y.frameRate)
|
|
18764
|
+
return p.frameRate - y.frameRate;
|
|
18765
|
+
if (p.videoRange !== y.videoRange)
|
|
18766
|
+
return is.indexOf(p.videoRange) - is.indexOf(y.videoRange);
|
|
18767
|
+
if (p.videoCodec !== y.videoCodec) {
|
|
18768
|
+
const S = $i(p.videoCodec), T = $i(y.videoCodec);
|
|
18769
|
+
if (S !== T)
|
|
18770
|
+
return T - S;
|
|
18771
|
+
}
|
|
18772
|
+
if (p.uri === y.uri && p.codecSet !== y.codecSet) {
|
|
18773
|
+
const S = ts(p.codecSet), T = ts(y.codecSet);
|
|
18774
|
+
if (S !== T)
|
|
18775
|
+
return T - S;
|
|
18776
|
+
}
|
|
18777
|
+
return p.averageBitrate !== y.averageBitrate ? p.averageBitrate - y.averageBitrate : 0;
|
|
18778
18778
|
});
|
|
18779
18779
|
let h = l[0];
|
|
18780
18780
|
if (this.steering && (c = this.steering.filterParsedLevels(c), c.length !== l.length)) {
|
|
18781
|
-
for (let
|
|
18782
|
-
if (l[
|
|
18783
|
-
h = l[
|
|
18781
|
+
for (let p = 0; p < l.length; p++)
|
|
18782
|
+
if (l[p].pathwayId === c[0].pathwayId) {
|
|
18783
|
+
h = l[p];
|
|
18784
18784
|
break;
|
|
18785
18785
|
}
|
|
18786
18786
|
}
|
|
18787
18787
|
this._levels = c;
|
|
18788
|
-
for (let
|
|
18789
|
-
if (c[
|
|
18788
|
+
for (let p = 0; p < c.length; p++)
|
|
18789
|
+
if (c[p] === h) {
|
|
18790
18790
|
var u;
|
|
18791
|
-
this._firstLevel =
|
|
18792
|
-
const y = h.bitrate,
|
|
18791
|
+
this._firstLevel = p;
|
|
18792
|
+
const y = h.bitrate, S = this.hls.bandwidthEstimate;
|
|
18793
18793
|
if (this.log(`manifest loaded, ${c.length} level(s) found, first bitrate: ${y}`), ((u = this.hls.userConfig) == null ? void 0 : u.abrEwmaDefaultEstimate) === void 0) {
|
|
18794
18794
|
const T = Math.min(y, this.hls.config.abrEwmaDefaultEstimateMax);
|
|
18795
|
-
T >
|
|
18795
|
+
T > S && S === this.hls.abrEwmaDefaultEstimate && (this.hls.bandwidthEstimate = T);
|
|
18796
18796
|
}
|
|
18797
18797
|
break;
|
|
18798
18798
|
}
|
|
18799
|
-
const d = r && !i, f = this.hls.config, g = !!(f.audioStreamController && f.audioTrackController),
|
|
18799
|
+
const d = r && !i, f = this.hls.config, g = !!(f.audioStreamController && f.audioTrackController), E = {
|
|
18800
18800
|
levels: c,
|
|
18801
18801
|
audioTracks: n,
|
|
18802
18802
|
subtitleTracks: o,
|
|
@@ -18806,9 +18806,9 @@ class gu extends Si {
|
|
|
18806
18806
|
stats: t.stats,
|
|
18807
18807
|
audio: r,
|
|
18808
18808
|
video: i,
|
|
18809
|
-
altAudio: g && !d && n.some((
|
|
18809
|
+
altAudio: g && !d && n.some((p) => !!p.url)
|
|
18810
18810
|
};
|
|
18811
|
-
this.hls.trigger(m.MANIFEST_PARSED,
|
|
18811
|
+
this.hls.trigger(m.MANIFEST_PARSED, E);
|
|
18812
18812
|
}
|
|
18813
18813
|
get levels() {
|
|
18814
18814
|
return this._levels.length === 0 ? null : this._levels;
|
|
@@ -19129,8 +19129,8 @@ class yu extends fi {
|
|
|
19129
19129
|
return;
|
|
19130
19130
|
const c = this.getLevelDetails();
|
|
19131
19131
|
if (c && this._streamEnded(o, c)) {
|
|
19132
|
-
const
|
|
19133
|
-
this.altAudio === 2 && (
|
|
19132
|
+
const E = {};
|
|
19133
|
+
this.altAudio === 2 && (E.type = "video"), this.hls.trigger(m.BUFFER_EOS, E), this.state = C.ENDED;
|
|
19134
19134
|
return;
|
|
19135
19135
|
}
|
|
19136
19136
|
if (!this.buffering)
|
|
@@ -19149,13 +19149,13 @@ class yu extends fi {
|
|
|
19149
19149
|
let f = this.getNextFragment(d, l);
|
|
19150
19150
|
if (this.couldBacktrack && !this.fragPrevious && f && ue(f) && this.fragmentTracker.getState(f) !== ce.OK) {
|
|
19151
19151
|
var g;
|
|
19152
|
-
const
|
|
19152
|
+
const p = ((g = this.backtrackFragment) != null ? g : f).sn - l.startSN, y = l.fragments[p - 1];
|
|
19153
19153
|
y && f.cc === y.cc && (f = y, this.fragmentTracker.removeFragment(y));
|
|
19154
19154
|
} else this.backtrackFragment && o.len && (this.backtrackFragment = null);
|
|
19155
19155
|
if (f && this.isLoopLoading(f, d)) {
|
|
19156
19156
|
if (!f.gap) {
|
|
19157
|
-
const
|
|
19158
|
-
y && this.afterBufferFlushed(y,
|
|
19157
|
+
const p = this.audioOnly && !this.altAudio ? ie.AUDIO : ie.VIDEO, y = (p === ie.VIDEO ? this.videoBuffer : this.mediaBuffer) || this.media;
|
|
19158
|
+
y && this.afterBufferFlushed(y, p, N.MAIN);
|
|
19159
19159
|
}
|
|
19160
19160
|
f = this.getNextFragmentLoopLoading(f, l, o, N.MAIN, u);
|
|
19161
19161
|
}
|
|
@@ -19328,8 +19328,8 @@ class yu extends fi {
|
|
|
19328
19328
|
this.warn(`Dropping fragment ${s.sn} of level ${s.level} after level details were reset`), this.fragmentTracker.removeFragment(s);
|
|
19329
19329
|
return;
|
|
19330
19330
|
}
|
|
19331
|
-
const l = o.videoCodec, h = c.PTSKnown || !c.live, u = (t = s.initSegment) == null ? void 0 : t.data, d = this._getAudioCodec(o), f = this.transmuxer = this.transmuxer || new jn(this.hls, N.MAIN, this._handleTransmuxComplete.bind(this), this._handleTransmuxerFlush.bind(this)), g = i ? i.index : -1,
|
|
19332
|
-
f.push(r, u, d, l, s, i, c.totalduration, h,
|
|
19331
|
+
const l = o.videoCodec, h = c.PTSKnown || !c.live, u = (t = s.initSegment) == null ? void 0 : t.data, d = this._getAudioCodec(o), f = this.transmuxer = this.transmuxer || new jn(this.hls, N.MAIN, this._handleTransmuxComplete.bind(this), this._handleTransmuxerFlush.bind(this)), g = i ? i.index : -1, E = g !== -1, p = new hi(s.level, s.sn, s.stats.chunkCount, r.byteLength, g, E), y = this.initPTS[s.cc];
|
|
19332
|
+
f.push(r, u, d, l, s, i, c.totalduration, h, p, y);
|
|
19333
19333
|
}
|
|
19334
19334
|
onAudioTrackSwitching(e, t) {
|
|
19335
19335
|
const s = this.hls, i = this.altAudio === 2;
|
|
@@ -19511,8 +19511,8 @@ class yu extends fi {
|
|
|
19511
19511
|
id3: f,
|
|
19512
19512
|
initSegment: g
|
|
19513
19513
|
} = r, {
|
|
19514
|
-
details:
|
|
19515
|
-
} = h,
|
|
19514
|
+
details: E
|
|
19515
|
+
} = h, p = this.altAudio ? void 0 : r.audio;
|
|
19516
19516
|
if (this.fragContextChanged(c)) {
|
|
19517
19517
|
this.fragmentTracker.removeFragment(c);
|
|
19518
19518
|
return;
|
|
@@ -19526,78 +19526,78 @@ class yu extends fi {
|
|
|
19526
19526
|
tracks: g.tracks
|
|
19527
19527
|
});
|
|
19528
19528
|
}
|
|
19529
|
-
const y = g.initPTS,
|
|
19529
|
+
const y = g.initPTS, S = g.timescale;
|
|
19530
19530
|
F(y) && (this.initPTS[c.cc] = {
|
|
19531
19531
|
baseTime: y,
|
|
19532
|
-
timescale:
|
|
19532
|
+
timescale: S
|
|
19533
19533
|
}, i.trigger(m.INIT_PTS_FOUND, {
|
|
19534
19534
|
frag: c,
|
|
19535
19535
|
id: s,
|
|
19536
19536
|
initPTS: y,
|
|
19537
|
-
timescale:
|
|
19537
|
+
timescale: S
|
|
19538
19538
|
}));
|
|
19539
19539
|
}
|
|
19540
|
-
if (u &&
|
|
19541
|
-
|
|
19542
|
-
const y =
|
|
19540
|
+
if (u && E) {
|
|
19541
|
+
p && u.type === "audiovideo" && this.logMuxedErr(c);
|
|
19542
|
+
const y = E.fragments[c.sn - 1 - E.startSN], S = c.sn === E.startSN, T = !y || c.cc > y.cc;
|
|
19543
19543
|
if (r.independent !== !1) {
|
|
19544
19544
|
const {
|
|
19545
|
-
startPTS:
|
|
19545
|
+
startPTS: v,
|
|
19546
19546
|
endPTS: x,
|
|
19547
19547
|
startDTS: _,
|
|
19548
|
-
endDTS:
|
|
19548
|
+
endDTS: A
|
|
19549
19549
|
} = u;
|
|
19550
19550
|
if (l)
|
|
19551
19551
|
l.elementaryStreams[u.type] = {
|
|
19552
|
-
startPTS:
|
|
19552
|
+
startPTS: v,
|
|
19553
19553
|
endPTS: x,
|
|
19554
19554
|
startDTS: _,
|
|
19555
|
-
endDTS:
|
|
19555
|
+
endDTS: A
|
|
19556
19556
|
};
|
|
19557
19557
|
else if (u.firstKeyFrame && u.independent && n.id === 1 && !T && (this.couldBacktrack = !0), u.dropped && u.independent) {
|
|
19558
|
-
const R = this.getMainFwdBufferInfo(), D = (R ? R.end : this.getLoadPosition()) + this.config.maxBufferHole,
|
|
19559
|
-
if (!
|
|
19558
|
+
const R = this.getMainFwdBufferInfo(), D = (R ? R.end : this.getLoadPosition()) + this.config.maxBufferHole, L = u.firstKeyFramePTS ? u.firstKeyFramePTS : v;
|
|
19559
|
+
if (!S && D < L - this.config.maxBufferHole && !T) {
|
|
19560
19560
|
this.backtrack(c);
|
|
19561
19561
|
return;
|
|
19562
19562
|
} else T && (c.gap = !0);
|
|
19563
|
-
c.setElementaryStreamInfo(u.type, c.start, x, c.start,
|
|
19564
|
-
} else
|
|
19565
|
-
c.setElementaryStreamInfo(u.type,
|
|
19566
|
-
} else if (
|
|
19563
|
+
c.setElementaryStreamInfo(u.type, c.start, x, c.start, A, !0);
|
|
19564
|
+
} else S && v - (E.appliedTimelineOffset || 0) > Jt && (c.gap = !0);
|
|
19565
|
+
c.setElementaryStreamInfo(u.type, v, x, _, A), this.backtrackFragment && (this.backtrackFragment = c), this.bufferFragmentData(u, c, l, n, S || T);
|
|
19566
|
+
} else if (S || T)
|
|
19567
19567
|
c.gap = !0;
|
|
19568
19568
|
else {
|
|
19569
19569
|
this.backtrack(c);
|
|
19570
19570
|
return;
|
|
19571
19571
|
}
|
|
19572
19572
|
}
|
|
19573
|
-
if (
|
|
19573
|
+
if (p) {
|
|
19574
19574
|
const {
|
|
19575
19575
|
startPTS: y,
|
|
19576
|
-
endPTS:
|
|
19576
|
+
endPTS: S,
|
|
19577
19577
|
startDTS: T,
|
|
19578
|
-
endDTS:
|
|
19579
|
-
} =
|
|
19578
|
+
endDTS: v
|
|
19579
|
+
} = p;
|
|
19580
19580
|
l && (l.elementaryStreams[ie.AUDIO] = {
|
|
19581
19581
|
startPTS: y,
|
|
19582
|
-
endPTS:
|
|
19582
|
+
endPTS: S,
|
|
19583
19583
|
startDTS: T,
|
|
19584
|
-
endDTS:
|
|
19585
|
-
}), c.setElementaryStreamInfo(ie.AUDIO, y,
|
|
19584
|
+
endDTS: v
|
|
19585
|
+
}), c.setElementaryStreamInfo(ie.AUDIO, y, S, T, v), this.bufferFragmentData(p, c, l, n);
|
|
19586
19586
|
}
|
|
19587
|
-
if (
|
|
19587
|
+
if (E && f != null && (t = f.samples) != null && t.length) {
|
|
19588
19588
|
const y = {
|
|
19589
19589
|
id: s,
|
|
19590
19590
|
frag: c,
|
|
19591
|
-
details:
|
|
19591
|
+
details: E,
|
|
19592
19592
|
samples: f.samples
|
|
19593
19593
|
};
|
|
19594
19594
|
i.trigger(m.FRAG_PARSING_METADATA, y);
|
|
19595
19595
|
}
|
|
19596
|
-
if (
|
|
19596
|
+
if (E && d) {
|
|
19597
19597
|
const y = {
|
|
19598
19598
|
id: s,
|
|
19599
19599
|
frag: c,
|
|
19600
|
-
details:
|
|
19600
|
+
details: E,
|
|
19601
19601
|
samples: d.samples
|
|
19602
19602
|
};
|
|
19603
19603
|
i.trigger(m.FRAG_PARSING_USERDATA, y);
|
|
@@ -19869,20 +19869,20 @@ class Tu {
|
|
|
19869
19869
|
retryDelay: 0,
|
|
19870
19870
|
maxRetryDelay: 0
|
|
19871
19871
|
}, u = {
|
|
19872
|
-
onSuccess: (d, f, g,
|
|
19872
|
+
onSuccess: (d, f, g, E) => {
|
|
19873
19873
|
const {
|
|
19874
|
-
frag:
|
|
19874
|
+
frag: p,
|
|
19875
19875
|
keyInfo: y,
|
|
19876
|
-
url:
|
|
19876
|
+
url: S
|
|
19877
19877
|
} = g;
|
|
19878
|
-
if (!
|
|
19879
|
-
return o(this.createKeyLoadError(
|
|
19880
|
-
y.decryptdata.key =
|
|
19881
|
-
frag:
|
|
19878
|
+
if (!p.decryptdata || y !== this.keyUriToKeyInfo[S])
|
|
19879
|
+
return o(this.createKeyLoadError(p, b.KEY_LOAD_ERROR, new Error("after key load, decryptdata unset or changed"), E));
|
|
19880
|
+
y.decryptdata.key = p.decryptdata.key = new Uint8Array(d.data), p.keyLoader = null, y.loader = null, n({
|
|
19881
|
+
frag: p,
|
|
19882
19882
|
keyInfo: y
|
|
19883
19883
|
});
|
|
19884
19884
|
},
|
|
19885
|
-
onError: (d, f, g,
|
|
19885
|
+
onError: (d, f, g, E) => {
|
|
19886
19886
|
this.resetLoader(f), o(this.createKeyLoadError(t, b.KEY_LOAD_ERROR, new Error(`HTTP Error ${d.code} loading key ${d.text}`), g, te({
|
|
19887
19887
|
url: c.url,
|
|
19888
19888
|
data: void 0
|
|
@@ -19924,7 +19924,7 @@ function Us(a, e) {
|
|
|
19924
19924
|
let t = a.url;
|
|
19925
19925
|
return (t === void 0 || t.indexOf("data:") === 0) && (t = e.url), t;
|
|
19926
19926
|
}
|
|
19927
|
-
class
|
|
19927
|
+
class Su {
|
|
19928
19928
|
constructor(e) {
|
|
19929
19929
|
this.hls = void 0, this.loaders = /* @__PURE__ */ Object.create(null), this.variableList = null, this.onManifestLoaded = this.checkAutostartLoad, this.hls = e, this.registerListeners();
|
|
19930
19930
|
}
|
|
@@ -20132,11 +20132,11 @@ class vu {
|
|
|
20132
20132
|
} = c;
|
|
20133
20133
|
this.variableList = g;
|
|
20134
20134
|
const {
|
|
20135
|
-
AUDIO:
|
|
20136
|
-
SUBTITLES:
|
|
20135
|
+
AUDIO: E = [],
|
|
20136
|
+
SUBTITLES: p,
|
|
20137
20137
|
"CLOSED-CAPTIONS": y
|
|
20138
20138
|
} = we.parseMasterPlaylistMedia(n, o, c);
|
|
20139
|
-
|
|
20139
|
+
E.length && !E.some((T) => !T.url) && h[0].audioCodec && !h[0].attrs.AUDIO && (this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"), E.unshift({
|
|
20140
20140
|
type: "main",
|
|
20141
20141
|
name: "main",
|
|
20142
20142
|
groupId: "main",
|
|
@@ -20149,8 +20149,8 @@ class vu {
|
|
|
20149
20149
|
url: ""
|
|
20150
20150
|
})), r.trigger(m.MANIFEST_LOADED, {
|
|
20151
20151
|
levels: h,
|
|
20152
|
-
audioTracks:
|
|
20153
|
-
subtitles:
|
|
20152
|
+
audioTracks: E,
|
|
20153
|
+
subtitles: p,
|
|
20154
20154
|
captions: y,
|
|
20155
20155
|
contentSteering: l,
|
|
20156
20156
|
url: o,
|
|
@@ -20255,7 +20255,7 @@ class vu {
|
|
|
20255
20255
|
id: h,
|
|
20256
20256
|
groupId: u,
|
|
20257
20257
|
deliveryDirectives: d
|
|
20258
|
-
} = i, f = Us(t, i), g = jr(i),
|
|
20258
|
+
} = i, f = Us(t, i), g = jr(i), E = typeof i.level == "number" && g === N.MAIN ? l : void 0;
|
|
20259
20259
|
if (!e.fragments.length) {
|
|
20260
20260
|
const y = e.playlistParsingError = new Error("No Segments found in Playlist");
|
|
20261
20261
|
o.trigger(m.ERROR, {
|
|
@@ -20267,7 +20267,7 @@ class vu {
|
|
|
20267
20267
|
reason: y.message,
|
|
20268
20268
|
response: t,
|
|
20269
20269
|
context: i,
|
|
20270
|
-
level:
|
|
20270
|
+
level: E,
|
|
20271
20271
|
parent: g,
|
|
20272
20272
|
networkDetails: r,
|
|
20273
20273
|
stats: s
|
|
@@ -20275,19 +20275,19 @@ class vu {
|
|
|
20275
20275
|
return;
|
|
20276
20276
|
}
|
|
20277
20277
|
e.targetduration || (e.playlistParsingError = new Error("Missing Target Duration"));
|
|
20278
|
-
const
|
|
20279
|
-
if (
|
|
20280
|
-
if (this.hls.logger.warn(
|
|
20278
|
+
const p = e.playlistParsingError;
|
|
20279
|
+
if (p) {
|
|
20280
|
+
if (this.hls.logger.warn(p), !o.config.ignorePlaylistParsingErrors) {
|
|
20281
20281
|
o.trigger(m.ERROR, {
|
|
20282
20282
|
type: U.NETWORK_ERROR,
|
|
20283
20283
|
details: b.LEVEL_PARSING_ERROR,
|
|
20284
20284
|
fatal: !1,
|
|
20285
20285
|
url: f,
|
|
20286
|
-
error:
|
|
20287
|
-
reason:
|
|
20286
|
+
error: p,
|
|
20287
|
+
reason: p.message,
|
|
20288
20288
|
response: t,
|
|
20289
20289
|
context: i,
|
|
20290
|
-
level:
|
|
20290
|
+
level: E,
|
|
20291
20291
|
parent: g,
|
|
20292
20292
|
networkDetails: r,
|
|
20293
20293
|
stats: s
|
|
@@ -20302,7 +20302,7 @@ class vu {
|
|
|
20302
20302
|
o.trigger(m.LEVEL_LOADED, {
|
|
20303
20303
|
details: e,
|
|
20304
20304
|
levelInfo: i.levelOrTrack || o.levels[0],
|
|
20305
|
-
level:
|
|
20305
|
+
level: E || 0,
|
|
20306
20306
|
id: h || 0,
|
|
20307
20307
|
stats: s,
|
|
20308
20308
|
networkDetails: r,
|
|
@@ -20398,16 +20398,16 @@ class Te {
|
|
|
20398
20398
|
capLevelController: n,
|
|
20399
20399
|
errorController: o,
|
|
20400
20400
|
fpsController: c
|
|
20401
|
-
} = s, l = new o(this), h = this.abrController = new i(this), u = new Po(this), d = s.interstitialsController, f = d ? this.interstitialsController = new d(this, Te) : null, g = this.bufferController = new r(this, u),
|
|
20402
|
-
|
|
20403
|
-
const D = [y,
|
|
20401
|
+
} = s, l = new o(this), h = this.abrController = new i(this), u = new Po(this), d = s.interstitialsController, f = d ? this.interstitialsController = new d(this, Te) : null, g = this.bufferController = new r(this, u), E = this.capLevelController = new n(this), p = new c(this), y = new Su(this), S = s.contentSteeringController, T = S ? new S(this) : null, v = this.levelController = new gu(this, T), x = new du(this), _ = new Tu(this.config), A = this.streamController = new yu(this, u, _), R = this.gapController = new cu(this, u);
|
|
20402
|
+
E.setStreamController(A), p.setStreamController(A);
|
|
20403
|
+
const D = [y, v, A];
|
|
20404
20404
|
f && D.splice(1, 0, f), T && D.splice(1, 0, T), this.networkControllers = D;
|
|
20405
|
-
const
|
|
20405
|
+
const L = [h, g, R, E, p, x, u];
|
|
20406
20406
|
this.audioTrackController = this.createController(s.audioTrackController, D);
|
|
20407
20407
|
const P = s.audioStreamController;
|
|
20408
20408
|
P && D.push(this.audioStreamController = new P(this, u, _)), this.subtitleTrackController = this.createController(s.subtitleTrackController, D);
|
|
20409
20409
|
const O = s.subtitleStreamController;
|
|
20410
|
-
O && D.push(this.subtititleStreamController = new O(this, u, _)), this.createController(s.timelineController,
|
|
20410
|
+
O && D.push(this.subtititleStreamController = new O(this, u, _)), this.createController(s.timelineController, L), _.emeController = this.emeController = this.createController(s.emeController, L), this.cmcdController = this.createController(s.cmcdController, L), this.latencyController = this.createController(fu, L), this.coreComponents = L, D.push(l);
|
|
20411
20411
|
const X = l.onErrorOut;
|
|
20412
20412
|
typeof X == "function" && this.on(m.ERROR, X, l), this.on(m.MANIFEST_LOADED, y.onManifestLoaded, y);
|
|
20413
20413
|
}
|
|
@@ -21042,7 +21042,7 @@ class Te {
|
|
|
21042
21042
|
}
|
|
21043
21043
|
}
|
|
21044
21044
|
Te.defaultConfig = void 0;
|
|
21045
|
-
const
|
|
21045
|
+
const vu = { class: "test-video-dialog" }, xu = ["das-loading-text"], Au = ["src", "objectFit"], Lu = /* @__PURE__ */ Sa({
|
|
21046
21046
|
__name: "das-hls-player",
|
|
21047
21047
|
props: {
|
|
21048
21048
|
src: {},
|
|
@@ -21056,8 +21056,8 @@ const Su = { class: "test-video-dialog" }, xu = ["das-loading-text"], Au = ["src
|
|
|
21056
21056
|
},
|
|
21057
21057
|
emits: ["loaded", "errorClick"],
|
|
21058
21058
|
setup(a, { expose: e, emit: t }) {
|
|
21059
|
-
|
|
21060
|
-
|
|
21059
|
+
va((R) => ({
|
|
21060
|
+
60797672: _.value
|
|
21061
21061
|
}));
|
|
21062
21062
|
const s = a, i = t, {
|
|
21063
21063
|
fit: r,
|
|
@@ -21065,16 +21065,18 @@ const Su = { class: "test-video-dialog" }, xu = ["das-loading-text"], Au = ["src
|
|
|
21065
21065
|
loading: o = !1,
|
|
21066
21066
|
error: c = !1,
|
|
21067
21067
|
errorText: l = ms("das-ui-hls-player-videoLoadFailedRetry")
|
|
21068
|
-
} = xa(s)
|
|
21068
|
+
} = xa(s);
|
|
21069
|
+
Ze(s.retryTime || 0);
|
|
21070
|
+
const h = Ze(!0);
|
|
21069
21071
|
ki(() => s.config || {});
|
|
21070
|
-
const
|
|
21071
|
-
|
|
21072
|
-
},
|
|
21072
|
+
const u = ki(() => s.src || ""), d = _a(s, "videoError"), f = Ze(null), g = Ze(null), E = () => {
|
|
21073
|
+
f.value && (f.value.destroy(), f.value = null);
|
|
21074
|
+
}, p = Ze(""), y = async (R) => {
|
|
21073
21075
|
if (!R) {
|
|
21074
|
-
|
|
21076
|
+
p.value = "视频URL为空";
|
|
21075
21077
|
return;
|
|
21076
21078
|
}
|
|
21077
|
-
await
|
|
21079
|
+
await T(), E();
|
|
21078
21080
|
const D = {
|
|
21079
21081
|
debug: !1,
|
|
21080
21082
|
// 是否开启调试模式,生产环境建议关闭
|
|
@@ -21082,132 +21084,76 @@ const Su = { class: "test-video-dialog" }, xu = ["das-loading-text"], Au = ["src
|
|
|
21082
21084
|
// 启用 Web Worker 进行解码,提高性能
|
|
21083
21085
|
lowLatencyMode: !0,
|
|
21084
21086
|
// 启用低延迟模式,减少播放延迟
|
|
21085
|
-
backBufferLength:
|
|
21087
|
+
backBufferLength: 60 * 1.5
|
|
21086
21088
|
// 回放缓冲区长度(秒),控制内存使用
|
|
21087
|
-
maxBufferLength: 30,
|
|
21088
|
-
// 最大缓冲区长度(秒),防止过度缓冲
|
|
21089
|
-
maxMaxBufferLength: 60,
|
|
21090
|
-
// 绝对最大缓冲区长度(秒)
|
|
21091
|
-
maxBufferSize: 60 * 1e3 * 1e3,
|
|
21092
|
-
// 最大缓冲区大小(字节),60MB
|
|
21093
|
-
maxBufferHole: 0.5,
|
|
21094
|
-
// 允许的最大缓冲区空洞(秒)
|
|
21095
|
-
startLevel: -1,
|
|
21096
|
-
// 初始质量级别,-1 表示自动选择
|
|
21097
|
-
abrEwmaDefaultEstimate: 5e5,
|
|
21098
|
-
// 带宽估计的默认值(bps)
|
|
21099
|
-
manifestLoadingTimeOut: 1e4,
|
|
21100
|
-
// 清单文件加载超时时间(毫秒)
|
|
21101
|
-
manifestLoadingMaxRetry: 3,
|
|
21102
|
-
// 清单文件加载最大重试次数
|
|
21103
|
-
manifestLoadingRetryDelay: 1e3,
|
|
21104
|
-
// 清单文件加载重试延迟(毫秒)
|
|
21105
|
-
levelLoadingTimeOut: 1e4,
|
|
21106
|
-
// 质量级别加载超时时间(毫秒)
|
|
21107
|
-
levelLoadingMaxRetry: 3,
|
|
21108
|
-
// 质量级别加载最大重试次数
|
|
21109
|
-
levelLoadingRetryDelay: 1e3,
|
|
21110
|
-
// 质量级别加载重试延迟(毫秒)
|
|
21111
|
-
fragLoadingTimeOut: 2e4,
|
|
21112
|
-
// 片段加载超时时间(毫秒)
|
|
21113
|
-
fragLoadingMaxRetry: 3,
|
|
21114
|
-
// 片段加载最大重试次数
|
|
21115
|
-
fragLoadingRetryDelay: 1e3,
|
|
21116
|
-
// 片段加载重试延迟(毫秒)
|
|
21117
|
-
startFragPrefetch: !0,
|
|
21118
|
-
// 是否预加载下一个片段
|
|
21119
|
-
testBandwidth: !0,
|
|
21120
|
-
// 是否测试带宽
|
|
21121
|
-
progressive: !0
|
|
21122
|
-
// 是否使用渐进式加载
|
|
21123
21089
|
};
|
|
21124
21090
|
try {
|
|
21125
|
-
|
|
21126
|
-
|
|
21127
|
-
|
|
21128
|
-
}), i("loaded", p.value);
|
|
21129
|
-
}), g.value.on(Te.Events.ERROR, (A, P) => {
|
|
21091
|
+
f.value = new Te(D), f.value.loadSource(R), f.value.autoLevelCapping = -1, f.value.attachMedia(g.value), f.value.on(Te.Events.MANIFEST_PARSED, () => {
|
|
21092
|
+
p.value = "", g.value.play(), i("loaded", g.value);
|
|
21093
|
+
}), f.value.on(Te.Events.ERROR, (L, P) => {
|
|
21130
21094
|
if (P.fatal)
|
|
21131
21095
|
switch (P.type) {
|
|
21132
21096
|
case Te.ErrorTypes.NETWORK_ERROR:
|
|
21133
|
-
|
|
21097
|
+
p.value = "网络错误,正在尝试恢复...", f.value.startLoad(), S();
|
|
21134
21098
|
break;
|
|
21135
21099
|
case Te.ErrorTypes.MEDIA_ERROR:
|
|
21136
|
-
|
|
21100
|
+
p.value = "媒体错误,正在尝试恢复...", f.value.recoverMediaError(), S();
|
|
21137
21101
|
break;
|
|
21138
21102
|
default:
|
|
21139
|
-
|
|
21103
|
+
p.value = "播放错误,正在尝试重新初始化...", S();
|
|
21140
21104
|
break;
|
|
21141
21105
|
}
|
|
21142
21106
|
else
|
|
21143
|
-
|
|
21144
|
-
}),
|
|
21145
|
-
|
|
21146
|
-
}),
|
|
21147
|
-
|
|
21148
|
-
}),
|
|
21149
|
-
|
|
21150
|
-
}), p.value.addEventListener("ended", () => {
|
|
21151
|
-
u.value = !1;
|
|
21152
|
-
}), p.value.addEventListener("error", (A) => {
|
|
21153
|
-
y.value = "视频播放错误", f.value = !0;
|
|
21107
|
+
p.value = "播放出现异常,正在尝试恢复...", S();
|
|
21108
|
+
}), f.value.on(Te.Events.FRAG_LOADED, () => {
|
|
21109
|
+
h.value = !1, p.value = "";
|
|
21110
|
+
}), g.value.addEventListener("playing", () => {
|
|
21111
|
+
h.value = !1, p.value = "";
|
|
21112
|
+
}), g.value.addEventListener("waiting", () => {
|
|
21113
|
+
p.value = "视频缓冲中...";
|
|
21154
21114
|
});
|
|
21155
|
-
} catch (
|
|
21156
|
-
|
|
21157
|
-
}
|
|
21158
|
-
},
|
|
21159
|
-
|
|
21160
|
-
|
|
21161
|
-
|
|
21162
|
-
|
|
21163
|
-
|
|
21164
|
-
E(), x();
|
|
21165
|
-
}, 1e3);
|
|
21166
|
-
}, S = () => new Promise((R, D) => {
|
|
21167
|
-
let A = 0;
|
|
21168
|
-
const P = 20, O = () => {
|
|
21169
|
-
if (p != null && p.value)
|
|
21170
|
-
return R();
|
|
21171
|
-
if (A++, A >= P)
|
|
21172
|
-
return D(new Error("Video element not found after timeout"));
|
|
21173
|
-
setTimeout(() => O(), 50);
|
|
21115
|
+
} catch (L) {
|
|
21116
|
+
p.value = "播放器初始化失败: " + L.message, S();
|
|
21117
|
+
}
|
|
21118
|
+
}, S = () => {
|
|
21119
|
+
p.value = "正在重试...", E(), x();
|
|
21120
|
+
}, T = () => new Promise((R) => {
|
|
21121
|
+
const D = () => {
|
|
21122
|
+
if (g != null && g.value) return R();
|
|
21123
|
+
setTimeout(() => D(), 50);
|
|
21174
21124
|
};
|
|
21175
|
-
|
|
21176
|
-
}),
|
|
21125
|
+
D();
|
|
21126
|
+
}), v = () => {
|
|
21127
|
+
var R, D;
|
|
21128
|
+
(R = g.value) == null || R.removeEventListener("playing", () => {
|
|
21129
|
+
}), (D = g.value) == null || D.removeEventListener("waiting", () => {
|
|
21130
|
+
});
|
|
21131
|
+
}, x = async () => {
|
|
21177
21132
|
try {
|
|
21178
|
-
if (!
|
|
21179
|
-
|
|
21133
|
+
if (!u.value) {
|
|
21134
|
+
p.value = "视频URL为空";
|
|
21180
21135
|
return;
|
|
21181
21136
|
}
|
|
21182
|
-
if (await
|
|
21183
|
-
|
|
21137
|
+
if (await T(), !g.value) {
|
|
21138
|
+
p.value = "视频元素未找到";
|
|
21184
21139
|
return;
|
|
21185
21140
|
}
|
|
21186
|
-
|
|
21187
|
-
}), p.value.removeEventListener("waiting", () => {
|
|
21188
|
-
}), p.value.removeEventListener("ended", () => {
|
|
21189
|
-
}), p.value.removeEventListener("error", () => {
|
|
21190
|
-
}), await v(d.value), u.value = !0;
|
|
21141
|
+
v(), await y(u.value), h.value = !0;
|
|
21191
21142
|
} catch (R) {
|
|
21192
|
-
|
|
21143
|
+
p.value = "初始化失败: " + R.message, h.value = !1, S();
|
|
21193
21144
|
}
|
|
21194
21145
|
};
|
|
21195
21146
|
Aa(() => {
|
|
21196
21147
|
x();
|
|
21197
21148
|
}), La(() => {
|
|
21198
|
-
|
|
21199
|
-
(R = p.value) == null || R.removeEventListener("playing", () => {
|
|
21200
|
-
}), (D = p.value) == null || D.removeEventListener("waiting", () => {
|
|
21201
|
-
}), (A = p.value) == null || A.removeEventListener("ended", () => {
|
|
21202
|
-
}), (P = p.value) == null || P.removeEventListener("error", () => {
|
|
21203
|
-
}), E();
|
|
21149
|
+
v(), E();
|
|
21204
21150
|
}), e({
|
|
21205
|
-
video:
|
|
21151
|
+
video: g
|
|
21206
21152
|
});
|
|
21207
|
-
const _ = Ze("rgba(255,255,255)"),
|
|
21153
|
+
const _ = Ze("rgba(255,255,255)"), A = () => {
|
|
21208
21154
|
x(), i("errorClick");
|
|
21209
21155
|
};
|
|
21210
|
-
return (R, D) => (kt(), Pt("div",
|
|
21156
|
+
return (R, D) => (kt(), Pt("div", vu, [
|
|
21211
21157
|
wi("button", {
|
|
21212
21158
|
onClick: x,
|
|
21213
21159
|
style: { "margin-top": "50px" }
|
|
@@ -21215,7 +21161,7 @@ const Su = { class: "test-video-dialog" }, xu = ["das-loading-text"], Au = ["src
|
|
|
21215
21161
|
wi(
|
|
21216
21162
|
"div",
|
|
21217
21163
|
null,
|
|
21218
|
-
Oi(
|
|
21164
|
+
Oi(p.value),
|
|
21219
21165
|
1
|
|
21220
21166
|
/* TEXT */
|
|
21221
21167
|
),
|
|
@@ -21224,12 +21170,12 @@ const Su = { class: "test-video-dialog" }, xu = ["das-loading-text"], Au = ["src
|
|
|
21224
21170
|
"das-loading-text": pt(n),
|
|
21225
21171
|
"das-loading-type": "component"
|
|
21226
21172
|
}, [
|
|
21227
|
-
pt(
|
|
21173
|
+
pt(d) ? (kt(), Pt(
|
|
21228
21174
|
"div",
|
|
21229
21175
|
{
|
|
21230
21176
|
key: 1,
|
|
21231
21177
|
class: "error",
|
|
21232
|
-
onClick:
|
|
21178
|
+
onClick: A
|
|
21233
21179
|
},
|
|
21234
21180
|
Oi(pt(ms)("das-ui-hls-player-videoLoadFailedRetry")),
|
|
21235
21181
|
1
|
|
@@ -21237,7 +21183,7 @@ const Su = { class: "test-video-dialog" }, xu = ["das-loading-text"], Au = ["src
|
|
|
21237
21183
|
)) : (kt(), Pt("video", {
|
|
21238
21184
|
key: 0,
|
|
21239
21185
|
ref_key: "video",
|
|
21240
|
-
ref:
|
|
21186
|
+
ref: g,
|
|
21241
21187
|
"x-webkit-airplay": "true",
|
|
21242
21188
|
preload: "auto",
|
|
21243
21189
|
autoplay: "",
|
|
@@ -21246,13 +21192,13 @@ const Su = { class: "test-video-dialog" }, xu = ["das-loading-text"], Au = ["src
|
|
|
21246
21192
|
"x5-video-player-typ": "h5",
|
|
21247
21193
|
muted: "",
|
|
21248
21194
|
crossorigin: "anonymous",
|
|
21249
|
-
src:
|
|
21195
|
+
src: u.value,
|
|
21250
21196
|
objectFit: pt(r),
|
|
21251
21197
|
class: "player",
|
|
21252
21198
|
controlsList: "nodownload nofullscreen noplaybackrate"
|
|
21253
21199
|
}, null, 8, Au))
|
|
21254
21200
|
], 8, xu)), [
|
|
21255
|
-
[pt(Da),
|
|
21201
|
+
[pt(Da), h.value]
|
|
21256
21202
|
])
|
|
21257
21203
|
]));
|
|
21258
21204
|
}
|
|
@@ -21261,7 +21207,7 @@ const Su = { class: "test-video-dialog" }, xu = ["das-loading-text"], Au = ["src
|
|
|
21261
21207
|
for (const [s, i] of e)
|
|
21262
21208
|
t[s] = i;
|
|
21263
21209
|
return t;
|
|
21264
|
-
}, Ru = /* @__PURE__ */ Iu(Lu, [["__scopeId", "data-v-
|
|
21210
|
+
}, Ru = /* @__PURE__ */ Iu(Lu, [["__scopeId", "data-v-2a88bbfd"]]), bu = {
|
|
21265
21211
|
加载中: { "zh-CN": "加载中", en: "Loading", _appCode: "framework" },
|
|
21266
21212
|
"das-ui-hls-player-videoLoadFailedRetry": {
|
|
21267
21213
|
"zh-CN": "视频加载失败,请点击重试",
|