@connectedxm/stream-player 0.0.6 → 0.0.7

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.
Files changed (2) hide show
  1. package/dist/index.es.js +325 -323
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -38,7 +38,7 @@ function so() {
38
38
  return "Profiler";
39
39
  case E:
40
40
  return "StrictMode";
41
- case P:
41
+ case C:
42
42
  return "Suspense";
43
43
  case x:
44
44
  return "SuspenseList";
@@ -101,7 +101,7 @@ function so() {
101
101
  }
102
102
  }
103
103
  function i() {
104
- var R = C.A;
104
+ var R = P.A;
105
105
  return R === null ? null : R.getOwner();
106
106
  }
107
107
  function r() {
@@ -219,7 +219,7 @@ React keys must be passed directly to JSX without using spread:
219
219
  function d(R) {
220
220
  return typeof R == "object" && R !== null && R.$$typeof === g;
221
221
  }
222
- var f = Ae, g = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), S = Symbol.for("react.context"), A = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), I = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), L = Symbol.for("react.activity"), k = Symbol.for("react.client.reference"), C = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, $ = Array.isArray, N = console.createTask ? console.createTask : function() {
222
+ var f = Ae, g = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), S = Symbol.for("react.context"), A = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), I = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), L = Symbol.for("react.activity"), k = Symbol.for("react.client.reference"), P = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, $ = Array.isArray, B = console.createTask ? console.createTask : function() {
223
223
  return null;
224
224
  };
225
225
  f = {
@@ -227,29 +227,29 @@ React keys must be passed directly to JSX without using spread:
227
227
  return R();
228
228
  }
229
229
  };
230
- var F, U = {}, B = f.react_stack_bottom_frame.bind(
230
+ var F, U = {}, N = f.react_stack_bottom_frame.bind(
231
231
  f,
232
232
  r
233
- )(), V = N(s(r)), W = {};
233
+ )(), V = B(s(r)), W = {};
234
234
  wt.Fragment = y, wt.jsx = function(R, O, H) {
235
- var j = 1e4 > C.recentlyCreatedOwnerStacks++;
235
+ var j = 1e4 > P.recentlyCreatedOwnerStacks++;
236
236
  return u(
237
237
  R,
238
238
  O,
239
239
  H,
240
240
  !1,
241
- j ? Error("react-stack-top-frame") : B,
242
- j ? N(s(R)) : V
241
+ j ? Error("react-stack-top-frame") : N,
242
+ j ? B(s(R)) : V
243
243
  );
244
244
  }, wt.jsxs = function(R, O, H) {
245
- var j = 1e4 > C.recentlyCreatedOwnerStacks++;
245
+ var j = 1e4 > P.recentlyCreatedOwnerStacks++;
246
246
  return u(
247
247
  R,
248
248
  O,
249
249
  H,
250
250
  !0,
251
- j ? Error("react-stack-top-frame") : B,
252
- j ? N(s(R)) : V
251
+ j ? Error("react-stack-top-frame") : N,
252
+ j ? B(s(R)) : V
253
253
  );
254
254
  };
255
255
  })()), wt;
@@ -415,12 +415,12 @@ const ne = {
415
415
  onStreamInputChange: E,
416
416
  roundedCorners: T
417
417
  }) => {
418
- const [v, S] = Ae.useState(!1), [A, P] = Ae.useState(!1), [x, I] = Ae.useState(null), b = (C) => C.displayName ? C.displayName : C.locale ? `${C.name} (${C.locale})` : C.name, L = (C, M) => ({
418
+ const [v, S] = Ae.useState(!1), [A, C] = Ae.useState(!1), [x, I] = Ae.useState(null), b = (P) => P.displayName ? P.displayName : P.locale ? `${P.name} (${P.locale})` : P.name, L = (P, M) => ({
419
419
  ...M,
420
- ...x === C ? ne.iconButtonHover : {}
421
- }), k = (C, M) => ({
420
+ ...x === P ? ne.iconButtonHover : {}
421
+ }), k = (P, M) => ({
422
422
  ...ne.dropdownItem,
423
- ...C ? ne.dropdownItemActive : {},
423
+ ...P ? ne.dropdownItemActive : {},
424
424
  ...M ? ne.dropdownItemHover : {}
425
425
  });
426
426
  return a ? /* @__PURE__ */ q.jsx("div", { style: ne.controlsWrapper(e || !t), children: /* @__PURE__ */ q.jsx(
@@ -515,7 +515,7 @@ const ne = {
515
515
  onMouseEnter: () => I("quality"),
516
516
  onMouseLeave: () => I(null),
517
517
  "aria-label": "Quality settings",
518
- children: n === -1 ? "Auto" : r.find((C) => C.level === n)?.label || "Auto"
518
+ children: n === -1 ? "Auto" : r.find((P) => P.level === n)?.label || "Auto"
519
519
  }
520
520
  ),
521
521
  v && /* @__PURE__ */ q.jsxs("div", { style: ne.dropdown, children: [
@@ -534,21 +534,21 @@ const ne = {
534
534
  children: "Auto"
535
535
  }
536
536
  ),
537
- r.map((C) => /* @__PURE__ */ q.jsx(
537
+ r.map((P) => /* @__PURE__ */ q.jsx(
538
538
  "button",
539
539
  {
540
540
  onClick: () => {
541
- g(C.level), S(!1);
541
+ g(P.level), S(!1);
542
542
  },
543
543
  style: k(
544
- n === C.level,
545
- x === `quality-${C.level}`
544
+ n === P.level,
545
+ x === `quality-${P.level}`
546
546
  ),
547
- onMouseEnter: () => I(`quality-${C.level}`),
547
+ onMouseEnter: () => I(`quality-${P.level}`),
548
548
  onMouseLeave: () => I(null),
549
- children: C.label
549
+ children: P.label
550
550
  },
551
- C.level
551
+ P.level
552
552
  ))
553
553
  ] })
554
554
  ] }),
@@ -556,7 +556,7 @@ const ne = {
556
556
  /* @__PURE__ */ q.jsx(
557
557
  "button",
558
558
  {
559
- onClick: () => P(!A),
559
+ onClick: () => C(!A),
560
560
  style: L("language", ne.textButton),
561
561
  onMouseEnter: () => I("language"),
562
562
  onMouseLeave: () => I(null),
@@ -564,21 +564,21 @@ const ne = {
564
564
  children: b(d)
565
565
  }
566
566
  ),
567
- A && /* @__PURE__ */ q.jsx("div", { style: { ...ne.dropdown, ...ne.dropdownWide }, children: h.map((C) => /* @__PURE__ */ q.jsx(
567
+ A && /* @__PURE__ */ q.jsx("div", { style: { ...ne.dropdown, ...ne.dropdownWide }, children: h.map((P) => /* @__PURE__ */ q.jsx(
568
568
  "button",
569
569
  {
570
570
  onClick: () => {
571
- E(C), P(!1);
571
+ E(P), C(!1);
572
572
  },
573
573
  style: k(
574
- d.id === C.id,
575
- x === `lang-${C.id}`
574
+ d.id === P.id,
575
+ x === `lang-${P.id}`
576
576
  ),
577
- onMouseEnter: () => I(`lang-${C.id}`),
577
+ onMouseEnter: () => I(`lang-${P.id}`),
578
578
  onMouseLeave: () => I(null),
579
- children: b(C)
579
+ children: b(P)
580
580
  },
581
- C.id
581
+ P.id
582
582
  )) })
583
583
  ] }),
584
584
  u && /* @__PURE__ */ q.jsx(
@@ -1510,12 +1510,12 @@ function bo(a, e, t) {
1510
1510
  const p = J(n, ["trun"]);
1511
1511
  let y = u.start || 0, E = 0, T = g;
1512
1512
  for (let v = 0; v < p.length; v++) {
1513
- const S = p[v], A = z(S, 4), P = u.sampleCount;
1513
+ const S = p[v], A = z(S, 4), C = u.sampleCount;
1514
1514
  u.sampleCount += A;
1515
- const x = S[3] & 1, I = S[3] & 4, b = S[2] & 1, L = S[2] & 2, k = S[2] & 4, C = S[2] & 8;
1515
+ const x = S[3] & 1, I = S[3] & 4, b = S[2] & 1, L = S[2] & 2, k = S[2] & 4, P = S[2] & 8;
1516
1516
  let M = 8, $ = A;
1517
- for (x && (M += 4), I && A && (!(S[M + 1] & 1) && u.keyFrameIndex === void 0 && (u.keyFrameIndex = P), M += 4, b ? (T = z(S, M), M += 4) : T = g, L && (M += 4), C && (M += 4), y += T, E += T, $--); $--; )
1518
- b ? (T = z(S, M), M += 4) : T = g, L && (M += 4), k && (S[M + 1] & 1 || u.keyFrameIndex === void 0 && (u.keyFrameIndex = u.sampleCount - ($ + 1), u.keyFrameStart = y), M += 4), C && (M += 4), y += T, E += T;
1517
+ for (x && (M += 4), I && A && (!(S[M + 1] & 1) && u.keyFrameIndex === void 0 && (u.keyFrameIndex = C), M += 4, b ? (T = z(S, M), M += 4) : T = g, L && (M += 4), P && (M += 4), y += T, E += T, $--); $--; )
1518
+ b ? (T = z(S, M), M += 4) : T = g, L && (M += 4), k && (S[M + 1] & 1 || u.keyFrameIndex === void 0 && (u.keyFrameIndex = u.sampleCount - ($ + 1), u.keyFrameStart = y), M += 4), P && (M += 4), y += T, E += T;
1519
1519
  !E && g && (E += g * A);
1520
1520
  }
1521
1521
  u.duration += E;
@@ -1567,23 +1567,23 @@ function or(a, e) {
1567
1567
  let v = 0;
1568
1568
  const S = (p & 16) !== 0;
1569
1569
  let A = 0;
1570
- const P = (p & 32) !== 0;
1570
+ const C = (p & 32) !== 0;
1571
1571
  let x = 8;
1572
- g === r && (y && (x += 8), E && (x += 4), T && (v = z(f, x), x += 4), S && (A = z(f, x), x += 4), P && (x += 4), e.type === "video" && (n = _s(e.codec)), J(h, ["trun"]).map((I) => {
1572
+ g === r && (y && (x += 8), E && (x += 4), T && (v = z(f, x), x += 4), S && (A = z(f, x), x += 4), C && (x += 4), e.type === "video" && (n = _s(e.codec)), J(h, ["trun"]).map((I) => {
1573
1573
  const b = I[0], L = z(I, 0) & 16777215, k = (L & 1) !== 0;
1574
- let C = 0;
1574
+ let P = 0;
1575
1575
  const M = (L & 4) !== 0, $ = (L & 256) !== 0;
1576
- let N = 0;
1576
+ let B = 0;
1577
1577
  const F = (L & 512) !== 0;
1578
1578
  let U = 0;
1579
- const B = (L & 1024) !== 0, V = (L & 2048) !== 0;
1579
+ const N = (L & 1024) !== 0, V = (L & 2048) !== 0;
1580
1580
  let W = 0;
1581
1581
  const R = z(I, 4);
1582
1582
  let O = 8;
1583
- k && (C = z(I, O), O += 4), M && (O += 4);
1584
- let H = C + l;
1583
+ k && (P = z(I, O), O += 4), M && (O += 4);
1584
+ let H = P + l;
1585
1585
  for (let j = 0; j < R; j++) {
1586
- if ($ ? (N = z(I, O), O += 4) : N = v, F ? (U = z(I, O), O += 4) : U = A, B && (O += 4), V && (b === 0 ? W = z(I, O) : W = bn(I, O), O += 4), e.type === oe.VIDEO) {
1586
+ if ($ ? (B = z(I, O), O += 4) : B = v, F ? (U = z(I, O), O += 4) : U = A, N && (O += 4), V && (b === 0 ? W = z(I, O) : W = bn(I, O), O += 4), e.type === oe.VIDEO) {
1587
1587
  let Q = 0;
1588
1588
  for (; Q < U; ) {
1589
1589
  const Z = z(s, H);
@@ -1594,7 +1594,7 @@ function or(a, e) {
1594
1594
  H += Z, Q += Z + 4;
1595
1595
  }
1596
1596
  }
1597
- a += N / i;
1597
+ a += B / i;
1598
1598
  }
1599
1599
  }));
1600
1600
  });
@@ -2321,13 +2321,13 @@ function Zo(a, e, t, s, i) {
2321
2321
  d = G(d) ? d : 0, f = G(f) ? f : 0;
2322
2322
  const S = Math.max(1080, d), A = Math.max(30, f);
2323
2323
  g = G(g) ? g : t, t = Math.max(g, t), h || (e = void 0);
2324
- const P = r.length > 1;
2324
+ const C = r.length > 1;
2325
2325
  return {
2326
2326
  codecSet: r.reduce((I, b) => {
2327
2327
  const L = a[b];
2328
2328
  if (b === I)
2329
2329
  return I;
2330
- if (E = h ? v.filter((k) => L.videoRanges[k] > 0) : [], P) {
2330
+ if (E = h ? v.filter((k) => L.videoRanges[k] > 0) : [], C) {
2331
2331
  if (L.minBitrate > t)
2332
2332
  return Ge(b, `min bitrate of ${L.minBitrate} > current estimate of ${t}`), I;
2333
2333
  if (!L.hasDefaultAudio)
@@ -2528,31 +2528,31 @@ class il extends Me {
2528
2528
  const v = this.bwEstimator.getEstimateTTFB(), S = Math.abs(c.playbackRate);
2529
2529
  if (d <= Math.max(v, 1e3 * (h / (S * 2))))
2530
2530
  return;
2531
- const A = T ? T.len / S : 0, P = u.loading.first ? u.loading.first - u.loading.start : -1, x = u.loaded && P > -1, I = this.getBwEstimate(), b = n.levels, L = b[g], k = Math.max(u.loaded, Math.round(h * (i.bitrate || L.averageBitrate) / 8));
2532
- let C = x ? d - P : d;
2533
- C < 1 && x && (C = Math.min(d, u.loaded * 8 / I));
2534
- const M = x ? u.loaded * 1e3 / C : 0, $ = v / 1e3, N = M ? (k - u.loaded) / M : k * 8 / I + $;
2535
- if (N <= A)
2531
+ const A = T ? T.len / S : 0, C = u.loading.first ? u.loading.first - u.loading.start : -1, x = u.loaded && C > -1, I = this.getBwEstimate(), b = n.levels, L = b[g], k = Math.max(u.loaded, Math.round(h * (i.bitrate || L.averageBitrate) / 8));
2532
+ let P = x ? d - C : d;
2533
+ P < 1 && x && (P = Math.min(d, u.loaded * 8 / I));
2534
+ const M = x ? u.loaded * 1e3 / P : 0, $ = v / 1e3, B = M ? (k - u.loaded) / M : k * 8 / I + $;
2535
+ if (B <= A)
2536
2536
  return;
2537
- const F = M ? M * 8 : I, U = ((s = t?.details || this.hls.latestLevelDetails) == null ? void 0 : s.live) === !0, B = this.hls.config.abrBandWidthUpFactor;
2537
+ const F = M ? M * 8 : I, U = ((s = t?.details || this.hls.latestLevelDetails) == null ? void 0 : s.live) === !0, N = this.hls.config.abrBandWidthUpFactor;
2538
2538
  let V = Number.POSITIVE_INFINITY, W;
2539
2539
  for (W = g - 1; W > f; W--) {
2540
2540
  const j = b[W].maxBitrate, Q = !b[W].details || U;
2541
2541
  if (V = this.getTimeToLoadFrag($, F, h * j, Q), V < Math.min(A, h + $))
2542
2542
  break;
2543
2543
  }
2544
- if (V >= N || V > h * 10)
2544
+ if (V >= B || V > h * 10)
2545
2545
  return;
2546
- x ? this.bwEstimator.sample(d - Math.min(v, P), u.loaded) : this.bwEstimator.sampleTTFB(d);
2546
+ x ? this.bwEstimator.sample(d - Math.min(v, C), u.loaded) : this.bwEstimator.sampleTTFB(d);
2547
2547
  const R = b[W].maxBitrate;
2548
- this.getBwEstimate() * B > R && this.resetEstimator(R);
2548
+ this.getBwEstimate() * N > R && this.resetEstimator(R);
2549
2549
  const O = this.findBestLevel(R, f, W, 0, A, 1, 1);
2550
2550
  O > -1 && (W = O), this.warn(`Fragment ${i.sn}${r ? " part " + r.index : ""} of level ${g} is loading too slowly;
2551
2551
  Fragment duration: ${i.duration.toFixed(3)}
2552
2552
  Time to underbuffer: ${A.toFixed(3)} s
2553
- Estimated load time for current fragment: ${N.toFixed(3)} s
2553
+ Estimated load time for current fragment: ${B.toFixed(3)} s
2554
2554
  Estimated load time for down switch fragment: ${V.toFixed(3)} s
2555
- TTFB estimate: ${P | 0} ms
2555
+ TTFB estimate: ${C | 0} ms
2556
2556
  Current BW estimate: ${G(I) ? I | 0 : "Unknown"} bps
2557
2557
  New BW estimate: ${this.getBwEstimate() | 0} bps
2558
2558
  Switching to level ${W} @ ${R | 0} bps`), n.nextLoadLevel = n.nextAutoLevel = W, this.clearTimer();
@@ -2567,7 +2567,7 @@ class il extends Me {
2567
2567
  }
2568
2568
  }
2569
2569
  };
2570
- y || N > V * 2 ? H() : this.timer = self.setInterval(H, V * 1e3), n.trigger(m.FRAG_LOAD_EMERGENCY_ABORTED, {
2570
+ y || B > V * 2 ? H() : this.timer = self.setInterval(H, V * 1e3), n.trigger(m.FRAG_LOAD_EMERGENCY_ABORTED, {
2571
2571
  frag: i,
2572
2572
  part: r,
2573
2573
  stats: u
@@ -2776,7 +2776,7 @@ class il extends Me {
2776
2776
  if (g.length === 1)
2777
2777
  return 0;
2778
2778
  const T = g[h], v = !!((c = this.hls.latestLevelDetails) != null && c.live), S = y === -1 || u === -1;
2779
- let A, P = "SDR", x = T?.frameRate || 0;
2779
+ let A, C = "SDR", x = T?.frameRate || 0;
2780
2780
  const {
2781
2781
  audioPreference: I,
2782
2782
  videoPreference: b
@@ -2785,26 +2785,26 @@ class il extends Me {
2785
2785
  if (S) {
2786
2786
  if (this.firstSelection !== -1)
2787
2787
  return this.firstSelection;
2788
- const F = this.codecTiers || (this.codecTiers = Jo(g, L, t, s)), U = Zo(F, P, e, I, b), {
2789
- codecSet: B,
2788
+ const F = this.codecTiers || (this.codecTiers = Jo(g, L, t, s)), U = Zo(F, C, e, I, b), {
2789
+ codecSet: N,
2790
2790
  videoRanges: V,
2791
2791
  minFramerate: W,
2792
2792
  minBitrate: R,
2793
2793
  minIndex: O,
2794
2794
  preferHDR: H
2795
2795
  } = U;
2796
- k = O, A = B, P = H ? V[V.length - 1] : V[0], x = W, e = Math.max(e, R), this.log(`picked start tier ${le(U)}`);
2796
+ k = O, A = N, C = H ? V[V.length - 1] : V[0], x = W, e = Math.max(e, R), this.log(`picked start tier ${le(U)}`);
2797
2797
  } else
2798
- A = T?.codecSet, P = T?.videoRange;
2799
- const C = f ? f.duration : d ? d.duration : 0, M = this.bwEstimator.getEstimateTTFB() / 1e3, $ = [];
2798
+ A = T?.codecSet, C = T?.videoRange;
2799
+ const P = f ? f.duration : d ? d.duration : 0, M = this.bwEstimator.getEstimateTTFB() / 1e3, $ = [];
2800
2800
  for (let F = s; F >= t; F--) {
2801
- var N;
2802
- const U = g[F], B = F > h;
2801
+ var B;
2802
+ const U = g[F], N = F > h;
2803
2803
  if (!U)
2804
2804
  continue;
2805
2805
  if (E.useMediaCapabilities && !U.supportedResult && !U.supportedPromise) {
2806
2806
  const Q = navigator.mediaCapabilities;
2807
- typeof Q?.decodingInfo == "function" && Ko(U, L, P, x, e, I) ? (U.supportedPromise = Fn(U, L, Q, this.supportedCache), U.supportedPromise.then((Z) => {
2807
+ typeof Q?.decodingInfo == "function" && Ko(U, L, C, x, e, I) ? (U.supportedPromise = Fn(U, L, Q, this.supportedCache), U.supportedPromise.then((Z) => {
2808
2808
  if (!this.hls)
2809
2809
  return;
2810
2810
  U.supportedResult = Z;
@@ -2814,14 +2814,14 @@ class il extends Me {
2814
2814
  this.warn(`Error handling MediaCapabilities decodingInfo: ${Z}`);
2815
2815
  })) : U.supportedResult = wn;
2816
2816
  }
2817
- if ((A && U.codecSet !== A || P && U.videoRange !== P || B && x > U.frameRate || !B && x > 0 && x < U.frameRate || (N = U.supportedResult) != null && (N = N.decodingInfoResults) != null && N.some((Q) => Q.smooth === !1)) && (!S || F !== k)) {
2817
+ if ((A && U.codecSet !== A || C && U.videoRange !== C || N && x > U.frameRate || !N && x > 0 && x < U.frameRate || (B = U.supportedResult) != null && (B = B.decodingInfoResults) != null && B.some((Q) => Q.smooth === !1)) && (!S || F !== k)) {
2818
2818
  $.push(F);
2819
2819
  continue;
2820
2820
  }
2821
- const V = U.details, W = (f ? V?.partTarget : V?.averagetargetduration) || C;
2821
+ const V = U.details, W = (f ? V?.partTarget : V?.averagetargetduration) || P;
2822
2822
  let R;
2823
- B ? R = o * e : R = n * e;
2824
- const O = C && i >= C * 2 && r === 0 ? U.averageBitrate : U.maxBitrate, H = this.getTimeToLoadFrag(M, R, O * W, V === void 0);
2823
+ N ? R = o * e : R = n * e;
2824
+ const O = P && i >= P * 2 && r === 0 ? U.averageBitrate : U.maxBitrate, H = this.getTimeToLoadFrag(M, R, O * W, V === void 0);
2825
2825
  if (
2826
2826
  // if adjusted bw is greater than level bitrate AND
2827
2827
  R >= O && // no level change, or new level has no error history
@@ -2831,7 +2831,7 @@ class il extends Me {
2831
2831
  (H <= M || !G(H) || v && !this.bitrateTestDelay || H < l)
2832
2832
  ) {
2833
2833
  const Q = this.forcedAutoLevel;
2834
- return F !== y && (Q === -1 || Q !== y) && ($.length && this.trace(`Skipped level(s) ${$.join(",")} of ${s} max with CODECS and VIDEO-RANGE:"${g[$[0]].codecs}" ${g[$[0]].videoRange}; not compatible with "${A}" ${P}`), this.info(`switch candidate:${h}->${F} adjustedbw(${Math.round(R)})-bitrate=${Math.round(R - O)} ttfb:${M.toFixed(1)} avgDuration:${W.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${H.toFixed(1)} firstSelection:${S} codecSet:${U.codecSet} videoRange:${U.videoRange} hls.loadLevel:${y}`)), S && (this.firstSelection = F), F;
2834
+ return F !== y && (Q === -1 || Q !== y) && ($.length && this.trace(`Skipped level(s) ${$.join(",")} of ${s} max with CODECS and VIDEO-RANGE:"${g[$[0]].codecs}" ${g[$[0]].videoRange}; not compatible with "${A}" ${C}`), this.info(`switch candidate:${h}->${F} adjustedbw(${Math.round(R)})-bitrate=${Math.round(R - O)} ttfb:${M.toFixed(1)} avgDuration:${W.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${H.toFixed(1)} firstSelection:${S} codecSet:${U.codecSet} videoRange:${U.videoRange} hls.loadLevel:${y}`)), S && (this.firstSelection = F), F;
2835
2835
  }
2836
2836
  }
2837
2837
  return -1;
@@ -3162,16 +3162,16 @@ class ll extends Me {
3162
3162
  } = s;
3163
3163
  !s.autoLevelEnabled && !s.config.preserveManualLevelOnError && (s.loadLevel = -1);
3164
3164
  const p = (r = e.frag) == null ? void 0 : r.type, E = (p === K.AUDIO && l === D.FRAG_PARSING_ERROR || e.sourceBufferName === "audio" && (l === D.BUFFER_ADD_CODEC_ERROR || l === D.BUFFER_APPEND_ERROR)) && h.some(({
3165
- audioCodec: P
3166
- }) => i.audioCodec !== P), v = e.sourceBufferName === "video" && (l === D.BUFFER_ADD_CODEC_ERROR || l === D.BUFFER_APPEND_ERROR) && h.some(({
3167
- codecSet: P,
3165
+ audioCodec: C
3166
+ }) => i.audioCodec !== C), v = e.sourceBufferName === "video" && (l === D.BUFFER_ADD_CODEC_ERROR || l === D.BUFFER_APPEND_ERROR) && h.some(({
3167
+ codecSet: C,
3168
3168
  audioCodec: x
3169
- }) => i.codecSet !== P && i.audioCodec === x), {
3169
+ }) => i.codecSet !== C && i.audioCodec === x), {
3170
3170
  type: S,
3171
3171
  groupId: A
3172
3172
  } = (n = e.context) != null ? n : {};
3173
- for (let P = h.length; P--; ) {
3174
- const x = (P + d) % h.length;
3173
+ for (let C = h.length; C--; ) {
3174
+ const x = (C + d) % h.length;
3175
3175
  if (x !== d && x >= f && x <= g && h[x].loadError === 0) {
3176
3176
  var o, c;
3177
3177
  const I = h[x];
@@ -3653,12 +3653,12 @@ class dl {
3653
3653
  const i = this.keySize + 6, r = this.invKeySchedule, n = this.invSBox, o = this.invSubMix, c = o[0], l = o[1], u = o[2], h = o[3], d = this.uint8ArrayToUint32Array_(s);
3654
3654
  let f = d[0], g = d[1], p = d[2], y = d[3];
3655
3655
  const E = new Int32Array(e), T = new Int32Array(E.length);
3656
- let v, S, A, P, x, I, b, L, k, C, M, $, N, F;
3656
+ let v, S, A, C, x, I, b, L, k, P, M, $, B, F;
3657
3657
  const U = this.networkToHostOrderSwap;
3658
3658
  for (; t < E.length; ) {
3659
- for (k = U(E[t]), C = U(E[t + 1]), M = U(E[t + 2]), $ = U(E[t + 3]), x = k ^ r[0], I = $ ^ r[1], b = M ^ r[2], L = C ^ r[3], N = 4, F = 1; F < i; F++)
3660
- v = c[x >>> 24] ^ l[I >> 16 & 255] ^ u[b >> 8 & 255] ^ h[L & 255] ^ r[N], S = c[I >>> 24] ^ l[b >> 16 & 255] ^ u[L >> 8 & 255] ^ h[x & 255] ^ r[N + 1], A = c[b >>> 24] ^ l[L >> 16 & 255] ^ u[x >> 8 & 255] ^ h[I & 255] ^ r[N + 2], P = c[L >>> 24] ^ l[x >> 16 & 255] ^ u[I >> 8 & 255] ^ h[b & 255] ^ r[N + 3], x = v, I = S, b = A, L = P, N = N + 4;
3661
- v = n[x >>> 24] << 24 ^ n[I >> 16 & 255] << 16 ^ n[b >> 8 & 255] << 8 ^ n[L & 255] ^ r[N], S = n[I >>> 24] << 24 ^ n[b >> 16 & 255] << 16 ^ n[L >> 8 & 255] << 8 ^ n[x & 255] ^ r[N + 1], A = n[b >>> 24] << 24 ^ n[L >> 16 & 255] << 16 ^ n[x >> 8 & 255] << 8 ^ n[I & 255] ^ r[N + 2], P = n[L >>> 24] << 24 ^ n[x >> 16 & 255] << 16 ^ n[I >> 8 & 255] << 8 ^ n[b & 255] ^ r[N + 3], T[t] = U(v ^ f), T[t + 1] = U(P ^ g), T[t + 2] = U(A ^ p), T[t + 3] = U(S ^ y), f = k, g = C, p = M, y = $, t = t + 4;
3659
+ for (k = U(E[t]), P = U(E[t + 1]), M = U(E[t + 2]), $ = U(E[t + 3]), x = k ^ r[0], I = $ ^ r[1], b = M ^ r[2], L = P ^ r[3], B = 4, F = 1; F < i; F++)
3660
+ v = c[x >>> 24] ^ l[I >> 16 & 255] ^ u[b >> 8 & 255] ^ h[L & 255] ^ r[B], S = c[I >>> 24] ^ l[b >> 16 & 255] ^ u[L >> 8 & 255] ^ h[x & 255] ^ r[B + 1], A = c[b >>> 24] ^ l[L >> 16 & 255] ^ u[x >> 8 & 255] ^ h[I & 255] ^ r[B + 2], C = c[L >>> 24] ^ l[x >> 16 & 255] ^ u[I >> 8 & 255] ^ h[b & 255] ^ r[B + 3], x = v, I = S, b = A, L = C, B = B + 4;
3661
+ v = n[x >>> 24] << 24 ^ n[I >> 16 & 255] << 16 ^ n[b >> 8 & 255] << 8 ^ n[L & 255] ^ r[B], S = n[I >>> 24] << 24 ^ n[b >> 16 & 255] << 16 ^ n[L >> 8 & 255] << 8 ^ n[x & 255] ^ r[B + 1], A = n[b >>> 24] << 24 ^ n[L >> 16 & 255] << 16 ^ n[x >> 8 & 255] << 8 ^ n[I & 255] ^ r[B + 2], C = n[L >>> 24] << 24 ^ n[x >> 16 & 255] << 16 ^ n[I >> 8 & 255] << 8 ^ n[b & 255] ^ r[B + 3], T[t] = U(v ^ f), T[t + 1] = U(C ^ g), T[t + 2] = U(A ^ p), T[t + 3] = U(S ^ y), f = k, g = P, p = M, y = $, t = t + 4;
3662
3662
  }
3663
3663
  return T.buffer;
3664
3664
  }
@@ -4849,7 +4849,7 @@ class We {
4849
4849
  const c = {
4850
4850
  url: t
4851
4851
  }, l = new Ll(t), u = l.fragments, h = [];
4852
- let d = null, f = 0, g = 0, p = 0, y = 0, E = 0, T = null, v = new Os(i, c), S, A, P, x = -1, I = !1, b = null, L;
4852
+ let d = null, f = 0, g = 0, p = 0, y = 0, E = 0, T = null, v = new Os(i, c), S, A, C, x = -1, I = !1, b = null, L;
4853
4853
  if (Bs.lastIndex = 0, l.m3u8 = e, l.hasVariableRefs = Lr(e), ((o = Bs.exec(e)) == null ? void 0 : o[0]) !== "#EXTM3U")
4854
4854
  return l.playlistParsingError = new Error("Missing format identifier #EXTM3U"), l;
4855
4855
  for (; (S = Bs.exec(e)) !== null; ) {
@@ -4857,13 +4857,13 @@ class We {
4857
4857
  const $ = S[1];
4858
4858
  if ($) {
4859
4859
  v.duration = parseFloat($);
4860
- const N = (" " + S[2]).slice(1);
4861
- v.title = N || null, v.tagList.push(N ? ["INF", $, N] : ["INF", $]);
4860
+ const B = (" " + S[2]).slice(1);
4861
+ v.title = B || null, v.tagList.push(B ? ["INF", $, B] : ["INF", $]);
4862
4862
  } else if (S[3]) {
4863
4863
  if (G(v.duration)) {
4864
- v.playlistOffset = p, v.setStart(p), P && Mr(v, P, l), v.sn = f, v.level = s, v.cc = y, u.push(v);
4865
- const N = (" " + S[3]).slice(1);
4866
- v.relurl = ui(l, N), di(v, T, h), T = v, p += v.duration, f++, g = 0, I = !0;
4864
+ v.playlistOffset = p, v.setStart(p), C && Mr(v, C, l), v.sn = f, v.level = s, v.cc = y, u.push(v);
4865
+ const B = (" " + S[3]).slice(1);
4866
+ v.relurl = ui(l, B), di(v, T, h), T = v, p += v.duration, f++, g = 0, I = !0;
4867
4867
  }
4868
4868
  } else {
4869
4869
  if (S = S[0].match(kl), !S) {
@@ -4872,8 +4872,8 @@ class We {
4872
4872
  }
4873
4873
  for (A = 1; A < S.length && S[A] === void 0; A++)
4874
4874
  ;
4875
- const N = (" " + S[A]).slice(1), F = (" " + S[A + 1]).slice(1), U = S[A + 2] ? (" " + S[A + 2]).slice(1) : null;
4876
- switch (N) {
4875
+ const B = (" " + S[A]).slice(1), F = (" " + S[A + 1]).slice(1), U = S[A + 2] ? (" " + S[A + 2]).slice(1) : null;
4876
+ switch (B) {
4877
4877
  case "BYTERANGE":
4878
4878
  T ? v.setByteRange(F, T) : v.setByteRange(F);
4879
4879
  break;
@@ -4881,34 +4881,34 @@ class We {
4881
4881
  v.rawProgramDateTime = F, v.tagList.push(["PROGRAM-DATE-TIME", F]), x === -1 && (x = u.length);
4882
4882
  break;
4883
4883
  case "PLAYLIST-TYPE":
4884
- l.type && ze(l, N, S), l.type = F.toUpperCase();
4884
+ l.type && ze(l, B, S), l.type = F.toUpperCase();
4885
4885
  break;
4886
4886
  case "MEDIA-SEQUENCE":
4887
- l.startSN !== 0 ? ze(l, N, S) : u.length > 0 && Nr(l, N, S), f = l.startSN = parseInt(F);
4887
+ l.startSN !== 0 ? ze(l, B, S) : u.length > 0 && Nr(l, B, S), f = l.startSN = parseInt(F);
4888
4888
  break;
4889
4889
  case "SKIP": {
4890
- l.skippedSegments && ze(l, N, S);
4891
- const B = new ue(F, l), V = B.decimalInteger("SKIPPED-SEGMENTS");
4890
+ l.skippedSegments && ze(l, B, S);
4891
+ const N = new ue(F, l), V = N.decimalInteger("SKIPPED-SEGMENTS");
4892
4892
  if (G(V)) {
4893
4893
  l.skippedSegments += V;
4894
4894
  for (let R = V; R--; )
4895
4895
  u.push(null);
4896
4896
  f += V;
4897
4897
  }
4898
- const W = B.enumeratedString("RECENTLY-REMOVED-DATERANGES");
4898
+ const W = N.enumeratedString("RECENTLY-REMOVED-DATERANGES");
4899
4899
  W && (l.recentlyRemovedDateranges = (l.recentlyRemovedDateranges || []).concat(W.split(" ")));
4900
4900
  break;
4901
4901
  }
4902
4902
  case "TARGETDURATION":
4903
- l.targetduration !== 0 && ze(l, N, S), l.targetduration = Math.max(parseInt(F), 1);
4903
+ l.targetduration !== 0 && ze(l, B, S), l.targetduration = Math.max(parseInt(F), 1);
4904
4904
  break;
4905
4905
  case "VERSION":
4906
- l.version !== null && ze(l, N, S), l.version = parseInt(F);
4906
+ l.version !== null && ze(l, B, S), l.version = parseInt(F);
4907
4907
  break;
4908
4908
  case "INDEPENDENT-SEGMENTS":
4909
4909
  break;
4910
4910
  case "ENDLIST":
4911
- l.live || ze(l, N, S), l.live = !1;
4911
+ l.live || ze(l, B, S), l.live = !1;
4912
4912
  break;
4913
4913
  case "#":
4914
4914
  (F || U) && v.tagList.push(U ? [F, U] : [F]);
@@ -4917,36 +4917,36 @@ class We {
4917
4917
  y++, v.tagList.push(["DIS"]);
4918
4918
  break;
4919
4919
  case "GAP":
4920
- v.gap = !0, v.tagList.push([N]);
4920
+ v.gap = !0, v.tagList.push([B]);
4921
4921
  break;
4922
4922
  case "BITRATE":
4923
- v.tagList.push([N, F]), E = parseInt(F) * 1e3, G(E) ? v.bitrate = E : E = 0;
4923
+ v.tagList.push([B, F]), E = parseInt(F) * 1e3, G(E) ? v.bitrate = E : E = 0;
4924
4924
  break;
4925
4925
  case "DATERANGE": {
4926
- const B = new ue(F, l), V = new Hn(B, l.dateRanges[B.ID], l.dateRangeTagCount);
4926
+ const N = new ue(F, l), V = new Hn(N, l.dateRanges[N.ID], l.dateRangeTagCount);
4927
4927
  l.dateRangeTagCount++, V.isValid || l.skippedSegments ? l.dateRanges[V.id] = V : re.warn(`Ignoring invalid DATERANGE tag: "${F}"`), v.tagList.push(["EXT-X-DATERANGE", F]);
4928
4928
  break;
4929
4929
  }
4930
4930
  case "DEFINE": {
4931
4931
  {
4932
- const B = new ue(F, l);
4933
- "IMPORT" in B ? El(l, B, n) : Ir(l, B, t);
4932
+ const N = new ue(F, l);
4933
+ "IMPORT" in N ? El(l, N, n) : Ir(l, N, t);
4934
4934
  }
4935
4935
  break;
4936
4936
  }
4937
4937
  case "DISCONTINUITY-SEQUENCE":
4938
- l.startCC !== 0 ? ze(l, N, S) : u.length > 0 && Nr(l, N, S), l.startCC = y = parseInt(F);
4938
+ l.startCC !== 0 ? ze(l, B, S) : u.length > 0 && Nr(l, B, S), l.startCC = y = parseInt(F);
4939
4939
  break;
4940
4940
  case "KEY": {
4941
- const B = Pr(F, t, l);
4942
- if (B.isSupported()) {
4943
- if (B.method === "NONE") {
4944
- P = void 0;
4941
+ const N = Pr(F, t, l);
4942
+ if (N.isSupported()) {
4943
+ if (N.method === "NONE") {
4944
+ C = void 0;
4945
4945
  break;
4946
4946
  }
4947
- P || (P = {});
4948
- const V = P[B.keyFormat];
4949
- V != null && V.matches(B) || (V && (P = ae({}, P)), P[B.keyFormat] = B);
4947
+ C || (C = {});
4948
+ const V = C[N.keyFormat];
4949
+ V != null && V.matches(N) || (V && (C = ae({}, C)), C[N.keyFormat] = N);
4950
4950
  } else
4951
4951
  re.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${F}"`);
4952
4952
  break;
@@ -4955,10 +4955,10 @@ class We {
4955
4955
  l.startTimeOffset = kr(F);
4956
4956
  break;
4957
4957
  case "MAP": {
4958
- const B = new ue(F, l);
4958
+ const N = new ue(F, l);
4959
4959
  if (v.duration) {
4960
4960
  const V = new Os(i, c);
4961
- Fr(V, B, s, P), d = V, v.initSegment = d, d.rawProgramDateTime && !v.rawProgramDateTime && (v.rawProgramDateTime = d.rawProgramDateTime);
4961
+ Fr(V, N, s, C), d = V, v.initSegment = d, d.rawProgramDateTime && !v.rawProgramDateTime && (v.rawProgramDateTime = d.rawProgramDateTime);
4962
4962
  } else {
4963
4963
  const V = v.byteRangeEndOffset;
4964
4964
  if (V) {
@@ -4966,36 +4966,36 @@ class We {
4966
4966
  b = `${V - W}@${W}`;
4967
4967
  } else
4968
4968
  b = null;
4969
- Fr(v, B, s, P), d = v, I = !0;
4969
+ Fr(v, N, s, C), d = v, I = !0;
4970
4970
  }
4971
4971
  d.cc = y;
4972
4972
  break;
4973
4973
  }
4974
4974
  case "SERVER-CONTROL": {
4975
- L && ze(l, N, S), L = new ue(F), 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);
4975
+ L && ze(l, B, S), L = new ue(F), 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);
4976
4976
  break;
4977
4977
  }
4978
4978
  case "PART-INF": {
4979
- l.partTarget && ze(l, N, S);
4980
- const B = new ue(F);
4981
- l.partTarget = B.decimalFloatingPoint("PART-TARGET");
4979
+ l.partTarget && ze(l, B, S);
4980
+ const N = new ue(F);
4981
+ l.partTarget = N.decimalFloatingPoint("PART-TARGET");
4982
4982
  break;
4983
4983
  }
4984
4984
  case "PART": {
4985
- let B = l.partList;
4986
- B || (B = l.partList = []);
4987
- const V = g > 0 ? B[B.length - 1] : void 0, W = g++, R = new ue(F, l), O = new Eo(R, v, c, W, V);
4988
- B.push(O), v.duration += O.duration;
4985
+ let N = l.partList;
4986
+ N || (N = l.partList = []);
4987
+ const V = g > 0 ? N[N.length - 1] : void 0, W = g++, R = new ue(F, l), O = new Eo(R, v, c, W, V);
4988
+ N.push(O), v.duration += O.duration;
4989
4989
  break;
4990
4990
  }
4991
4991
  case "PRELOAD-HINT": {
4992
- const B = new ue(F, l);
4993
- l.preloadHint = B;
4992
+ const N = new ue(F, l);
4993
+ l.preloadHint = N;
4994
4994
  break;
4995
4995
  }
4996
4996
  case "RENDITION-REPORT": {
4997
- const B = new ue(F, l);
4998
- l.renditionReports = l.renditionReports || [], l.renditionReports.push(B);
4997
+ const N = new ue(F, l);
4998
+ l.renditionReports = l.renditionReports || [], l.renditionReports.push(N);
4999
4999
  break;
5000
5000
  }
5001
5001
  default:
@@ -5004,14 +5004,14 @@ class We {
5004
5004
  }
5005
5005
  }
5006
5006
  }
5007
- T && !T.relurl ? (u.pop(), p -= T.duration, l.partList && (l.fragmentHint = T)) : l.partList && (di(v, T, h), v.cc = y, l.fragmentHint = v, P && Mr(v, P, l)), l.targetduration || (l.playlistParsingError = new Error("Missing Target Duration"));
5008
- const k = u.length, C = u[0], M = u[k - 1];
5007
+ T && !T.relurl ? (u.pop(), p -= T.duration, l.partList && (l.fragmentHint = T)) : l.partList && (di(v, T, h), v.cc = y, l.fragmentHint = v, C && Mr(v, C, l)), l.targetduration || (l.playlistParsingError = new Error("Missing Target Duration"));
5008
+ const k = u.length, P = u[0], M = u[k - 1];
5009
5009
  if (p += l.skippedSegments * l.targetduration, p > 0 && k && M) {
5010
5010
  l.averagetargetduration = p / k;
5011
5011
  const $ = M.sn;
5012
- l.endSN = $ !== "initSegment" ? $ : 0, l.live || (M.endList = !0), x > 0 && (Ol(u, x), C && h.unshift(C));
5012
+ l.endSN = $ !== "initSegment" ? $ : 0, l.live || (M.endList = !0), x > 0 && (Ol(u, x), P && h.unshift(P));
5013
5013
  }
5014
- return l.fragmentHint && (p += l.fragmentHint.duration), l.totalduration = p, h.length && l.dateRangeTagCount && C && zn(h, l), l.endCC = y, l;
5014
+ return l.fragmentHint && (p += l.fragmentHint.duration), l.totalduration = p, h.length && l.dateRangeTagCount && P && zn(h, l), l.endCC = y, l;
5015
5015
  }
5016
5016
  }
5017
5017
  function zn(a, e) {
@@ -7518,8 +7518,8 @@ class Rc extends Ta {
7518
7518
  for (g(1), p(), p(), o = d(), l = 0; l < o; l++)
7519
7519
  p();
7520
7520
  y(), g(1);
7521
- const S = d(), A = d(), P = h(1);
7522
- P === 0 && g(1), g(1), f() && (s = d(), i = d(), r = d(), n = d());
7521
+ const S = d(), A = d(), C = h(1);
7522
+ C === 0 && g(1), g(1), f() && (s = d(), i = d(), r = d(), n = d());
7523
7523
  let x = [1, 1];
7524
7524
  if (f() && f())
7525
7525
  switch (u()) {
@@ -7578,7 +7578,7 @@ class Rc extends Ta {
7578
7578
  }
7579
7579
  return {
7580
7580
  width: Math.ceil((S + 1) * 16 - s * 2 - i * 2),
7581
- height: (2 - P) * (A + 1) * 16 - (P ? 2 : 4) * (r + n),
7581
+ height: (2 - C) * (A + 1) * 16 - (C ? 2 : 4) * (r + n),
7582
7582
  pixelRatio: x
7583
7583
  };
7584
7584
  }
@@ -7710,11 +7710,11 @@ class bc extends Ta {
7710
7710
  t.readUEG();
7711
7711
  const S = t.readUEG();
7712
7712
  S == 3 && t.skipBits(1);
7713
- const A = t.readUEG(), P = t.readUEG(), x = t.readBoolean();
7713
+ const A = t.readUEG(), C = t.readUEG(), x = t.readBoolean();
7714
7714
  let I = 0, b = 0, L = 0, k = 0;
7715
7715
  x && (I += t.readUEG(), b += t.readUEG(), L += t.readUEG(), k += t.readUEG());
7716
- const C = t.readUEG(), M = t.readUEG(), $ = t.readUEG(), N = t.readBoolean();
7717
- for (let se = N ? 0 : s; se <= s; se++)
7716
+ const P = t.readUEG(), M = t.readUEG(), $ = t.readUEG(), B = t.readBoolean();
7717
+ for (let se = B ? 0 : s; se <= s; se++)
7718
7718
  t.skipUEG(), t.skipUEG(), t.skipUEG();
7719
7719
  if (t.skipUEG(), t.skipUEG(), t.skipUEG(), t.skipUEG(), t.skipUEG(), t.skipUEG(), t.readBoolean() && t.readBoolean())
7720
7720
  for (let xe = 0; xe < 4; xe++)
@@ -7728,12 +7728,12 @@ class bc extends Ta {
7728
7728
  t.readEG();
7729
7729
  }
7730
7730
  t.readBoolean(), t.readBoolean(), t.readBoolean() && (t.readUByte(), t.skipUEG(), t.skipUEG(), t.readBoolean());
7731
- const B = t.readUEG();
7731
+ const N = t.readUEG();
7732
7732
  let V = 0;
7733
- for (let se = 0; se < B; se++) {
7733
+ for (let se = 0; se < N; se++) {
7734
7734
  let xe = !1;
7735
7735
  if (se !== 0 && (xe = t.readBoolean()), xe) {
7736
- se === B && t.readUEG(), t.readBoolean(), t.readUEG();
7736
+ se === N && t.readUEG(), t.readBoolean(), t.readUEG();
7737
7737
  let Oe = 0;
7738
7738
  for (let ot = 0; ot <= V; ot++) {
7739
7739
  const Ne = t.readBoolean();
@@ -7786,10 +7786,10 @@ class bc extends Ta {
7786
7786
  }
7787
7787
  t.readBoolean() && (t.readBoolean(), t.readBoolean(), t.readBoolean(), R = t.readUEG());
7788
7788
  }
7789
- let Se = A, we = P;
7789
+ let Se = A, we = C;
7790
7790
  if (x) {
7791
7791
  let se = 1, xe = 1;
7792
- S === 1 ? se = xe = 2 : S == 2 && (se = 2), Se = A - se * b - se * I, we = P - xe * k - xe * L;
7792
+ S === 1 ? se = xe = 2 : S == 2 && (se = 2), Se = A - se * b - se * I, we = C - xe * k - xe * L;
7793
7793
  }
7794
7794
  const at = i ? ["A", "B", "C"][i] : "", Za = o << 24 | c << 16 | l << 8 | u;
7795
7795
  let Ps = 0;
@@ -7805,8 +7805,8 @@ class bc extends Ta {
7805
7805
  general_profile_compatibility_flags: [o, c, l, u],
7806
7806
  general_constraint_indicator_flags: [h, d, f, g, p, y],
7807
7807
  general_level_idc: E,
7808
- bit_depth: C + 8,
7809
- bit_depth_luma_minus8: C,
7808
+ bit_depth: P + 8,
7809
+ bit_depth_luma_minus8: P,
7810
7810
  bit_depth_chroma_minus8: M,
7811
7811
  min_spatial_segmentation_idc: R,
7812
7812
  chroma_format_idc: S,
@@ -7956,8 +7956,8 @@ class st {
7956
7956
  break;
7957
7957
  case T: {
7958
7958
  I && (k += e[k] + 1);
7959
- const C = Dc(e, k, this.typeSupported, s, this.observer, this.logger);
7960
- u = C.videoPid, u > 0 && (n.pid = u, n.segmentCodec = C.segmentVideoCodec), d = C.audioPid, d > 0 && (o.pid = d, o.segmentCodec = C.segmentAudioCodec), f = C.id3Pid, f > 0 && (c.pid = f), y !== null && !E && (this.logger.warn(`MPEG-TS PMT found at ${x} after unknown PID '${y}'. Backtracking to sync byte @${S} to parse all TS packets.`), y = null, x = S - 188), E = this.pmtParsed = !0;
7959
+ const P = Dc(e, k, this.typeSupported, s, this.observer, this.logger);
7960
+ u = P.videoPid, u > 0 && (n.pid = u, n.segmentCodec = P.segmentVideoCodec), d = P.audioPid, d > 0 && (o.pid = d, o.segmentCodec = P.segmentAudioCodec), f = P.id3Pid, f > 0 && (c.pid = f), y !== null && !E && (this.logger.warn(`MPEG-TS PMT found at ${x} after unknown PID '${y}'. Backtracking to sync byte @${S} to parse all TS packets.`), y = null, x = S - 188), E = this.pmtParsed = !0;
7961
7961
  break;
7962
7962
  }
7963
7963
  case 17:
@@ -7970,13 +7970,13 @@ class st {
7970
7970
  } else
7971
7971
  A++;
7972
7972
  A > 0 && mi(this.observer, new Error(`Found ${A} TS packet/s that do not start with 0x47`), void 0, this.logger), n.pesData = h, o.pesData = g, c.pesData = p;
7973
- const P = {
7973
+ const C = {
7974
7974
  audioTrack: o,
7975
7975
  videoTrack: n,
7976
7976
  id3Track: c,
7977
7977
  textTrack: l
7978
7978
  };
7979
- return i && this.extractRemainingSamples(P), P;
7979
+ return i && this.extractRemainingSamples(C), C;
7980
7980
  }
7981
7981
  flush() {
7982
7982
  const {
@@ -9552,13 +9552,13 @@ class ds extends Me {
9552
9552
  }
9553
9553
  this.ISGenerated || (h = this.generateIS(e, t, r, n));
9554
9554
  const k = this.isVideoContiguous;
9555
- let C = -1, M;
9556
- if (A && (C = Nc(t.samples), !k && this.config.forceKeyFrameOnDiscontinuity))
9557
- if (g = !0, C > 0) {
9558
- this.warn(`Dropped ${C} out of ${v} video samples due to a missing keyframe`);
9555
+ let P = -1, M;
9556
+ if (A && (P = Nc(t.samples), !k && this.config.forceKeyFrameOnDiscontinuity))
9557
+ if (g = !0, P > 0) {
9558
+ this.warn(`Dropped ${P} out of ${v} video samples due to a missing keyframe`);
9559
9559
  const $ = this.getVideoStartPts(t.samples);
9560
- t.samples = t.samples.slice(C), t.dropped += C, y += (t.samples[0].pts - $) / t.inputTimeScale, M = y;
9561
- } else C === -1 && (this.warn(`No keyframe found out of ${v} video samples`), g = !1);
9560
+ t.samples = t.samples.slice(P), t.dropped += P, y += (t.samples[0].pts - $) / t.inputTimeScale, M = y;
9561
+ } else P === -1 && (this.warn(`No keyframe found out of ${v} video samples`), g = !1);
9562
9562
  if (this.ISGenerated) {
9563
9563
  if (S && A) {
9564
9564
  const $ = this.getVideoStartPts(t.samples), F = (De(e.samples[0].pts, $) - $) / t.inputTimeScale;
@@ -9570,7 +9570,7 @@ class ds extends Me {
9570
9570
  t.inputTimeScale || (this.warn("regenerate InitSegment as video detected"), h = this.generateIS(e, t, r, n)), l = this.remuxVideo(t, y, k, $);
9571
9571
  }
9572
9572
  } else A && (l = this.remuxVideo(t, y, k, 0));
9573
- l && (l.firstKeyFrame = C, l.independent = C !== -1, l.firstKeyFramePTS = M);
9573
+ l && (l.firstKeyFrame = P, l.independent = P !== -1, l.firstKeyFramePTS = M);
9574
9574
  }
9575
9575
  }
9576
9576
  return this.ISGenerated && this._initPTS && this._initDTS && (s.samples.length && (f = Sa(s, r, this._initPTS, this._initDTS)), i.samples.length && (d = xa(i, r, this._initPTS))), {
@@ -9688,16 +9688,16 @@ class ds extends Me {
9688
9688
  }
9689
9689
  }
9690
9690
  g = Math.max(0, g);
9691
- let P = 0, x = 0, I = g;
9691
+ let C = 0, x = 0, I = g;
9692
9692
  for (let R = 0; R < c; R++) {
9693
9693
  const O = n[R], H = O.units, j = H.length;
9694
9694
  let Q = 0;
9695
9695
  for (let Z = 0; Z < j; Z++)
9696
9696
  Q += H[Z].data.length;
9697
- x += Q, P += j, O.length = Q, O.dts < I ? (O.dts = I, I += A / 4 | 0 || 1) : I = O.dts, y = Math.min(O.pts, y), E = Math.max(O.pts, E);
9697
+ x += Q, C += j, O.length = Q, O.dts < I ? (O.dts = I, I += A / 4 | 0 || 1) : I = O.dts, y = Math.min(O.pts, y), E = Math.max(O.pts, E);
9698
9698
  }
9699
9699
  p = n[c - 1].dts;
9700
- const b = x + 4 * P + 8;
9700
+ const b = x + 4 * C + 8;
9701
9701
  let L;
9702
9702
  try {
9703
9703
  L = new Uint8Array(b);
@@ -9714,7 +9714,7 @@ class ds extends Me {
9714
9714
  }
9715
9715
  const k = new DataView(L.buffer);
9716
9716
  k.setUint32(0, b), L.set(_.types.mdat, 4);
9717
- let C = !1, M = Number.POSITIVE_INFINITY, $ = Number.POSITIVE_INFINITY, N = Number.NEGATIVE_INFINITY, F = Number.NEGATIVE_INFINITY;
9717
+ let P = !1, M = Number.POSITIVE_INFINITY, $ = Number.POSITIVE_INFINITY, B = Number.NEGATIVE_INFINITY, F = Number.NEGATIVE_INFINITY;
9718
9718
  for (let R = 0; R < c; R++) {
9719
9719
  const O = n[R], H = O.units;
9720
9720
  let j = 0;
@@ -9729,12 +9729,12 @@ class ds extends Me {
9729
9729
  const te = this.config, ce = R > 0 ? O.dts - n[R - 1].dts : A;
9730
9730
  if (Q = R > 0 ? O.pts - n[R - 1].pts : A, te.stretchShortVideoTrack && this.nextAudioTs !== null) {
9731
9731
  const Se = Math.floor(te.maxBufferHole * r), we = (i ? y + i * r : this.nextAudioTs + u) - O.pts;
9732
- we > Se ? (f = we - ce, f < 0 ? f = ce : C = !0, this.log(`It is approximately ${we / 90} ms to the next segment; using duration ${f / 90} ms for the last video frame.`)) : f = ce;
9732
+ we > Se ? (f = we - ce, f < 0 ? f = ce : P = !0, this.log(`It is approximately ${we / 90} ms to the next segment; using duration ${f / 90} ms for the last video frame.`)) : f = ce;
9733
9733
  } else
9734
9734
  f = ce;
9735
9735
  }
9736
9736
  const Z = Math.round(O.pts - O.dts);
9737
- M = Math.min(M, f), N = Math.max(N, f), $ = Math.min($, Q), F = Math.max(F, Q), o.push(Wr(O.key, f, j, Z));
9737
+ M = Math.min(M, f), B = Math.max(B, f), $ = Math.min($, Q), F = Math.max(F, Q), o.push(Wr(O.key, f, j, Z));
9738
9738
  }
9739
9739
  if (o.length) {
9740
9740
  if (St) {
@@ -9742,7 +9742,7 @@ class ds extends Me {
9742
9742
  const R = o[0].flags;
9743
9743
  R.dependsOn = 2, R.isNonSync = 0;
9744
9744
  }
9745
- } else if (Vs && F - $ < N - M && A / N < 0.025 && o[0].cts === 0) {
9745
+ } else if (Vs && F - $ < B - M && A / B < 0.025 && o[0].cts === 0) {
9746
9746
  this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");
9747
9747
  let R = g;
9748
9748
  for (let O = 0, H = o.length; O < H; O++) {
@@ -9756,7 +9756,7 @@ class ds extends Me {
9756
9756
  }
9757
9757
  }
9758
9758
  }
9759
- f = C || !f ? A : f;
9759
+ f = P || !f ? A : f;
9760
9760
  const U = p + f;
9761
9761
  this.nextVideoTs = h = U - u, this.videoSampleDuration = f, this.isVideoContiguous = !0;
9762
9762
  const W = {
@@ -9800,39 +9800,39 @@ class ds extends Me {
9800
9800
  }
9801
9801
  if (e.segmentCodec === "aac") {
9802
9802
  const F = this.config.maxAudioFramesDrift;
9803
- for (let U = 0, B = E + T; U < p.length; U++) {
9804
- const V = p[U], W = V.pts, R = W - B, O = Math.abs(1e3 * R / n);
9803
+ for (let U = 0, N = E + T; U < p.length; U++) {
9804
+ const V = p[U], W = V.pts, R = W - N, O = Math.abs(1e3 * R / n);
9805
9805
  if (R <= -F * u && g)
9806
- U === 0 && (this.warn(`Audio frame @ ${(W / n).toFixed(3)}s overlaps marker by ${Math.round(1e3 * R / n)} ms.`), this.nextAudioTs = E = W - T, B = W);
9806
+ U === 0 && (this.warn(`Audio frame @ ${(W / n).toFixed(3)}s overlaps marker by ${Math.round(1e3 * R / n)} ms.`), this.nextAudioTs = E = W - T, N = W);
9807
9807
  else if (R >= F * u && O < wc && g) {
9808
9808
  let H = Math.round(R / u);
9809
- for (B = W - H * u; B < 0 && H && u; )
9810
- H--, B += u;
9811
- U === 0 && (this.nextAudioTs = E = B - T), this.warn(`Injecting ${H} audio frames @ ${((B - T) / n).toFixed(3)}s due to ${Math.round(1e3 * R / n)} ms gap.`);
9809
+ for (N = W - H * u; N < 0 && H && u; )
9810
+ H--, N += u;
9811
+ U === 0 && (this.nextAudioTs = E = N - T), this.warn(`Injecting ${H} audio frames @ ${((N - T) / n).toFixed(3)}s due to ${Math.round(1e3 * R / n)} ms gap.`);
9812
9812
  for (let j = 0; j < H; j++) {
9813
9813
  let Q = Cc.getSilentFrame(e.parsedCodec || e.manifestCodec || e.codec, e.channelCount);
9814
9814
  Q || (this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."), Q = V.unit.subarray()), p.splice(U, 0, {
9815
9815
  unit: Q,
9816
- pts: B
9817
- }), B += u, U++;
9816
+ pts: N
9817
+ }), N += u, U++;
9818
9818
  }
9819
9819
  }
9820
- V.pts = B, B += u;
9820
+ V.pts = N, N += u;
9821
9821
  }
9822
9822
  }
9823
- let S = null, A = null, P, x = 0, I = p.length;
9823
+ let S = null, A = null, C, x = 0, I = p.length;
9824
9824
  for (; I--; )
9825
9825
  x += p[I].unit.byteLength;
9826
9826
  for (let F = 0, U = p.length; F < U; F++) {
9827
- const B = p[F], V = B.unit;
9828
- let W = B.pts;
9827
+ const N = p[F], V = N.unit;
9828
+ let W = N.pts;
9829
9829
  if (A !== null) {
9830
9830
  const O = f[F - 1];
9831
9831
  O.duration = Math.round((W - A) / c);
9832
9832
  } else if (s && e.segmentCodec === "aac" && (W = E + T), S = W, x > 0) {
9833
9833
  x += y;
9834
9834
  try {
9835
- P = new Uint8Array(x);
9835
+ C = new Uint8Array(x);
9836
9836
  } catch (O) {
9837
9837
  this.observer.emit(m.ERROR, m.ERROR, {
9838
9838
  type: Y.MUX_ERROR,
@@ -9844,10 +9844,10 @@ class ds extends Me {
9844
9844
  });
9845
9845
  return;
9846
9846
  }
9847
- d || (new DataView(P.buffer).setUint32(0, x), P.set(_.types.mdat, 4));
9847
+ d || (new DataView(C.buffer).setUint32(0, x), C.set(_.types.mdat, 4));
9848
9848
  } else
9849
9849
  return;
9850
- P.set(V, y);
9850
+ C.set(V, y);
9851
9851
  const R = V.byteLength;
9852
9852
  y += R, f.push(Wr(!0, l, R, 0)), A = W;
9853
9853
  }
@@ -9860,19 +9860,19 @@ class ds extends Me {
9860
9860
  samples: f
9861
9861
  }));
9862
9862
  e.samples = [];
9863
- const C = (S - T) / n, M = this.nextAudioTs / n, N = {
9863
+ const P = (S - T) / n, M = this.nextAudioTs / n, B = {
9864
9864
  data1: k,
9865
- data2: P,
9866
- startPTS: C,
9865
+ data2: C,
9866
+ startPTS: P,
9867
9867
  endPTS: M,
9868
- startDTS: C,
9868
+ startDTS: P,
9869
9869
  endDTS: M,
9870
9870
  type: "audio",
9871
9871
  hasAudio: !0,
9872
9872
  hasVideo: !1,
9873
9873
  nb: b
9874
9874
  };
9875
- return this.isAudioContiguous = !0, N;
9875
+ return this.isAudioContiguous = !0, B;
9876
9876
  }
9877
9877
  }
9878
9878
  function De(a, e) {
@@ -10005,41 +10005,41 @@ class Bc extends Me {
10005
10005
  return this.warn("Failed to generate initSegment."), h;
10006
10006
  this.emitInitSegment && (f.tracks = this.initTracks, this.emitInitSegment = !1);
10007
10007
  const p = bo(d, g, this), y = g.audio ? p[g.audio.id] : null, E = g.video ? p[g.video.id] : null, T = es(E, 1 / 0), v = es(y, 1 / 0), S = es(E, 0, !0), A = es(y, 0, !0);
10008
- let P = r, x = 0;
10008
+ let C = r, x = 0;
10009
10009
  const I = y && (!E || !l && v < T || l && l.trackId === g.audio.id), b = I ? y : E;
10010
10010
  if (b) {
10011
- const B = b.timescale, V = b.start - r * B, W = I ? g.audio.id : g.video.id;
10012
- P = b.start / B, x = I ? A - v : S - T, (n || !l) && (Uc(l, P, r, x) || B !== l.timescale) && (l && this.warn(`Timestamps at playlist time: ${n ? "" : "~"}${r} ${V / B} != initPTS: ${l.baseTime / l.timescale} (${l.baseTime}/${l.timescale}) trackId: ${l.trackId}`), this.log(`Found initPTS at playlist time: ${r} offset: ${P - r} (${V}/${B}) trackId: ${W}`), l = null, f.initPTS = V, f.timescale = B, f.trackId = W);
10011
+ const N = b.timescale, V = b.start - r * N, W = I ? g.audio.id : g.video.id;
10012
+ C = b.start / N, x = I ? A - v : S - T, (n || !l) && (Uc(l, C, r, x) || N !== l.timescale) && (l && this.warn(`Timestamps at playlist time: ${n ? "" : "~"}${r} ${V / N} != initPTS: ${l.baseTime / l.timescale} (${l.baseTime}/${l.timescale}) trackId: ${l.trackId}`), this.log(`Found initPTS at playlist time: ${r} offset: ${C - r} (${V}/${N}) trackId: ${W}`), l = null, f.initPTS = V, f.timescale = N, f.trackId = W);
10013
10013
  } else
10014
10014
  this.warn(`No audio or video samples found for initPTS at playlist time: ${r}`);
10015
- l ? (f.initPTS = l.baseTime, f.timescale = l.timescale, f.trackId = l.trackId) : ((!f.timescale || f.trackId === void 0 || f.initPTS === void 0) && (this.warn("Could not set initPTS"), f.initPTS = P, f.timescale = 1, f.trackId = -1), this.initPTS = l = {
10015
+ l ? (f.initPTS = l.baseTime, f.timescale = l.timescale, f.trackId = l.trackId) : ((!f.timescale || f.trackId === void 0 || f.initPTS === void 0) && (this.warn("Could not set initPTS"), f.initPTS = C, f.timescale = 1, f.trackId = -1), this.initPTS = l = {
10016
10016
  baseTime: f.initPTS,
10017
10017
  timescale: f.timescale,
10018
10018
  trackId: f.trackId
10019
10019
  });
10020
- const L = P - l.baseTime / l.timescale, k = L + x;
10020
+ const L = C - l.baseTime / l.timescale, k = L + x;
10021
10021
  x > 0 ? this.lastEndTime = k : (this.warn("Duration parsed from mp4 should be greater than zero"), this.resetNextTimestamp());
10022
- const C = !!g.audio, M = !!g.video;
10022
+ const P = !!g.audio, M = !!g.video;
10023
10023
  let $ = "";
10024
- C && ($ += "audio"), M && ($ += "video");
10025
- const N = (g.audio ? g.audio.encrypted : !1) || (g.video ? g.video.encrypted : !1), F = {
10024
+ P && ($ += "audio"), M && ($ += "video");
10025
+ const B = (g.audio ? g.audio.encrypted : !1) || (g.video ? g.video.encrypted : !1), F = {
10026
10026
  data1: d,
10027
10027
  startPTS: L,
10028
10028
  startDTS: L,
10029
10029
  endPTS: k,
10030
10030
  endDTS: k,
10031
10031
  type: $,
10032
- hasAudio: C,
10032
+ hasAudio: P,
10033
10033
  hasVideo: M,
10034
10034
  nb: 1,
10035
10035
  dropped: 0,
10036
- encrypted: N
10036
+ encrypted: B
10037
10037
  };
10038
- h.audio = C && !M ? F : void 0, h.video = M ? F : void 0;
10038
+ h.audio = P && !M ? F : void 0, h.video = M ? F : void 0;
10039
10039
  const U = E?.sampleCount;
10040
10040
  if (U) {
10041
- const B = E.keyFrameIndex, V = B !== -1;
10042
- F.nb = U, F.dropped = B === 0 || this.isVideoContiguous ? 0 : V ? B : U, F.independent = V, F.firstKeyFrame = B, V && E.keyFrameStart && (F.firstKeyFramePTS = (E.keyFrameStart - l.baseTime) / l.timescale), this.isVideoContiguous || (h.independent = V), this.isVideoContiguous || (this.isVideoContiguous = V), F.dropped && this.warn(`fmp4 does not start with IDR: firstIDR ${B}/${U} dropped: ${F.dropped} start: ${F.firstKeyFramePTS || "NA"}`);
10041
+ const N = E.keyFrameIndex, V = N !== -1;
10042
+ F.nb = U, F.dropped = N === 0 || this.isVideoContiguous ? 0 : V ? N : U, F.independent = V, F.firstKeyFrame = N, V && E.keyFrameStart && (F.firstKeyFramePTS = (E.keyFrameStart - l.baseTime) / l.timescale), this.isVideoContiguous || (h.independent = V), this.isVideoContiguous || (this.isVideoContiguous = V), F.dropped && this.warn(`fmp4 does not start with IDR: firstIDR ${N}/${U} dropped: ${F.dropped} start: ${F.firstKeyFramePTS || "NA"}`);
10043
10043
  }
10044
10044
  return h.initSegment = f, h.id3 = Sa(s, r, l, l), i.samples.length && (h.text = xa(i, r, l)), h;
10045
10045
  }
@@ -10115,8 +10115,8 @@ class qr {
10115
10115
  if (I.isSync()) {
10116
10116
  let L = I.softwareDecrypt(n, S.key.buffer, S.iv.buffer, b);
10117
10117
  if (s.part > -1) {
10118
- const C = I.flush();
10119
- L = C && C.buffer;
10118
+ const P = I.flush();
10119
+ L = P && P.buffer;
10120
10120
  }
10121
10121
  if (!L)
10122
10122
  return r.executeEnd = Ze(), Hs(s);
@@ -10140,10 +10140,10 @@ class qr {
10140
10140
  }), r.executeEnd = Ze(), Hs(s);
10141
10141
  }
10142
10142
  (u || h || g || A) && this.resetInitSegment(v, p, y, T, t), (u || g || A) && this.resetInitialTimestamp(E), l || this.resetContiguity();
10143
- const P = this.transmux(n, S, f, d, s);
10144
- this.asyncResult = Ht(P);
10143
+ const C = this.transmux(n, S, f, d, s);
10144
+ this.asyncResult = Ht(C);
10145
10145
  const x = this.currentTransmuxState;
10146
- return x.contiguous = !0, x.discontinuity = !1, x.trackSwitch = !1, r.executeEnd = Ze(), P;
10146
+ return x.contiguous = !0, x.discontinuity = !1, x.trackSwitch = !1, r.executeEnd = Ze(), C;
10147
10147
  }
10148
10148
  // Due to data caching, flush calls can produce more than one TransmuxerResult (hence the Array type)
10149
10149
  flush(e) {
@@ -10398,7 +10398,7 @@ class Aa {
10398
10398
  const {
10399
10399
  instanceNo: f,
10400
10400
  transmuxer: g
10401
- } = this, p = n ? n.start : r.start, y = r.decryptdata, E = this.frag, T = !(E && r.cc === E.cc), v = !(E && l.level === E.level), S = E ? l.sn - E.sn : -1, A = this.part ? l.part - this.part.index : -1, P = S === 0 && l.id > 1 && l.id === E?.stats.chunkCount, x = !v && (S === 1 || S === 0 && (A === 1 || P && A <= 0)), I = self.performance.now();
10401
+ } = this, p = n ? n.start : r.start, y = r.decryptdata, E = this.frag, T = !(E && r.cc === E.cc), v = !(E && l.level === E.level), S = E ? l.sn - E.sn : -1, A = this.part ? l.part - this.part.index : -1, C = S === 0 && l.id > 1 && l.id === E?.stats.chunkCount, x = !v && (S === 1 || S === 0 && (A === 1 || C && A <= 0)), I = self.performance.now();
10402
10402
  (v || S || r.stats.parsing.start === 0) && (r.stats.parsing.start = I), n && (A || !x) && (n.stats.parsing.start = I);
10403
10403
  const b = !(E && ((h = r.initSegment) == null ? void 0 : h.url) === ((d = E.initSegment) == null ? void 0 : d.url)), L = new Kc(T, x, c, v, p, b);
10404
10404
  if (!x || T || b) {
@@ -10423,10 +10423,10 @@ class Aa {
10423
10423
  }, e instanceof ArrayBuffer ? [e] : []);
10424
10424
  else if (g) {
10425
10425
  const k = g.push(e, y, l, L);
10426
- Ht(k) ? k.then((C) => {
10427
- this.handleTransmuxComplete(C);
10428
- }).catch((C) => {
10429
- this.transmuxerError(C, l, "transmuxer-interface push error");
10426
+ Ht(k) ? k.then((P) => {
10427
+ this.handleTransmuxComplete(P);
10428
+ }).catch((P) => {
10429
+ this.transmuxerError(P, l, "transmuxer-interface push error");
10430
10430
  }) : this.handleTransmuxComplete(k);
10431
10431
  }
10432
10432
  }
@@ -11093,8 +11093,8 @@ class Ki extends Me {
11093
11093
  return;
11094
11094
  let p, y, E;
11095
11095
  if (i.canBlockReload && i.endSN && i.advanced) {
11096
- const T = this.hls.config.lowLatencyMode, v = i.lastPartSn, S = i.endSN, A = i.lastPartIndex, P = A !== -1, x = v === S;
11097
- P ? x ? (y = S + 1, E = T ? 0 : A) : (y = v, E = T ? A + 1 : i.maxPartIndex) : y = S + 1;
11096
+ const T = this.hls.config.lowLatencyMode, v = i.lastPartSn, S = i.endSN, A = i.lastPartIndex, C = A !== -1, x = v === S;
11097
+ C ? x ? (y = S + 1, E = T ? 0 : A) : (y = v, E = T ? A + 1 : i.maxPartIndex) : y = S + 1;
11098
11098
  const I = i.age, b = I + i.ageHeader;
11099
11099
  let L = Math.min(b - i.partTarget, i.targetduration * 1.5);
11100
11100
  if (L > 0) {
@@ -11105,8 +11105,8 @@ class Ki extends Me {
11105
11105
  else {
11106
11106
  const k = Math.floor(L / i.targetduration);
11107
11107
  if (y += k, E !== void 0) {
11108
- const C = Math.round(L % i.targetduration / i.partTarget);
11109
- E += C;
11108
+ const P = Math.round(L % i.targetduration / i.partTarget);
11109
+ E += P;
11110
11110
  }
11111
11111
  this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${I.toFixed(2)}s goal: ${L} skip sn ${k} to part ${E}`);
11112
11112
  }
@@ -11737,7 +11737,7 @@ transfer tracks: ${le(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !Sn(i,
11737
11737
  supplemental: E
11738
11738
  } = h;
11739
11739
  let T = i[c];
11740
- const v = (l = this.transferData) == null || (l = l.tracks) == null ? void 0 : l[c], S = v != null && v.buffer ? v : T, A = S?.pendingCodec || S?.codec, P = S?.levelCodec;
11740
+ const v = (l = this.transferData) == null || (l = l.tracks) == null ? void 0 : l[c], S = v != null && v.buffer ? v : T, A = S?.pendingCodec || S?.codec, C = S?.levelCodec;
11741
11741
  T || (T = i[c] = {
11742
11742
  buffer: void 0,
11743
11743
  listeners: [],
@@ -11748,7 +11748,7 @@ transfer tracks: ${le(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !Sn(i,
11748
11748
  metadata: y,
11749
11749
  id: d
11750
11750
  });
11751
- const x = cs(A, P), I = x?.replace(Qr, "$1");
11751
+ const x = cs(A, C), I = x?.replace(Qr, "$1");
11752
11752
  let b = cs(f, g);
11753
11753
  const L = (u = b) == null ? void 0 : u.replace(Qr, "$1");
11754
11754
  b && x && I !== L && (c.slice(0, 5) === "audio" && (b = Es(b, this.appendSource)), this.log(`switching codec ${A} to ${b}`), b !== (T.pendingCodec || T.codec) && (T.pendingCodec = b), T.container = p, this.appendChangeType(c, p, b));
@@ -11843,8 +11843,8 @@ transfer tracks: ${le(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !Sn(i,
11843
11843
  if (S && d !== "initSegment") {
11844
11844
  const x = c || o, I = this.blockedAudioAppend;
11845
11845
  if (r === "audio" && n !== "main" && !this.blockedAudioAppend && !(v.ending || v.ended)) {
11846
- const L = x.start + x.duration * 0.05, k = S.buffered, C = this.currentOp("video");
11847
- !k.length && !C ? this.blockAudio(x) : !C && !X.isBuffered(S, L) && this.lastVideoAppendEnd < L && this.blockAudio(x);
11846
+ const L = x.start + x.duration * 0.05, k = S.buffered, P = this.currentOp("video");
11847
+ !k.length && !P ? this.blockAudio(x) : !P && !X.isBuffered(S, L) && this.lastVideoAppendEnd < L && this.blockAudio(x);
11848
11848
  } else if (r === "video") {
11849
11849
  const b = x.end;
11850
11850
  if (I) {
@@ -11854,7 +11854,7 @@ transfer tracks: ${le(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !Sn(i,
11854
11854
  this.lastVideoAppendEnd = b;
11855
11855
  }
11856
11856
  }
11857
- const A = (c || o).start, P = {
11857
+ const A = (c || o).start, C = {
11858
11858
  label: `append-${r}`,
11859
11859
  execute: () => {
11860
11860
  var x;
@@ -11906,7 +11906,7 @@ transfer tracks: ${le(i, (c, l) => c === "initSegment" ? void 0 : l)}}`), !Sn(i,
11906
11906
  this.hls.trigger(m.ERROR, b);
11907
11907
  }
11908
11908
  };
11909
- this.log(`queuing "${r}" append sn: ${d}${c ? " p: " + c.index : ""} of ${o.type === K.MAIN ? "level" : "track"} ${o.level} cc: ${f}`), this.append(P, r, this.isPending(this.tracks[r]));
11909
+ this.log(`queuing "${r}" append sn: ${d}${c ? " p: " + c.index : ""} of ${o.type === K.MAIN ? "level" : "track"} ${o.level} cc: ${f}`), this.append(C, r, this.isPending(this.tracks[r]));
11910
11910
  }
11911
11911
  getFlushOp(e, t, s) {
11912
11912
  return this.log(`queuing "${e}" remove ${t}-${s}`), {
@@ -14974,7 +14974,7 @@ class ih extends Me {
14974
14974
  let c = 0, l = 0;
14975
14975
  if (e.forEach((u, h) => {
14976
14976
  const d = u.cue.pre, f = u.cue.post, g = e[h - 1] || null, p = u.appendInPlace, y = f ? r : u.startOffset, E = u.duration, T = u.timelineOccupancy === bs.Range ? E : 0, v = u.resumptionOffset, S = g?.startTime === y, A = y + u.cumulativeDuration;
14977
- let P = p ? A + E : y + v;
14977
+ let C = p ? A + E : y + v;
14978
14978
  if (d || !f && y <= 0) {
14979
14979
  const I = l;
14980
14980
  l += T, u.timelineStart = A;
@@ -14982,7 +14982,7 @@ class ih extends Me {
14982
14982
  n += E, s.push({
14983
14983
  event: u,
14984
14984
  start: A,
14985
- end: P,
14985
+ end: C,
14986
14986
  playout: {
14987
14987
  start: b,
14988
14988
  end: n
@@ -14996,7 +14996,7 @@ class ih extends Me {
14996
14996
  if (!S) {
14997
14997
  const L = y - c;
14998
14998
  if (L > nn) {
14999
- const k = c, C = l;
14999
+ const k = c, P = l;
15000
15000
  l += L;
15001
15001
  const M = n;
15002
15002
  n += L;
@@ -15010,21 +15010,21 @@ class ih extends Me {
15010
15010
  end: n
15011
15011
  },
15012
15012
  integrated: {
15013
- start: C,
15013
+ start: P,
15014
15014
  end: l
15015
15015
  }
15016
15016
  };
15017
15017
  s.push($);
15018
15018
  } else L > 0 && g && (g.cumulativeDuration += L, s[s.length - 1].end = y);
15019
15019
  }
15020
- f && (P = A), u.timelineStart = A;
15020
+ f && (C = A), u.timelineStart = A;
15021
15021
  const I = l;
15022
15022
  l += T;
15023
15023
  const b = n;
15024
15024
  n += E, s.push({
15025
15025
  event: u,
15026
15026
  start: A,
15027
- end: P,
15027
+ end: C,
15028
15028
  playout: {
15029
15029
  start: b,
15030
15030
  end: n
@@ -15407,8 +15407,8 @@ Schedule: ${c.map((p) => Be(p))} pos: ${this.timelinePos}`), u.length && this.lo
15407
15407
  if (p != null && (f = p.event) != null && f.restrictions.skip || !e.schedule)
15408
15408
  return;
15409
15409
  e.log(`seek to ${h} "${d}"`);
15410
- const y = e.effectivePlayingItem, E = e.schedule.findItemIndexAtTime(h, d), T = (g = e.schedule.items) == null ? void 0 : g[E], v = e.getBufferingPlayer(), S = v?.interstitial, A = S?.appendInPlace, P = y && e.itemsMatch(y, T);
15411
- if (y && (A || P)) {
15410
+ const y = e.effectivePlayingItem, E = e.schedule.findItemIndexAtTime(h, d), T = (g = e.schedule.items) == null ? void 0 : g[E], v = e.getBufferingPlayer(), S = v?.interstitial, A = S?.appendInPlace, C = y && e.itemsMatch(y, T);
15411
+ if (y && (A || C)) {
15412
15412
  const x = s(e.playingAsset), I = x?.media || e.primaryMedia;
15413
15413
  if (I) {
15414
15414
  const b = d === "primary" ? I.currentTime : i(y, d, e.playingAsset, "timelinePos", "currentTime"), L = h - b, k = (A ? b : I.currentTime) + L;
@@ -15441,10 +15441,10 @@ Schedule: ${c.map((p) => Be(p))} pos: ${this.timelinePos}`), u.length && this.lo
15441
15441
  if (I)
15442
15442
  e.timelinePos = x, e.checkBuffer();
15443
15443
  else {
15444
- const k = T.event.assetList, C = h - (T[d] || T).start;
15444
+ const k = T.event.assetList, P = h - (T[d] || T).start;
15445
15445
  for (let M = k.length; M--; ) {
15446
15446
  const $ = k[M];
15447
- if ($.duration && C >= $.startOffset && C < $.startOffset + $.duration) {
15447
+ if ($.duration && P >= $.startOffset && P < $.startOffset + $.duration) {
15448
15448
  L = M;
15449
15449
  break;
15450
15450
  }
@@ -16238,8 +16238,8 @@ Schedule: ${c.map((p) => Be(p))} pos: ${this.timelinePos}`), u.length && this.lo
16238
16238
  this.handleAssetItemError(b, e, L, s, I.message);
16239
16239
  return;
16240
16240
  }
16241
- const P = S.edge - S.fragmentStart, x = t.duration;
16242
- (p || x === null || P > x) && (p = !1, this.log(`Interstitial asset "${h}" duration change ${x} > ${P}`), t.duration = P, this.updateSchedule());
16241
+ const C = S.edge - S.fragmentStart, x = t.duration;
16242
+ (p || x === null || C > x) && (p = !1, this.log(`Interstitial asset "${h}" duration change ${x} > ${C}`), t.duration = C, this.updateSchedule());
16243
16243
  };
16244
16244
  g.on(m.LEVEL_UPDATED, (S, {
16245
16245
  details: A
@@ -16247,11 +16247,11 @@ Schedule: ${c.map((p) => Be(p))} pos: ${this.timelinePos}`), u.length && this.lo
16247
16247
  details: A
16248
16248
  }) => y(A)), g.on(m.EVENT_CUE_ENTER, () => this.onInterstitialCueEnter());
16249
16249
  const E = (S, A) => {
16250
- const P = this.getAssetPlayer(h);
16251
- if (P && A.tracks) {
16252
- P.off(m.BUFFER_CODECS, E), P.tracks = A.tracks;
16250
+ const C = this.getAssetPlayer(h);
16251
+ if (C && A.tracks) {
16252
+ C.off(m.BUFFER_CODECS, E), C.tracks = A.tracks;
16253
16253
  const x = this.primaryMedia;
16254
- this.bufferingAsset === P.assetItem && x && !P.media && this.bufferAssetPlayer(P, x);
16254
+ this.bufferingAsset === C.assetItem && x && !C.media && this.bufferAssetPlayer(C, x);
16255
16255
  }
16256
16256
  };
16257
16257
  g.on(m.BUFFER_CODECS, E);
@@ -16260,7 +16260,7 @@ Schedule: ${c.map((p) => Be(p))} pos: ${this.timelinePos}`), u.length && this.lo
16260
16260
  const A = this.getAssetPlayer(h);
16261
16261
  if (this.log(`buffered to end of asset ${A}`), !A || !this.schedule)
16262
16262
  return;
16263
- const P = this.schedule.findEventIndex(e.identifier), x = (S = this.schedule.items) == null ? void 0 : S[P];
16263
+ const C = this.schedule.findEventIndex(e.identifier), x = (S = this.schedule.items) == null ? void 0 : S[C];
16264
16264
  this.isInterstitial(x) && this.advanceAssetBuffering(x, t);
16265
16265
  };
16266
16266
  g.on(m.BUFFERED_TO_END, T);
@@ -16268,15 +16268,15 @@ Schedule: ${c.map((p) => Be(p))} pos: ${this.timelinePos}`), u.length && this.lo
16268
16268
  if (!this.getAssetPlayer(h) || !this.schedule)
16269
16269
  return;
16270
16270
  this.shouldPlay = !0;
16271
- const P = this.schedule.findEventIndex(e.identifier);
16272
- this.advanceAfterAssetEnded(e, P, S);
16271
+ const C = this.schedule.findEventIndex(e.identifier);
16272
+ this.advanceAfterAssetEnded(e, C, S);
16273
16273
  };
16274
16274
  return g.once(m.MEDIA_ENDED, v(s)), g.once(m.PLAYOUT_LIMIT_REACHED, v(1 / 0)), g.on(m.ERROR, (S, A) => {
16275
16275
  if (!this.schedule)
16276
16276
  return;
16277
- const P = this.getAssetPlayer(h);
16277
+ const C = this.getAssetPlayer(h);
16278
16278
  if (A.details === D.BUFFER_STALLED_ERROR) {
16279
- if (P != null && P.appendInPlace) {
16279
+ if (C != null && C.appendInPlace) {
16280
16280
  this.handleInPlaceStall(e);
16281
16281
  return;
16282
16282
  }
@@ -16287,13 +16287,13 @@ Schedule: ${c.map((p) => Be(p))} pos: ${this.timelinePos}`), u.length && this.lo
16287
16287
  }), g.on(m.DESTROYING, () => {
16288
16288
  if (!this.getAssetPlayer(h) || !this.schedule)
16289
16289
  return;
16290
- const A = new Error(`Asset player destroyed unexpectedly ${h}`), P = {
16290
+ const A = new Error(`Asset player destroyed unexpectedly ${h}`), C = {
16291
16291
  fatal: !0,
16292
16292
  type: Y.OTHER_ERROR,
16293
16293
  details: D.INTERSTITIAL_ASSET_ITEM_ERROR,
16294
16294
  error: A
16295
16295
  };
16296
- this.handleAssetItemError(P, e, this.schedule.findEventIndex(e.identifier), s, A.message);
16296
+ this.handleAssetItemError(C, e, this.schedule.findEventIndex(e.identifier), s, A.message);
16297
16297
  }), this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${xt(t)}`), this.hls.trigger(m.INTERSTITIAL_ASSET_PLAYER_CREATED, {
16298
16298
  asset: t,
16299
16299
  assetListIndex: s,
@@ -17515,7 +17515,7 @@ var Wi = (function() {
17515
17515
  enumerable: !0
17516
17516
  };
17517
17517
  u.hasBeenReset = !1;
17518
- let d = "", f = !1, g = o, p = c, y = l, E = null, T = "", v = !0, S = "auto", A = "start", P = 50, x = "middle", I = 50, b = "middle";
17518
+ let d = "", f = !1, g = o, p = c, y = l, E = null, T = "", v = !0, S = "auto", A = "start", C = 50, x = "middle", I = 50, b = "middle";
17519
17519
  Object.defineProperty(u, "id", r({}, h, {
17520
17520
  get: function() {
17521
17521
  return d;
@@ -17600,12 +17600,12 @@ var Wi = (function() {
17600
17600
  }
17601
17601
  })), Object.defineProperty(u, "position", r({}, h, {
17602
17602
  get: function() {
17603
- return P;
17603
+ return C;
17604
17604
  },
17605
17605
  set: function(L) {
17606
17606
  if (L < 0 || L > 100)
17607
17607
  throw new Error("Position must be between 0 and 100.");
17608
- P = L, this.hasBeenReset = !0;
17608
+ C = L, this.hasBeenReset = !0;
17609
17609
  }
17610
17610
  })), Object.defineProperty(u, "positionAlign", r({}, h, {
17611
17611
  get: function() {
@@ -17913,8 +17913,8 @@ function Rh(a, e, t, s, i, r, n) {
17913
17913
  }
17914
17914
  const S = y.endTime - y.startTime, A = De((y.startTime + T - f) * 9e4, i * 9e4) / 9e4;
17915
17915
  y.startTime = Math.max(A, 0), y.endTime = Math.max(A + S, 0);
17916
- const P = y.text.trim();
17917
- y.text = decodeURIComponent(encodeURIComponent(P)), y.id || (y.id = ji(y.startTime, y.endTime, P)), y.endTime > 0 && l.push(y);
17916
+ const C = y.text.trim();
17917
+ y.text = decodeURIComponent(encodeURIComponent(C)), y.id || (y.id = ji(y.startTime, y.endTime, C)), y.endTime > 0 && l.push(y);
17918
17918
  }, o.onparsingerror = function(y) {
17919
17919
  g = y;
17920
17920
  }, o.onflush = function() {
@@ -19229,7 +19229,7 @@ class Zh extends Kn {
19229
19229
  }
19230
19230
  const h = X.bufferInfo(n, e, 0), d = h.nextStart || 0, f = this.fragmentTracker;
19231
19231
  if (o && f && this.hls) {
19232
- const P = pn(this.hls.inFlightFragments, e), x = h.len > ps, I = !d || P || d - e > ps && !f.getPartialFragment(e);
19232
+ const C = pn(this.hls.inFlightFragments, e), x = h.len > ps, I = !d || C || d - e > ps && !f.getPartialFragment(e);
19233
19233
  if (x || I)
19234
19234
  return;
19235
19235
  this.moved = !1;
@@ -19685,40 +19685,40 @@ class ed {
19685
19685
  this.id3Track || (this.id3Track = this.createTrack(this.media));
19686
19686
  for (let p = 0; p < u.length; p++) {
19687
19687
  const y = u[p], E = l[y], T = E.startTime, v = h[y], S = v?.cues || {};
19688
- let A = v?.durationKnown || !1, P = ls;
19688
+ let A = v?.durationKnown || !1, C = ls;
19689
19689
  const {
19690
19690
  duration: x,
19691
19691
  endDate: I
19692
19692
  } = E;
19693
19693
  if (I && x !== null)
19694
- P = T + x, A = !0;
19694
+ C = T + x, A = !0;
19695
19695
  else if (E.endOnNext && !A) {
19696
- const L = u.reduce((k, C) => {
19697
- if (C !== E.id) {
19698
- const M = l[C];
19696
+ const L = u.reduce((k, P) => {
19697
+ if (P !== E.id) {
19698
+ const M = l[P];
19699
19699
  if (M.class === E.class && M.startDate > E.startDate && (!k || E.startDate < k.startDate))
19700
19700
  return M;
19701
19701
  }
19702
19702
  return k;
19703
19703
  }, null);
19704
- L && (P = L.startTime, A = !0);
19704
+ L && (C = L.startTime, A = !0);
19705
19705
  }
19706
19706
  const b = Object.keys(E.attr);
19707
19707
  for (let L = 0; L < b.length; L++) {
19708
19708
  const k = b[L];
19709
19709
  if (!Sl(k))
19710
19710
  continue;
19711
- const C = S[k];
19712
- if (C)
19713
- A && !(v != null && v.durationKnown) ? C.endTime = P : Math.abs(C.startTime - T) > 0.01 && (C.startTime = T, C.endTime = P);
19711
+ const P = S[k];
19712
+ if (P)
19713
+ A && !(v != null && v.durationKnown) ? P.endTime = C : Math.abs(P.startTime - T) > 0.01 && (P.startTime = T, P.endTime = C);
19714
19714
  else if (o) {
19715
19715
  let M = E.attr[k];
19716
19716
  xl(k) && (M = xn(M));
19717
- const N = ei(o, T, P, {
19717
+ const B = ei(o, T, C, {
19718
19718
  key: k,
19719
19719
  data: M
19720
19720
  }, Ce.dateRange);
19721
- N && (N.id = y, this.id3Track.addCue(N), S[k] = N, n && (k === "X-ASSET-LIST" || k === "X-ASSET-URL") && N.addEventListener("enter", this.onEventCueEnter));
19721
+ B && (B.id = y, this.id3Track.addCue(B), S[k] = B, n && (k === "X-ASSET-LIST" || k === "X-ASSET-URL") && B.addEventListener("enter", this.onEventCueEnter));
19722
19722
  }
19723
19723
  }
19724
19724
  h[y] = {
@@ -19926,9 +19926,9 @@ class sd extends Ki {
19926
19926
  "FRAME-RATE": v,
19927
19927
  "HDCP-LEVEL": S,
19928
19928
  "PATHWAY-ID": A,
19929
- RESOLUTION: P,
19929
+ RESOLUTION: C,
19930
19930
  "VIDEO-RANGE": x
19931
- } = h, b = `${`${A || "."}-`}${u.bitrate}-${P}-${v}-${T}-${x}-${S}`;
19931
+ } = h, b = `${`${A || "."}-`}${u.bitrate}-${C}-${v}-${T}-${x}-${S}`;
19932
19932
  if (r[b])
19933
19933
  if (r[b].uri !== u.url && !u.attrs["PATHWAY-ID"]) {
19934
19934
  const L = n[b] += 1;
@@ -19970,7 +19970,7 @@ class sd extends Ki {
19970
19970
  Promise.resolve().then(() => {
19971
19971
  if (this.hls) {
19972
19972
  let T = "no level with compatible codecs found in manifest", v = T;
19973
- t.levels.length && (v = `one or more CODECS in variant not supported: ${le(t.levels.map((A) => A.attrs.CODECS).filter((A, P, x) => x.indexOf(A) === P))}`, this.warn(v), T += ` (${v})`);
19973
+ t.levels.length && (v = `one or more CODECS in variant not supported: ${le(t.levels.map((A) => A.attrs.CODECS).filter((A, C, x) => x.indexOf(A) === C))}`, this.warn(v), T += ` (${v})`);
19974
19974
  const S = new Error(T);
19975
19975
  this.hls.trigger(m.ERROR, {
19976
19976
  type: Y.MEDIA_ERROR,
@@ -20792,14 +20792,14 @@ class ad extends Oi {
20792
20792
  startPTS: v,
20793
20793
  endPTS: S,
20794
20794
  startDTS: A,
20795
- endDTS: P
20795
+ endDTS: C
20796
20796
  } = u;
20797
20797
  if (c)
20798
20798
  c.elementaryStreams[u.type] = {
20799
20799
  startPTS: v,
20800
20800
  endPTS: S,
20801
20801
  startDTS: A,
20802
- endDTS: P
20802
+ endDTS: C
20803
20803
  };
20804
20804
  else if (u.firstKeyFrame && u.independent && r.id === 1 && !T && (this.couldBacktrack = !0), u.dropped && u.independent) {
20805
20805
  const x = this.getMainFwdBufferInfo(), I = (x ? x.end : this.getLoadPosition()) + this.config.maxBufferHole, b = u.firstKeyFramePTS ? u.firstKeyFramePTS : v;
@@ -20807,9 +20807,9 @@ class ad extends Oi {
20807
20807
  this.backtrack(o);
20808
20808
  return;
20809
20809
  } else T && (o.gap = !0);
20810
- o.setElementaryStreamInfo(u.type, o.start, S, o.start, P, !0);
20810
+ o.setElementaryStreamInfo(u.type, o.start, S, o.start, C, !0);
20811
20811
  } else E && v - (g.appliedTimelineOffset || 0) > ps && (o.gap = !0);
20812
- o.setElementaryStreamInfo(u.type, v, S, A, P), this.backtrackFragment && (this.backtrackFragment = o), this.bufferFragmentData(u, o, c, r, E || T);
20812
+ o.setElementaryStreamInfo(u.type, v, S, A, C), this.backtrackFragment && (this.backtrackFragment = o), this.bufferFragmentData(u, o, c, r, E || T);
20813
20813
  } else if (E || T)
20814
20814
  o.gap = !0;
20815
20815
  else {
@@ -21409,11 +21409,11 @@ class ld {
21409
21409
  } = this.hls.config;
21410
21410
  let {
21411
21411
  audioCodec: A,
21412
- videoCodec: P
21412
+ videoCodec: C
21413
21413
  } = T;
21414
21414
  for (let x = v.length; x--; ) {
21415
21415
  const I = v[x];
21416
- Ut(I, "audio", S) ? (T.audioCodec = A = A ? `${A},${I}` : I, _t.audio[A.substring(0, 4)] = 2, v.splice(x, 1)) : Ut(I, "video", S) && (T.videoCodec = P = P ? `${P},${I}` : I, _t.video[P.substring(0, 4)] = 2, v.splice(x, 1));
21416
+ Ut(I, "audio", S) ? (T.audioCodec = A = A ? `${A},${I}` : I, _t.audio[A.substring(0, 4)] = 2, v.splice(x, 1)) : Ut(I, "video", S) && (T.videoCodec = C = C ? `${C},${I}` : I, _t.video[C.substring(0, 4)] = 2, v.splice(x, 1));
21417
21417
  }
21418
21418
  }
21419
21419
  });
@@ -21693,16 +21693,16 @@ class Pe {
21693
21693
  capLevelController: n,
21694
21694
  errorController: o,
21695
21695
  fpsController: c
21696
- } = s, l = new o(this), u = this.abrController = new i(this), h = new cl(this), d = s.interstitialsController, f = d ? this.interstitialsController = new d(this, Pe) : null, g = this.bufferController = new r(this, h), p = this.capLevelController = new n(this), y = new c(this), E = new ld(this), T = s.contentSteeringController, v = T ? new T(this) : null, S = this.levelController = new sd(this, v), A = new ed(this), P = new od(this.config, this.logger), x = this.streamController = new ad(this, h, P), I = this.gapController = new Zh(this, h);
21696
+ } = s, l = new o(this), u = this.abrController = new i(this), h = new cl(this), d = s.interstitialsController, f = d ? this.interstitialsController = new d(this, Pe) : null, g = this.bufferController = new r(this, h), p = this.capLevelController = new n(this), y = new c(this), E = new ld(this), T = s.contentSteeringController, v = T ? new T(this) : null, S = this.levelController = new sd(this, v), A = new ed(this), C = new od(this.config, this.logger), x = this.streamController = new ad(this, h, C), I = this.gapController = new Zh(this, h);
21697
21697
  p.setStreamController(x), y.setStreamController(x);
21698
21698
  const b = [E, S, x];
21699
21699
  f && b.splice(1, 0, f), v && b.splice(1, 0, v), this.networkControllers = b;
21700
21700
  const L = [u, g, I, p, y, A, h];
21701
21701
  this.audioTrackController = this.createController(s.audioTrackController, b);
21702
21702
  const k = s.audioStreamController;
21703
- k && b.push(this.audioStreamController = new k(this, h, P)), this.subtitleTrackController = this.createController(s.subtitleTrackController, b);
21704
- const C = s.subtitleStreamController;
21705
- C && b.push(this.subtititleStreamController = new C(this, h, P)), this.createController(s.timelineController, L), P.emeController = this.emeController = this.createController(s.emeController, L), this.cmcdController = this.createController(s.cmcdController, L), this.latencyController = this.createController(td, L), this.coreComponents = L, b.push(l);
21703
+ k && b.push(this.audioStreamController = new k(this, h, C)), this.subtitleTrackController = this.createController(s.subtitleTrackController, b);
21704
+ const P = s.subtitleStreamController;
21705
+ P && b.push(this.subtititleStreamController = new P(this, h, C)), this.createController(s.timelineController, L), C.emeController = this.emeController = this.createController(s.emeController, L), this.cmcdController = this.createController(s.cmcdController, L), this.latencyController = this.createController(td, L), this.coreComponents = L, b.push(l);
21706
21706
  const M = l.onErrorOut;
21707
21707
  typeof M == "function" && this.on(m.ERROR, M, l), this.on(m.MANIFEST_LOADED, E.onManifestLoaded, E);
21708
21708
  }
@@ -22454,60 +22454,60 @@ const cd = async ({
22454
22454
  ft(() => {
22455
22455
  o(!1), l([]), h(-1), f(!1), v(!1);
22456
22456
  }, [a]), ft(() => {
22457
- const C = t.current;
22458
- if (!C || !T) return;
22459
- f(!C.paused), p(C.volume), E(C.muted);
22457
+ const P = t.current;
22458
+ if (!P || !T) return;
22459
+ f(!P.paused), p(P.volume), E(P.muted);
22460
22460
  const M = localStorage.getItem("hls-player-volume");
22461
- M && (C.volume = parseFloat(M), p(parseFloat(M)));
22461
+ M && (P.volume = parseFloat(M), p(parseFloat(M)));
22462
22462
  const $ = () => {
22463
- f(!C.paused), p(C.volume), E(C.muted);
22463
+ f(!P.paused), p(P.volume), E(P.muted);
22464
22464
  };
22465
- return C.addEventListener("play", $), C.addEventListener("pause", $), C.addEventListener("volumechange", $), () => {
22466
- C.removeEventListener("play", $), C.removeEventListener("pause", $), C.removeEventListener("volumechange", $);
22465
+ return P.addEventListener("play", $), P.addEventListener("pause", $), P.addEventListener("volumechange", $), () => {
22466
+ P.removeEventListener("play", $), P.removeEventListener("pause", $), P.removeEventListener("volumechange", $);
22467
22467
  };
22468
22468
  }, [t, T]);
22469
- const P = ri(S), x = dt(async () => {
22470
- const C = t.current;
22471
- if (!(!C || C.paused === !1))
22469
+ const C = ri(S), x = dt(async () => {
22470
+ const P = t.current;
22471
+ if (!(!P || P.paused === !1))
22472
22472
  try {
22473
- await C.play();
22473
+ await P.play();
22474
22474
  } catch {
22475
22475
  console.log("Autoplay blocked, waiting for user interaction");
22476
22476
  }
22477
22477
  }, [t]);
22478
22478
  ft(() => {
22479
- S && !P.current && r.current && a && (console.log("Stream came back online, reloading source"), r.current.loadSource(
22479
+ S && !C.current && r.current && a && (console.log("Stream came back online, reloading source"), r.current.loadSource(
22480
22480
  ii(a, e)
22481
- ), x()), P.current = S;
22481
+ ), x()), C.current = S;
22482
22482
  }, [S, a, x]), ft(() => {
22483
22483
  if (!a || !t.current) return;
22484
- const C = t.current;
22484
+ const P = t.current;
22485
22485
  if (Pe.isSupported()) {
22486
22486
  const M = new Pe(A);
22487
- return r.current = M, M.loadSource(ii(a, e)), M.attachMedia(C), v(!0), M.on(Pe.Events.MANIFEST_PARSED, ($, N) => {
22487
+ return r.current = M, M.loadSource(ii(a, e)), M.attachMedia(P), v(!0), M.on(Pe.Events.MANIFEST_PARSED, ($, B) => {
22488
22488
  l(
22489
- N.levels.map((F, U) => ({
22489
+ B.levels.map((F, U) => ({
22490
22490
  level: U,
22491
22491
  height: F.height,
22492
22492
  label: `${F.height}p`
22493
22493
  }))
22494
22494
  ), x();
22495
- }), M.on(Pe.Events.ERROR, ($, N) => {
22496
- N.fatal && (N.type === Pe.ErrorTypes.NETWORK_ERROR ? setTimeout(() => M.startLoad(), 5e3) : N.type === Pe.ErrorTypes.MEDIA_ERROR ? M.recoverMediaError() : (o(!0), s?.({
22497
- type: N.type,
22498
- message: N.details || "Unknown error",
22495
+ }), M.on(Pe.Events.ERROR, ($, B) => {
22496
+ B.fatal && (B.type === Pe.ErrorTypes.NETWORK_ERROR ? setTimeout(() => M.startLoad(), 5e3) : B.type === Pe.ErrorTypes.MEDIA_ERROR ? M.recoverMediaError() : (o(!0), s?.({
22497
+ type: B.type,
22498
+ message: B.details || "Unknown error",
22499
22499
  fatal: !0
22500
22500
  })));
22501
22501
  }), () => {
22502
22502
  M.destroy(), r.current = null;
22503
22503
  };
22504
- } else if (C.canPlayType("application/vnd.apple.mpegurl")) {
22505
- C.src = ii(a, e), v(!0);
22504
+ } else if (P.canPlayType("application/vnd.apple.mpegurl")) {
22505
+ P.src = ii(a, e), v(!0);
22506
22506
  const M = () => {
22507
22507
  o(!0), s?.({ type: "native", message: "Playback error", fatal: !0 });
22508
22508
  };
22509
- return C.addEventListener("loadedmetadata", x), C.addEventListener("error", M), () => {
22510
- C.removeEventListener("loadedmetadata", x), C.removeEventListener("error", M);
22509
+ return P.addEventListener("loadedmetadata", x), P.addEventListener("error", M), () => {
22510
+ P.removeEventListener("loadedmetadata", x), P.removeEventListener("error", M);
22511
22511
  };
22512
22512
  }
22513
22513
  }, [
@@ -22519,19 +22519,19 @@ const cd = async ({
22519
22519
  x
22520
22520
  ]);
22521
22521
  const I = dt(() => {
22522
- const C = t.current;
22523
- C && (C.paused ? C.play() : C.pause());
22522
+ const P = t.current;
22523
+ P && (P.paused ? P.play() : P.pause());
22524
22524
  }, [t]), b = dt(
22525
- (C) => {
22525
+ (P) => {
22526
22526
  const M = t.current;
22527
- M && (M.volume = C, M.muted = C === 0, localStorage.setItem("hls-player-volume", C.toString()));
22527
+ M && (M.volume = P, M.muted = P === 0, localStorage.setItem("hls-player-volume", P.toString()));
22528
22528
  },
22529
22529
  [t]
22530
22530
  ), L = dt(() => {
22531
- const C = t.current;
22532
- C && (C.muted = !C.muted, !C.muted && C.volume === 0 && (C.volume = 0.5));
22533
- }, [t]), k = dt((C) => {
22534
- r.current && (r.current.currentLevel = C, h(C));
22531
+ const P = t.current;
22532
+ P && (P.muted = !P.muted, !P.muted && P.volume === 0 && (P.volume = 0.5));
22533
+ }, [t]), k = dt((P) => {
22534
+ r.current && (r.current.currentLevel = P, h(P));
22535
22535
  }, []);
22536
22536
  return {
22537
22537
  isLive: S,
@@ -22704,13 +22704,13 @@ const cd = async ({
22704
22704
  const {
22705
22705
  isLive: S,
22706
22706
  hasError: A,
22707
- playing: P,
22707
+ playing: C,
22708
22708
  volume: x,
22709
22709
  muted: I,
22710
22710
  qualities: b,
22711
22711
  currentQuality: L,
22712
22712
  handlePlayPause: k,
22713
- handleMuteToggle: C,
22713
+ handleMuteToggle: P,
22714
22714
  handleQualityChange: M
22715
22715
  } = dd({
22716
22716
  cloudflareId: y?.cloudflareId ?? "",
@@ -22727,16 +22727,18 @@ const cd = async ({
22727
22727
  document.removeEventListener("fullscreenchange", F);
22728
22728
  };
22729
22729
  }, []), Ae.useEffect(() => {
22730
- let F;
22730
+ let F = null;
22731
22731
  const U = () => {
22732
- p(!0), clearTimeout(F), F = setTimeout(() => {
22733
- P && p(!1);
22732
+ p(!0), F && clearTimeout(F), F = setTimeout(() => {
22733
+ C && p(!1), F = null;
22734
22734
  }, 3e3);
22735
- }, B = h.current;
22736
- return B && (B.addEventListener("mousemove", U), B.addEventListener("mouseenter", U)), () => {
22737
- clearTimeout(F), B && (B.removeEventListener("mousemove", U), B.removeEventListener("mouseenter", U));
22735
+ }, N = h.current;
22736
+ return N && (N.addEventListener("mousemove", U), N.addEventListener("mouseenter", U), N.addEventListener("touchstart", U, { passive: !0 }), N.addEventListener("touchmove", U, { passive: !0 })), C && (F = setTimeout(() => {
22737
+ p(!1), F = null;
22738
+ }, 3e3)), () => {
22739
+ F && (clearTimeout(F), F = null), N && (N.removeEventListener("mousemove", U), N.removeEventListener("mouseenter", U), N.removeEventListener("touchstart", U), N.removeEventListener("touchmove", U));
22738
22740
  };
22739
- }, [P]);
22741
+ }, [C]);
22740
22742
  const $ = () => {
22741
22743
  if (h.current)
22742
22744
  try {
@@ -22747,10 +22749,10 @@ const cd = async ({
22747
22749
  };
22748
22750
  if (Ae.useEffect(() => {
22749
22751
  typeof a < "u" && (a.current = {
22750
- playing: P,
22752
+ playing: C,
22751
22753
  playPause: k,
22752
22754
  volume: x,
22753
- muteToggle: C,
22755
+ muteToggle: P,
22754
22756
  quality: L,
22755
22757
  qualities: b,
22756
22758
  qualityChange: M,
@@ -22763,7 +22765,7 @@ const cd = async ({
22763
22765
  }, []), Ae.useEffect(() => {
22764
22766
  r && r({
22765
22767
  isLive: S,
22766
- playing: P,
22768
+ playing: C,
22767
22769
  muted: I,
22768
22770
  volume: x,
22769
22771
  quality: L,
@@ -22773,7 +22775,7 @@ const cd = async ({
22773
22775
  });
22774
22776
  }, [
22775
22777
  S,
22776
- P,
22778
+ C,
22777
22779
  I,
22778
22780
  x,
22779
22781
  L,
@@ -22783,7 +22785,7 @@ const cd = async ({
22783
22785
  r
22784
22786
  ]), !y)
22785
22787
  return null;
22786
- const N = fd[o];
22788
+ const B = fd[o];
22787
22789
  return /* @__PURE__ */ q.jsxs(
22788
22790
  "div",
22789
22791
  {
@@ -22813,7 +22815,7 @@ const cd = async ({
22813
22815
  {
22814
22816
  style: {
22815
22817
  ...ye.spinner,
22816
- ...N.spinner
22818
+ ...B.spinner
22817
22819
  }
22818
22820
  }
22819
22821
  ),
@@ -22822,7 +22824,7 @@ const cd = async ({
22822
22824
  {
22823
22825
  style: {
22824
22826
  ...ye.waitingText,
22825
- ...N.waitingText
22827
+ ...B.waitingText
22826
22828
  },
22827
22829
  children: "Waiting for stream..."
22828
22830
  }
@@ -22832,7 +22834,7 @@ const cd = async ({
22832
22834
  {
22833
22835
  style: {
22834
22836
  ...ye.waitingSubtext,
22835
- ...N.waitingSubtext
22837
+ ...B.waitingSubtext
22836
22838
  },
22837
22839
  children: "The stream will start automatically when available"
22838
22840
  }
@@ -22842,12 +22844,12 @@ const cd = async ({
22842
22844
  /* @__PURE__ */ q.jsx("p", { style: ye.errorTitle, children: "Stream Error" }),
22843
22845
  /* @__PURE__ */ q.jsx("p", { style: ye.errorText, children: "Unable to load the stream. Please try again later." })
22844
22846
  ] }),
22845
- S && !A && !P && /* @__PURE__ */ q.jsx("div", { style: ye.playOverlay, onClick: k, children: /* @__PURE__ */ q.jsx(
22847
+ S && !A && !C && /* @__PURE__ */ q.jsx("div", { style: ye.playOverlay, onClick: k, children: /* @__PURE__ */ q.jsx(
22846
22848
  "button",
22847
22849
  {
22848
22850
  style: {
22849
22851
  ...ye.playButton,
22850
- ...N.playButton,
22852
+ ...B.playButton,
22851
22853
  ...T ? ye.playButtonHover : {}
22852
22854
  },
22853
22855
  "aria-label": "Play video",
@@ -22859,7 +22861,7 @@ const cd = async ({
22859
22861
  xmlns: "http://www.w3.org/2000/svg",
22860
22862
  viewBox: "0 0 24 24",
22861
22863
  fill: "currentColor",
22862
- style: { ...ye.playIcon, ...N.playIcon },
22864
+ style: { ...ye.playIcon, ...B.playIcon },
22863
22865
  children: /* @__PURE__ */ q.jsx(
22864
22866
  "path",
22865
22867
  {
@@ -22872,14 +22874,14 @@ const cd = async ({
22872
22874
  )
22873
22875
  }
22874
22876
  ) }),
22875
- S && !A && P && /* @__PURE__ */ q.jsx("div", { style: ye.clickableArea, onClick: k })
22877
+ S && !A && C && /* @__PURE__ */ q.jsx("div", { style: ye.clickableArea, onClick: k })
22876
22878
  ] }),
22877
22879
  /* @__PURE__ */ q.jsx(
22878
22880
  ro,
22879
22881
  {
22880
22882
  controls: c,
22881
22883
  showControls: g,
22882
- playing: P,
22884
+ playing: C,
22883
22885
  volume: x,
22884
22886
  muted: I,
22885
22887
  qualities: b,
@@ -22890,7 +22892,7 @@ const cd = async ({
22890
22892
  streamInputs: e,
22891
22893
  selectedStreamInput: y,
22892
22894
  onPlayPause: k,
22893
- onMuteToggle: C,
22895
+ onMuteToggle: P,
22894
22896
  onQualityChange: M,
22895
22897
  onGoToLive: () => {
22896
22898
  },