TLDR Tech / Dev
We Built a Video Rendering Engine by Lying to the Browser About What Time It Is
Replit developed a unique video rendering engine to turn any web page into a deterministic video file, overcoming the challenge that browsers are real-time systems ill-suited for frame-perfect capture. Its solution involves injecting a JavaScript virtual clock into the browser, which replaces native timing APIs like `setTimeout` and `requestAnimationFrame`, so time advances only when commanded. This system also has a complex pipeline for handling video elements by preprocessing them server-side and rendering frames to a canvas.
Read the full story