realtime-avatar 0.11.3 → 0.11.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.
@@ -218,7 +218,7 @@ function isTransient(cause) {
218
218
 
219
219
  // ../http-client/src/client.ts
220
220
  var DEFAULT_BASE_URL = "https://realtimeavatar.ai/api/v1";
221
- var SDK_VERSION = "0.11.3";
221
+ var SDK_VERSION = "0.11.4";
222
222
  var RealtimeAvatar = class {
223
223
  #apiKey;
224
224
  #baseUrl;
@@ -1,4 +1,4 @@
1
- import { RealtimeAvatar, isQueued, RealtimeAvatarHttpError } from './chunk-K726WCDN.js';
1
+ import { RealtimeAvatar, isQueued, RealtimeAvatarHttpError } from './chunk-UMFUVCWT.js';
2
2
 
3
3
  // ../proxy/src/config.ts
4
4
  var json = (body, status = 200) => new Response(JSON.stringify(body), {
package/dist/express.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createProxyHandler } from './chunk-OVAQBIZ2.js';
2
- import './chunk-K726WCDN.js';
1
+ import { createProxyHandler } from './chunk-WUUXNNDP.js';
2
+ import './chunk-UMFUVCWT.js';
3
3
 
4
4
  // ../proxy/src/express.ts
5
5
  function realtimeAvatarExpress(config) {
package/dist/hono.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createProxyHandler } from './chunk-OVAQBIZ2.js';
2
- import './chunk-K726WCDN.js';
1
+ import { createProxyHandler } from './chunk-WUUXNNDP.js';
2
+ import './chunk-UMFUVCWT.js';
3
3
 
4
4
  // ../proxy/src/hono.ts
5
5
  function realtimeAvatarHono(config) {
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, clipLibraryDeclarationSchema, isQueued, verifyTranscript } from './chunk-K726WCDN.js';
1
+ export { RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, clipLibraryDeclarationSchema, isQueued, verifyTranscript } from './chunk-UMFUVCWT.js';
package/dist/nextjs.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createProxyHandler } from './chunk-OVAQBIZ2.js';
2
- import './chunk-K726WCDN.js';
1
+ import { createProxyHandler } from './chunk-WUUXNNDP.js';
2
+ import './chunk-UMFUVCWT.js';
3
3
 
4
4
  // ../proxy/src/nextjs.ts
5
5
  function createRealtimeAvatarRoute(config) {
package/dist/react.js CHANGED
@@ -1502,7 +1502,8 @@ function useLiveFrameFlow(wrapRef, trackProducing, trackIdentity, stallAfterMs)
1502
1502
  lastFrameAtMs: null,
1503
1503
  maxGapMs: 0,
1504
1504
  resumePending: false,
1505
- producingSinceMs: null
1505
+ producingSinceMs: null,
1506
+ lastSizeKey: null
1506
1507
  });
1507
1508
  useEffect(() => {
1508
1509
  sampleRef.current = {
@@ -1510,7 +1511,8 @@ function useLiveFrameFlow(wrapRef, trackProducing, trackIdentity, stallAfterMs)
1510
1511
  lastFrameAtMs: null,
1511
1512
  maxGapMs: 0,
1512
1513
  resumePending: document.visibilityState !== "visible",
1513
- producingSinceMs: trackProducing ? Date.now() : null
1514
+ producingSinceMs: trackProducing ? Date.now() : null,
1515
+ lastSizeKey: null
1514
1516
  };
1515
1517
  flowingRef.current = false;
1516
1518
  setSeenFrame(false);
@@ -1527,17 +1529,20 @@ function useLiveFrameFlow(wrapRef, trackProducing, trackIdentity, stallAfterMs)
1527
1529
  const now = Date.now();
1528
1530
  lastCurrentTime = video?.currentTime ?? lastCurrentTime;
1529
1531
  const firstFrame = !previous.seenFrame;
1532
+ const sizeKey = `${video?.videoWidth ?? 0}x${video?.videoHeight ?? 0}`;
1533
+ const layerSwitched = previous.lastSizeKey !== null && sizeKey !== previous.lastSizeKey;
1530
1534
  sampleRef.current = {
1531
1535
  producingSinceMs: previous.producingSinceMs,
1532
1536
  seenFrame: true,
1533
1537
  lastFrameAtMs: now,
1534
1538
  // A hidden tab/bfcache resume is a local scheduling gap, not network
1535
1539
  // congestion. The first fresh frame becomes the new baseline.
1536
- maxGapMs: previous.resumePending ? 0 : Math.max(
1540
+ maxGapMs: previous.resumePending || layerSwitched ? 0 : Math.max(
1537
1541
  previous.maxGapMs,
1538
1542
  previous.lastFrameAtMs === null ? 0 : now - previous.lastFrameAtMs
1539
1543
  ),
1540
- resumePending: false
1544
+ resumePending: false,
1545
+ lastSizeKey: sizeKey
1541
1546
  };
1542
1547
  if (firstFrame) setSeenFrame(true);
1543
1548
  recovery.stallAfterMs = escalation.thresholdMs(now);
package/dist/server.js CHANGED
@@ -1 +1 @@
1
- export { RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, clipLibraryDeclarationSchema, isQueued, verifyTranscript } from './chunk-K726WCDN.js';
1
+ export { RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, clipLibraryDeclarationSchema, isQueued, verifyTranscript } from './chunk-UMFUVCWT.js';
@@ -1,5 +1,5 @@
1
- import { createProxyHandler } from './chunk-OVAQBIZ2.js';
2
- import './chunk-K726WCDN.js';
1
+ import { createProxyHandler } from './chunk-WUUXNNDP.js';
2
+ import './chunk-UMFUVCWT.js';
3
3
 
4
4
  // src/tanstack-start.ts
5
5
  function realtimeAvatarServerRoute(config) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "realtime-avatar",
3
- "version": "0.11.3",
3
+ "version": "0.11.4",
4
4
  "description": "Realtime Avatar SDK. `realtime-avatar` and the route adapters hold your API key and are server-only; `realtime-avatar/react`, `/browser` and `/tools` never can — importing a server entry into a browser build throws at bundle time.",
5
5
  "license": "MIT",
6
6
  "author": "The Influence Company",