@tavus/widget 0.19.3 → 0.19.4
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.iife.js +2 -2
- package/dist/index.mjs +12 -10
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3048,7 +3048,7 @@ var xn = class extends Error {
|
|
|
3048
3048
|
}
|
|
3049
3049
|
}, Sn = {
|
|
3050
3050
|
name: "@tavus/widget",
|
|
3051
|
-
version: "0.19.
|
|
3051
|
+
version: "0.19.4",
|
|
3052
3052
|
variant: "widget"
|
|
3053
3053
|
}, Cn = /* @__PURE__ */ new Set([
|
|
3054
3054
|
"Error",
|
|
@@ -30023,7 +30023,7 @@ function vI({ onShutdown: e }) {
|
|
|
30023
30023
|
//#region ../core/src/hooks/use-picture-in-picture.ts
|
|
30024
30024
|
var yI = en("PiP"), bI = 360, xI = 280;
|
|
30025
30025
|
function SI() {
|
|
30026
|
-
return globalThis.window !== void 0 && "documentPictureInPicture" in globalThis.window;
|
|
30026
|
+
return globalThis.window !== void 0 && "documentPictureInPicture" in globalThis.window && !navigator.userAgent.includes("Firefox/");
|
|
30027
30027
|
}
|
|
30028
30028
|
function CI(e) {
|
|
30029
30029
|
let { enabled: t, active: n } = e, [r, i] = M(null), a = SI(), o = L(Kh), s = I(() => {
|
|
@@ -30052,18 +30052,20 @@ function CI(e) {
|
|
|
30052
30052
|
document.visibilityState === "hidden" ? c() : document.visibilityState === "visible" && s();
|
|
30053
30053
|
};
|
|
30054
30054
|
document.addEventListener("visibilitychange", e);
|
|
30055
|
-
let r =
|
|
30055
|
+
let r = () => s();
|
|
30056
|
+
globalThis.window.addEventListener("focus", r);
|
|
30057
|
+
let i = [], o = null, l = "none", u = !1;
|
|
30056
30058
|
if (typeof navigator < "u" && "mediaSession" in navigator) {
|
|
30057
30059
|
let e = navigator.mediaSession;
|
|
30058
|
-
|
|
30060
|
+
o = e.metadata, l = e.playbackState;
|
|
30059
30061
|
try {
|
|
30060
|
-
e.metadata = new MediaMetadata({ title: "Tavus conversation" }), e.playbackState = "playing",
|
|
30062
|
+
e.metadata = new MediaMetadata({ title: "Tavus conversation" }), e.playbackState = "playing", u = !0;
|
|
30061
30063
|
} catch (e) {
|
|
30062
30064
|
yI.warn("mediaSession metadata setup failed", e);
|
|
30063
30065
|
}
|
|
30064
30066
|
let t = (t, n) => {
|
|
30065
30067
|
try {
|
|
30066
|
-
e.setActionHandler(t, n),
|
|
30068
|
+
e.setActionHandler(t, n), i.push(t);
|
|
30067
30069
|
} catch (e) {
|
|
30068
30070
|
yI.info(`mediaSession.${t} not supported`, e);
|
|
30069
30071
|
}
|
|
@@ -30073,13 +30075,13 @@ function CI(e) {
|
|
|
30073
30075
|
}), t("play", () => {}), t("pause", () => {});
|
|
30074
30076
|
}
|
|
30075
30077
|
return () => {
|
|
30076
|
-
if (document.removeEventListener("visibilitychange", e), typeof navigator < "u" && "mediaSession" in navigator) {
|
|
30078
|
+
if (document.removeEventListener("visibilitychange", e), globalThis.window.removeEventListener("focus", r), typeof navigator < "u" && "mediaSession" in navigator) {
|
|
30077
30079
|
let e = navigator.mediaSession;
|
|
30078
|
-
for (let t of
|
|
30080
|
+
for (let t of i) try {
|
|
30079
30081
|
e.setActionHandler(t, null);
|
|
30080
30082
|
} catch {}
|
|
30081
|
-
if (
|
|
30082
|
-
e.metadata =
|
|
30083
|
+
if (u) try {
|
|
30084
|
+
e.metadata = o, e.playbackState = l;
|
|
30083
30085
|
} catch {}
|
|
30084
30086
|
}
|
|
30085
30087
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tavus/widget",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.4",
|
|
4
4
|
"description": "Add a face-to-face Tavus PAL to any website with the <tavus-widget> floating launcher. Fully managed conversational video, no backend or API key in the browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agent",
|