@oddin-gg/havik-player 2.5.1 → 2.6.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/havik-player.global.js +2 -2
- package/dist/havik-player.global.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -23
- package/dist/index.js.map +1 -1
- package/embed/index.html +1 -1
- package/examples/vanilla.html +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1691,11 +1691,9 @@ var lt = class {
|
|
|
1691
1691
|
if (e && e(this.url, t)) return;
|
|
1692
1692
|
}
|
|
1693
1693
|
let n = this.opts.fetchFn ?? (typeof fetch < "u" ? fetch : void 0);
|
|
1694
|
-
|
|
1695
|
-
let r = { "content-type": "application/json" };
|
|
1696
|
-
this.opts.apiKey && (r["x-api-key"] = this.opts.apiKey), n(this.url, {
|
|
1694
|
+
n && n(this.url, {
|
|
1697
1695
|
method: "POST",
|
|
1698
|
-
headers:
|
|
1696
|
+
headers: { "content-type": "application/json" },
|
|
1699
1697
|
body: t,
|
|
1700
1698
|
keepalive: !0
|
|
1701
1699
|
}).catch(() => {});
|
|
@@ -1776,7 +1774,7 @@ async function mt() {
|
|
|
1776
1774
|
}
|
|
1777
1775
|
//#endregion
|
|
1778
1776
|
//#region src/core/version.ts
|
|
1779
|
-
var ht = "2.
|
|
1777
|
+
var ht = "2.6.1", J = {
|
|
1780
1778
|
accent: "#E1B600",
|
|
1781
1779
|
accentText: "#1B1C23",
|
|
1782
1780
|
background: "#0e0f13",
|
|
@@ -2369,39 +2367,38 @@ var Pt = class {
|
|
|
2369
2367
|
a(), i.destroy();
|
|
2370
2368
|
return;
|
|
2371
2369
|
}
|
|
2372
|
-
this.engine = i, this.detachMedia = a, this.opts.maxBitrate != null && i.setMaxBitrate(this.opts.maxBitrate), this.startStats(), this.scheduleLicenseRefresh(), this.startLiveState(t), this.startAnalytics(e, i
|
|
2370
|
+
this.engine = i, this.detachMedia = a, this.opts.maxBitrate != null && i.setMaxBitrate(this.opts.maxBitrate), this.startStats(), this.scheduleLicenseRefresh(), this.startLiveState(t), this.startAnalytics(e, i), r && (this.pendingStartLoad = !0, this.setState("paused"), i.name === "native" && setTimeout(() => {
|
|
2373
2371
|
this.destroyed || t !== this.loadGen || this.engine !== i || (this.analyticsSession?.noteReady(), this.emit("ready"));
|
|
2374
2372
|
}, 0));
|
|
2375
2373
|
}
|
|
2376
|
-
startAnalytics(e, t
|
|
2374
|
+
startAnalytics(e, t) {
|
|
2377
2375
|
if (this.analyticsSession?.noteDestroyed(), this.analyticsSession = null, this.detachMediaListeners?.(), this.opts.analytics === !1) return;
|
|
2378
|
-
let
|
|
2376
|
+
let n = e.analytics?.sid;
|
|
2377
|
+
if (!n) return;
|
|
2378
|
+
let r = (typeof this.opts.analytics == "object" ? this.opts.analytics.endpoint : void 0) ?? ct(this.opts.baseUrl);
|
|
2379
2379
|
if (!r) return;
|
|
2380
|
-
let i =
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
endpoint: i,
|
|
2384
|
-
sid: r,
|
|
2385
|
-
apiKey: n,
|
|
2380
|
+
let i = this.opts.video, a = new lt({
|
|
2381
|
+
endpoint: r,
|
|
2382
|
+
sid: n,
|
|
2386
2383
|
player: t.name === "native" ? "PLAYER_SAFARI_NATIVE" : "PLAYER_HLSJS",
|
|
2387
2384
|
sdkVersion: ht,
|
|
2388
|
-
environment: pt(
|
|
2385
|
+
environment: pt(i),
|
|
2389
2386
|
sample: () => {
|
|
2390
|
-
let e = this.engine?.getStats() ?? I, t =
|
|
2387
|
+
let e = this.engine?.getStats() ?? I, t = i.buffered.length ? Math.max(0, i.buffered.end(i.buffered.length - 1) - i.currentTime) : 0;
|
|
2391
2388
|
return {
|
|
2392
2389
|
...e,
|
|
2393
2390
|
bufferedMs: Math.round(t * 1e3),
|
|
2394
2391
|
state: this._state,
|
|
2395
|
-
positionMs: Math.round(
|
|
2396
|
-
playbackRate:
|
|
2392
|
+
positionMs: Math.round(i.currentTime * 1e3),
|
|
2393
|
+
playbackRate: i.playbackRate
|
|
2397
2394
|
};
|
|
2398
2395
|
}
|
|
2399
2396
|
});
|
|
2400
|
-
this.analyticsSession =
|
|
2401
|
-
let
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
},
|
|
2397
|
+
this.analyticsSession = a;
|
|
2398
|
+
let o = () => a.noteSeek(), s = () => a.noteVolume(i.muted, i.volume);
|
|
2399
|
+
i.addEventListener("seeking", o), i.addEventListener("volumechange", s), this.detachMediaListeners = () => {
|
|
2400
|
+
i.removeEventListener("seeking", o), i.removeEventListener("volumechange", s);
|
|
2401
|
+
}, a.start(), a.seedVolume(i.muted, i.volume), a.notePresentation(this.currentPresentation()), mt().then((e) => a.noteEnvironment(e)), this.opts.autoplay === !1 && a.noteAutoplay("AUTOPLAY_RESULT_NOT_ATTEMPTED");
|
|
2405
2402
|
}
|
|
2406
2403
|
currentPresentation() {
|
|
2407
2404
|
let e = this.opts.video;
|