Skip to content

🎥 Make videos programmatically with React

Clarify the motion blur fallback notice

JonnyBurger7d9787c8c399
diff --git a/packages/core/src/HtmlInCanvas.tsx b/packages/core/src/HtmlInCanvas.tsx
index 80a60450b4..69c7060851 100644
--- a/packages/core/src/HtmlInCanvas.tsx
+++ b/packages/core/src/HtmlInCanvas.tsx
@@ -459,6 +459,7 @@ export type HtmlInCanvasProps = Omit<InteractiveBaseProps, 'children'> &
readonly pixelDensity?: HtmlInCanvasPixelDensity;
// captureElementImage() only accepts immediate children of the layout canvas.
readonly _remotionInternalCanvasSiblings?: React.ReactNode;
+ readonly _remotionInternalFallbackLabel?: string;
};
/* eslint-enable react/require-default-props */
@@ -1111,6 +1112,7 @@ const HtmlInCanvasInner = forwardRef<
onInit,
pixelDensity,
_remotionInternalCanvasSiblings,
+ _remotionInternalFallbackLabel = 'Effects are not visible',
controls,
style,
cropLeft,
@@ -1199,7 +1201,10 @@ const HtmlInCanvasInner = forwardRef<
_remotionInternalIsPostmounting={postmountingActive}
>
{!isRendering && unsupportedMessage !== null ? (
- <HtmlInCanvasFallback style={{width, height, ...croppedStyle}}>
+ <HtmlInCanvasFallback
+ style={{width, height, ...croppedStyle}}
+ label={_remotionInternalFallbackLabel}
+ >
<DefaultPremountContext.Provider value={0}>
<div style={{width, height}}>{children}</div>
</DefaultPremountContext.Provider>
diff --git a/packages/core/src/HtmlInCanvasFallback.tsx b/packages/core/src/HtmlInCanvasFallback.tsx
index b7ffeff2f4..6818c63636 100644
--- a/packages/core/src/HtmlInCanvasFallback.tsx
+++ b/packages/core/src/HtmlInCanvasFallback.tsx
@@ -3,7 +3,8 @@ import React from 'react';
export const HtmlInCanvasFallback: React.FC<{
readonly children: React.ReactNode;
readonly style: React.CSSProperties;
-}> = ({children, style}) => {
+ readonly label: string;
+}> = ({children, style, label}) => {
return (
<div style={{position: 'relative', ...style}}>
{children}
@@ -44,7 +45,7 @@ export const HtmlInCanvasFallback: React.FC<{
color: '#e8bdc3',
}}
>
- Effects are not visible
+ {label}
</div>
</div>
</div>
diff --git a/packages/docs/docs/motion-blur/html-in-canvas-motion-blur.mdx b/packages/docs/docs/motion-blur/html-in-canvas-motion-blur.mdx
index e85d08274e..73e83b3220 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
@@ -14,7 +14,7 @@ crumb: '@remotion/motion-blur'
`<HtmlInCanvasMotionBlur>` is the state-of-the-art recommended way to achieve motion blur in Remotion.
It requires [HTML-in-canvas](/docs/html-in-canvas#enabling-the-flag-in-chrome) to be enabled during preview. Rendering needs no configuration.
-From <AvailableFrom v="4.0.538" inline />, if HTML-in-canvas is unavailable during preview, the component displays its children at the current frame without motion blur and shows an "Effects are not visible" warning. Rendering still fails when HTML-in-canvas is unavailable.
+From <AvailableFrom v="4.0.538" inline />, if HTML-in-canvas is unavailable during preview, the component displays its children at the current frame without motion blur and shows a "Motion blur is not visible" warning. Rendering still fails when HTML-in-canvas is unavailable.
```tsx twoslash title="MyComposition.tsx"
import {
diff --git a/packages/motion-blur/src/HtmlInCanvasMotionBlur.tsx b/packages/motion-blur/src/HtmlInCanvasMotionBlur.tsx
index 92b51f46c1..c8b0a32710 100644
--- a/packages/motion-blur/src/HtmlInCanvasMotionBlur.tsx
+++ b/packages/motion-blur/src/HtmlInCanvasMotionBlur.tsx
@@ -258,6 +258,7 @@ const HtmlInCanvasMotionBlurInner: React.FC<
{...{controls}}
onPaint={onPaint}
_remotionInternalCanvasSiblings={sampleElements.slice(1)}
+ _remotionInternalFallbackLabel="Motion blur is not visible"
>
{passThrough ? children : sampleElements[0]}
</HtmlInCanvas>
diff --git a/packages/transitions/src/html-in-canvas-presentation.tsx b/packages/transitions/src/html-in-canvas-presentation.tsx
index cae3bbd2b9..b9a46854f4 100644
--- a/packages/transitions/src/html-in-canvas-presentation.tsx
+++ b/packages/transitions/src/html-in-canvas-presentation.tsx
@@ -331,6 +331,7 @@ export const HtmlInCanvasPresentation = <
: props.presentationProgress < 0.5;
return (
<Internals.HtmlInCanvasFallback
+ label="Effects are not visible"
style={{
position: 'absolute',
inset: 0,