🎥 Make videos programmatically with React
Update render-in-browser.mdx
Jonny Burger23cb08761627
diff --git a/packages/docs/docs/miscellaneous/render-in-browser.mdx b/packages/docs/docs/miscellaneous/render-in-browser.mdxindex 2b56cad475..6bb9bb14d2 100644--- a/packages/docs/docs/miscellaneous/render-in-browser.mdx+++ b/packages/docs/docs/miscellaneous/render-in-browser.mdx@@ -8,44 +8,20 @@ crumb: 'FAQ'Rendering videos in the browser is currently not supported.In order to render videos, you need to hook up [server-side rendering](/docs/ssr), [Remotion Lambda](/docs/lambda), or [render videos locally](/docs/render).-## Our future plans+## Our future plan-The biggest limitation is that there is no way to capture the browser viewport.--<details>- <summary>How about?</summary>--### a Chrome extension?--Chrome extensions do get the privilege of capturing the viewport. However, asking the user to install an extension is a big barrier and therefore we are not believing in this approach.--### [`canvas.getImageData()`](https://developer.mozilla.org/de/docs/Web/API/CanvasRenderingContext2D/getImageData)?--It allows to capture the pixels from a canvas, however Remotion videos can be written with any web technology including HTML and SVG. Canvas elements are just a subset of what's supported in Remotion.--### [`html2canvas`](https://html2canvas.hertzen.com/)?+**We are planning to add support for rendering videos in the browser in the future.**+As of September 2025, this is our biggest priority on the roadmap and the feature is in the works.-It implements it's own rendering engine which only supports a subset of CSS properties.-You would only have access to a very limited feature set.--### SVG `<foreignElement>`?--You can render HTML markup inside an SVG `<foreignElement>` and then render that SVG to a canvas and then call [`getImageData()`](https://developer.mozilla.org/de/docs/Web/API/CanvasRenderingContext2D/getImageData) to turn that into an image.--This is the closest thing to browser rendering, however there are problems with `<img>` tags and potentially other technologies as well. It's not yet fully out of the questions, but seems hacky so far.--### The Element Capture API--Returns an already compressed video stream of the DOM instead of just a bitmap.-Also will display a permission prompt to the user.-After discussion with the authors of the specification, capturing images is not a usecase they are considering.+The biggest limitation is that there is no way to capture the browser viewport.-</details>+Therefore, with browser rendering, only certain tags will be supported, such as `<canvas>`, `<svg>`, `<Video>` and `<Img>`. Also, `<Audio>` can be processed.-However, certain elements can be captured, such as `<canvas>`, `<video>` and `<img>`. Also, `<audio>` can be processed.-We are intending to introduce a render mode of Remotion which is limited to those tags, but allows for rendering in the browser.+It will still be possible to layout these tags using `<div>`'s and CSS, since Remotion will be able to programmatically determine the position of the elements.+Remotion will extract canvas-like elements from the DOM and compose them.+This keeps the possibility to have event handlers like `onPointerDown` attached to them. We hope this is more productive than to just have one `<canvas>` element and disable event handlers and CSS layouting.-The encoding of the video would work with WebCodecs.+The encoding of the video will work with [Mediabunny](/docs/mediabunny).We hope to launch this mode in late 2025.## See also