diff --git a/src/pages/Watch.tsx b/src/pages/Watch.tsx index e9897e4..f969c5f 100644 --- a/src/pages/Watch.tsx +++ b/src/pages/Watch.tsx @@ -14,6 +14,7 @@ export default function Watch() { const [state, setState] = useState('checking'); const [error, setError] = useState(''); const [fullscreen, setFullscreen] = useState(false); + const [fallbackFrame, setFallbackFrame] = useState(''); useEffect(() => { let cancelled = false; @@ -39,10 +40,15 @@ export default function Watch() { if (!videoRef.current) return; try { - const handle = await joinAsViewer(code.toUpperCase(), videoRef.current, (s, detail) => { - setState(s as ConnState); - if (detail) setError(detail); - }); + const handle = await joinAsViewer( + code.toUpperCase(), + videoRef.current, + (s, detail) => { + setState(s as ConnState); + if (detail) setError(detail); + }, + setFallbackFrame, + ); handleRef.current = handle; } catch (e) { setError(e instanceof Error ? e.message : String(e)); @@ -100,6 +106,14 @@ export default function Watch() { className="max-w-full max-h-full object-contain" /> + {fallbackFrame && ( + Transmissão ao vivo da sessão XR + )} + {(state === 'checking' || state === 'connecting' || state === 'waiting') && (