From ae2673d057f0ad8141b62305cf66e3971f9c2da2 Mon Sep 17 00:00:00 2001 From: Tomer Shlasky <45847538+tomershlasky@users.noreply.github.com> Date: Fri, 22 May 2026 05:12:14 +0300 Subject: [PATCH] show local camera feed while connecting to avoid black screen --- examples/ecommerce/components/TryOnModal.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/ecommerce/components/TryOnModal.tsx b/examples/ecommerce/components/TryOnModal.tsx index 4f96246..3bce26f 100644 --- a/examples/ecommerce/components/TryOnModal.tsx +++ b/examples/ecommerce/components/TryOnModal.tsx @@ -46,6 +46,11 @@ export function TryOnModal({ product, onClose }: TryOnModalProps) { const mediaStream = await startCamera(); if (!mediaStream || cancelled) return; + // Show local camera feed immediately so users see themselves while connecting + if (videoRef.current) { + videoRef.current.srcObject = mediaStream; + } + const res = await fetch("/api/tokens", { method: "POST" }); const { apiKey } = await res.json(); if (cancelled) return;