@oddin-gg/havik-player 2.4.0 → 2.5.1

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.d.cts CHANGED
@@ -663,7 +663,15 @@ export declare interface PlaybackErrorInit {
663
663
 
664
664
  export declare interface PlaybackStats {
665
665
  droppedFrames: number;
666
- /** Frames decoded this session — the denominator dropped frames need. */
666
+ /**
667
+ * TOTAL frames this session — the denominator dropped frames need, and it
668
+ * ALREADY INCLUDES the dropped ones (it is
669
+ * `VideoPlaybackQuality.totalVideoFrames`). So the ratio is
670
+ * `droppedFrames / decodedFrames`, with nothing added to the bottom.
671
+ *
672
+ * The name says "decoded" because it is the wire field's name and a
673
+ * contract rename is not worth a migration (plan D10). Read it as "total".
674
+ */
667
675
  decodedFrames?: number;
668
676
  /** Live-edge latency in seconds (hls.js engine only). */
669
677
  latencySeconds?: number;
package/dist/index.d.ts CHANGED
@@ -663,7 +663,15 @@ export declare interface PlaybackErrorInit {
663
663
 
664
664
  export declare interface PlaybackStats {
665
665
  droppedFrames: number;
666
- /** Frames decoded this session — the denominator dropped frames need. */
666
+ /**
667
+ * TOTAL frames this session — the denominator dropped frames need, and it
668
+ * ALREADY INCLUDES the dropped ones (it is
669
+ * `VideoPlaybackQuality.totalVideoFrames`). So the ratio is
670
+ * `droppedFrames / decodedFrames`, with nothing added to the bottom.
671
+ *
672
+ * The name says "decoded" because it is the wire field's name and a
673
+ * contract rename is not worth a migration (plan D10). Read it as "total".
674
+ */
667
675
  decodedFrames?: number;
668
676
  /** Live-edge latency in seconds (hls.js engine only). */
669
677
  latencySeconds?: number;
package/dist/index.js CHANGED
@@ -142,7 +142,7 @@ function ae(e, t) {
142
142
  t?.addEventListener("abort", a, { once: !0 });
143
143
  });
144
144
  }
145
- async function v(e, t, r) {
145
+ async function oe(e, t, r) {
146
146
  let i = ee(t), a = Date.now(), s = i.timeoutMs == null ? Infinity : a + i.timeoutMs, c = 0, l;
147
147
  for (;;) {
148
148
  if (r?.aborted) throw new n("ABORTED", 0, "wait-for-live aborted");
@@ -168,21 +168,21 @@ async function v(e, t, r) {
168
168
  }
169
169
  //#endregion
170
170
  //#region src/core/resolve.ts
171
- async function y(e) {
171
+ async function v(e) {
172
172
  if (!e.matchUrn || typeof e.matchUrn != "string") throw new n("INVALID_URN", 0, "resolveStream: a non-empty matchUrn is required");
173
173
  let t = await u(c(e.baseUrl, `/v1/playback/${encodeURIComponent(e.matchUrn)}`), {
174
174
  credential: e.credential,
175
175
  signal: e.signal,
176
176
  apiHeaders: e.apiHeaders
177
177
  });
178
- if (!t.ok) throw await oe(t);
179
- return ce(await t.json(), e.matchUrn);
178
+ if (!t.ok) throw await se(t);
179
+ return le(await t.json(), e.matchUrn);
180
180
  }
181
- function b(e) {
182
- let t = () => y(e);
183
- return e.waitForLive ? v(t, e.waitForLive, e.signal) : t();
181
+ function y(e) {
182
+ let t = () => v(e);
183
+ return e.waitForLive ? oe(t, e.waitForLive, e.signal) : t();
184
184
  }
185
- async function oe(e) {
185
+ async function se(e) {
186
186
  let t = l(e.headers.get("retry-after")), i = e.headers.get("x-request-id") ?? e.headers.get("x-amzn-requestid") ?? void 0, a = e.statusText || `HTTP ${e.status}`, o, s;
187
187
  try {
188
188
  let t = await e.json();
@@ -198,7 +198,7 @@ async function oe(e) {
198
198
  liveStartsAtMs: s
199
199
  });
200
200
  }
201
- var se = /* @__PURE__ */ new Set([
201
+ var ce = /* @__PURE__ */ new Set([
202
202
  "matchUrn",
203
203
  "protocol",
204
204
  "drmEnabled",
@@ -209,7 +209,7 @@ var se = /* @__PURE__ */ new Set([
209
209
  "expiresAt",
210
210
  "analytics"
211
211
  ]);
212
- function x(e, t) {
212
+ function b(e, t) {
213
213
  let r;
214
214
  try {
215
215
  r = new URL(t);
@@ -219,36 +219,36 @@ function x(e, t) {
219
219
  if (r.protocol !== "https:" && r.protocol !== "http:") throw new n("INTERNAL", 0, `playback ${e} has a disallowed scheme: ${r.protocol}`);
220
220
  return t;
221
221
  }
222
- function ce(e, t) {
222
+ function le(e, t) {
223
223
  if (!e.manifestUrl) throw new n("INTERNAL", 0, "playback response is missing manifestUrl");
224
224
  let r = e.drmEnabled ?? !!e.drm, i = {
225
225
  matchUrn: e.matchUrn ?? t,
226
226
  protocol: "hls",
227
227
  drmEnabled: r,
228
- manifestUrl: x("manifestUrl", e.manifestUrl),
228
+ manifestUrl: b("manifestUrl", e.manifestUrl),
229
229
  serverTime: e.serverTime ?? ""
230
230
  };
231
231
  if (e.liveStartsAt && (i.liveStartsAt = e.liveStartsAt), typeof e.analytics?.sid == "string" && e.analytics.sid && (i.analytics = { sid: e.analytics.sid }), r && e.drm) {
232
232
  let t = {};
233
- e.drm.widevine?.licenseUrl && (t.widevine = { licenseUrl: x("widevine licenseUrl", e.drm.widevine.licenseUrl) }), e.drm.fairplay?.licenseUrl && e.drm.fairplay.certificateUrl && (t.fairplay = {
234
- licenseUrl: x("fairplay licenseUrl", e.drm.fairplay.licenseUrl),
235
- certificateUrl: x("fairplay certificateUrl", e.drm.fairplay.certificateUrl)
233
+ e.drm.widevine?.licenseUrl && (t.widevine = { licenseUrl: b("widevine licenseUrl", e.drm.widevine.licenseUrl) }), e.drm.fairplay?.licenseUrl && e.drm.fairplay.certificateUrl && (t.fairplay = {
234
+ licenseUrl: b("fairplay licenseUrl", e.drm.fairplay.licenseUrl),
235
+ certificateUrl: b("fairplay certificateUrl", e.drm.fairplay.certificateUrl)
236
236
  }), (t.widevine || t.fairplay) && (i.drm = t);
237
237
  }
238
238
  let a = {};
239
- for (let [t, n] of Object.entries(e)) se.has(t) || (a[t] = n);
239
+ for (let [t, n] of Object.entries(e)) ce.has(t) || (a[t] = n);
240
240
  return Object.keys(a).length > 0 && (i.extensions = a), i;
241
241
  }
242
242
  //#endregion
243
243
  //#region src/core/fullscreen.ts
244
- function S(e) {
244
+ function x(e) {
245
245
  return e.ownerDocument ?? document;
246
246
  }
247
- function le(e) {
247
+ function S(e) {
248
248
  return e.fullscreenElement ?? e.webkitFullscreenElement ?? null;
249
249
  }
250
250
  function C(e, t) {
251
- let n = le(S(e));
251
+ let n = S(x(e));
252
252
  return n != null && (n === e || t != null && n === t) || e.webkitDisplayingFullscreen === !0;
253
253
  }
254
254
  async function w(e, t) {
@@ -264,7 +264,7 @@ async function T(e, t) {
264
264
  n.webkitExitFullscreen?.();
265
265
  return;
266
266
  }
267
- let r = S(e), i = le(r);
267
+ let r = x(e), i = S(r);
268
268
  i != null && (i === e || t != null && i === t) && (typeof r.exitFullscreen == "function" ? await r.exitFullscreen() : r.webkitExitFullscreen?.());
269
269
  }
270
270
  //#endregion
@@ -535,7 +535,7 @@ var N = ["SW_SECURE_DECODE", "SW_SECURE_CRYPTO"];
535
535
  function be(e) {
536
536
  return e.startsWith("com.widevine");
537
537
  }
538
- function P(e, t) {
538
+ function xe(e, t) {
539
539
  if (!be(e)) return t;
540
540
  let n = (e, t) => {
541
541
  let n = e.videoCapabilities;
@@ -552,8 +552,8 @@ function P(e, t) {
552
552
  })));
553
553
  return [...t, ...r];
554
554
  }
555
- function xe(e) {
556
- return (t, n) => M() ? navigator.requestMediaKeySystemAccess(t, P(t, n)).then((t) => ({
555
+ function Se(e) {
556
+ return (t, n) => M() ? navigator.requestMediaKeySystemAccess(t, xe(t, n)).then((t) => ({
557
557
  keySystem: t.keySystem,
558
558
  getConfiguration: () => t.getConfiguration(),
559
559
  createMediaKeys: () => ye(e, t)
@@ -561,7 +561,7 @@ function xe(e) {
561
561
  }
562
562
  //#endregion
563
563
  //#region src/core/drm/support.ts
564
- var Se = 5e3, Ce = "video/mp4; codecs=\"avc1.42E01E\"", we = "audio/mp4; codecs=\"mp4a.40.2\"", Te = {
564
+ var Ce = 5e3, we = "video/mp4; codecs=\"avc1.42E01E\"", P = "audio/mp4; codecs=\"mp4a.40.2\"", Te = {
565
565
  widevine: ["com.widevine.alpha"],
566
566
  fairplay: ["com.apple.fps"]
567
567
  };
@@ -573,24 +573,24 @@ function Ee(e) {
573
573
  "cenc"
574
574
  ],
575
575
  videoCapabilities: [{
576
- contentType: Ce,
576
+ contentType: we,
577
577
  robustness: "",
578
578
  encryptionScheme: "cbcs"
579
579
  }],
580
580
  audioCapabilities: [{
581
- contentType: we,
581
+ contentType: P,
582
582
  robustness: "",
583
583
  encryptionScheme: "cbcs"
584
584
  }]
585
- }] : P("com.widevine.alpha", [{
585
+ }] : xe("com.widevine.alpha", [{
586
586
  initDataTypes: ["cenc"],
587
587
  videoCapabilities: [{
588
- contentType: Ce,
588
+ contentType: we,
589
589
  robustness: "SW_SECURE_DECODE",
590
590
  encryptionScheme: "cbcs"
591
591
  }],
592
592
  audioCapabilities: [{
593
- contentType: we,
593
+ contentType: P,
594
594
  robustness: "SW_SECURE_CRYPTO",
595
595
  encryptionScheme: "cbcs"
596
596
  }]
@@ -607,7 +607,7 @@ function F(e, t) {
607
607
  });
608
608
  }
609
609
  async function De(e = {}) {
610
- let t = e.systems ?? ["widevine", "fairplay"], n = e.timeoutMs ?? Se, r = {};
610
+ let t = e.systems ?? ["widevine", "fairplay"], n = e.timeoutMs ?? Ce, r = {};
611
611
  if (typeof window < "u" && window.isSecureContext === !1) return {
612
612
  verdict: "insecure-context",
613
613
  detail: r
@@ -682,7 +682,7 @@ function R(e) {
682
682
  let t = e.getVideoPlaybackQuality?.();
683
683
  return {
684
684
  dropped: t?.droppedVideoFrames ?? 0,
685
- decoded: t?.totalVideoFrames ?? 0
685
+ totalFrames: t?.totalVideoFrames ?? 0
686
686
  };
687
687
  }
688
688
  function Me(e, t) {
@@ -873,7 +873,7 @@ var V = class {
873
873
  getStats() {
874
874
  let e = this.deps.video, t = R(e), n = {
875
875
  droppedFrames: t.dropped,
876
- decodedFrames: t.decoded
876
+ decodedFrames: t.totalFrames
877
877
  };
878
878
  return this.cdnHost ||= je(this.builtAt), this.cdnHost && (n.cdnHost = this.cdnHost), this.deps.descriptor.drmEnabled && (n.keySystem = "fairplay"), e.duration === Infinity && (n.isLive = !0, e.seekable.length > 0 && (n.atLiveEdge = e.currentTime >= e.seekable.end(e.seekable.length - 1) - 2)), n;
879
879
  }
@@ -1034,7 +1034,7 @@ var U = class {
1034
1034
  videoEncryptionScheme: "cbcs",
1035
1035
  audioEncryptionScheme: "cbcs"
1036
1036
  },
1037
- ...M() ? { requestMediaKeySystemAccessFunc: xe(t) } : {},
1037
+ ...M() ? { requestMediaKeySystemAccessFunc: Se(t) } : {},
1038
1038
  licenseXhrSetup: (e, t) => {
1039
1039
  e.open("POST", this.licenseUrl ?? t, !0), e.setRequestHeader("x-api-key", r.apiKey), e.setRequestHeader("X-Match-Urn", n.matchUrn), e.setRequestHeader("X-Device-Id", i), a && e.setRequestHeader("X-User-Id", a), this.licenseRequested = !0;
1040
1040
  let o = performance.now();
@@ -1195,7 +1195,7 @@ var U = class {
1195
1195
  getStats() {
1196
1196
  let e = this.hls, t = R(this.deps.video), n = {
1197
1197
  droppedFrames: t.dropped,
1198
- decodedFrames: t.decoded,
1198
+ decodedFrames: t.totalFrames,
1199
1199
  lowLatency: this.detectedLowLatency,
1200
1200
  bytesLoaded: this.bytesLoaded,
1201
1201
  playlistBytesLoaded: this.playlistBytesLoaded,
@@ -1437,6 +1437,7 @@ var lt = class {
1437
1437
  lastHbHiddenMs = 0;
1438
1438
  lastHbRebufferMs = 0;
1439
1439
  lastHbRebufferCount = 0;
1440
+ lastHbActiveMs = 0;
1440
1441
  rebufferCount = 0;
1441
1442
  rebufferTotalMs = 0;
1442
1443
  bufferingSinceMs = null;
@@ -1606,31 +1607,33 @@ var lt = class {
1606
1607
  this.hiddenSinceMs !== null && (r += t - this.hiddenSinceMs);
1607
1608
  let i = this.rebufferTotalMs;
1608
1609
  this.bufferingSinceMs !== null && (i += t - this.bufferingSinceMs);
1609
- let a = {}, o = e.bytesLoaded ?? 0;
1610
- o > this.lastBytes && (a.bytesDownloadedDelta = o - this.lastBytes), this.lastBytes = o;
1611
- let s = e.playlistBytesLoaded ?? 0;
1612
- s > this.lastPlaylistBytes && (a.playlistBytesDelta = s - this.lastPlaylistBytes), this.lastPlaylistBytes = s;
1613
- let c = e.droppedFrames ?? 0;
1614
- c > this.lastDropped && (a.droppedFramesDelta = c - this.lastDropped), this.lastDropped = c;
1615
- let l = e.renditionSwitches ?? 0;
1616
- l > this.lastSwitches && (a.renditionSwitchesDelta = l - this.lastSwitches), this.lastSwitches = l, n > this.lastHbPlayingMs && (a.playingMsDelta = Math.round(n - this.lastHbPlayingMs)), this.lastHbPlayingMs = n, r > this.lastHbHiddenMs && (a.hiddenMsDelta = Math.round(r - this.lastHbHiddenMs)), this.lastHbHiddenMs = r, i > this.lastHbRebufferMs && (a.rebufferMsDelta = Math.round(i - this.lastHbRebufferMs)), this.lastHbRebufferMs = i, this.rebufferCount > this.lastHbRebufferCount && (a.rebufferCountDelta = this.rebufferCount - this.lastHbRebufferCount), this.lastHbRebufferCount = this.rebufferCount, typeof e.latencySeconds == "number" && (a.latencyMs = Math.round(e.latencySeconds * 1e3)), typeof e.targetLatencySeconds == "number" && (a.targetLatencyMs = Math.round(e.targetLatencySeconds * 1e3)), typeof e.bandwidthKbps == "number" && (a.bandwidthEstKbps = e.bandwidthKbps), typeof e.levelHeight == "number" && (a.renditionHeight = e.levelHeight), typeof e.renditionBitrateKbps == "number" && (a.renditionBitrateKbps = e.renditionBitrateKbps), e.atLiveEdge === !0 && (a.atLiveEdge = !0), typeof e.bufferedMs == "number" && e.bufferedMs > 0 && (a.bufferedMs = Math.round(e.bufferedMs)), a.playerState = q[e.state] ?? "PLAYER_STATE_UNSPECIFIED";
1617
- let u = this.mutedTotalMs;
1618
- this.mutedSinceMs !== null && (u += t - this.mutedSinceMs), u > this.lastHbMutedMs && (a.mutedMsDelta = Math.round(u - this.lastHbMutedMs)), this.lastHbMutedMs = u;
1619
- let d = e.upshifts ?? 0;
1620
- d > this.lastUpshifts && (a.upshiftsDelta = d - this.lastUpshifts), this.lastUpshifts = d;
1621
- let f = e.downshifts ?? 0;
1622
- f > this.lastDownshifts && (a.downshiftsDelta = f - this.lastDownshifts), this.lastDownshifts = f;
1623
- let p = e.decodedFrames ?? 0;
1624
- p > this.lastDecoded && (a.decodedFramesDelta = p - this.lastDecoded), this.lastDecoded = p;
1625
- let m = e.requestErrors ?? 0;
1626
- m > this.lastRequestErrors && (a.requestErrorsDelta = m - this.lastRequestErrors), this.lastRequestErrors = m;
1627
- let h = e.requestCount ?? 0, g = h - this.lastRequestCount;
1628
- if (this.lastRequestCount = h, g > 0) {
1629
- a.requestCountDelta = g;
1630
- let t = e.requestTimesMs ?? [], n = t.slice(Math.max(0, t.length - g)).sort((e, t) => e - t);
1631
- n.length > 0 && (a.requestTimeP50Ms = K(n, 50), a.requestTimeP95Ms = K(n, 95));
1610
+ let a = this.activeTotalMs;
1611
+ this.activeSinceMs !== null && (a += t - this.activeSinceMs);
1612
+ let o = {}, s = e.bytesLoaded ?? 0;
1613
+ s > this.lastBytes && (o.bytesDownloadedDelta = s - this.lastBytes), this.lastBytes = s;
1614
+ let c = e.playlistBytesLoaded ?? 0;
1615
+ c > this.lastPlaylistBytes && (o.playlistBytesDelta = c - this.lastPlaylistBytes), this.lastPlaylistBytes = c;
1616
+ let l = e.droppedFrames ?? 0;
1617
+ l > this.lastDropped && (o.droppedFramesDelta = l - this.lastDropped), this.lastDropped = l;
1618
+ let u = e.renditionSwitches ?? 0;
1619
+ u > this.lastSwitches && (o.renditionSwitchesDelta = u - this.lastSwitches), this.lastSwitches = u, n > this.lastHbPlayingMs && (o.playingMsDelta = Math.round(n - this.lastHbPlayingMs)), this.lastHbPlayingMs = n, r > this.lastHbHiddenMs && (o.hiddenMsDelta = Math.round(r - this.lastHbHiddenMs)), this.lastHbHiddenMs = r, i > this.lastHbRebufferMs && (o.rebufferMsDelta = Math.round(i - this.lastHbRebufferMs)), this.lastHbRebufferMs = i, this.rebufferCount > this.lastHbRebufferCount && (o.rebufferCountDelta = this.rebufferCount - this.lastHbRebufferCount), this.lastHbRebufferCount = this.rebufferCount, a > this.lastHbActiveMs && (o.activeMsDelta = Math.round(a - this.lastHbActiveMs)), this.lastHbActiveMs = a, typeof e.latencySeconds == "number" && (o.latencyMs = Math.round(e.latencySeconds * 1e3)), typeof e.targetLatencySeconds == "number" && (o.targetLatencyMs = Math.round(e.targetLatencySeconds * 1e3)), typeof e.bandwidthKbps == "number" && (o.bandwidthEstKbps = e.bandwidthKbps), typeof e.levelHeight == "number" && (o.renditionHeight = e.levelHeight), typeof e.renditionBitrateKbps == "number" && (o.renditionBitrateKbps = e.renditionBitrateKbps), e.atLiveEdge === !0 && (o.atLiveEdge = !0), typeof e.bufferedMs == "number" && e.bufferedMs > 0 && (o.bufferedMs = Math.round(e.bufferedMs)), o.playerState = q[e.state] ?? "PLAYER_STATE_UNSPECIFIED";
1620
+ let d = this.mutedTotalMs;
1621
+ this.mutedSinceMs !== null && (d += t - this.mutedSinceMs), d > this.lastHbMutedMs && (o.mutedMsDelta = Math.round(d - this.lastHbMutedMs)), this.lastHbMutedMs = d;
1622
+ let f = e.upshifts ?? 0;
1623
+ f > this.lastUpshifts && (o.upshiftsDelta = f - this.lastUpshifts), this.lastUpshifts = f;
1624
+ let p = e.downshifts ?? 0;
1625
+ p > this.lastDownshifts && (o.downshiftsDelta = p - this.lastDownshifts), this.lastDownshifts = p;
1626
+ let m = e.decodedFrames ?? 0;
1627
+ m > this.lastDecoded && (o.decodedFramesDelta = m - this.lastDecoded), this.lastDecoded = m;
1628
+ let h = e.requestErrors ?? 0;
1629
+ h > this.lastRequestErrors && (o.requestErrorsDelta = h - this.lastRequestErrors), this.lastRequestErrors = h;
1630
+ let g = e.requestCount ?? 0, _ = g - this.lastRequestCount;
1631
+ if (this.lastRequestCount = g, _ > 0) {
1632
+ o.requestCountDelta = _;
1633
+ let t = e.requestTimesMs ?? [], n = t.slice(Math.max(0, t.length - _)).sort((e, t) => e - t);
1634
+ n.length > 0 && (o.requestTimeP50Ms = K(n, 50), o.requestTimeP95Ms = K(n, 95));
1632
1635
  }
1633
- typeof e.latencySeconds == "number" && typeof e.targetLatencySeconds == "number" && (a.driftMs = Math.round((e.latencySeconds - e.targetLatencySeconds) * 1e3)), typeof e.playbackRate == "number" && e.playbackRate > 0 && (a.playbackRate = e.playbackRate), e.qualityPinned === !0 && (a.qualityPinned = !0), e.cdnHost && (a.cdnHost = e.cdnHost), this.maybeEmitMediaInfo(e), this.enqueue({ heartbeat: a }), this.flush(), o > 0 && this.noteFirstBytes();
1636
+ typeof e.latencySeconds == "number" && typeof e.targetLatencySeconds == "number" && (o.driftMs = Math.round((e.latencySeconds - e.targetLatencySeconds) * 1e3)), typeof e.playbackRate == "number" && e.playbackRate > 0 && (o.playbackRate = e.playbackRate), e.qualityPinned === !0 && (o.qualityPinned = !0), e.cdnHost && (o.cdnHost = e.cdnHost), this.maybeEmitMediaInfo(e), this.enqueue({ heartbeat: o }), this.flush(), s > 0 && this.noteFirstBytes();
1634
1637
  }
1635
1638
  maybeEmitMediaInfo(e) {
1636
1639
  if (!(e.videoCodec ?? e.keySystem ?? e.ladderHeights)) return;
@@ -1735,12 +1738,21 @@ function dt() {
1735
1738
  function ft() {
1736
1739
  let e = typeof navigator < "u" ? navigator.connection : void 0;
1737
1740
  if (!e) return { connectionType: "CONNECTION_TYPE_UNKNOWN" };
1738
- let t = { connectionType: e.type ? {
1741
+ let t = {
1739
1742
  wifi: "CONNECTION_TYPE_WIFI",
1740
1743
  cellular: "CONNECTION_TYPE_CELLULAR",
1741
1744
  ethernet: "CONNECTION_TYPE_ETHERNET"
1742
- }[e.type] ?? "CONNECTION_TYPE_OTHER" : "CONNECTION_TYPE_UNKNOWN" };
1743
- return typeof e.downlink == "number" && e.downlink > 0 && (t.downlinkKbps = Math.round(e.downlink * 1e3)), e.saveData && (t.saveData = !0), t;
1745
+ }, n = {
1746
+ "slow-2g": "RADIO_ACCESS_ESTIMATED_SLOW_2G",
1747
+ "2g": "RADIO_ACCESS_ESTIMATED_2G",
1748
+ "3g": "RADIO_ACCESS_ESTIMATED_3G",
1749
+ "4g": "RADIO_ACCESS_ESTIMATED_4G"
1750
+ }, r = (e, t) => Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0, i = { connectionType: e.type ? r(t, e.type) ?? "CONNECTION_TYPE_OTHER" : "CONNECTION_TYPE_UNKNOWN" };
1751
+ if (e.effectiveType) {
1752
+ let t = r(n, e.effectiveType);
1753
+ t && (i.radioAccess = t);
1754
+ }
1755
+ return typeof e.downlink == "number" && e.downlink > 0 && (i.downlinkKbps = Math.round(e.downlink * 1e3)), typeof e.rtt == "number" && e.rtt > 0 && (i.rttMs = Math.round(e.rtt)), e.saveData && (i.saveData = !0), i;
1744
1756
  }
1745
1757
  function pt(e) {
1746
1758
  let t = ut(), n = {
@@ -1764,7 +1776,7 @@ async function mt() {
1764
1776
  }
1765
1777
  //#endregion
1766
1778
  //#region src/core/version.ts
1767
- var ht = "2.4.0", J = {
1779
+ var ht = "2.5.1", J = {
1768
1780
  accent: "#E1B600",
1769
1781
  accentText: "#1B1C23",
1770
1782
  background: "#0e0f13",
@@ -2234,7 +2246,7 @@ var Pt = class {
2234
2246
  this.opts.muted && (this.opts.video.muted = !0), this.opts.poster && (this.opts.video.poster = this.opts.poster), this.mountControls(), this.attachPipListeners(), this.setState("loading");
2235
2247
  let e = ++this.loadGen, t = this.resolveOptions();
2236
2248
  try {
2237
- let n = await y(t);
2249
+ let n = await v(t);
2238
2250
  if (await this.onResolved(n, e), e === this.loadGen && this._state === "error" && this._lastError) {
2239
2251
  let e = this._lastError;
2240
2252
  throw this.destroy(), e;
@@ -2261,7 +2273,7 @@ var Pt = class {
2261
2273
  r ? this.armWithSse(e, r, t, n) : this.beginArmingByPolling(e);
2262
2274
  }
2263
2275
  beginArmingByPolling(e) {
2264
- b({
2276
+ y({
2265
2277
  ...this.resolveOptions(),
2266
2278
  signal: this.abort.signal,
2267
2279
  waitForLive: this.buildWaitConfig(e)
@@ -2295,7 +2307,7 @@ var Pt = class {
2295
2307
  }
2296
2308
  }
2297
2309
  }, h = () => {
2298
- a || s || p() || (s = !0, b({
2310
+ a || s || p() || (s = !0, y({
2299
2311
  ...this.resolveOptions(),
2300
2312
  signal: c.signal,
2301
2313
  waitForLive: this.buildWaitConfig(e)
@@ -2303,7 +2315,7 @@ var Pt = class {
2303
2315
  a || p() || c.signal.aborted || (a = !0, this.closeArming(), this.fail(e instanceof n ? e : new n("INTERNAL", 0, String(e))));
2304
2316
  }));
2305
2317
  }, g = () => {
2306
- a || p() || y(this.resolveOptions()).then((e) => m(e)).catch((e) => {
2318
+ a || p() || v(this.resolveOptions()).then((e) => m(e)).catch((e) => {
2307
2319
  if (!(a || p())) {
2308
2320
  if (e instanceof n && o(e.code)) {
2309
2321
  h();
@@ -2557,7 +2569,7 @@ var Pt = class {
2557
2569
  async refreshLicense() {
2558
2570
  let e = this.engine;
2559
2571
  if (!this.destroyed && e) try {
2560
- let t = await y(this.resolveOptions());
2572
+ let t = await v(this.resolveOptions());
2561
2573
  if (this.destroyed || this.engine !== e) return;
2562
2574
  let n = t.drm?.widevine?.licenseUrl, r = t.drm?.fairplay?.licenseUrl;
2563
2575
  (n || r) && (e.setLicenseUrls({
@@ -2642,7 +2654,7 @@ var Pt = class {
2642
2654
  let e = ++this.loadGen;
2643
2655
  this.teardownPlayback();
2644
2656
  try {
2645
- let t = await b({
2657
+ let t = await y({
2646
2658
  ...this.resolveOptions(),
2647
2659
  waitForLive: this.opts.waitForLive ? this.buildWaitConfig(e) : void 0
2648
2660
  });
@@ -2929,6 +2941,6 @@ function Bt() {
2929
2941
  e.textContent = "html,body{margin:0;height:100%;background:#000;overflow:hidden}body{display:flex}", document.head.appendChild(e);
2930
2942
  }
2931
2943
  //#endregion
2932
- export { J as ODDIN_THEME, n as PlaybackError, X as applyTheme, Rt as bootEmbed, ge as clearDeviceId, Nt as createPlayer, D as deriveEventsBaseUrl, De as detectDrmSupport, w as enterVideoFullscreen, T as exitVideoFullscreen, ue as fetchCatalog, fe as fetchTournament, me as flattenMatches, A as getDeviceId, ke as isLowLatencyManifest, $ as isOddinMessage, ve as licenseRequestHeaders, Ft as mountEmbed, v as pollToLive, b as resolveStream, E as subscribeLiveState, C as videoFullscreenActive, he as watchStatus };
2944
+ export { J as ODDIN_THEME, n as PlaybackError, X as applyTheme, Rt as bootEmbed, ge as clearDeviceId, Nt as createPlayer, D as deriveEventsBaseUrl, De as detectDrmSupport, w as enterVideoFullscreen, T as exitVideoFullscreen, ue as fetchCatalog, fe as fetchTournament, me as flattenMatches, A as getDeviceId, ke as isLowLatencyManifest, $ as isOddinMessage, ve as licenseRequestHeaders, Ft as mountEmbed, oe as pollToLive, y as resolveStream, E as subscribeLiveState, C as videoFullscreenActive, he as watchStatus };
2933
2945
 
2934
2946
  //# sourceMappingURL=index.js.map