@goboss/web-video-player-sdk 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -149,7 +149,7 @@ function ee(e, t, n) {
149
149
  return t[e] ? t[e].bind(t) : F(e, n);
150
150
  }
151
151
  var te = P();
152
- function I(e, t, n) {
152
+ function ne(e, t, n) {
153
153
  let r = P();
154
154
  if (typeof console == "object" && e === !0 || typeof e == "object") {
155
155
  let i = [
@@ -173,8 +173,8 @@ function I(e, t, n) {
173
173
  } else E(te, r);
174
174
  return r;
175
175
  }
176
- var L = te;
177
- function ne(e = !0) {
176
+ var I = te;
177
+ function L(e = !0) {
178
178
  if (!(typeof self > "u")) return (e || !self.MediaSource) && self.ManagedMediaSource || self.MediaSource || self.WebKitMediaSource;
179
179
  }
180
180
  function re(e) {
@@ -558,7 +558,7 @@ function Te(e) {
558
558
  let n = r, a = H(e, n);
559
559
  n += 4;
560
560
  let o = a & 2147483647;
561
- if ((a & 2147483648) >>> 31 == 1) return L.warn("SIDX has hierarchical references (not supported)"), null;
561
+ if ((a & 2147483648) >>> 31 == 1) return I.warn("SIDX has hierarchical references (not supported)"), null;
562
562
  let c = H(e, n);
563
563
  n += 4, t.push({
564
564
  referenceSize: o,
@@ -745,7 +745,7 @@ function Me(e, t) {
745
745
  let n = t.keyId;
746
746
  n && t.isCommonEncryption && Pe(e, (e, t) => {
747
747
  let r = e.subarray(8, 24);
748
- r.some((e) => e !== 0) || (L.log(`[eme] Patching keyId in 'enc${t ? "a" : "v"}>sinf>>tenc' box: ${R(r)} -> ${R(n)}`), e.set(n, 8));
748
+ r.some((e) => e !== 0) || (I.log(`[eme] Patching keyId in 'enc${t ? "a" : "v"}>sinf>>tenc' box: ${R(r)} -> ${R(n)}`), e.set(n, 8));
749
749
  });
750
750
  }
751
751
  function Ne(e) {
@@ -897,7 +897,7 @@ function He(e, t, n, r) {
897
897
  let e = i.length - a, t = a;
898
898
  if (s < e) a += s;
899
899
  else if (s > e) {
900
- L.error(`Malformed SEI payload. ${s} is too small, only ${e} bytes left to parse.`);
900
+ I.error(`Malformed SEI payload. ${s} is too small, only ${e} bytes left to parse.`);
901
901
  break;
902
902
  }
903
903
  if (o === 4) {
@@ -960,7 +960,7 @@ function We(e) {
960
960
  let t = H(e, l);
961
961
  l += 4;
962
962
  let a = H(e, l);
963
- for (l += 4, o = 2 ** 32 * t + a, g(o) || (o = 2 ** 53 - 1, L.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")), s = H(e, l), l += 4, c = H(e, l), l += 4; V(e.subarray(l, l + 1)) !== "\0";) n += V(e.subarray(l, l + 1)), l += 1;
963
+ for (l += 4, o = 2 ** 32 * t + a, g(o) || (o = 2 ** 53 - 1, I.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")), s = H(e, l), l += 4, c = H(e, l), l += 4; V(e.subarray(l, l + 1)) !== "\0";) n += V(e.subarray(l, l + 1)), l += 1;
964
964
  for (n += V(e.subarray(l, l + 1)), l += 1; V(e.subarray(l, l + 1)) !== "\0";) r += V(e.subarray(l, l + 1)), l += 1;
965
965
  r += V(e.subarray(l, l + 1)), l += 1;
966
966
  }
@@ -1140,7 +1140,7 @@ function Qe(e, t, n = !0) {
1140
1140
  return !e.split(",").some((e) => !$e(e, t, n));
1141
1141
  }
1142
1142
  function $e(e, t, n = !0) {
1143
- return ne(n)?.isTypeSupported(et(e, t)) ?? !1;
1143
+ return L(n)?.isTypeSupported(et(e, t)) ?? !1;
1144
1144
  }
1145
1145
  function et(e, t) {
1146
1146
  return `${t}/mp4;codecs=${e}`;
@@ -1174,7 +1174,7 @@ function it(e, t = !0) {
1174
1174
  for (let i = 0; i < n.length; i++) {
1175
1175
  var r;
1176
1176
  if ($e(n[i], "audio", t)) return rt[e] = n[i], n[i];
1177
- if (n[i] === "mp3" && (r = ne(t)) != null && r.isTypeSupported("audio/mpeg")) return "";
1177
+ if (n[i] === "mp3" && (r = L(t)) != null && r.isTypeSupported("audio/mpeg")) return "";
1178
1178
  }
1179
1179
  return e;
1180
1180
  }
@@ -1236,7 +1236,7 @@ function dt(e) {
1236
1236
  return e;
1237
1237
  }
1238
1238
  function ft(e) {
1239
- let t = ne(e) || { isTypeSupported: () => !1 };
1239
+ let t = L(e) || { isTypeSupported: () => !1 };
1240
1240
  return {
1241
1241
  mpeg: t.isTypeSupported("audio/mpeg"),
1242
1242
  mp3: t.isTypeSupported("audio/mp4; codecs=\"mp3\""),
@@ -1545,7 +1545,7 @@ function Lt(e, t, n, r, i) {
1545
1545
  };
1546
1546
  }
1547
1547
  function Rt(e, t) {
1548
- L.log(`[abr] start candidates with "${e}" ignored because ${t}`);
1548
+ I.log(`[abr] start candidates with "${e}" ignored because ${t}`);
1549
1549
  }
1550
1550
  function zt(e) {
1551
1551
  return e.reduce((e, t) => {
@@ -1690,7 +1690,7 @@ var Xt = class extends j {
1690
1690
  Current BW estimate: ${h(C) ? C | 0 : "Unknown"} bps
1691
1691
  New BW estimate: ${this.getBwEstimate() | 0} bps
1692
1692
  Switching to level ${F} @ ${ee | 0} bps`), r.nextLoadLevel = r.nextAutoLevel = F, this.clearTimer();
1693
- let I = () => {
1693
+ let ne = () => {
1694
1694
  if (this.clearTimer(), this.fragCurrent === t && this.hls.loadLevel === F && F > 0) {
1695
1695
  let e = this.getStarvationDelay();
1696
1696
  if (this.warn(`Aborting inflight request ${F > 0 ? "and switching down" : ""}
@@ -1701,7 +1701,7 @@ var Xt = class extends j {
1701
1701
  }
1702
1702
  }
1703
1703
  };
1704
- p || A > P * 2 ? I() : this.timer = self.setInterval(I, P * 1e3), r.trigger(b.FRAG_LOAD_EMERGENCY_ABORTED, {
1704
+ p || A > P * 2 ? ne() : this.timer = self.setInterval(ne, P * 1e3), r.trigger(b.FRAG_LOAD_EMERGENCY_ABORTED, {
1705
1705
  frag: t,
1706
1706
  part: n,
1707
1707
  stats: s
@@ -2609,7 +2609,7 @@ var Dn = 16, On = class {
2609
2609
  }
2610
2610
  softwareDecrypt(e, t, n, r) {
2611
2611
  let { currentIV: i, currentResult: a, remainderData: o } = this;
2612
- if (r !== xn.cbc || t.byteLength !== 16) return L.warn("SoftwareDecrypt: can only handle AES-128-CBC"), null;
2612
+ if (r !== xn.cbc || t.byteLength !== 16) return I.warn("SoftwareDecrypt: can only handle AES-128-CBC"), null;
2613
2613
  this.logOnce("JS AES decrypt"), o && (e = Re(o, e), this.remainderData = null);
2614
2614
  let s = this.getValidChunk(e);
2615
2615
  if (!s.length) return null;
@@ -2624,7 +2624,7 @@ var Dn = 16, On = class {
2624
2624
  if (!this.subtle) return Promise.resolve(this.onWebCryptoError(e, t, n, r));
2625
2625
  this.key = t, this.fastAesKey = new Tn(this.subtle, t, r);
2626
2626
  }
2627
- return this.fastAesKey.expandKey().then((t) => this.subtle ? (this.logOnce("WebCrypto AES decrypt"), new Sn(this.subtle, new Uint8Array(n), r).decrypt(e.buffer, t)) : Promise.reject(/* @__PURE__ */ Error("web crypto not initialized"))).catch((i) => (L.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`), this.onWebCryptoError(e, t, n, r)));
2627
+ return this.fastAesKey.expandKey().then((t) => this.subtle ? (this.logOnce("WebCrypto AES decrypt"), new Sn(this.subtle, new Uint8Array(n), r).decrypt(e.buffer, t)) : Promise.reject(/* @__PURE__ */ Error("web crypto not initialized"))).catch((i) => (I.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`), this.onWebCryptoError(e, t, n, r)));
2628
2628
  }
2629
2629
  onWebCryptoError(e, t, n, r) {
2630
2630
  let i = this.enableSoftwareAES;
@@ -2640,7 +2640,7 @@ var Dn = 16, On = class {
2640
2640
  return n !== e.length && (t = e.slice(0, n), this.remainderData = e.slice(n)), t;
2641
2641
  }
2642
2642
  logOnce(e) {
2643
- this.logEnabled &&= (L.log(`[decrypter]: ${e}`), !1);
2643
+ this.logEnabled &&= (I.log(`[decrypter]: ${e}`), !1);
2644
2644
  }
2645
2645
  }, kn = 2 ** 17, An = class {
2646
2646
  constructor(e) {
@@ -2983,7 +2983,7 @@ var Rn = {
2983
2983
  try {
2984
2984
  return e.buffered || Rn;
2985
2985
  } catch (e) {
2986
- return L.log("failed to get media.buffered", e), Rn;
2986
+ return I.log("failed to get media.buffered", e), Rn;
2987
2987
  }
2988
2988
  }
2989
2989
  }, zn = /\{\$([a-zA-Z0-9-_]+)\}/g;
@@ -3117,7 +3117,7 @@ var Wn = /^(\d+)x(\d+)$/, Gn = /(.+?)=(".*?"|.*?)(?:,|$)/g, Y = class e {
3117
3117
  case "VALUE":
3118
3118
  case "VIDEO":
3119
3119
  case "X-ASSET-LIST":
3120
- case "X-ASSET-URI": L.warn(`${e}: attribute ${i} is missing quotes`);
3120
+ case "X-ASSET-URI": I.warn(`${e}: attribute ${i} is missing quotes`);
3121
3121
  }
3122
3122
  r[i] = a;
3123
3123
  }
@@ -3135,7 +3135,7 @@ var Yn = class {
3135
3135
  if (this.attr = void 0, this.tagAnchor = void 0, this.tagOrder = void 0, this._startDate = void 0, this._endDate = void 0, this._dateAtEnd = void 0, this._cue = void 0, this._badValueForSameId = void 0, this.tagAnchor = t?.tagAnchor || null, this.tagOrder = t?.tagOrder ?? n, t) {
3136
3136
  let n = t.attr;
3137
3137
  for (let t in n) if (Object.prototype.hasOwnProperty.call(e, t) && e[t] !== n[t]) {
3138
- L.warn(`DATERANGE tag attribute: "${t}" does not match for tags with ID: "${e.ID}"`), this._badValueForSameId = t;
3138
+ I.warn(`DATERANGE tag attribute: "${t}" does not match for tags with ID: "${e.ID}"`), this._badValueForSameId = t;
3139
3139
  break;
3140
3140
  }
3141
3141
  e = E(new Y({}), n, e);
@@ -3161,7 +3161,7 @@ var Yn = class {
3161
3161
  }
3162
3162
  get startTime() {
3163
3163
  let { tagAnchor: e } = this;
3164
- return e === null || e.programDateTime === null ? (L.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`), NaN) : e.start + (this.startDate.getTime() - e.programDateTime) / 1e3;
3164
+ return e === null || e.programDateTime === null ? (I.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`), NaN) : e.start + (this.startDate.getTime() - e.programDateTime) / 1e3;
3165
3165
  }
3166
3166
  get startDate() {
3167
3167
  return this._startDate;
@@ -3434,7 +3434,7 @@ var _r = {}, vr = class e {
3434
3434
  if (!this.encrypted || !this.uri) return null;
3435
3435
  if (er(this.method)) {
3436
3436
  let n = this.iv;
3437
- return n ||= (typeof t != "number" && (L.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`), t = 0), xr(t)), new e(this.method, this.uri, "identity", this.keyFormatVersions, n);
3437
+ return n ||= (typeof t != "number" && (I.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`), t = 0), xr(t)), new e(this.method, this.uri, "identity", this.keyFormatVersions, n);
3438
3438
  }
3439
3439
  if (this.keyId) {
3440
3440
  let t = _r[this.uri];
@@ -3566,7 +3566,7 @@ var Sr = /#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X
3566
3566
  }
3567
3567
  case "SESSION-KEY": {
3568
3568
  let e = Ar(i, n, r);
3569
- e.encrypted && e.isSupported() ? (r.sessionKeys === null && (r.sessionKeys = []), r.sessionKeys.push(e)) : L.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${i}"`);
3569
+ e.encrypted && e.isSupported() ? (r.sessionKeys === null && (r.sessionKeys = []), r.sessionKeys.push(e)) : I.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${i}"`);
3570
3570
  break;
3571
3571
  }
3572
3572
  case "DEFINE":
@@ -3648,7 +3648,7 @@ var Sr = /#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X
3648
3648
  }
3649
3649
  } else {
3650
3650
  if (y = y[0].match(Er), !y) {
3651
- L.warn("No matches on slow regex match for level playlist!");
3651
+ I.warn("No matches on slow regex match for level playlist!");
3652
3652
  continue;
3653
3653
  }
3654
3654
  for (b = 1; b < y.length && y[b] === void 0; b++);
@@ -3702,7 +3702,7 @@ var Sr = /#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X
3702
3702
  break;
3703
3703
  case "DATERANGE": {
3704
3704
  let e = new Y(i, s), t = new Yn(e, s.dateRanges[e.ID], s.dateRangeTagCount);
3705
- s.dateRangeTagCount++, t.isValid || s.skippedSegments ? s.dateRanges[t.id] = t : L.warn(`Ignoring invalid DATERANGE tag: "${i}"`), v.tagList.push(["EXT-X-DATERANGE", i]);
3705
+ s.dateRangeTagCount++, t.isValid || s.skippedSegments ? s.dateRanges[t.id] = t : I.warn(`Ignoring invalid DATERANGE tag: "${i}"`), v.tagList.push(["EXT-X-DATERANGE", i]);
3706
3706
  break;
3707
3707
  }
3708
3708
  case "DEFINE":
@@ -3724,7 +3724,7 @@ var Sr = /#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X
3724
3724
  x ||= {};
3725
3725
  let t = x[e.keyFormat];
3726
3726
  t != null && t.matches(e) || (t && (x = E({}, x)), x[e.keyFormat] = e);
3727
- } else L.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${i}"`);
3727
+ } else I.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${i}"`);
3728
3728
  break;
3729
3729
  }
3730
3730
  case "START":
@@ -3768,7 +3768,7 @@ var Sr = /#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X
3768
3768
  break;
3769
3769
  }
3770
3770
  default:
3771
- L.warn(`line parsed but not handled: ${y}`);
3771
+ I.warn(`line parsed but not handled: ${y}`);
3772
3772
  break;
3773
3773
  }
3774
3774
  }
@@ -3824,7 +3824,7 @@ function kr(e, t, n, r, i) {
3824
3824
  }
3825
3825
  function Ar(e, t, n) {
3826
3826
  let r = new Y(e, n), i = r.METHOD ?? "", a = r.URI, o = r.hexadecimalInteger("IV"), s = r.KEYFORMATVERSIONS, c = r.KEYFORMAT ?? "identity";
3827
- return a && r.IV && !o && L.error(`Invalid IV: ${r.IV}`), new vr(i, a ? Dr.resolve(a, t) : "", c, (s || "1").split("/").map(Number).filter(Number.isFinite), o, r.KEYID);
3827
+ return a && r.IV && !o && I.error(`Invalid IV: ${r.IV}`), new vr(i, a ? Dr.resolve(a, t) : "", c, (s || "1").split("/").map(Number).filter(Number.isFinite), o, r.KEYID);
3828
3828
  }
3829
3829
  function jr(e) {
3830
3830
  let t = new Y(e).decimalFloatingPoint("TIME-OFFSET");
@@ -4062,7 +4062,7 @@ function oi(e, t) {
4062
4062
  function si(e, t) {
4063
4063
  if (!ri(t, e)) return;
4064
4064
  let n = Math.min(t.endCC, e.endCC), r = ni(t.fragments, n), i = ni(e.fragments, n);
4065
- !r || !i || (L.log(`Aligning playlist at start of dicontinuity sequence ${n}`), ai(r.start - i.start, e));
4065
+ !r || !i || (I.log(`Aligning playlist at start of dicontinuity sequence ${n}`), ai(r.start - i.start, e));
4066
4066
  }
4067
4067
  function ci(e, t) {
4068
4068
  if (!e.hasProgramDateTime || !t.hasProgramDateTime) return;
@@ -5019,7 +5019,7 @@ function Ai(e, t, n, r) {
5019
5019
  let s = (a >> 6 & 3) + 1, c = t[n + 3] >> 6 & 3 | (a & 1) << 2, l = "mp4a.40." + s, u = i[o], d = o;
5020
5020
  (s === 5 || s === 29) && (d -= 3);
5021
5021
  let f = [s << 3 | (d & 14) >> 1, (d & 1) << 7 | c << 3];
5022
- return L.log(`manifest codec:${r}, parsed codec:${l}, channels:${c}, rate:${u} (ADTS object type:${s} sampling index:${o})`), {
5022
+ return I.log(`manifest codec:${r}, parsed codec:${l}, channels:${c}, rate:${u} (ADTS object type:${s} sampling index:${o})`), {
5023
5023
  config: f,
5024
5024
  samplerate: u,
5025
5025
  channelCount: c,
@@ -5732,7 +5732,7 @@ var Ta = class extends ca {
5732
5732
  if (!e) return !1;
5733
5733
  let t = ki(e, 0), n = t?.length || 0;
5734
5734
  if (t && e[n] === 11 && e[n + 1] === 119 && aa(t) !== void 0 && Sa(e, n) <= 16) return !1;
5735
- for (let t = e.length; n < t; n++) if (ba(e, n)) return L.log("MPEG Audio sync word found !"), !0;
5735
+ for (let t = e.length; n < t; n++) if (ba(e, n)) return I.log("MPEG Audio sync word found !"), !0;
5736
5736
  return !1;
5737
5737
  }
5738
5738
  canParse(e, t) {
@@ -5984,7 +5984,7 @@ var ka = class {
5984
5984
  }
5985
5985
  readBits(e) {
5986
5986
  let t = Math.min(this.bitsAvailable, e), n = this.word >>> 32 - t;
5987
- if (e > 32 && L.error("Cannot read more than 32 bits at a time"), this.bitsAvailable -= t, this.bitsAvailable > 0) this.word <<= t;
5987
+ if (e > 32 && I.error("Cannot read more than 32 bits at a time"), this.bitsAvailable -= t, this.bitsAvailable > 0) this.word <<= t;
5988
5988
  else if (this.bytesAvailable > 0) this.loadWord();
5989
5989
  else throw Error("no bits available");
5990
5990
  return t = e - t, t > 0 && this.bitsAvailable ? n << t | this.readBits(t) : n;
@@ -6303,9 +6303,9 @@ var ka = class {
6303
6303
  t.readBits(1);
6304
6304
  }
6305
6305
  }
6306
- let N = 0, P = 1, F = 1, ee = !0, te = 1, I = 0;
6306
+ let N = 0, P = 1, F = 1, ee = !0, te = 1, ne = 0;
6307
6307
  t.readBoolean(), t.readBoolean();
6308
- let L = !1;
6308
+ let I = !1;
6309
6309
  if (t.readBoolean()) {
6310
6310
  if (t.readBoolean()) {
6311
6311
  let e = t.readUByte();
@@ -6345,7 +6345,7 @@ var ka = class {
6345
6345
  1
6346
6346
  ][e - 1]) : e === 255 && (P = t.readBits(16), F = t.readBits(16));
6347
6347
  }
6348
- 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(), L = t.readBoolean(), L && (t.skipUEG(), t.skipUEG(), t.skipUEG(), t.skipUEG()), t.readBoolean() && (te = t.readBits(32), I = t.readBits(32), t.readBoolean() && t.readUEG(), t.readBoolean())) {
6348
+ 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(), I = t.readBoolean(), I && (t.skipUEG(), t.skipUEG(), t.skipUEG(), t.skipUEG()), t.readBoolean() && (te = t.readBits(32), ne = t.readBits(32), t.readBoolean() && t.readUEG(), t.readBoolean())) {
6349
6349
  let e = t.readBoolean(), r = t.readBoolean(), i = !1;
6350
6350
  (e || r) && (i = t.readBoolean(), i && (t.readUByte(), t.readBits(5), t.readBoolean(), t.readBits(5)), t.readBits(4), t.readBits(4), i && t.readBits(4), t.readBits(5), t.readBits(5), t.readBits(5));
6351
6351
  for (let a = 0; a <= n; a++) {
@@ -6359,10 +6359,10 @@ var ka = class {
6359
6359
  }
6360
6360
  t.readBoolean() && (t.readBoolean(), t.readBoolean(), t.readBoolean(), N = t.readUEG());
6361
6361
  }
6362
- let ne = b, re = x;
6362
+ let L = b, re = x;
6363
6363
  if (S) {
6364
6364
  let e = 1, t = 1;
6365
- y === 1 ? e = t = 2 : y == 2 && (e = 2), ne = b - e * w - e * C, re = x - t * E - t * T;
6365
+ y === 1 ? e = t = 2 : y == 2 && (e = 2), L = b - e * w - e * C, re = x - t * E - t * T;
6366
6366
  }
6367
6367
  let ie = r ? [
6368
6368
  "A",
@@ -6399,10 +6399,10 @@ var ka = class {
6399
6399
  chroma_format_idc: y,
6400
6400
  frame_rate: {
6401
6401
  fixed: ee,
6402
- fps: I / te
6402
+ fps: ne / te
6403
6403
  }
6404
6404
  },
6405
- width: ne,
6405
+ width: L,
6406
6406
  height: re,
6407
6407
  pixelRatio: [P, F]
6408
6408
  };
@@ -9708,7 +9708,7 @@ ${this.list("audiovideo")}}`;
9708
9708
  }, this._onMediaEmptied = () => {
9709
9709
  let { mediaSrc: e, _objectUrl: t } = this;
9710
9710
  e !== t && this.error(`Media element src was set while attaching MediaSource (${t} > ${e})`);
9711
- }, this.hls = e, this.fragmentTracker = t, this.appendSource = re(ne(e.config.preferManagedMediaSource)), this.initTracks(), this.registerListeners();
9711
+ }, this.hls = e, this.fragmentTracker = t, this.appendSource = re(L(e.config.preferManagedMediaSource)), this.initTracks(), this.registerListeners();
9712
9712
  }
9713
9713
  hasSourceTypes() {
9714
9714
  return Object.keys(this.tracks).length > 0;
@@ -9759,7 +9759,7 @@ ${this.list("audiovideo")}}`;
9759
9759
  onMediaAttaching(e, t) {
9760
9760
  let n = this.media = t.media;
9761
9761
  this.transferData = this.overrides = void 0;
9762
- let r = ne(this.appendSource);
9762
+ let r = L(this.appendSource);
9763
9763
  if (r) {
9764
9764
  let e = !!t.mediaSource;
9765
9765
  (e || t.overrides) && (this.transferData = t, this.overrides = t.overrides);
@@ -11900,12 +11900,12 @@ function _c(e, t) {
11900
11900
  if (n === "disabled" && (e.mode = "hidden"), e.cues && !e.cues.getCueById(t.id)) try {
11901
11901
  if (e.addCue(t), !e.cues.getCueById(t.id)) throw Error(`addCue is failed for: ${t}`);
11902
11902
  } catch (n) {
11903
- L.debug(`[texttrack-utils]: ${n}`);
11903
+ I.debug(`[texttrack-utils]: ${n}`);
11904
11904
  try {
11905
11905
  let n = new self.TextTrackCue(t.startTime, t.endTime, t.text);
11906
11906
  n.id = t.id, e.addCue(n);
11907
11907
  } catch (e) {
11908
- L.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${e}`);
11908
+ I.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${e}`);
11909
11909
  }
11910
11910
  }
11911
11911
  n === "disabled" && (e.mode = n);
@@ -14286,7 +14286,7 @@ Schedule: ${a.map((e) => Rc(e))} pos: ${this.timelinePos}`), s.length && this.lo
14286
14286
  log(e, t) {
14287
14287
  if (this.verboseLevel >= e) {
14288
14288
  let n = typeof t == "function" ? t() : t;
14289
- L.log(`${this.time} [${e}] ${n}`);
14289
+ I.log(`${this.time} [${e}] ${n}`);
14290
14290
  }
14291
14291
  }
14292
14292
  }, nl = function(e) {
@@ -15777,7 +15777,7 @@ var iu = class extends Error {
15777
15777
  })) this.retry(c);
15778
15778
  else {
15779
15779
  var o;
15780
- L.error(`${r} while loading ${e.url}`), (o = this.callbacks) == null || o.onError({
15780
+ I.error(`${r} while loading ${e.url}`), (o = this.callbacks) == null || o.onError({
15781
15781
  code: r,
15782
15782
  text: t.statusText
15783
15783
  }, e, t, n);
@@ -15789,14 +15789,14 @@ var iu = class extends Error {
15789
15789
  let e = this.config.loadPolicy.timeoutRetry, t = this.stats.retry;
15790
15790
  if (dn(e, t, !0)) this.retry(e);
15791
15791
  else {
15792
- L.warn(`timeout while loading ${this.context?.url}`);
15792
+ I.warn(`timeout while loading ${this.context?.url}`);
15793
15793
  let e = this.callbacks;
15794
15794
  e && (this.abortInternal(), e.onTimeout(this.stats, this.context, this.loader));
15795
15795
  }
15796
15796
  }
15797
15797
  retry(e) {
15798
15798
  let { context: t, stats: n } = this;
15799
- this.retryDelay = ln(e, n.retry), n.retry++, L.warn(`${status ? "HTTP Status " + status : "Timeout"} while loading ${t?.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`), this.abortInternal(), this.loader = null, self.clearTimeout(this.retryTimeout), this.retryTimeout = self.setTimeout(this.loadInternal.bind(this), this.retryDelay);
15799
+ this.retryDelay = ln(e, n.retry), n.retry++, I.warn(`${status ? "HTTP Status " + status : "Timeout"} while loading ${t?.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`), this.abortInternal(), this.loader = null, self.clearTimeout(this.retryTimeout), this.retryTimeout = self.setTimeout(this.loadInternal.bind(this), this.retryDelay);
15800
15800
  }
15801
15801
  loadprogress(e) {
15802
15802
  let t = this.stats;
@@ -16928,13 +16928,13 @@ function Ou() {
16928
16928
  return self.SourceBuffer || self.WebKitSourceBuffer;
16929
16929
  }
16930
16930
  function ku() {
16931
- if (!ne()) return !1;
16931
+ if (!L()) return !1;
16932
16932
  let e = Ou();
16933
16933
  return !e || e.prototype && typeof e.prototype.appendBuffer == "function" && typeof e.prototype.remove == "function";
16934
16934
  }
16935
16935
  function Au() {
16936
16936
  if (!ku()) return !1;
16937
- let e = ne();
16937
+ let e = L();
16938
16938
  return typeof e?.isTypeSupported == "function" && ([
16939
16939
  "avc1.42E01E,mp4a.40.2",
16940
16940
  "av01.0.01M.08",
@@ -18080,7 +18080,7 @@ var Ru = class {
18080
18080
  return Au();
18081
18081
  }
18082
18082
  static getMediaSource() {
18083
- return ne();
18083
+ return L();
18084
18084
  }
18085
18085
  static get Events() {
18086
18086
  return b;
@@ -18102,7 +18102,7 @@ var Ru = class {
18102
18102
  }
18103
18103
  constructor(t = {}) {
18104
18104
  this.config = void 0, this.userConfig = void 0, this.logger = void 0, this.coreComponents = void 0, this.networkControllers = void 0, this._emitter = new yi(), this._autoLevelCapping = -1, this._maxHdcpLevel = null, this.abrController = void 0, this.bufferController = void 0, this.capLevelController = void 0, this.latencyController = void 0, this.levelController = void 0, this.streamController = void 0, this.audioStreamController = void 0, this.subtititleStreamController = void 0, this.audioTrackController = void 0, this.subtitleTrackController = void 0, this.interstitialsController = void 0, this.gapController = void 0, this.emeController = void 0, this.cmcdController = void 0, this._media = null, this._url = null, this._sessionId = void 0, this.triggeringException = void 0, this.started = !1;
18105
- let n = this.logger = I(t.debug || !1, "Hls instance", t.assetPlayerId), r = this.config = lu(e.DefaultConfig, t, n);
18105
+ let n = this.logger = ne(t.debug || !1, "Hls instance", t.assetPlayerId), r = this.config = lu(e.DefaultConfig, t, n);
18106
18106
  this.userConfig = t, r.progressive && du(r, n);
18107
18107
  let { abrController: i, bufferController: a, capLevelController: o, errorController: s, fpsController: c } = r, l = new s(this), u = this.abrController = new i(this), d = new _n(this), f = r.interstitialsController, p = f ? this.interstitialsController = new f(this, e) : null, m = this.bufferController = new a(this, d), h = this.capLevelController = new o(this), g = new c(this), _ = new Ru(this), v = r.contentSteeringController, y = v ? new v(this) : null, x = this.levelController = new Eu(this, y), S = new wu(this), C = new Pu(this.config, this.logger), w = this.streamController = new Nu(this, d, C), T = this.gapController = new gu(this, d);
18108
18108
  h.setStreamController(w), g.setStreamController(w);
@@ -19703,48 +19703,48 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
19703
19703
  let n = `${kd(e).toLowerCase()}|${(e.lang || "").trim().toLowerCase()}`;
19704
19704
  return t.has(n) ? !1 : (t.add(n), !0);
19705
19705
  });
19706
- }, jd = ({ src: e, autoplay: t = !1, muted: n = !1, chapters: r = [], keyMoments: s, subtitles: c = [], watermark: l, themeColor: u = "#6366f1", drmConfig: d, firebaseConfig: f, onAnalyticsEvent: h, onKeyMomentsLoaded: g, enableControls: _ = !0, enableChromecast: v = !0, enableKeyMoments: y = !0, enableSubtitles: b = !0, enableQuality: x = !0, enablePlaybackSpeed: S = !0, enablePiP: C = !0, enableFullscreen: w = !0, subtitleStyle: T = {} }) => {
19707
- let E = a(null), D = a(null), O = a(null), k = a(null), A = a(null), j = a(null), M = a(null), N = a(!1), P = a(!1), F = a(null), ee = a(null), te = a(null), [I, L] = o(null), [ne, re] = o(!1), [ie, ae] = o(0), [R, oe] = o(0), [se, ce] = o(1), [le, ue] = o(!1), [de, fe] = o(!1), [z, pe] = o(!1), [B, me] = o(!1), [he, ge] = o(!1), [_e, ve] = o([]), [ye, be] = o({
19706
+ }, jd = ({ src: e, autoplay: t = !1, muted: n = !1, chapters: r = [], keyMoments: s, subtitles: c = [], watermark: l, themeColor: u = "#6366f1", drmConfig: d, firebaseConfig: f, onAnalyticsEvent: h, onKeyMomentsLoaded: g, enableControls: _ = !0, enableChromecast: v = !0, enableKeyMoments: y = !0, enableSubtitles: b = !0, enableQuality: x = !0, enablePlaybackSpeed: S = !0, enablePiP: C = !0, enableFullscreen: w = !0, autoFullscreen: T = !1, subtitleStyle: E = {} }) => {
19707
+ let D = a(null), O = a(null), k = a(!1), A = a(null), j = a(null), M = a(null), N = a(null), P = a(null), F = a(!1), ee = a(!1), te = a(null), ne = a(null), I = a(null), [L, re] = o(null), [ie, ae] = o(!1), [R, oe] = o(0), [se, ce] = o(0), [le, ue] = o(1), [de, fe] = o(!1), [z, pe] = o(!1), [B, me] = o(!1), [he, ge] = o(!1), [_e, ve] = o(!1), [ye, be] = o([]), [V, xe] = o({
19708
19708
  id: -1,
19709
19709
  height: 0,
19710
19710
  width: 0,
19711
19711
  bitrate: 0,
19712
19712
  label: "Auto"
19713
- }), [V, xe] = o(""), [H, Se] = o("off"), [Ce, we] = o(Ad(c)), [U, Te] = o([]), [Ee, De] = o(0);
19713
+ }), [H, Se] = o(""), [Ce, we] = o("off"), [U, Te] = o(Ad(c)), [Ee, De] = o([]), [Oe, ke] = o(0);
19714
19714
  i(() => {
19715
- if (I) {
19716
- let e = I.subtitles.getTracks();
19717
- we(Ad([...c, ...e.filter((e) => !c.some((t) => t.id === e.id))]));
19718
- } else we(Ad(c));
19719
- }, [c, I]);
19720
- let [Oe, ke] = o({
19715
+ if (L) {
19716
+ let e = L.subtitles.getTracks();
19717
+ Te(Ad([...c, ...e.filter((e) => !c.some((t) => t.id === e.id))]));
19718
+ } else Te(Ad(c));
19719
+ }, [c.map((e) => e.id).join(","), L]);
19720
+ let [Ae, je] = o({
19721
19721
  chapter: null,
19722
19722
  index: -1
19723
- }), [Ae, je] = o(s || r || []), [W, Me] = o("none"), [Ne, Pe] = o(1), [Fe, Ie] = o(!1), [Le, Re] = o({}), ze = JSON.stringify(Ae.map((e) => ({
19723
+ }), [W, Me] = o(s || r || []), [Ne, Pe] = o("none"), [Fe, Ie] = o(1), [Le, Re] = o(!1), [ze, Be] = o({}), Ve = JSON.stringify(W.map((e) => ({
19724
19724
  title: e.title,
19725
19725
  startTime: e.startTime
19726
19726
  })));
19727
19727
  i(() => {
19728
- je(s || r || []);
19729
- }, [s, r]), i(() => {
19730
- if (!e || !Ae || Ae.length === 0) return;
19731
- Re({});
19728
+ Me(s || r || []);
19729
+ }, [(s || r || []).map((e) => `${e.startTime}:${e.title}`).join(",")]), i(() => {
19730
+ if (!e || !W || W.length === 0) return;
19731
+ Be({});
19732
19732
  let t = document.createElement("video");
19733
19733
  t.muted = !0, t.preload = "metadata", t.crossOrigin = "anonymous", t.style.cssText = "position:fixed;top:0;left:0;width:10px;height:10px;opacity:0.01;pointer-events:none;z-index:-9999;", document.body.appendChild(t);
19734
19734
  let n = null, r = e.includes(".m3u8"), i = document.createElement("canvas");
19735
19735
  i.width = 160, i.height = 90;
19736
19736
  let a = i.getContext("2d"), o = 0, s = !1, c = () => {
19737
- if (o >= Ae.length) {
19737
+ if (o >= W.length) {
19738
19738
  f();
19739
19739
  return;
19740
19740
  }
19741
- let e = Ae[o].startTime;
19741
+ let e = W[o].startTime;
19742
19742
  t.currentTime = e === 0 ? .01 : e;
19743
19743
  }, l = () => {
19744
19744
  if (a && t.readyState >= 2) {
19745
19745
  a.drawImage(t, 0, 0, i.width, i.height);
19746
19746
  let e = i.toDataURL("image/jpeg", .8);
19747
- Re((t) => ({
19747
+ Be((t) => ({
19748
19748
  ...t,
19749
19749
  [o]: e
19750
19750
  })), o++, c();
@@ -19773,24 +19773,24 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
19773
19773
  t.removeEventListener("seeked", l), t.removeEventListener("canplay", u), n && n.destroy(), document.body.contains(t) && document.body.removeChild(t);
19774
19774
  };
19775
19775
  return f;
19776
- }, [e, ze]);
19777
- let [Be, Ve] = o(null), [He, Ue] = o(!1), [We, Ge] = o(!1), [Ke, qe] = o(null), [Je, Ye] = o(null), [Xe, Ze] = o(0), [Qe, $e] = o(null), [et, tt] = o(null), [nt, rt] = o(null);
19776
+ }, [e, Ve]);
19777
+ let [He, Ue] = o(null), [We, Ge] = o(!1), [Ke, qe] = o(!1), [Je, Ye] = o(null), [Xe, Ze] = o(null), [Qe, $e] = o(0), [et, tt] = o(null), [nt, rt] = o(null), [it, at] = o(null);
19778
19778
  i(() => {
19779
- if (te.current && !te.current.querySelector("google-cast-launcher")) {
19779
+ if (I.current && !I.current.querySelector("google-cast-launcher")) {
19780
19780
  let e = document.createElement("google-cast-launcher");
19781
- e.style.cursor = "pointer", e.style.width = "100%", e.style.height = "100%", e.style.display = "block", te.current.appendChild(e);
19781
+ e.style.cursor = "pointer", e.style.width = "100%", e.style.height = "100%", e.style.display = "block", I.current.appendChild(e);
19782
19782
  }
19783
19783
  }, []), i(() => {
19784
- if (!I) {
19785
- Ue(!1), Ge(!1), qe(null);
19784
+ if (!L) {
19785
+ Ge(!1), qe(!1), Ye(null);
19786
19786
  return;
19787
19787
  }
19788
- let e = (e) => Ue(e), t = () => {
19789
- let e = I.getVideoElement(), t = !!e?.webkitCurrentPlaybackTargetIsWireless;
19790
- Ge(t), qe(t ? e.webkitCurrentPlaybackTargetName || "AirPlay device" : null);
19788
+ let e = (e) => Ge(e), t = () => {
19789
+ let e = L.getVideoElement(), t = !!e?.webkitCurrentPlaybackTargetIsWireless;
19790
+ qe(t), Ye(t ? e.webkitCurrentPlaybackTargetName || "AirPlay device" : null);
19791
19791
  };
19792
- e(I.casting.isAirPlayAvailable()), t();
19793
- let n = I.getVideoElement(), r = (t) => {
19792
+ e(L.casting.isAirPlayAvailable()), t();
19793
+ let n = L.getVideoElement(), r = (t) => {
19794
19794
  e(t.availability === "available");
19795
19795
  }, i = () => {
19796
19796
  t();
@@ -19798,12 +19798,12 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
19798
19798
  return "webkitShowPlaybackTargetPicker" in n && (n.addEventListener("webkitplaybacktargetavailabilitychanged", r), n.addEventListener("webkitcurrentplaybacktargetiswirelesschanged", i)), () => {
19799
19799
  "webkitShowPlaybackTargetPicker" in n && (n.removeEventListener("webkitplaybacktargetavailabilitychanged", r), n.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged", i));
19800
19800
  };
19801
- }, [I]);
19802
- let [it, at] = o(!0), ot = a(null), st = a(!1), ct = a("none"), lt = a(c);
19801
+ }, [L]);
19802
+ let [ot, st] = o(!0), ct = a(null), lt = a(!1), ut = a("none"), dt = a(c);
19803
19803
  i(() => {
19804
- if (!E.current) return;
19804
+ if (!D.current) return;
19805
19805
  let r = document.createElement("video");
19806
- r.muted = !0, r.preload = "metadata", r.crossOrigin = "anonymous", r.style.cssText = "display:none;position:absolute;pointer-events:none;", document.body.appendChild(r), A.current = r;
19806
+ r.muted = !0, r.preload = "metadata", r.crossOrigin = "anonymous", r.style.cssText = "display:none;position:absolute;pointer-events:none;", document.body.appendChild(r), M.current = r;
19807
19807
  let i = e.includes(".m3u8");
19808
19808
  if (i && zu.isSupported()) {
19809
19809
  let t = new zu({
@@ -19823,25 +19823,25 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
19823
19823
  }
19824
19824
  }
19825
19825
  });
19826
- t.loadSource(Td(e)), t.attachMedia(r), j.current = t;
19826
+ t.loadSource(Td(e)), t.attachMedia(r), N.current = t;
19827
19827
  } else i && r.canPlayType("application/vnd.apple.mpegurl"), r.src = e;
19828
19828
  r.addEventListener("seeked", () => {
19829
- let e = k.current;
19829
+ let e = j.current;
19830
19830
  if (!e) return;
19831
19831
  let t = e.getContext("2d");
19832
- t && r.readyState >= 2 && (t.drawImage(r, 0, 0, e.width, e.height), $e(e.toDataURL("image/jpeg", .82)));
19832
+ t && r.readyState >= 2 && (t.drawImage(r, 0, 0, e.width, e.height), tt(e.toDataURL("image/jpeg", .82)));
19833
19833
  });
19834
19834
  let a;
19835
19835
  if (f) {
19836
19836
  let e = new vd(f);
19837
- D.current = e, a = e.createCallback();
19837
+ O.current = e, a = e.createCallback();
19838
19838
  }
19839
19839
  let o = new wd({
19840
- container: E.current,
19840
+ container: D.current,
19841
19841
  src: e,
19842
19842
  autoplay: t,
19843
19843
  muted: n,
19844
- keyMoments: Ae,
19844
+ keyMoments: W,
19845
19845
  subtitles: c,
19846
19846
  drm: {
19847
19847
  watermarkText: l,
@@ -19854,48 +19854,50 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
19854
19854
  themeColor: u
19855
19855
  });
19856
19856
  o.on("keymomentsloaded", (e) => {
19857
- je(e), g && g(e);
19857
+ Me(e), g && g(e);
19858
19858
  }), o.on("chaptersloaded", (e) => {
19859
- je(e), g && g(e);
19859
+ Me(e), g && g(e);
19860
19860
  }), o.on("play", () => {
19861
- re(!0), ge(!1);
19862
- }), o.on("pause", () => re(!1)), o.on("ended", () => {
19863
- re(!1), ge(!0);
19861
+ ae(!0), ve(!1);
19862
+ }), o.on("pause", () => ae(!1)), o.on("ended", () => {
19863
+ ae(!1), ve(!0);
19864
19864
  }), o.on("timeupdate", (e) => {
19865
- if (P.current && F.current !== null) if (Math.abs(e - F.current) < 5) P.current = !1, F.current = null, ee.current &&= (window.clearTimeout(ee.current), null);
19865
+ if (ee.current && te.current !== null) if (Math.abs(e - te.current) < 5) ee.current = !1, te.current = null, ne.current &&= (window.clearTimeout(ne.current), null);
19866
19866
  else return;
19867
- ae(e), oe(o.getDuration());
19867
+ oe(e), ce(o.getDuration());
19868
19868
  let t = o.keyMoments.getCurrentMoment(e);
19869
- ke({
19869
+ je({
19870
19870
  chapter: t.keyMoment,
19871
19871
  index: t.index
19872
19872
  });
19873
19873
  }), o.on("qualitylevels", (e) => {
19874
- ve(e);
19875
- }), o.on("qualitychange", (e) => {
19876
19874
  be(e);
19875
+ }), o.on("qualitychange", (e) => {
19876
+ xe(e);
19877
19877
  }), o.on("buffering", (e) => {
19878
- fe(e);
19878
+ pe(e);
19879
19879
  }), o.on("volumechange", (e) => {
19880
- ce(e.volume), ue(e.muted);
19880
+ ue(e.volume), fe(e.muted);
19881
19881
  }), o.on("pipchange", (e) => {
19882
- me(e);
19882
+ ge(e);
19883
19883
  }), o.subtitles.onSubtitleChange((e) => {
19884
- xe(e);
19884
+ Se(e);
19885
19885
  }), o.on("subtitlesloaded", (e) => {
19886
- we(Ad([...e]));
19886
+ Te(Ad([...e]));
19887
19887
  let t = e.find((e) => e.isDefault);
19888
- t && (o.subtitles.setActiveTrack(t.id), Se(t.id));
19888
+ t && (o.subtitles.setActiveTrack(t.id), we(t.id));
19889
19889
  }), o.on("audiotracksloaded", (e) => {
19890
- Te(e), De(e[0]?.id ?? 0);
19890
+ De(e), ke(e[0]?.id ?? 0);
19891
19891
  }), o.on("audiotrackchange", (e) => {
19892
- De(e);
19892
+ ke(e);
19893
19893
  }), o.casting.onCastStateChange((e, t) => {
19894
- Ve(e ? t : null);
19895
- }), ce(o.getVolume()), ue(o.isMuted()), L(o);
19894
+ Ue(e ? t : null);
19895
+ }), ue(o.getVolume()), fe(o.isMuted()), re(o), T && D.current && (k.current = !0, D.current.requestFullscreen().catch(() => {
19896
+ k.current = !1;
19897
+ }));
19896
19898
  let s = () => {
19897
19899
  let e = !!document.fullscreenElement;
19898
- pe(e);
19900
+ me(e);
19899
19901
  let t = o.getVideoElement();
19900
19902
  o.analytics.track(e ? "fullscreen_enter" : "fullscreen_exit", t);
19901
19903
  };
@@ -19932,125 +19934,133 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
19932
19934
  e.preventDefault(), o.togglePictureInPicture();
19933
19935
  break;
19934
19936
  case "c":
19935
- if (e.preventDefault(), o.subtitles.getActiveTrackId() !== "off") o.subtitles.setActiveTrack("off"), Se("off");
19937
+ if (e.preventDefault(), o.subtitles.getActiveTrackId() !== "off") o.subtitles.setActiveTrack("off"), we("off");
19936
19938
  else {
19937
- let e = lt.current;
19938
- e && e.length > 0 && (o.subtitles.setActiveTrack(e[0].id), Se(e[0].id));
19939
+ let e = dt.current;
19940
+ e && e.length > 0 && (o.subtitles.setActiveTrack(e[0].id), we(e[0].id));
19939
19941
  }
19940
19942
  break;
19941
19943
  default: return;
19942
19944
  }
19943
- ut();
19945
+ ft();
19944
19946
  }
19945
19947
  };
19946
- return document.addEventListener("keydown", p), ut(), () => {
19947
- o.destroy(), D.current?.destroy(), D.current = null, document.removeEventListener("fullscreenchange", s), document.removeEventListener("keydown", p), ot.current && window.clearTimeout(ot.current), j.current &&= (j.current.destroy(), null), A.current &&= (document.body.removeChild(A.current), null);
19948
+ return document.addEventListener("keydown", p), ft(), () => {
19949
+ o.destroy(), O.current?.destroy(), O.current = null, document.removeEventListener("fullscreenchange", s), document.removeEventListener("keydown", p), ct.current && window.clearTimeout(ct.current), N.current &&= (N.current.destroy(), null), M.current &&= (document.body.removeChild(M.current), null);
19948
19950
  };
19949
19951
  }, [e, l]), i(() => {
19950
- if (I) {
19951
- I.keyMoments.setKeyMoments(Ae);
19952
- let e = E.current?.querySelector("video");
19952
+ if (L) {
19953
+ L.keyMoments.setKeyMoments(W);
19954
+ let e = D.current?.querySelector("video");
19953
19955
  if (e) {
19954
- let t = I.keyMoments.getCurrentMoment(e.currentTime);
19955
- ke({
19956
+ let t = L.keyMoments.getCurrentMoment(e.currentTime);
19957
+ je({
19956
19958
  chapter: t.keyMoment,
19957
19959
  index: t.index
19958
19960
  });
19959
19961
  }
19960
19962
  }
19961
- }, [ze, I]), i(() => {
19963
+ }, [Ve, L]), i(() => {
19962
19964
  let e = (e) => {
19963
- W !== "none" && (e.target.closest(".sdk-menu-container") || Me("none"));
19965
+ Ne !== "none" && (e.target.closest(".sdk-menu-container") || Pe("none"));
19964
19966
  };
19965
19967
  return document.addEventListener("click", e), () => {
19966
19968
  document.removeEventListener("click", e);
19967
19969
  };
19968
- }, [W]), st.current = ne, ct.current = W, lt.current = Ce;
19969
- let ut = () => {
19970
- at(!0), ot.current && window.clearTimeout(ot.current), ot.current = window.setTimeout(() => {
19971
- st.current && ct.current === "none" && at(!1);
19970
+ }, [Ne]), i(() => {
19971
+ lt.current = ie;
19972
+ }, [ie]), i(() => {
19973
+ ut.current = Ne;
19974
+ }, [Ne]), i(() => {
19975
+ dt.current = U;
19976
+ }, [U]);
19977
+ let ft = () => {
19978
+ st(!0), ct.current && window.clearTimeout(ct.current), ct.current = window.setTimeout(() => {
19979
+ lt.current && ut.current === "none" && st(!1);
19972
19980
  }, 1e4);
19973
- }, dt = () => {
19974
- ut();
19975
- }, ft = () => {
19976
- I && (he ? (ht(0), I.play(), ge(!1)) : ne ? I.pause() : I.play(), ut());
19977
- }, pt = (e) => {
19978
- if (!O.current || !I || R === 0) return 0;
19979
- let t = O.current.getBoundingClientRect();
19980
- return Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * R;
19981
- }, mt = (e) => {
19982
- if (!I) return;
19983
- N.current = !0, rt(pt(e));
19981
+ }, pt = () => {
19982
+ ft();
19983
+ }, mt = () => {
19984
+ T && !k.current && D.current && (k.current = !0, D.current.requestFullscreen().catch(() => {}));
19985
+ }, ht = () => {
19986
+ L && (_e ? (vt(0), mt(), L.play(), ve(!1)) : ie ? L.pause() : (mt(), L.play()), ft());
19987
+ }, gt = (e) => {
19988
+ if (!A.current || !L || se === 0) return 0;
19989
+ let t = A.current.getBoundingClientRect();
19990
+ return Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * se;
19991
+ }, _t = (e) => {
19992
+ if (!L) return;
19993
+ F.current = !0, at(gt(e));
19984
19994
  let t = (e) => {
19985
- if (!N.current || !O.current) return;
19986
- let t = O.current.getBoundingClientRect(), n = Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * R;
19987
- rt(n), Ye(e.clientX - t.left), Ze(n), A.current && (A.current.currentTime = n), ut();
19995
+ if (!F.current || !A.current) return;
19996
+ let t = A.current.getBoundingClientRect(), n = Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * se;
19997
+ at(n), Ze(e.clientX - t.left), $e(n), M.current && (M.current.currentTime = n), ft();
19988
19998
  }, n = (e) => {
19989
- if (N.current = !1, O.current) {
19990
- let t = O.current.getBoundingClientRect();
19991
- ht(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * R);
19999
+ if (F.current = !1, A.current) {
20000
+ let t = A.current.getBoundingClientRect();
20001
+ vt(Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * se);
19992
20002
  }
19993
- rt(null), document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
20003
+ at(null), document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
19994
20004
  };
19995
20005
  document.addEventListener("mousemove", t), document.addEventListener("mouseup", n);
19996
- }, ht = (e) => {
19997
- if (!I) return;
19998
- let t = Math.max(0, R > 0 ? Math.min(e, R) : e);
19999
- P.current = !0, F.current = t, ae(t), I.seek(t), ee.current && window.clearTimeout(ee.current), ee.current = window.setTimeout(() => {
20000
- P.current = !1, F.current = null, ee.current = null;
20001
- }, 3e3);
20002
- }, gt = (e) => {
20003
- if (!I) return;
20004
- let t = parseFloat(e.target.value);
20005
- I.setVolume(t), ce(t), ue(t === 0);
20006
- }, _t = () => {
20007
- if (!I) return;
20008
- let e = !le;
20009
- I.setMute(e), ue(e);
20010
20006
  }, vt = (e) => {
20011
- I && (I.setPlaybackRate(e), Pe(e), Me("none"));
20007
+ if (!L) return;
20008
+ let t = Math.max(0, se > 0 ? Math.min(e, se) : e);
20009
+ ee.current = !0, te.current = t, oe(t), L.seek(t), ne.current && window.clearTimeout(ne.current), ne.current = window.setTimeout(() => {
20010
+ ee.current = !1, te.current = null, ne.current = null;
20011
+ }, 3e3);
20012
20012
  }, yt = (e) => {
20013
- if (!I) return;
20014
- I.setQuality(e);
20015
- let t = _e.find((t) => t.id === e);
20016
- t && be(t), Me("none");
20017
- }, bt = (e) => {
20018
- I && (I.subtitles.setActiveTrack(e), Se(e), Me("none"));
20013
+ if (!L) return;
20014
+ let t = parseFloat(e.target.value);
20015
+ L.setVolume(t), ue(t), fe(t === 0);
20016
+ }, bt = () => {
20017
+ if (!L) return;
20018
+ let e = !de;
20019
+ L.setMute(e), fe(e);
20019
20020
  }, xt = (e) => {
20020
- ht(e), Me("none");
20021
- }, St = () => {
20022
- I && I.togglePictureInPicture();
20023
- }, Ct = () => {
20024
- I && I.toggleFullscreen();
20025
- }, wt = () => {
20026
- I && (Be ? I.casting.stopCasting() : I.casting.requestSession(e, ie));
20021
+ L && (L.setPlaybackRate(e), Ie(e), Pe("none"));
20022
+ }, St = (e) => {
20023
+ if (!L) return;
20024
+ L.setQuality(e);
20025
+ let t = ye.find((t) => t.id === e);
20026
+ t && xe(t), Pe("none");
20027
+ }, Ct = (e) => {
20028
+ L && (L.subtitles.setActiveTrack(e), we(e), Pe("none"));
20029
+ }, wt = (e) => {
20030
+ vt(e), Pe("none");
20027
20031
  }, Tt = () => {
20028
- if (!I) return;
20029
- let e = I.getVideoElement();
20030
- if (We) {
20031
- I.casting.stopAirPlay(e);
20032
+ L && L.togglePictureInPicture();
20033
+ }, Et = () => {
20034
+ L && L.toggleFullscreen();
20035
+ }, Dt = () => {
20036
+ L && (He ? L.casting.stopCasting() : L.casting.requestSession(e, R));
20037
+ }, Ot = () => {
20038
+ if (!L) return;
20039
+ let e = L.getVideoElement();
20040
+ if (Ke) {
20041
+ L.casting.stopAirPlay(e);
20032
20042
  return;
20033
20043
  }
20034
- typeof e.webkitShowPlaybackTargetPicker == "function" || I.casting.isAirPlayAvailable() ? I.casting.requestAirPlaySession(e) : console.warn("[PlayerSDK AirPlay] AirPlay is not available on this device.");
20035
- }, Et = (e) => {
20036
- if (!O.current || R === 0 || !I) return;
20037
- let t = O.current.getBoundingClientRect(), n = Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * R;
20038
- Ye(e.clientX - t.left), Ze(n), M.current && window.clearTimeout(M.current), M.current = window.setTimeout(() => {
20039
- A.current && (A.current.currentTime = n);
20040
- }, 100), tt(I.keyMoments.getCurrentMoment(n).keyMoment);
20041
- }, Dt = () => {
20042
- Ye(null), $e(null), tt(null), M.current && window.clearTimeout(M.current);
20043
- }, Ot = (e) => {
20044
+ typeof e.webkitShowPlaybackTargetPicker == "function" || L.casting.isAirPlayAvailable() ? L.casting.requestAirPlaySession(e) : console.warn("[PlayerSDK AirPlay] AirPlay is not available on this device.");
20045
+ }, kt = (e) => {
20046
+ if (!A.current || se === 0 || !L) return;
20047
+ let t = A.current.getBoundingClientRect(), n = Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)) * se;
20048
+ Ze(e.clientX - t.left), $e(n), P.current && window.clearTimeout(P.current), P.current = window.setTimeout(() => {
20049
+ M.current && (M.current.currentTime = n);
20050
+ }, 100), rt(L.keyMoments.getCurrentMoment(n).keyMoment);
20051
+ }, At = () => {
20052
+ Ze(null), tt(null), rt(null), P.current && window.clearTimeout(P.current);
20053
+ }, jt = (e) => {
20044
20054
  if (isNaN(e) || e < 0) return "00:00";
20045
20055
  let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60, a = (e) => String(e).padStart(2, "0");
20046
20056
  return n > 0 ? `${a(n)}:${a(r)}:${a(i)}` : `${a(r)}:${a(i)}`;
20047
- }, kt = () => p(le || se === 0 ? fd : se < .3 ? pd : se < .7 ? ud : dd, { size: 18 }), At = (e) => {
20048
- Me(W === e ? "none" : e);
20057
+ }, Mt = () => p(de || le === 0 ? fd : le < .3 ? pd : le < .7 ? ud : dd, { size: 18 }), Nt = (e) => {
20058
+ Pe(Ne === e ? "none" : e);
20049
20059
  };
20050
20060
  return /* @__PURE__ */ m("div", {
20051
- ref: E,
20052
- className: `sdk-player-container ${it ? "controls-active" : ""}`,
20053
- onMouseMove: dt,
20061
+ ref: D,
20062
+ className: `sdk-player-container ${ot ? "controls-active" : ""}`,
20063
+ onMouseMove: pt,
20054
20064
  onMouseLeave: () => {},
20055
20065
  style: {
20056
20066
  border: "1px solid rgba(255, 255, 255, 0.08)",
@@ -20059,7 +20069,7 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20059
20069
  },
20060
20070
  children: [
20061
20071
  /* @__PURE__ */ p("canvas", {
20062
- ref: k,
20072
+ ref: j,
20063
20073
  width: 160,
20064
20074
  height: 90,
20065
20075
  style: {
@@ -20069,24 +20079,24 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20069
20079
  }
20070
20080
  }),
20071
20081
  /* @__PURE__ */ p("div", {
20072
- className: `sdk-spinner-overlay ${de ? "active" : ""}`,
20082
+ className: `sdk-spinner-overlay ${z ? "active" : ""}`,
20073
20083
  children: /* @__PURE__ */ p("div", { className: "sdk-spinner" })
20074
20084
  }),
20075
- V && H !== "off" && /* @__PURE__ */ p("div", {
20085
+ H && Ce !== "off" && /* @__PURE__ */ p("div", {
20076
20086
  className: "sdk-subtitles-overlay",
20077
20087
  children: /* @__PURE__ */ p("span", {
20078
20088
  className: "sdk-subtitles-text",
20079
20089
  style: {
20080
- fontSize: T.size === "small" ? "14px" : T.size === "large" ? "24px" : "18px",
20081
- color: T.color ?? "#ffffff",
20082
- background: T.background === "none" ? "transparent" : T.background === "solid" ? "rgba(0, 0, 0, 0.92)" : "rgba(15, 23, 42, 0.78)",
20083
- border: T.background === "none" ? "none" : "1px solid rgba(255,255,255,0.08)",
20084
- backdropFilter: T.background === "none" ? "none" : "blur(8px)"
20090
+ fontSize: E.size === "small" ? "14px" : E.size === "large" ? "24px" : "18px",
20091
+ color: E.color ?? "#ffffff",
20092
+ background: E.background === "none" ? "transparent" : E.background === "solid" ? "rgba(0, 0, 0, 0.92)" : "rgba(15, 23, 42, 0.78)",
20093
+ border: E.background === "none" ? "none" : "1px solid rgba(255,255,255,0.08)",
20094
+ backdropFilter: E.background === "none" ? "none" : "blur(8px)"
20085
20095
  },
20086
- dangerouslySetInnerHTML: { __html: V }
20096
+ dangerouslySetInnerHTML: { __html: H }
20087
20097
  })
20088
20098
  }),
20089
- (Be || We) && /* @__PURE__ */ m("div", {
20099
+ (He || Ke) && /* @__PURE__ */ m("div", {
20090
20100
  className: "sdk-cast-screen",
20091
20101
  children: [
20092
20102
  /* @__PURE__ */ p(Zu, {
@@ -20095,27 +20105,27 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20095
20105
  }),
20096
20106
  /* @__PURE__ */ p("div", {
20097
20107
  className: "sdk-cast-title",
20098
- children: Be ? `Casting to ${Be}` : `AirPlay to ${Ke || "device"}`
20108
+ children: He ? `Casting to ${He}` : `AirPlay to ${Je || "device"}`
20099
20109
  }),
20100
20110
  /* @__PURE__ */ p("div", {
20101
20111
  className: "sdk-cast-desc",
20102
- children: Be ? "This media asset is currently streaming on your external screen." : `This media asset is currently streaming via AirPlay${Ke ? ` to ${Ke}` : ""}.`
20112
+ children: He ? "This media asset is currently streaming on your external screen." : `This media asset is currently streaming via AirPlay${Je ? ` to ${Je}` : ""}.`
20103
20113
  }),
20104
20114
  /* @__PURE__ */ p("button", {
20105
20115
  className: "sdk-cast-disconnect-btn",
20106
20116
  onClick: () => {
20107
- Be ? I?.casting.stopCasting() : We && I?.casting.stopAirPlay(I.getVideoElement());
20117
+ He ? L?.casting.stopCasting() : Ke && L?.casting.stopAirPlay(L.getVideoElement());
20108
20118
  },
20109
20119
  children: "Disconnect Streaming"
20110
20120
  })
20111
20121
  ]
20112
20122
  }),
20113
- !Be && !ne && /* @__PURE__ */ p("div", {
20123
+ !He && !ie && /* @__PURE__ */ p("div", {
20114
20124
  className: "sdk-center-action-overlay",
20115
- onClick: ft,
20125
+ onClick: ht,
20116
20126
  children: /* @__PURE__ */ p("div", {
20117
20127
  className: "sdk-center-action-btn",
20118
- children: he ? /* @__PURE__ */ p(sd, {
20128
+ children: _e ? /* @__PURE__ */ p(sd, {
20119
20129
  size: 32,
20120
20130
  className: "sdk-center-icon"
20121
20131
  }) : /* @__PURE__ */ p(od, {
@@ -20126,43 +20136,43 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20126
20136
  })
20127
20137
  })
20128
20138
  }),
20129
- !Be && /* @__PURE__ */ p("div", {
20139
+ !He && /* @__PURE__ */ p("div", {
20130
20140
  className: "sdk-controls-overlay",
20131
20141
  onClick: (e) => {
20132
- e.target === e.currentTarget && ft();
20142
+ e.target === e.currentTarget && ht();
20133
20143
  },
20134
20144
  children: _ && /* @__PURE__ */ m("div", {
20135
20145
  className: "sdk-control-bar",
20136
20146
  children: [/* @__PURE__ */ m("div", {
20137
- ref: O,
20147
+ ref: A,
20138
20148
  className: "sdk-seekbar-container",
20139
- onMouseDown: mt,
20140
- onMouseMove: Et,
20141
- onMouseLeave: Dt,
20149
+ onMouseDown: _t,
20150
+ onMouseMove: kt,
20151
+ onMouseLeave: At,
20142
20152
  children: [
20143
20153
  /* @__PURE__ */ p("div", {
20144
20154
  className: "sdk-seekbar-buffered",
20145
- style: { width: `${R ? (I && I.getBufferedRanges()[0]?.end || 0) / R * 100 : 0}%` }
20155
+ style: { width: `${se ? (L && L.getBufferedRanges()[0]?.end || 0) / se * 100 : 0}%` }
20146
20156
  }),
20147
20157
  /* @__PURE__ */ p("div", {
20148
20158
  className: "sdk-seekbar-progress",
20149
20159
  style: {
20150
- width: `${R ? (nt === null ? ie : nt) / R * 100 : 0}%`,
20160
+ width: `${se ? (it === null ? R : it) / se * 100 : 0}%`,
20151
20161
  background: u
20152
20162
  },
20153
20163
  children: /* @__PURE__ */ p("div", { className: "sdk-seekbar-handle" })
20154
20164
  }),
20155
- y && Ae.map((e, t) => R === 0 ? null : /* @__PURE__ */ p("div", {
20165
+ y && W.map((e, t) => se === 0 ? null : /* @__PURE__ */ p("div", {
20156
20166
  className: "sdk-seekbar-chapter-marker",
20157
- style: { left: `${e.startTime / R * 100}%` }
20167
+ style: { left: `${e.startTime / se * 100}%` }
20158
20168
  }, t)),
20159
- Je !== null && Qe && /* @__PURE__ */ m("div", {
20169
+ Xe !== null && et && /* @__PURE__ */ m("div", {
20160
20170
  className: "sdk-thumbnail-tooltip",
20161
- style: { left: `${Je}px` },
20171
+ style: { left: `${Xe}px` },
20162
20172
  children: [/* @__PURE__ */ p("div", {
20163
20173
  className: "sdk-thumbnail-preview",
20164
20174
  children: /* @__PURE__ */ p("img", {
20165
- src: Qe,
20175
+ src: et,
20166
20176
  alt: "preview",
20167
20177
  style: {
20168
20178
  width: "100%",
@@ -20174,9 +20184,9 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20174
20184
  })
20175
20185
  }), /* @__PURE__ */ m("div", {
20176
20186
  className: "sdk-thumbnail-text",
20177
- children: [Ot(Xe), et && /* @__PURE__ */ p("div", {
20187
+ children: [jt(Qe), nt && /* @__PURE__ */ p("div", {
20178
20188
  className: "sdk-thumbnail-chapter",
20179
- children: et.title
20189
+ children: nt.title
20180
20190
  })]
20181
20191
  })]
20182
20192
  })
@@ -20188,9 +20198,9 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20188
20198
  children: [
20189
20199
  /* @__PURE__ */ p("button", {
20190
20200
  className: "sdk-control-btn",
20191
- onClick: ft,
20192
- title: ne ? "Pause" : "Play",
20193
- children: p(ne ? id : od, {
20201
+ onClick: ht,
20202
+ title: ie ? "Pause" : "Play",
20203
+ children: p(ie ? id : od, {
20194
20204
  size: 18,
20195
20205
  fill: "currentColor"
20196
20206
  })
@@ -20198,14 +20208,14 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20198
20208
  /* @__PURE__ */ p("button", {
20199
20209
  className: "sdk-control-btn",
20200
20210
  onClick: () => {
20201
- ht(0), ne || I?.play();
20211
+ vt(0), ie || L?.play();
20202
20212
  },
20203
20213
  title: "Replay from beginning",
20204
20214
  children: /* @__PURE__ */ p(sd, { size: 18 })
20205
20215
  }),
20206
20216
  /* @__PURE__ */ p("button", {
20207
20217
  className: "sdk-control-btn",
20208
- onClick: () => ht(ie - 10),
20218
+ onClick: () => vt(R - 10),
20209
20219
  title: "Rewind 10s",
20210
20220
  children: /* @__PURE__ */ m("div", {
20211
20221
  style: {
@@ -20234,7 +20244,7 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20234
20244
  }),
20235
20245
  /* @__PURE__ */ p("button", {
20236
20246
  className: "sdk-control-btn",
20237
- onClick: () => ht(ie + 10),
20247
+ onClick: () => vt(R + 10),
20238
20248
  title: "Forward 10s",
20239
20249
  children: /* @__PURE__ */ m("div", {
20240
20250
  style: {
@@ -20265,8 +20275,8 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20265
20275
  className: "sdk-volume-group",
20266
20276
  children: [/* @__PURE__ */ p("button", {
20267
20277
  className: "sdk-control-btn",
20268
- onClick: _t,
20269
- children: kt()
20278
+ onClick: bt,
20279
+ children: Mt()
20270
20280
  }), /* @__PURE__ */ p("div", {
20271
20281
  className: "sdk-volume-slider-container",
20272
20282
  children: /* @__PURE__ */ p("input", {
@@ -20274,25 +20284,25 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20274
20284
  min: "0",
20275
20285
  max: "1",
20276
20286
  step: "0.05",
20277
- value: le ? 0 : se,
20278
- onChange: gt,
20287
+ value: de ? 0 : le,
20288
+ onChange: yt,
20279
20289
  className: "sdk-volume-slider",
20280
- style: { "--volume-pct": `${(le ? 0 : se) * 100}%` }
20290
+ style: { "--volume-pct": `${(de ? 0 : le) * 100}%` }
20281
20291
  })
20282
20292
  })]
20283
20293
  }),
20284
20294
  /* @__PURE__ */ m("div", {
20285
20295
  className: "sdk-time-display",
20286
20296
  children: [
20287
- Ot(nt === null ? ie : nt),
20297
+ jt(it === null ? R : it),
20288
20298
  " / ",
20289
- Ot(R)
20299
+ jt(se)
20290
20300
  ]
20291
20301
  }),
20292
- y && Oe.chapter && /* @__PURE__ */ m("div", {
20293
- className: `sdk-chapter-badge ${Fe ? "active" : ""}`,
20302
+ y && Ae.chapter && /* @__PURE__ */ m("div", {
20303
+ className: `sdk-chapter-badge ${Le ? "active" : ""}`,
20294
20304
  title: "Toggle Key Moments side panel",
20295
- onClick: () => Ie(!Fe),
20305
+ onClick: () => Re(!Le),
20296
20306
  style: {
20297
20307
  cursor: "pointer",
20298
20308
  display: "flex",
@@ -20305,13 +20315,13 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20305
20315
  }),
20306
20316
  /* @__PURE__ */ p("span", {
20307
20317
  style: { marginRight: "3px" },
20308
- children: Oe.chapter.title
20318
+ children: Ae.chapter.title
20309
20319
  }),
20310
20320
  /* @__PURE__ */ p($u, {
20311
20321
  size: 10,
20312
20322
  style: {
20313
20323
  opacity: .8,
20314
- transform: Fe ? "rotate(90deg)" : "none",
20324
+ transform: Le ? "rotate(90deg)" : "none",
20315
20325
  transition: "transform 0.2s ease"
20316
20326
  }
20317
20327
  })
@@ -20323,37 +20333,37 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20323
20333
  children: [
20324
20334
  v && /* @__PURE__ */ p("button", {
20325
20335
  className: "sdk-control-btn",
20326
- onClick: wt,
20336
+ onClick: Dt,
20327
20337
  title: "Cast Stream",
20328
- style: { color: Be ? "#3b82f6" : "" },
20338
+ style: { color: He ? "#3b82f6" : "" },
20329
20339
  children: /* @__PURE__ */ p(Zu, { size: 18 })
20330
20340
  }),
20331
- He && /* @__PURE__ */ p("button", {
20341
+ We && /* @__PURE__ */ p("button", {
20332
20342
  className: "sdk-control-btn",
20333
- onClick: Tt,
20343
+ onClick: Ot,
20334
20344
  title: "AirPlay",
20335
20345
  style: { color: u },
20336
20346
  children: /* @__PURE__ */ p(Yu, { size: 18 })
20337
20347
  }),
20338
- U.length > 1 && /* @__PURE__ */ m("div", {
20348
+ Ee.length > 1 && /* @__PURE__ */ m("div", {
20339
20349
  className: "sdk-menu-container",
20340
20350
  children: [/* @__PURE__ */ p("button", {
20341
20351
  className: "sdk-control-btn",
20342
- onClick: () => At("audio"),
20352
+ onClick: () => Nt("audio"),
20343
20353
  title: "Audio track",
20344
- style: { color: W === "audio" ? u : "" },
20354
+ style: { color: Ne === "audio" ? u : "" },
20345
20355
  children: /* @__PURE__ */ p(ed, { size: 18 })
20346
- }), W === "audio" && /* @__PURE__ */ m("div", {
20356
+ }), Ne === "audio" && /* @__PURE__ */ m("div", {
20347
20357
  className: "sdk-dropup-menu",
20348
20358
  children: [/* @__PURE__ */ p("div", {
20349
20359
  className: "sdk-dropup-header",
20350
20360
  children: "Audio Tracks"
20351
- }), U.map((e) => /* @__PURE__ */ m("div", {
20352
- className: `sdk-dropup-item ${Ee === e.id ? "active" : ""}`,
20361
+ }), Ee.map((e) => /* @__PURE__ */ m("div", {
20362
+ className: `sdk-dropup-item ${Oe === e.id ? "active" : ""}`,
20353
20363
  onClick: () => {
20354
- I?.setAudioTrack(e.id), De(e.id), Me("none");
20364
+ L?.setAudioTrack(e.id), ke(e.id), Pe("none");
20355
20365
  },
20356
- children: [/* @__PURE__ */ p("span", { children: kd(e) }), Ee === e.id && /* @__PURE__ */ p(Qu, { size: 12 })]
20366
+ children: [/* @__PURE__ */ p("span", { children: kd(e) }), Oe === e.id && /* @__PURE__ */ p(Qu, { size: 12 })]
20357
20367
  }, e.id))]
20358
20368
  })]
20359
20369
  }),
@@ -20361,11 +20371,11 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20361
20371
  className: "sdk-menu-container",
20362
20372
  children: [/* @__PURE__ */ p("button", {
20363
20373
  className: "sdk-control-btn",
20364
- onClick: () => At("subtitles"),
20374
+ onClick: () => Nt("subtitles"),
20365
20375
  title: "Subtitles track selector",
20366
- style: { color: H === "off" ? "" : u },
20376
+ style: { color: Ce === "off" ? "" : u },
20367
20377
  children: /* @__PURE__ */ p(Xu, { size: 18 })
20368
- }), W === "subtitles" && /* @__PURE__ */ m("div", {
20378
+ }), Ne === "subtitles" && /* @__PURE__ */ m("div", {
20369
20379
  className: "sdk-dropup-menu",
20370
20380
  children: [
20371
20381
  /* @__PURE__ */ p("div", {
@@ -20373,14 +20383,14 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20373
20383
  children: "Subtitles"
20374
20384
  }),
20375
20385
  /* @__PURE__ */ m("div", {
20376
- className: `sdk-dropup-item ${H === "off" ? "active" : ""}`,
20377
- onClick: () => bt("off"),
20378
- children: [/* @__PURE__ */ p("span", { children: "Off" }), H === "off" && /* @__PURE__ */ p(Qu, { size: 12 })]
20386
+ className: `sdk-dropup-item ${Ce === "off" ? "active" : ""}`,
20387
+ onClick: () => Ct("off"),
20388
+ children: [/* @__PURE__ */ p("span", { children: "Off" }), Ce === "off" && /* @__PURE__ */ p(Qu, { size: 12 })]
20379
20389
  }),
20380
- Ce.map((e) => /* @__PURE__ */ m("div", {
20381
- className: `sdk-dropup-item ${H === e.id ? "active" : ""}`,
20382
- onClick: () => bt(e.id),
20383
- children: [/* @__PURE__ */ p("span", { children: kd(e) }), H === e.id && /* @__PURE__ */ p(Qu, { size: 12 })]
20390
+ U.map((e) => /* @__PURE__ */ m("div", {
20391
+ className: `sdk-dropup-item ${Ce === e.id ? "active" : ""}`,
20392
+ onClick: () => Ct(e.id),
20393
+ children: [/* @__PURE__ */ p("span", { children: kd(e) }), Ce === e.id && /* @__PURE__ */ p(Qu, { size: 12 })]
20384
20394
  }, e.id))
20385
20395
  ]
20386
20396
  })]
@@ -20389,19 +20399,19 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20389
20399
  className: "sdk-menu-container",
20390
20400
  children: [/* @__PURE__ */ p("button", {
20391
20401
  className: "sdk-control-btn",
20392
- onClick: () => At("quality"),
20402
+ onClick: () => Nt("quality"),
20393
20403
  title: "Stream Quality settings",
20394
- style: { color: ye.id === -1 ? "" : u },
20404
+ style: { color: V.id === -1 ? "" : u },
20395
20405
  children: /* @__PURE__ */ p(ld, { size: 18 })
20396
- }), W === "quality" && /* @__PURE__ */ m("div", {
20406
+ }), Ne === "quality" && /* @__PURE__ */ m("div", {
20397
20407
  className: "sdk-dropup-menu large",
20398
20408
  children: [/* @__PURE__ */ p("div", {
20399
20409
  className: "sdk-dropup-header",
20400
20410
  children: "Quality Options"
20401
- }), _e.map((e) => /* @__PURE__ */ m("div", {
20402
- className: `sdk-dropup-item ${ye.id === e.id ? "active" : ""}`,
20403
- onClick: () => yt(e.id),
20404
- children: [/* @__PURE__ */ p("span", { children: e.label }), ye.id === e.id && /* @__PURE__ */ p(Qu, { size: 12 })]
20411
+ }), ye.map((e) => /* @__PURE__ */ m("div", {
20412
+ className: `sdk-dropup-item ${V.id === e.id ? "active" : ""}`,
20413
+ onClick: () => St(e.id),
20414
+ children: [/* @__PURE__ */ p("span", { children: e.label }), V.id === e.id && /* @__PURE__ */ p(Qu, { size: 12 })]
20405
20415
  }, e.id))]
20406
20416
  })]
20407
20417
  }),
@@ -20409,16 +20419,16 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20409
20419
  className: "sdk-menu-container",
20410
20420
  children: [/* @__PURE__ */ p("button", {
20411
20421
  className: "sdk-control-btn",
20412
- onClick: () => At("speed"),
20422
+ onClick: () => Nt("speed"),
20413
20423
  title: "Playback Speed",
20414
20424
  children: /* @__PURE__ */ m("span", {
20415
20425
  style: {
20416
20426
  fontSize: "11px",
20417
20427
  fontWeight: "bold"
20418
20428
  },
20419
- children: [Ne, "x"]
20429
+ children: [Fe, "x"]
20420
20430
  })
20421
- }), W === "speed" && /* @__PURE__ */ m("div", {
20431
+ }), Ne === "speed" && /* @__PURE__ */ m("div", {
20422
20432
  className: "sdk-dropup-menu",
20423
20433
  children: [/* @__PURE__ */ p("div", {
20424
20434
  className: "sdk-dropup-header",
@@ -20431,31 +20441,31 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20431
20441
  1.5,
20432
20442
  2
20433
20443
  ].map((e) => /* @__PURE__ */ m("div", {
20434
- className: `sdk-dropup-item ${Ne === e ? "active" : ""}`,
20435
- onClick: () => vt(e),
20436
- children: [/* @__PURE__ */ p("span", { children: e === 1 ? "Normal" : `${e}x` }), Ne === e && /* @__PURE__ */ p(Qu, { size: 12 })]
20444
+ className: `sdk-dropup-item ${Fe === e ? "active" : ""}`,
20445
+ onClick: () => xt(e),
20446
+ children: [/* @__PURE__ */ p("span", { children: e === 1 ? "Normal" : `${e}x` }), Fe === e && /* @__PURE__ */ p(Qu, { size: 12 })]
20437
20447
  }, e))]
20438
20448
  })]
20439
20449
  }),
20440
20450
  C && /* @__PURE__ */ p("button", {
20441
20451
  className: "sdk-control-btn",
20442
- onClick: St,
20452
+ onClick: Tt,
20443
20453
  title: "Picture-in-Picture",
20444
- style: { color: B ? u : "" },
20454
+ style: { color: he ? u : "" },
20445
20455
  children: /* @__PURE__ */ p(ad, { size: 18 })
20446
20456
  }),
20447
20457
  w && /* @__PURE__ */ p("button", {
20448
20458
  className: "sdk-control-btn",
20449
- onClick: Ct,
20459
+ onClick: Et,
20450
20460
  title: "Fullscreen",
20451
- children: p(z ? rd : nd, { size: 18 })
20461
+ children: p(B ? rd : nd, { size: 18 })
20452
20462
  })
20453
20463
  ]
20454
20464
  })]
20455
20465
  })]
20456
20466
  })
20457
20467
  }),
20458
- y && Fe && Ae.length > 0 && /* @__PURE__ */ m("div", {
20468
+ y && Le && W.length > 0 && /* @__PURE__ */ m("div", {
20459
20469
  className: "sdk-sidebar-panel",
20460
20470
  children: [
20461
20471
  /* @__PURE__ */ m("div", {
@@ -20465,7 +20475,7 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20465
20475
  children: "In this video"
20466
20476
  }), /* @__PURE__ */ p("button", {
20467
20477
  className: "sdk-sidebar-close-btn",
20468
- onClick: () => Ie(!1),
20478
+ onClick: () => Re(!1),
20469
20479
  title: "Close panel",
20470
20480
  children: /* @__PURE__ */ p(md, { size: 16 })
20471
20481
  })]
@@ -20479,16 +20489,16 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20479
20489
  }),
20480
20490
  /* @__PURE__ */ p("div", {
20481
20491
  className: "sdk-sidebar-content",
20482
- children: Ae.map((e, t) => {
20483
- let n = Oe.index === t;
20492
+ children: W.map((e, t) => {
20493
+ let n = Ae.index === t;
20484
20494
  return /* @__PURE__ */ m("div", {
20485
20495
  className: `sdk-sidebar-chapter-row ${n ? "active" : ""}`,
20486
- onClick: () => xt(e.startTime),
20496
+ onClick: () => wt(e.startTime),
20487
20497
  children: [/* @__PURE__ */ m("div", {
20488
20498
  className: "sdk-sidebar-chapter-thumbnail",
20489
20499
  style: { overflow: "hidden" },
20490
- children: [Le[t] || e.thumbnail ? /* @__PURE__ */ p("img", {
20491
- src: Le[t] || e.thumbnail,
20500
+ children: [ze[t] || e.thumbnail ? /* @__PURE__ */ p("img", {
20501
+ src: ze[t] || e.thumbnail,
20492
20502
  alt: e.title,
20493
20503
  style: {
20494
20504
  width: "100%",
@@ -20502,7 +20512,7 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20502
20512
  style: { color: n ? u : "rgba(255,255,255,0.4)" }
20503
20513
  }), /* @__PURE__ */ p("span", {
20504
20514
  className: "sdk-sidebar-chapter-time",
20505
- children: Ot(e.startTime)
20515
+ children: jt(e.startTime)
20506
20516
  })]
20507
20517
  }), /* @__PURE__ */ m("div", {
20508
20518
  className: "sdk-sidebar-chapter-info",
@@ -20512,7 +20522,7 @@ var Bu = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e)
20512
20522
  children: e.title
20513
20523
  }), /* @__PURE__ */ m("div", {
20514
20524
  className: "sdk-sidebar-chapter-duration",
20515
- children: ["Start at ", Ot(e.startTime)]
20525
+ children: ["Start at ", jt(e.startTime)]
20516
20526
  })]
20517
20527
  })]
20518
20528
  }, t);