🎥 Make videos programmatically with React
remotion: Add `HtmlInCanvas.isNestingSupported()` for nested canvases
JonnyBurgerbe4307517d13
diff --git a/packages/docs/docs/client-side-rendering/html-in-canvas.mdx b/packages/docs/docs/client-side-rendering/html-in-canvas.mdxindex f374083a82..3f8778f303 100644--- a/packages/docs/docs/client-side-rendering/html-in-canvas.mdx+++ b/packages/docs/docs/client-side-rendering/html-in-canvas.mdx@@ -89,6 +89,8 @@ HTML-in-canvas depends on Chromium flag `chrome://flags/#canvas-draw-element`, wUse a recent Chrome or Chromium version with the flag enabled for full support. Compositions containing [`<HtmlInCanvas>`](/docs/remotion/html-in-canvas) use native capture in Chrome 157 or newer. Earlier versions use the built-in DOM composer.+This applies to client-side rendering in your browser. Remotion's bundled browser for server-side rendering is currently Chrome 149, so nested `<HtmlInCanvas>` components require a separate Chrome 157 or newer executable on the server.+## See also- [`<HtmlInCanvas>`](/docs/remotion/html-in-canvas)diff --git a/packages/docs/docs/html-in-canvas-guide.mdx b/packages/docs/docs/html-in-canvas-guide.mdxindex b2d392ffde..fd5070ddf5 100644--- a/packages/docs/docs/html-in-canvas-guide.mdx+++ b/packages/docs/docs/html-in-canvas-guide.mdx@@ -108,6 +108,8 @@ From [`v4.0.455`](https://github.com/remotion-dev/remotion/releases/tag/v4.0.455We compiled a version of Chrome and made it the default, and enabled the flag for you.+The bundled browser is currently Chrome 149, so these server-side rendering options do not yet support nested `<HtmlInCanvas>` components by default. To render nested components locally or with the server-side APIs, provide a Chrome 157 or newer executable through [`--browser-executable`](/docs/cli/render#--browser-executable) or [`browserExecutable`](/docs/renderer/render-media#browserexecutable). Preview and client-side rendering can use Chrome 157 or newer installed on your machine.+If your effect uses a WebGL shader, pass [`--gl=angle`](/docs/gl-options) to make the render work:```bash@@ -142,7 +144,7 @@ This is opt-in. In Chrome versions earlier than 157, compositions containing [`<## Nested HTML-in-canvas-Nesting `<HtmlInCanvas>` components is supported in Chrome 157 or newer with HTML-in-canvas enabled. Use [`HtmlInCanvas.isNestingSupported()`](/docs/remotion/html-in-canvas#htmlincanvasisnestingsupported) to check at runtime. Older versions throw an error.+Nesting `<HtmlInCanvas>` components is supported in Chrome 157 or newer with HTML-in-canvas enabled. Use [`HtmlInCanvas.isNestingSupported()`](/docs/remotion/html-in-canvas#htmlincanvasisnestingsupported) to check at runtime. Older versions throw an error. Remotion's bundled browser is currently Chrome 149, so nested components need a separate Chrome 157 or newer executable for server-side rendering.## See alsodiff --git a/packages/docs/docs/motion-blur/html-in-canvas-motion-blur.mdx b/packages/docs/docs/motion-blur/html-in-canvas-motion-blur.mdxindex 22e4a7aa49..4fa7d4d371 100644--- a/packages/docs/docs/motion-blur/html-in-canvas-motion-blur.mdx+++ b/packages/docs/docs/motion-blur/html-in-canvas-motion-blur.mdx@@ -111,6 +111,8 @@ Samples outside the composition are clamped to its first or last frame.Children of `<HtmlInCanvasMotionBlur>` can contain another [`<HtmlInCanvas>`](/docs/remotion/html-in-canvas) component, or vice versa, in Chrome 157 or newer with HTML-in-canvas enabled. Check [`HtmlInCanvas.isNestingSupported()`](/docs/remotion/html-in-canvas#htmlincanvasisnestingsupported) before nesting them.+Remotion's bundled server-side browser is currently Chrome 149. Rendering nested components on the server requires a Chrome 157 or newer executable.+## Compatibility<CompatibilityTable chrome firefox={false} safari={false} nodejs="" bun="" serverlessFunctions="" clientSideRendering serverSideRendering player studio hideServers />diff --git a/packages/docs/docs/remotion/html-in-canvas.mdx b/packages/docs/docs/remotion/html-in-canvas.mdxindex ea23443962..b3a31aded4 100644--- a/packages/docs/docs/remotion/html-in-canvas.mdx+++ b/packages/docs/docs/remotion/html-in-canvas.mdx@@ -48,6 +48,8 @@ Return value: _boolean_Returns `true` when HTML-in-canvas is enabled in Chrome or a Chromium-based browser version 157 or newer. Use it before nesting `<HtmlInCanvas>` components. Older versions throw an error when components are nested.+Remotion's bundled browser for server-side rendering is currently Chrome 149, so this method returns `false` there unless you provide a Chrome 157 or newer executable.+## Using WebGL and WebGPU during rendersSee [Using WebGL and WebGPU during renders](/docs/webgl).@@ -848,6 +850,8 @@ const onPaint: HtmlInCanvasOnPaint = async ({canvas, elementImage}) => {You can nest `<HtmlInCanvas>` components in Chrome 157 or newer when HTML-in-canvas is enabled. Check [`HtmlInCanvas.isNestingSupported()`](#htmlincanvasisnestingsupported) before rendering nested components. In older versions, nesting throws an error.+Remotion's bundled server-side browser is currently Chrome 149. Nested compositions require a Chrome 157 or newer executable for server-side rendering.+## Compatibility<CompatibilityTable