@oddin-gg/havik-player 2.16.10 → 2.16.12

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
@@ -1540,13 +1540,14 @@ var Qt = class {
1540
1540
  startHls() {
1541
1541
  let { video: t, descriptor: n, credential: r, deviceId: i, userId: a, lowLatency: o, debug: s, hlsConfig: c, emit: l } = this.deps;
1542
1542
  this.clearKick(), this.resetStarvationWindow(), this.resetChaseWindow(), this.resetFrameDropWindow(), this.lastFragLoadingMs = 0, this.lastEndSN = -1, this.lastAdvanceMs = 0;
1543
- let u = n.drmEnabled && !!(n.drm?.widevine?.licenseUrl || n.drm?.fairplay?.licenseUrl), d = {
1543
+ let u = n.drmEnabled && !!(n.drm?.widevine?.licenseUrl || n.drm?.fairplay?.licenseUrl), d = H(this.deps.video) && U(), f = {
1544
1544
  debug: s === !0,
1545
1545
  enableWorker: !o,
1546
1546
  lowLatencyMode: o,
1547
1547
  backBufferLength: 90,
1548
+ liveDurationInfinity: !0,
1548
1549
  maxBufferHole: .5,
1549
- maxLiveSyncPlaybackRate: 1.1,
1550
+ maxLiveSyncPlaybackRate: d ? 1 : 1.1,
1550
1551
  abrEwmaDefaultEstimate: 1e6,
1551
1552
  capLevelToPlayerSize: !1,
1552
1553
  ...this.loadStarted ? {} : { autoStartLoad: !1 },
@@ -1586,24 +1587,24 @@ var Qt = class {
1586
1587
  } } : {},
1587
1588
  ...c
1588
1589
  };
1589
- if (this.prefetch?.destroy(), this.prefetch = null, u && this.deps.mediaDuringKey !== !1 && !d.fLoader) {
1590
+ if (this.prefetch?.destroy(), this.prefetch = null, u && this.deps.mediaDuringKey !== !1 && !f.fLoader) {
1590
1591
  let e = new pt({
1591
1592
  sessionId: n.analytics?.sid,
1592
1593
  contentId: n.matchUrn
1593
1594
  }), t = mt(e);
1594
- t && (this.prefetch = e, d.fLoader = t);
1595
+ t && (this.prefetch = e, f.fLoader = t);
1595
1596
  }
1596
- Xt(d), this.catchUpRate = typeof d.maxLiveSyncPlaybackRate == "number" ? d.maxLiveSyncPlaybackRate : 1, this.catchUpEngaged = !1, this.catchUpRate > 1 && (d.maxLiveSyncPlaybackRate = 1), this.sizeCapManaged = d.capLevelToPlayerSize !== !0, this.fpsCapManaged = !(c && "capLevelOnFPSDrop" in c), this.loadStarted = d.autoStartLoad !== !1;
1597
- let f = new e(d);
1598
- if (this.hls = f, f.on(e.Events.FRAG_PARSED, (e, t) => this.reanchorPartTimeline(f, t)), f.on(e.Events.MANIFEST_PARSED, () => {
1599
- this.mediaRecoveries = 0, this.networkRecoveries = 0, u && !this.deps.hlsConfig?.requestMediaKeySystemAccessFunc && this.dropLevelsWidevineCannotPlay(f), this.measureLadder(f), this.applySizeCap(), this.loadSuspended = !1, t.paused && this.schedulePauseSuspend(), l({ type: "ready" });
1600
- }), f.on(e.Events.FRAG_BUFFERED, (e, t) => {
1597
+ Xt(f), this.catchUpRate = typeof f.maxLiveSyncPlaybackRate == "number" ? f.maxLiveSyncPlaybackRate : 1, this.catchUpEngaged = !1, this.catchUpRate > 1 && (f.maxLiveSyncPlaybackRate = 1), this.sizeCapManaged = f.capLevelToPlayerSize !== !0, this.fpsCapManaged = !(c && "capLevelOnFPSDrop" in c), this.loadStarted = f.autoStartLoad !== !1;
1598
+ let p = new e(f);
1599
+ if (this.hls = p, p.on(e.Events.FRAG_PARSED, (e, t) => this.reanchorPartTimeline(p, t)), p.on(e.Events.MANIFEST_PARSED, () => {
1600
+ this.mediaRecoveries = 0, this.networkRecoveries = 0, u && !this.deps.hlsConfig?.requestMediaKeySystemAccessFunc && this.dropLevelsWidevineCannotPlay(p), this.measureLadder(p), this.applySizeCap(), this.loadSuspended = !1, t.paused && this.schedulePauseSuspend(), l({ type: "ready" });
1601
+ }), p.on(e.Events.FRAG_BUFFERED, (e, t) => {
1601
1602
  t?.frag?.type === "main" && (this.kickKind !== "dead" && this.clearKick(), (this.mediaRecoveries > 0 || this.networkRecoveries > 0 || this.licenseRecoveries > 0 || this.starvationKicks > 0 || this.starvationRebuilds > 0) && !this.recoveryResetTimer && (this.recoveryResetTimer = setTimeout(() => {
1602
1603
  this.mediaRecoveries = 0, this.networkRecoveries = 0, this.licenseRecoveries = 0, this.starvationKicks = 0, this.starvationRebuilds = 0, this.recoveryResetTimer = null;
1603
1604
  }, Ct)));
1604
- }), f.on(e.Events.FRAG_LOADING, (e, t) => {
1605
+ }), p.on(e.Events.FRAG_LOADING, (e, t) => {
1605
1606
  t?.frag?.type === "main" && (this.lastFragLoadingMs = Date.now());
1606
- }), f.on(e.Events.FRAG_LOADED, (e, t) => {
1607
+ }), p.on(e.Events.FRAG_LOADED, (e, t) => {
1607
1608
  t?.frag?.type === "main" && (this.mainFragsSinceTick += 1);
1608
1609
  let n = t?.frag?.stats, r = n?.loaded;
1609
1610
  typeof r == "number" && (this.bytesLoaded += r), !this.reportedFirstBytes && typeof r == "number" && r > 0 && (this.reportedFirstBytes = !0, l({ type: "firstBytes" }));
@@ -1614,7 +1615,7 @@ var Qt = class {
1614
1615
  let e = Je(a);
1615
1616
  e && (this.cdnHost = e);
1616
1617
  }
1617
- }), f.on(e.Events.LEVEL_LOADED, (e, t) => {
1618
+ }), p.on(e.Events.LEVEL_LOADED, (e, t) => {
1618
1619
  let n = t?.stats?.loaded;
1619
1620
  if (typeof n == "number" && (this.playlistBytesLoaded += n), this.reportedFirstPlaylist || (this.reportedFirstPlaylist = !0, l({ type: "firstPlaylist" })), this.detectedLowLatency) return;
1620
1621
  let r = t.details;
@@ -1622,31 +1623,31 @@ var Qt = class {
1622
1623
  type: "lowLatencyDetected",
1623
1624
  value: !0
1624
1625
  }));
1625
- }), f.on(e.Events.LEVEL_LOADED, (e, t) => this.trackEnd(t)), this.prefetch) {
1626
+ }), p.on(e.Events.LEVEL_LOADED, (e, t) => this.trackEnd(t)), this.prefetch) {
1626
1627
  let t = this.prefetch;
1627
- f.on(e.Events.KEY_LOADING, (e, n) => {
1628
+ p.on(e.Events.KEY_LOADING, (e, n) => {
1628
1629
  let r = n?.frag, i = gt(r?.type);
1629
- if (r && t.isActive(i)) for (let e of _t(f, r)) t.prefetch(e.url, i, e.kind);
1630
- }), f.on(e.Events.KEY_LOADED, (e, n) => t.keyUsable(gt(n?.frag?.type)));
1630
+ if (r && t.isActive(i)) for (let e of _t(p, r)) t.prefetch(e.url, i, e.kind);
1631
+ }), p.on(e.Events.KEY_LOADED, (e, n) => t.keyUsable(gt(n?.frag?.type)));
1631
1632
  }
1632
- f.on(e.Events.KEY_LOADED, () => {
1633
+ p.on(e.Events.KEY_LOADED, () => {
1633
1634
  u && !this.reportedDrmReady && (this.reportedDrmReady = !0, l({ type: "drmReady" }));
1634
1635
  }), this.endWatchdog && clearInterval(this.endWatchdog), this.endWatchdog = setInterval(() => {
1635
1636
  this.checkEndStale(), this.checkStarvation(), this.updateCatchUpBand(), this.checkFutileChase(), this.checkFrameDrops();
1636
- }, Tt), f.on(e.Events.LEVEL_SWITCHED, (e, t) => {
1637
+ }, Tt), p.on(e.Events.LEVEL_SWITCHED, (e, t) => {
1637
1638
  this.renditionSwitches += 1;
1638
- let n = this.lastLevelIndex >= 0 ? f.levels[this.lastLevelIndex] : void 0, r = f.levels[t.level];
1639
+ let n = this.lastLevelIndex >= 0 ? p.levels[this.lastLevelIndex] : void 0, r = p.levels[t.level];
1639
1640
  n && r && r.bitrate !== n.bitrate && (r.bitrate > n.bitrate ? this.upshifts += 1 : this.downshifts += 1), this.lastLevelIndex = t.level, l({
1640
1641
  type: "qualitychange",
1641
1642
  index: t.level
1642
1643
  });
1643
- }), f.on(e.Events.AUDIO_TRACK_SWITCHED, (e, t) => l({
1644
+ }), p.on(e.Events.AUDIO_TRACK_SWITCHED, (e, t) => l({
1644
1645
  type: "audiotrackchange",
1645
1646
  id: t.id
1646
- })), f.on(e.Events.SUBTITLE_TRACK_SWITCH, (e, t) => l({
1647
+ })), p.on(e.Events.SUBTITLE_TRACK_SWITCH, (e, t) => l({
1647
1648
  type: "texttrackchange",
1648
1649
  id: t.id
1649
- })), f.on(e.Events.ERROR, (e, t) => this.onError(t)), f.loadSource(n.manifestUrl), f.attachMedia(t);
1650
+ })), p.on(e.Events.ERROR, (e, t) => this.onError(t)), p.loadSource(n.manifestUrl), p.attachMedia(t);
1650
1651
  }
1651
1652
  getQualityLevels() {
1652
1653
  return this.hls ? this.hls.levels.map((e, t) => ({
@@ -2518,7 +2519,7 @@ async function Sn() {
2518
2519
  }
2519
2520
  //#endregion
2520
2521
  //#region src/core/version.ts
2521
- var Cn = "2.16.10", wn = {
2522
+ var Cn = "2.16.12", wn = {
2522
2523
  accent: "#E1B600",
2523
2524
  accentText: "#1B1C23",
2524
2525
  background: "#0e0f13",