@tavus/embed 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.mjs CHANGED
@@ -3101,7 +3101,7 @@ var jn = class extends Error {
3101
3101
  }
3102
3102
  }, Mn = {
3103
3103
  name: "@tavus/embed",
3104
- version: "0.19.3",
3104
+ version: "0.19.4",
3105
3105
  variant: "embed"
3106
3106
  }, Nn = /* @__PURE__ */ new Set([
3107
3107
  "Error",
@@ -30329,7 +30329,7 @@ function cL({ onShutdown: e }) {
30329
30329
  //#region ../core/src/hooks/use-picture-in-picture.ts
30330
30330
  var lL = dn("PiP"), uL = 360, dL = 280;
30331
30331
  function fL() {
30332
- return globalThis.window !== void 0 && "documentPictureInPicture" in globalThis.window;
30332
+ return globalThis.window !== void 0 && "documentPictureInPicture" in globalThis.window && !navigator.userAgent.includes("Firefox/");
30333
30333
  }
30334
30334
  function pL(e) {
30335
30335
  let { enabled: t, active: n } = e, [r, i] = M(null), a = fL(), o = L(ng), s = I(() => {
@@ -30358,18 +30358,20 @@ function pL(e) {
30358
30358
  document.visibilityState === "hidden" ? c() : document.visibilityState === "visible" && s();
30359
30359
  };
30360
30360
  document.addEventListener("visibilitychange", e);
30361
- let r = [], i = null, o = "none", l = !1;
30361
+ let r = () => s();
30362
+ globalThis.window.addEventListener("focus", r);
30363
+ let i = [], o = null, l = "none", u = !1;
30362
30364
  if (typeof navigator < "u" && "mediaSession" in navigator) {
30363
30365
  let e = navigator.mediaSession;
30364
- i = e.metadata, o = e.playbackState;
30366
+ o = e.metadata, l = e.playbackState;
30365
30367
  try {
30366
- e.metadata = new MediaMetadata({ title: "Tavus conversation" }), e.playbackState = "playing", l = !0;
30368
+ e.metadata = new MediaMetadata({ title: "Tavus conversation" }), e.playbackState = "playing", u = !0;
30367
30369
  } catch (e) {
30368
30370
  lL.warn("mediaSession metadata setup failed", e);
30369
30371
  }
30370
30372
  let t = (t, n) => {
30371
30373
  try {
30372
- e.setActionHandler(t, n), r.push(t);
30374
+ e.setActionHandler(t, n), i.push(t);
30373
30375
  } catch (e) {
30374
30376
  lL.info(`mediaSession.${t} not supported`, e);
30375
30377
  }
@@ -30379,13 +30381,13 @@ function pL(e) {
30379
30381
  }), t("play", () => {}), t("pause", () => {});
30380
30382
  }
30381
30383
  return () => {
30382
- if (document.removeEventListener("visibilitychange", e), typeof navigator < "u" && "mediaSession" in navigator) {
30384
+ if (document.removeEventListener("visibilitychange", e), globalThis.window.removeEventListener("focus", r), typeof navigator < "u" && "mediaSession" in navigator) {
30383
30385
  let e = navigator.mediaSession;
30384
- for (let t of r) try {
30386
+ for (let t of i) try {
30385
30387
  e.setActionHandler(t, null);
30386
30388
  } catch {}
30387
- if (l) try {
30388
- e.metadata = i, e.playbackState = o;
30389
+ if (u) try {
30390
+ e.metadata = o, e.playbackState = l;
30389
30391
  } catch {}
30390
30392
  }
30391
30393
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tavus/embed",
3
- "version": "0.19.3",
3
+ "version": "0.19.4",
4
4
  "description": "Drop a face-to-face Tavus PAL into any page with the <tavus-embed> custom element. Fully managed conversational video, no backend or API key in the browser.",
5
5
  "keywords": [
6
6
  "ai-agent",