mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-14 18:01:20 +08:00
47fb33785a
Chromium throttles requestAnimationFrame in deeply nested cross-origin iframes — specifically the composition iframe inside an MCP widget rendered in Claude desktop (Electron). Because the HyperFrames runtime drives all animation by seeking GSAP on each rAF tick rather than letting GSAP run freely, a stalled rAF loop means no animation, even when the TransportClock is in the playing state. Add a setInterval fallback at 16 ms alongside the primary rAF loop. The interval is a no-op when rAF is healthy (fires within the last 100 ms); it takes over only when rAF is starved. Interval-driven ticks do not reschedule rAF (avoids handle accumulation), and do not update lastRafMs (so the interval keeps firing until rAF resumes). When rAF does resume, lastRafMs is updated and the interval goes dormant again. Fixes autoplay and the play button in Claude desktop's MCP widget. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>