@oddin-gg/havik-player 2.5.0 → 2.6.0

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
@@ -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
  }
@@ -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,
@@ -1685,18 +1685,20 @@ var lt = class {
1685
1685
  }
1686
1686
  flush(e = !1) {
1687
1687
  if (this.firstFlushTimer &&= (clearTimeout(this.firstFlushTimer), null), this.pendingStart = null, this.pending.length === 0) return;
1688
- let t = JSON.stringify({ beacons: this.pending });
1688
+ let t = { beacons: this.pending };
1689
+ this.opts.apiKey && (t.apiKey = this.opts.apiKey);
1690
+ let n = JSON.stringify(t);
1689
1691
  if (this.pending = [], e) {
1690
1692
  let e = this.opts.sendBeacon ?? (typeof navigator < "u" && navigator.sendBeacon ? navigator.sendBeacon.bind(navigator) : void 0);
1691
- if (e && e(this.url, t)) return;
1693
+ if (e && e(this.url, n)) return;
1692
1694
  }
1693
- let n = this.opts.fetchFn ?? (typeof fetch < "u" ? fetch : void 0);
1694
- if (!n) return;
1695
- let r = { "content-type": "application/json" };
1696
- this.opts.apiKey && (r["x-api-key"] = this.opts.apiKey), n(this.url, {
1695
+ let r = this.opts.fetchFn ?? (typeof fetch < "u" ? fetch : void 0);
1696
+ if (!r) return;
1697
+ let i = { "content-type": "application/json" };
1698
+ this.opts.apiKey && (i["x-api-key"] = this.opts.apiKey), r(this.url, {
1697
1699
  method: "POST",
1698
- headers: r,
1699
- body: t,
1700
+ headers: i,
1701
+ body: n,
1700
1702
  keepalive: !0
1701
1703
  }).catch(() => {});
1702
1704
  }
@@ -1738,12 +1740,21 @@ function dt() {
1738
1740
  function ft() {
1739
1741
  let e = typeof navigator < "u" ? navigator.connection : void 0;
1740
1742
  if (!e) return { connectionType: "CONNECTION_TYPE_UNKNOWN" };
1741
- let t = { connectionType: e.type ? {
1743
+ let t = {
1742
1744
  wifi: "CONNECTION_TYPE_WIFI",
1743
1745
  cellular: "CONNECTION_TYPE_CELLULAR",
1744
1746
  ethernet: "CONNECTION_TYPE_ETHERNET"
1745
- }[e.type] ?? "CONNECTION_TYPE_OTHER" : "CONNECTION_TYPE_UNKNOWN" };
1746
- return typeof e.downlink == "number" && e.downlink > 0 && (t.downlinkKbps = Math.round(e.downlink * 1e3)), e.saveData && (t.saveData = !0), t;
1747
+ }, n = {
1748
+ "slow-2g": "RADIO_ACCESS_ESTIMATED_SLOW_2G",
1749
+ "2g": "RADIO_ACCESS_ESTIMATED_2G",
1750
+ "3g": "RADIO_ACCESS_ESTIMATED_3G",
1751
+ "4g": "RADIO_ACCESS_ESTIMATED_4G"
1752
+ }, 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" };
1753
+ if (e.effectiveType) {
1754
+ let t = r(n, e.effectiveType);
1755
+ t && (i.radioAccess = t);
1756
+ }
1757
+ 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;
1747
1758
  }
1748
1759
  function pt(e) {
1749
1760
  let t = ut(), n = {
@@ -1767,7 +1778,7 @@ async function mt() {
1767
1778
  }
1768
1779
  //#endregion
1769
1780
  //#region src/core/version.ts
1770
- var ht = "2.5.0", J = {
1781
+ var ht = "2.6.0", J = {
1771
1782
  accent: "#E1B600",
1772
1783
  accentText: "#1B1C23",
1773
1784
  background: "#0e0f13",