π₯ Make videos programmatically with React
Docs: Replace redundant `<AbsoluteFill>` wrappers with fragments
JonnyBurgerf538dc71c55a
diff --git a/packages/docs/docs/audio/delaying.mdx b/packages/docs/docs/audio/delaying.mdxindex 37598c5e44..a929781d5a 100644--- a/packages/docs/docs/audio/delaying.mdx+++ b/packages/docs/docs/audio/delaying.mdx@@ -14,14 +14,14 @@ Use the [`from`](/docs/media/audio#from) prop to delay the audio from playing.In the following example, the audio will start playing after 100 frames.```tsx twoslash {6-8}-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Audio} from '@remotion/media';export const MyComposition = () => {return (- <AbsoluteFill>+ <><Audio from={100} src={staticFile('audio.mp3')} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/audio/from-video.mdx b/packages/docs/docs/audio/from-video.mdxindex 2222f0a8e8..4486fd6483 100644--- a/packages/docs/docs/audio/from-video.mdx+++ b/packages/docs/docs/audio/from-video.mdx@@ -14,14 +14,14 @@ Audio from [`<Video>`](/docs/media/video), [`<Html5Video>`](/docs/html5-video) aThe same principles apply as for audio - you may [trim](/docs/audio/trimming), [delay](/docs/audio/delaying), [mute](/docs/audio/muting), [speed up](/docs/audio/speed) and [reduce the volume](/docs/audio/volume) of your videos.```tsx twoslash {6} title="MyComp.tsx"-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Video} from '@remotion/media';export const MyComposition = () => {return (- <AbsoluteFill>+ <><Video src={staticFile('video.mp4')} playbackRate={2} volume={0.5} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/audio/importing.mdx b/packages/docs/docs/audio/importing.mdxindex b1cd2935a7..07d0c86f5f 100644--- a/packages/docs/docs/audio/importing.mdx+++ b/packages/docs/docs/audio/importing.mdx@@ -13,14 +13,14 @@ import TabItem from '@theme/TabItem';Add an [`<Audio/>`](/docs/media/audio) tag to your component to add sound to it.```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Audio} from '@remotion/media';export const MyComposition = () => {return (- <AbsoluteFill>+ <><Audio src={staticFile('audio.mp3')} />- </AbsoluteFill>+ </>);};```@@ -28,14 +28,13 @@ export const MyComposition = () => {You can also add remote audio by passing a URL:```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Audio} from '@remotion/media';export const MyComposition = () => {return (- <AbsoluteFill>+ <><Audio src="https://example.com/audio.mp3" />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/audio/muting.mdx b/packages/docs/docs/audio/muting.mdxindex c9f4f98a55..8fda372371 100644--- a/packages/docs/docs/audio/muting.mdx+++ b/packages/docs/docs/audio/muting.mdx@@ -15,7 +15,7 @@ You may pass in the [`muted`](/docs/media/audio#muted) prop to [`<Audio>`](/docsWhen [`muted`](/docs/media/audio#muted) is true, audio will be omitted at that time. In the following example, we are muting the track between seconds 2 and 4.```tsx twoslash {9}-import {AbsoluteFill, staticFile, useCurrentFrame, useVideoConfig} from 'remotion';+import {staticFile, useCurrentFrame, useVideoConfig} from 'remotion';import {Audio} from '@remotion/media';export const MyComposition = () => {@@ -23,9 +23,9 @@ export const MyComposition = () => {const {fps} = useVideoConfig();return (- <AbsoluteFill>+ <><Audio src={staticFile('audio.mp3')} muted={frame >= 2 * fps && frame <= 4 * fps} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/audio/pitch.mdx b/packages/docs/docs/audio/pitch.mdxindex 1ec690b01c..1daf5bdd37 100644--- a/packages/docs/docs/audio/pitch.mdx+++ b/packages/docs/docs/audio/pitch.mdx@@ -24,14 +24,14 @@ The value must stay constant for each audio or video asset. Animating or keyfram```tsx twoslash {7} title="MyComp.tsx"import {Audio} from '@remotion/media';-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';export const MyComposition = () => {return (- <AbsoluteFill>+ <><div>Hello World!</div><Audio src={staticFile('audio.mp3')} toneFrequency={0.8} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/audio/speed.mdx b/packages/docs/docs/audio/speed.mdxindex e0407b87c1..209251a9ab 100644--- a/packages/docs/docs/audio/speed.mdx+++ b/packages/docs/docs/audio/speed.mdx@@ -16,14 +16,14 @@ You can use the [`playbackRate`](/docs/media/audio#playbackrate) prop to control- Google Chrome supports playback rates between `0.0625` and `16`.```tsx twoslash {6} title="MyComp.tsx"-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Audio} from '@remotion/media';export const MyComposition = () => {return (- <AbsoluteFill>+ <><Audio src={staticFile('audio.mp3')} playbackRate={2} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/audio/trimming.mdx b/packages/docs/docs/audio/trimming.mdxindex 8a40fd4693..19eba97256 100644--- a/packages/docs/docs/audio/trimming.mdx+++ b/packages/docs/docs/audio/trimming.mdx@@ -13,16 +13,16 @@ The [`<Audio />`](/docs/media/audio) and [`<Video />`](/docs/media/video) tags sUse them together to select a section of the source.```tsx twoslash {8} title="MyComp.tsx"-import {AbsoluteFill, staticFile, useVideoConfig} from 'remotion';+import {staticFile, useVideoConfig} from 'remotion';import {Video} from '@remotion/media';export const MyComposition = () => {const {fps} = useVideoConfig();return (- <AbsoluteFill>+ <><Video src={staticFile('video.mp4')} trimBefore={2 * fps} durationInFrames={2 * fps} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/audio/volume.mdx b/packages/docs/docs/audio/volume.mdxindex f800feb721..02ce8fe81d 100644--- a/packages/docs/docs/audio/volume.mdx+++ b/packages/docs/docs/audio/volume.mdx@@ -12,14 +12,14 @@ The simplest way is to pass a number between `0` and `1`.```tsx twoslash {9} title="MyComp.tsx"import {Audio} from '@remotion/media';-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';export const MyComposition = () => {return (- <AbsoluteFill>+ <><div>Hello World!</div><Audio src={staticFile('audio.mp3')} volume={0.5} />- </AbsoluteFill>+ </>);};```@@ -30,16 +30,16 @@ You can also change volume over time using [`useCurrentFrame()`](/docs/use-curre```tsx twoslash {6,11} title="MyComp.tsx"import {Audio} from '@remotion/media';-import {AbsoluteFill, interpolate, staticFile, useCurrentFrame, useVideoConfig} from 'remotion';+import {interpolate, staticFile, useCurrentFrame, useVideoConfig} from 'remotion';export const MyComposition = () => {const frame = useCurrentFrame();const {fps} = useVideoConfig();return (- <AbsoluteFill>+ <><Audio src={staticFile('audio.mp3')} volume={interpolate(frame, [0, 1 * fps], [0, 1], {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'})} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/canvasimage.mdx b/packages/docs/docs/canvasimage.mdxindex c30406023f..c4a7e2e0e0 100644--- a/packages/docs/docs/canvasimage.mdx+++ b/packages/docs/docs/canvasimage.mdx@@ -14,13 +14,13 @@ Drawback: Assets must support CORS.Use [`<Img>`](/docs/img) if you want a component based on the regular `<img>` tag.```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, CanvasImage, staticFile} from 'remotion';+import {CanvasImage, staticFile} from 'remotion';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><CanvasImage src={staticFile('image.png')} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/captions/displaying.mdx b/packages/docs/docs/captions/displaying.mdxindex 77e6875070..6cde7d4b5b 100644--- a/packages/docs/docs/captions/displaying.mdx+++ b/packages/docs/docs/captions/displaying.mdx@@ -15,7 +15,7 @@ First, fetch your captions JSON file. Use [`useDelayRender()`](/docs/use-delay-r```tsx twoslash title="Fetching captions"import {useState, useEffect, useCallback} from 'react';-import {AbsoluteFill, staticFile, useDelayRender} from 'remotion';+import {staticFile, useDelayRender} from 'remotion';import type {Caption} from '@remotion/captions';export const MyComponent: React.FC = () => {@@ -42,7 +42,7 @@ export const MyComponent: React.FC = () => {return null;}- return <AbsoluteFill>{/* Render captions here */}</AbsoluteFill>;+ return <>{/* Render captions here */}</>;};```@@ -79,7 +79,7 @@ If a caption has `pageBreakAfter: true`, the current page ends after that captioMap over the pages and render each one in a [`<Sequence>`](/docs/sequence). Calculate the start frame and duration from the page timing:```tsx twoslash title="Rendering caption pages"-import {Sequence, useVideoConfig, AbsoluteFill} from 'remotion';+import {Sequence, useVideoConfig} from 'remotion';import type {TikTokPage} from '@remotion/captions';const SWITCH_CAPTIONS_EVERY_MS = 1200;@@ -94,7 +94,7 @@ const CaptionedContent: React.FC = () => {const {fps} = useVideoConfig();return (- <AbsoluteFill>+ <>{pages.map((page, index) => {const nextPage = pages[index + 1] ?? null;const startFrame = (page.startMs / 1000) * fps;@@ -111,7 +111,7 @@ const CaptionedContent: React.FC = () => {</Sequence>);})}- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/captions/importing.mdx b/packages/docs/docs/captions/importing.mdxindex c0d51990ee..b19156cf72 100644--- a/packages/docs/docs/captions/importing.mdx+++ b/packages/docs/docs/captions/importing.mdx@@ -15,7 +15,7 @@ Use [`staticFile()`](/docs/staticfile) to reference an `.srt` file in your `publ```tsx twoslash title="Importing captions from .srt"import {useState, useEffect, useCallback} from 'react';-import {AbsoluteFill, staticFile, useDelayRender} from 'remotion';+import {staticFile, useDelayRender} from 'remotion';import {parseSrt} from '@remotion/captions';import type {Caption} from '@remotion/captions';@@ -44,7 +44,7 @@ export const MyComponent: React.FC = () => {return null;}- return <AbsoluteFill>{/* Use captions here */}</AbsoluteFill>;+ return <>{/* Use captions here */}</>;};```diff --git a/packages/docs/docs/effects/barrel-distortion.mdx b/packages/docs/docs/effects/barrel-distortion.mdxindex 431f04bcbd..5e8aec880b 100644--- a/packages/docs/docs/effects/barrel-distortion.mdx+++ b/packages/docs/docs/effects/barrel-distortion.mdx@@ -21,13 +21,12 @@ It only applies geometric curvature. It does not add scanlines, blur, glow, chro## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {barrelDistortion} from '@remotion/effects/barrel-distortion';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -36,7 +35,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/blur.mdx b/packages/docs/docs/effects/blur.mdxindex 8261d92a07..e7c7d7a2cc 100644--- a/packages/docs/docs/effects/blur.mdx+++ b/packages/docs/docs/effects/blur.mdx@@ -19,18 +19,17 @@ A Gaussian blur that can be applied to canvas-based components such as [`<Video>## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {blur} from '@remotion/effects/blur';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[blur({radius: 8})]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/brightness.mdx b/packages/docs/docs/effects/brightness.mdxindex 1184ae9095..ac7de301e4 100644--- a/packages/docs/docs/effects/brightness.mdx+++ b/packages/docs/docs/effects/brightness.mdx@@ -19,15 +19,14 @@ A brightness adjustment effect that can be applied to canvas-based components su## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {brightness} from '@remotion/effects/brightness';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Video src="https://remotion.media/video.mp4" effects={[brightness({amount: 0.25})]} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/burlap.mdx b/packages/docs/docs/effects/burlap.mdxindex 4b9273dede..681f691ff4 100644--- a/packages/docs/docs/effects/burlap.mdx+++ b/packages/docs/docs/effects/burlap.mdx@@ -21,12 +21,12 @@ The effect preserves the source colors and alpha mask. Transparent regions stay## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, Solid} from 'remotion';+import {Solid} from 'remotion';import {burlap} from '@remotion/effects/burlap';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -41,7 +41,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/checkerboard.mdx b/packages/docs/docs/effects/checkerboard.mdxindex 12c938d6bd..97cfb1f66e 100644--- a/packages/docs/docs/effects/checkerboard.mdx+++ b/packages/docs/docs/effects/checkerboard.mdx@@ -22,13 +22,13 @@ It uses the same color, gap, angle and alpha masking controls as [`lines()`](/do```tsx twoslash title="MyComp.tsx"import {checkerboard} from '@remotion/effects/checkerboard';-import {AbsoluteFill, Solid, useCurrentFrame} from 'remotion';+import {Solid, useCurrentFrame} from 'remotion';export const MyComp: React.FC = () => {const frame = useCurrentFrame();return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -43,7 +43,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/chromatic-aberration.mdx b/packages/docs/docs/effects/chromatic-aberration.mdxindex ac72fcdf74..fb34b1e304 100644--- a/packages/docs/docs/effects/chromatic-aberration.mdx+++ b/packages/docs/docs/effects/chromatic-aberration.mdx@@ -21,13 +21,12 @@ Use it for an RGB split or lens-fringe look while still controlling effect order## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {chromaticAberration} from '@remotion/effects/chromatic-aberration';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -37,7 +36,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/contour-lines.mdx b/packages/docs/docs/effects/contour-lines.mdxindex ccc3cbdf72..c5c5b7cdca 100644--- a/packages/docs/docs/effects/contour-lines.mdx+++ b/packages/docs/docs/effects/contour-lines.mdx@@ -22,18 +22,13 @@ The effect renders static procedural linework. Animate its parameters, such as ````tsx twoslash title="MyComp.tsx"import {contourLines} from '@remotion/effects/contour-lines';-import {- AbsoluteFill,- CanvasImage,- staticFile,- useCurrentFrame,-} from 'remotion';+import {CanvasImage, staticFile, useCurrentFrame} from 'remotion';export const MyComp: React.FC = () => {const frame = useCurrentFrame();return (- <AbsoluteFill>+ <><CanvasImagesrc={staticFile('image.png')}width={1280}@@ -53,7 +48,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/contrast.mdx b/packages/docs/docs/effects/contrast.mdxindex e513523cea..ebc18f87f7 100644--- a/packages/docs/docs/effects/contrast.mdx+++ b/packages/docs/docs/effects/contrast.mdx@@ -19,15 +19,14 @@ A contrast adjustment effect that can be applied to canvas-based components such## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {contrast} from '@remotion/effects/contrast';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Video src="https://remotion.media/video.mp4" effects={[contrast({amount: 1.25})]} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/corner-pin.mdx b/packages/docs/docs/effects/corner-pin.mdxindex cebf6e34a3..070d5471e5 100644--- a/packages/docs/docs/effects/corner-pin.mdx+++ b/packages/docs/docs/effects/corner-pin.mdx@@ -21,13 +21,12 @@ The effect maps the input rectangle into the quadrilateral described by `topLeft## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {cornerPin} from '@remotion/effects/corner-pin';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -39,7 +38,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/dot-grid.mdx b/packages/docs/docs/effects/dot-grid.mdxindex 75e23f2e3c..fc23164e93 100644--- a/packages/docs/docs/effects/dot-grid.mdx+++ b/packages/docs/docs/effects/dot-grid.mdx@@ -21,13 +21,12 @@ Use it for dotted masks on [`<Video>`](/docs/media/video), [`<HtmlInCanvas>`](/d## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {dotGrid} from '@remotion/effects/dot-grid';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -37,7 +36,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```@@ -45,13 +44,12 @@ export const MyComp: React.FC = () => {To cut transparent dots out of the source instead, set `invert` to `true`:```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {dotGrid} from '@remotion/effects/dot-grid';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -62,7 +60,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/drop-shadow.mdx b/packages/docs/docs/effects/drop-shadow.mdxindex 0f311c5498..85a86aaab7 100644--- a/packages/docs/docs/effects/drop-shadow.mdx+++ b/packages/docs/docs/effects/drop-shadow.mdx@@ -19,12 +19,12 @@ Adds a blurred shadow behind canvas-based components such as [`<Video>`](/docs/m## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, HtmlInCanvas} from 'remotion';+import {HtmlInCanvas} from 'remotion';import {dropShadow} from '@remotion/effects/drop-shadow';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><HtmlInCanvaswidth={1280}height={720}@@ -49,7 +49,7 @@ export const MyComp: React.FC = () => {Hello</div></HtmlInCanvas>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/duotone.mdx b/packages/docs/docs/effects/duotone.mdxindex 81468e2de6..533a8a78f0 100644--- a/packages/docs/docs/effects/duotone.mdx+++ b/packages/docs/docs/effects/duotone.mdx@@ -21,13 +21,12 @@ The source alpha channel is preserved, so transparent and semi-transparent regio## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {duotone} from '@remotion/effects/duotone';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -38,7 +37,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/emboss.mdx b/packages/docs/docs/effects/emboss.mdxindex 2e02ecfa93..5c3739891a 100644--- a/packages/docs/docs/effects/emboss.mdx+++ b/packages/docs/docs/effects/emboss.mdx@@ -23,13 +23,13 @@ The effect preserves the source colors and alpha mask. Transparent regions stay```tsx twoslash title="MyComp.tsx"import {emboss} from '@remotion/effects/emboss';import {Video} from '@remotion/media';-import {AbsoluteFill, useCurrentFrame} from 'remotion';+import {useCurrentFrame} from 'remotion';export const MyComp: React.FC = () => {const frame = useCurrentFrame();return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -44,7 +44,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/evolve.mdx b/packages/docs/docs/effects/evolve.mdxindex 9b81d5ab58..0ee9483033 100644--- a/packages/docs/docs/effects/evolve.mdx+++ b/packages/docs/docs/effects/evolve.mdx@@ -21,7 +21,7 @@ Use it for wipes, reveals, and intro/outro animations on [`<Video>`](/docs/media## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, interpolate, useCurrentFrame} from 'remotion';+import {interpolate, useCurrentFrame} from 'remotion';import {Video} from '@remotion/media';import {evolve} from '@remotion/effects/evolve';@@ -33,7 +33,7 @@ export const MyComp: React.FC = () => {});return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -44,7 +44,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/fisheye.mdx b/packages/docs/docs/effects/fisheye.mdxindex 93813472b0..0d0ac6d576 100644--- a/packages/docs/docs/effects/fisheye.mdx+++ b/packages/docs/docs/effects/fisheye.mdx@@ -21,13 +21,12 @@ Pixels near the center are magnified while content near the edges is radially co## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {fisheye} from '@remotion/effects/fisheye';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -36,7 +35,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/glow.mdx b/packages/docs/docs/effects/glow.mdxindex 975233d543..de2e0f388f 100644--- a/packages/docs/docs/effects/glow.mdx+++ b/packages/docs/docs/effects/glow.mdx@@ -21,13 +21,12 @@ Use it when an element should appear to emit light.## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {glow} from '@remotion/effects/glow';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -39,7 +38,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/grayscale.mdx b/packages/docs/docs/effects/grayscale.mdxindex 71a4265b6f..da817c5fe0 100644--- a/packages/docs/docs/effects/grayscale.mdx+++ b/packages/docs/docs/effects/grayscale.mdx@@ -21,18 +21,17 @@ Use it when you want a dedicated black-and-white pass whose order can be control## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {grayscale} from '@remotion/effects/grayscale';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[grayscale({amount: 1})]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/gridlines.mdx b/packages/docs/docs/effects/gridlines.mdxindex 4bf03da07d..694573bef8 100644--- a/packages/docs/docs/effects/gridlines.mdx+++ b/packages/docs/docs/effects/gridlines.mdx@@ -21,12 +21,12 @@ Use it for overlays, guide patterns, and generated backgrounds on canvas-based c## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, Solid} from 'remotion';+import {Solid} from 'remotion';import {gridlines} from '@remotion/effects/gridlines';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -39,7 +39,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```@@ -47,12 +47,12 @@ export const MyComp: React.FC = () => {To generate a complete grid tile, set `backgroundColor`:```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, Solid} from 'remotion';+import {Solid} from 'remotion';import {gridlines} from '@remotion/effects/gridlines';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -66,7 +66,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```@@ -74,12 +74,12 @@ export const MyComp: React.FC = () => {To create a retro perspective floor, combine `rotationX` and `perspective`:```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, Solid} from 'remotion';+import {Solid} from 'remotion';import {gridlines} from '@remotion/effects/gridlines';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -95,7 +95,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/halftone-linear-gradient.mdx b/packages/docs/docs/effects/halftone-linear-gradient.mdxindex ab0e621651..921ac43ca4 100644--- a/packages/docs/docs/effects/halftone-linear-gradient.mdx+++ b/packages/docs/docs/effects/halftone-linear-gradient.mdx@@ -21,12 +21,12 @@ Use it for dot-pattern wipes, overlays, and backgrounds on canvas-based componen## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, Solid} from 'remotion';+import {Solid} from 'remotion';import {halftoneLinearGradient} from '@remotion/effects/halftone-linear-gradient';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -42,7 +42,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```@@ -50,12 +50,12 @@ export const MyComp: React.FC = () => {To use colors from the previous effect in the chain, set `colorMode` to `'source'`:```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, Solid} from 'remotion';+import {Solid} from 'remotion';import {halftoneLinearGradient} from '@remotion/effects/halftone-linear-gradient';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -71,7 +71,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/halftone.mdx b/packages/docs/docs/effects/halftone.mdxindex ef18d5083f..b69873b98a 100644--- a/packages/docs/docs/effects/halftone.mdx+++ b/packages/docs/docs/effects/halftone.mdx@@ -21,13 +21,12 @@ Use it when you want a printed-dot look while still controlling effect order thr## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {halftone} from '@remotion/effects/halftone';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -40,7 +39,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```@@ -48,13 +47,12 @@ export const MyComp: React.FC = () => {To preserve the original color of each sampled grid cell, set `colorMode` to `'source'`:```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {halftone} from '@remotion/effects/halftone';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -67,7 +65,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/hue.mdx b/packages/docs/docs/effects/hue.mdxindex ceb0d141c0..3b3d492db5 100644--- a/packages/docs/docs/effects/hue.mdx+++ b/packages/docs/docs/effects/hue.mdx@@ -19,15 +19,14 @@ A hue rotation effect that can be applied to canvas-based components such as [`<## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {hue} from '@remotion/effects/hue';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Video src="https://remotion.media/video.mp4" effects={[hue({degrees: 120})]} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/invert.mdx b/packages/docs/docs/effects/invert.mdxindex 608da8b2b5..6f60e80954 100644--- a/packages/docs/docs/effects/invert.mdx+++ b/packages/docs/docs/effects/invert.mdx@@ -21,15 +21,14 @@ Use it for negative-color looks, x-ray style passes, or as a preprocessing step## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {invert} from '@remotion/effects/invert';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Video src="https://remotion.media/video.mp4" effects={[invert({amount: 1})]} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/light-trail.mdx b/packages/docs/docs/effects/light-trail.mdxindex 9d4a9c3c92..f9302279c1 100644--- a/packages/docs/docs/effects/light-trail.mdx+++ b/packages/docs/docs/effects/light-trail.mdx@@ -22,11 +22,11 @@ Use it for speed streaks, luminous text trails and fast-moving logo smears.```tsx twoslash title="MyComp.tsx"import {lightTrail} from '@remotion/effects/light-trail';-import {AbsoluteFill, CanvasImage, staticFile} from 'remotion';+import {CanvasImage, staticFile} from 'remotion';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><CanvasImagesrc={staticFile('logo.png')}width={1280}@@ -43,7 +43,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/linear-gradient-tint.mdx b/packages/docs/docs/effects/linear-gradient-tint.mdxindex 9a6f234eaa..fbb21ece6c 100644--- a/packages/docs/docs/effects/linear-gradient-tint.mdx+++ b/packages/docs/docs/effects/linear-gradient-tint.mdx@@ -21,13 +21,12 @@ Use it to colorize canvas-based components such as [`<Video>`](/docs/media/video## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {linearGradientTint} from '@remotion/effects/linear-gradient-tint';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -40,7 +39,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/linear-gradient.mdx b/packages/docs/docs/effects/linear-gradient.mdxindex 624744ca8b..c65c688ab5 100644--- a/packages/docs/docs/effects/linear-gradient.mdx+++ b/packages/docs/docs/effects/linear-gradient.mdx@@ -21,12 +21,12 @@ Use it to fill a layer with a gradient. The effect replaces the source pixels.## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, Solid} from 'remotion';+import {Solid} from 'remotion';import {linearGradient} from '@remotion/effects/linear-gradient';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -39,7 +39,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/linear-progressive-blur.mdx b/packages/docs/docs/effects/linear-progressive-blur.mdxindex 8db978c197..123784e13a 100644--- a/packages/docs/docs/effects/linear-progressive-blur.mdx+++ b/packages/docs/docs/effects/linear-progressive-blur.mdx@@ -21,13 +21,12 @@ Use it for depth-of-field, focus pulls, and directional softening on canvas-base## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {linearProgressiveBlur} from '@remotion/effects/linear-progressive-blur';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -39,7 +38,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/linear-progressive-pixelate.mdx b/packages/docs/docs/effects/linear-progressive-pixelate.mdxindex c12bbb9b84..9499614c2b 100644--- a/packages/docs/docs/effects/linear-progressive-pixelate.mdx+++ b/packages/docs/docs/effects/linear-progressive-pixelate.mdx@@ -21,13 +21,12 @@ Use it for progressive mosaics, focus transitions, and directional pixelation on## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {linearProgressivePixelate} from '@remotion/effects/linear-progressive-pixelate';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -39,7 +38,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/lines.mdx b/packages/docs/docs/effects/lines.mdxindex 8a7bd42f66..fff774d3a6 100644--- a/packages/docs/docs/effects/lines.mdx+++ b/packages/docs/docs/effects/lines.mdx@@ -22,13 +22,13 @@ Each line color is composited over the source.```tsx twoslash title="MyComp.tsx"import {lines} from '@remotion/effects/lines';-import {AbsoluteFill, Solid, useCurrentFrame} from 'remotion';+import {Solid, useCurrentFrame} from 'remotion';export const MyComp: React.FC = () => {const frame = useCurrentFrame();return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -43,7 +43,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/mirror.mdx b/packages/docs/docs/effects/mirror.mdxindex b386f9db3b..55e50db0ad 100644--- a/packages/docs/docs/effects/mirror.mdx+++ b/packages/docs/docs/effects/mirror.mdx@@ -19,13 +19,12 @@ A mirror effect that can be applied to canvas-based components such as [`<Video>## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {mirror} from '@remotion/effects/mirror';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -35,7 +34,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/noise-displacement.mdx b/packages/docs/docs/effects/noise-displacement.mdxindex 6b9337127d..b927bd3fa4 100644--- a/packages/docs/docs/effects/noise-displacement.mdx+++ b/packages/docs/docs/effects/noise-displacement.mdx@@ -22,11 +22,11 @@ The effect is anchored to a UV coordinate and radius. Pixels outside the radius```tsx twoslash title="MyComp.tsx"import {noiseDisplacement} from '@remotion/effects/noise-displacement';-import {AbsoluteFill, CanvasImage, staticFile} from 'remotion';+import {CanvasImage, staticFile} from 'remotion';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><CanvasImagesrc={staticFile('image.png')}width={1280}@@ -44,7 +44,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/noise.mdx b/packages/docs/docs/effects/noise.mdxindex d451c3fc2f..67fe7f7e59 100644--- a/packages/docs/docs/effects/noise.mdx+++ b/packages/docs/docs/effects/noise.mdx@@ -21,12 +21,12 @@ The effect preserves the source alpha mask. Transparent regions stay transparent## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, Solid} from 'remotion';+import {Solid} from 'remotion';import {noise} from '@remotion/effects/noise';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -39,7 +39,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/paper.mdx b/packages/docs/docs/effects/paper.mdxindex 35b49c67d9..a02ae6f12d 100644--- a/packages/docs/docs/effects/paper.mdx+++ b/packages/docs/docs/effects/paper.mdx@@ -24,11 +24,11 @@ Based on the open-source [Paper Shaders paper texture](https://shaders.paper.des```tsx twoslash title="MyComp.tsx"import {paper} from '@remotion/effects/paper';-import {AbsoluteFill, Solid} from 'remotion';+import {Solid} from 'remotion';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -48,7 +48,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/pattern.mdx b/packages/docs/docs/effects/pattern.mdxindex 6395c3f513..02c2300263 100644--- a/packages/docs/docs/effects/pattern.mdx+++ b/packages/docs/docs/effects/pattern.mdx@@ -21,12 +21,12 @@ Use it to create wallpaper, contact sheets, tiled backgrounds, or staggered bric## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, Img, staticFile} from 'remotion';+import {Img, staticFile} from 'remotion';import {pattern} from '@remotion/effects/pattern';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Imgsrc={staticFile('logo.png')}effects={[@@ -41,7 +41,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/pixel-dissolve.mdx b/packages/docs/docs/effects/pixel-dissolve.mdxindex a13232d83a..f4f7191dba 100644--- a/packages/docs/docs/effects/pixel-dissolve.mdx+++ b/packages/docs/docs/effects/pixel-dissolve.mdx@@ -19,13 +19,12 @@ A pixel dissolve effect that divides the frame into a grid and fades the cells o## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {pixelDissolve} from '@remotion/effects/pixel-dissolve';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -38,7 +37,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/pixelate.mdx b/packages/docs/docs/effects/pixelate.mdxindex 9d54a8d1c2..0605f918ba 100644--- a/packages/docs/docs/effects/pixelate.mdx+++ b/packages/docs/docs/effects/pixelate.mdx@@ -21,13 +21,12 @@ Use it when you want a mosaic or censored look while still controlling effect or## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {pixelate} from '@remotion/effects/pixelate';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -36,7 +35,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/radial-progressive-blur.mdx b/packages/docs/docs/effects/radial-progressive-blur.mdxindex 1ae560cefd..c336bb5b2c 100644--- a/packages/docs/docs/effects/radial-progressive-blur.mdx+++ b/packages/docs/docs/effects/radial-progressive-blur.mdx@@ -21,13 +21,12 @@ Use it for depth-of-field, spotlight focus, and radial softening on canvas-based## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {radialProgressiveBlur} from '@remotion/effects/radial-progressive-blur';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -42,7 +41,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/radial-progressive-pixelate.mdx b/packages/docs/docs/effects/radial-progressive-pixelate.mdxindex 247d977732..1b348c7286 100644--- a/packages/docs/docs/effects/radial-progressive-pixelate.mdx+++ b/packages/docs/docs/effects/radial-progressive-pixelate.mdx@@ -21,13 +21,12 @@ Use it for pixelated focus regions, spotlight transitions, and radial mosaics on## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {radialProgressivePixelate} from '@remotion/effects/radial-progressive-pixelate';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -42,7 +41,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/region-blur.mdx b/packages/docs/docs/effects/region-blur.mdxindex 1539a84d49..68b37294a0 100644--- a/packages/docs/docs/effects/region-blur.mdx+++ b/packages/docs/docs/effects/region-blur.mdx@@ -21,13 +21,12 @@ Use it to obscure faces, license plates, documents, and other sensitive parts of## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {regionBlur} from '@remotion/effects/region-blur';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -40,7 +39,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/rings.mdx b/packages/docs/docs/effects/rings.mdxindex 106b981f56..ee92048c2f 100644--- a/packages/docs/docs/effects/rings.mdx+++ b/packages/docs/docs/effects/rings.mdx@@ -22,13 +22,13 @@ It uses the same band controls as [`lines()`](/docs/effects/lines), but radiates```tsx twoslash title="MyComp.tsx"import {rings} from '@remotion/effects/rings';-import {AbsoluteFill, Solid, useCurrentFrame} from 'remotion';+import {Solid, useCurrentFrame} from 'remotion';export const MyComp: React.FC = () => {const frame = useCurrentFrame();return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -42,7 +42,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/roughen-edges.mdx b/packages/docs/docs/effects/roughen-edges.mdxindex d307ad550c..ecafd48b08 100644--- a/packages/docs/docs/effects/roughen-edges.mdx+++ b/packages/docs/docs/effects/roughen-edges.mdx@@ -24,11 +24,11 @@ Based on the open-source [Paper Shaders](https://shaders.paper.design) noise hel```tsx twoslash title="MyComp.tsx"import {roughenEdges} from '@remotion/effects/roughen-edges';-import {AbsoluteFill, CanvasImage, staticFile} from 'remotion';+import {CanvasImage, staticFile} from 'remotion';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><CanvasImagesrc={staticFile('logo-with-alpha.png')}width={1280}@@ -42,7 +42,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/saturation.mdx b/packages/docs/docs/effects/saturation.mdxindex 7a45fcbb5c..e4b0254426 100644--- a/packages/docs/docs/effects/saturation.mdx+++ b/packages/docs/docs/effects/saturation.mdx@@ -21,18 +21,17 @@ Use it when you want to scale color intensity without overlaying a new color.## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {saturation} from '@remotion/effects/saturation';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[saturation({amount: 1.5})]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/scale.mdx b/packages/docs/docs/effects/scale.mdxindex 089b76fe3c..12d8c5a8ab 100644--- a/packages/docs/docs/effects/scale.mdx+++ b/packages/docs/docs/effects/scale.mdx@@ -19,18 +19,17 @@ A scale effect that can be applied to canvas-based components such as [`<Video>`## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {scale} from '@remotion/effects/scale';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[scale({scale: 0.8})]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/scanlines.mdx b/packages/docs/docs/effects/scanlines.mdxindex e18b3e8a35..2b50f4a472 100644--- a/packages/docs/docs/effects/scanlines.mdx+++ b/packages/docs/docs/effects/scanlines.mdx@@ -23,13 +23,13 @@ The effect is additive and preserves the source alpha mask. Transparent regions```tsx twoslash title="MyComp.tsx"import {scanlines} from '@remotion/effects/scanlines';import {Video} from '@remotion/media';-import {AbsoluteFill, useCurrentFrame} from 'remotion';+import {useCurrentFrame} from 'remotion';export const MyComp: React.FC = () => {const frame = useCurrentFrame();return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -41,7 +41,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/shine.mdx b/packages/docs/docs/effects/shine.mdxindex 18dcb42e3f..69e305a07c 100644--- a/packages/docs/docs/effects/shine.mdx+++ b/packages/docs/docs/effects/shine.mdx@@ -21,7 +21,7 @@ Use it for stickers, badges, titles, and surfaces that should look reflective.## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, interpolate, useCurrentFrame} from 'remotion';+import {interpolate, useCurrentFrame} from 'remotion';import {Video} from '@remotion/media';import {shine} from '@remotion/effects/shine';@@ -33,7 +33,7 @@ export const MyComp: React.FC = () => {});return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -47,7 +47,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/skew.mdx b/packages/docs/docs/effects/skew.mdxindex 0294b1510a..b9bdc1bae9 100644--- a/packages/docs/docs/effects/skew.mdx+++ b/packages/docs/docs/effects/skew.mdx@@ -22,17 +22,17 @@ Pixels moved outside the canvas are clipped. Newly uncovered regions are transpa```tsx twoslash title="MyComp.tsx"import {Video} from '@remotion/media';-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {skew} from '@remotion/effects/skew';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc={staticFile('video.mp4')}effects={[skew({x: 24, y: 0, origin: [0.25, 0.5]})]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/speckle.mdx b/packages/docs/docs/effects/speckle.mdxindex 4ec0072f4f..d666fe3889 100644--- a/packages/docs/docs/effects/speckle.mdx+++ b/packages/docs/docs/effects/speckle.mdx@@ -21,13 +21,12 @@ Use it for isolated pinpricks or dust-like missing spots without adding edge dam## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {speckle} from '@remotion/effects/speckle';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -38,7 +37,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/starburst.mdx b/packages/docs/docs/effects/starburst.mdxindex 68f4c2b50a..772a0aaa9e 100644--- a/packages/docs/docs/effects/starburst.mdx+++ b/packages/docs/docs/effects/starburst.mdx@@ -22,11 +22,11 @@ Renders a WebGL2-based retro starburst ray pattern on canvas-based components su```tsx twoslash title="MyComp.tsx"import {starburst} from '@remotion/effects/starburst';-import {AbsoluteFill, Solid} from 'remotion';+import {Solid} from 'remotion';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -40,7 +40,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/tear.mdx b/packages/docs/docs/effects/tear.mdxindex 432a4c5912..6ec5336bf6 100644--- a/packages/docs/docs/effects/tear.mdx+++ b/packages/docs/docs/effects/tear.mdx@@ -19,7 +19,7 @@ Tears a canvas-based component along a zigzag seam in any direction. The two pie## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, interpolate, useCurrentFrame} from 'remotion';+import {interpolate, useCurrentFrame} from 'remotion';import {Video} from '@remotion/media';import {tear} from '@remotion/effects/tear';@@ -31,12 +31,12 @@ export const MyComp: React.FC = () => {});return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[tear({progress, rotation: 20, jaggedness: 20})]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/thermal-vision.mdx b/packages/docs/docs/effects/thermal-vision.mdxindex fba6dafd62..ef2fb904af 100644--- a/packages/docs/docs/effects/thermal-vision.mdx+++ b/packages/docs/docs/effects/thermal-vision.mdx@@ -22,11 +22,11 @@ The source alpha channel is preserved, so transparent and semi-transparent regio```tsx twoslash title="MyComp.tsx"import {thermalVision} from '@remotion/effects/thermal-vision';-import {AbsoluteFill, CanvasImage, staticFile} from 'remotion';+import {CanvasImage, staticFile} from 'remotion';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><CanvasImagesrc={staticFile('image.png')}width={1280}@@ -48,7 +48,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/tile.mdx b/packages/docs/docs/effects/tile.mdxindex 26a6bea5d8..3c33871fd9 100644--- a/packages/docs/docs/effects/tile.mdx+++ b/packages/docs/docs/effects/tile.mdx@@ -21,14 +21,13 @@ Place [`scale()`](/docs/effects/scale) before `tile()` to expand a texture beyon## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {tile} from '@remotion/effects/tile';import {scale} from '@remotion/effects/scale';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -36,7 +35,7 @@ export const MyComp: React.FC = () => {tile(),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/tint.mdx b/packages/docs/docs/effects/tint.mdxindex 0c25fa70db..2585660af4 100644--- a/packages/docs/docs/effects/tint.mdx+++ b/packages/docs/docs/effects/tint.mdx@@ -21,18 +21,17 @@ The tint respects the source's alpha mask, so transparent regions are left untou## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {tint} from '@remotion/effects/tint';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[tint({color: '#1ec8ff', amount: 0.7})]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/tv-signal-off.mdx b/packages/docs/docs/effects/tv-signal-off.mdxindex 899bdf68b6..8135a0f86c 100644--- a/packages/docs/docs/effects/tv-signal-off.mdx+++ b/packages/docs/docs/effects/tv-signal-off.mdx@@ -21,12 +21,12 @@ The effect generates color bars, calibration blocks, and a grayscale ramp. The s## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, CanvasImage, staticFile} from 'remotion';+import {CanvasImage, staticFile} from 'remotion';import {tvSignalOff} from '@remotion/effects/tv-signal-off';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><CanvasImagesrc={staticFile('image.png')}width={1280}@@ -38,7 +38,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/uv-translate.mdx b/packages/docs/docs/effects/uv-translate.mdxindex cbb2d4b811..7f30d423a2 100644--- a/packages/docs/docs/effects/uv-translate.mdx+++ b/packages/docs/docs/effects/uv-translate.mdx@@ -21,18 +21,17 @@ It can be applied to components such as [`<Video>`](/docs/media/video), [`<HtmlI## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {uvTranslate} from '@remotion/effects/translate';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[uvTranslate({u: 0.1, v: 0.05})]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/venetian-blinds.mdx b/packages/docs/docs/effects/venetian-blinds.mdxindex 76989e2dbb..9d1625ba7c 100644--- a/packages/docs/docs/effects/venetian-blinds.mdx+++ b/packages/docs/docs/effects/venetian-blinds.mdx@@ -21,7 +21,7 @@ Use it for slatted wipes, intro animations, and outro animations on [`<Video>`](## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, interpolate, useCurrentFrame} from 'remotion';+import {interpolate, useCurrentFrame} from 'remotion';import {Video} from '@remotion/media';import {venetianBlinds} from '@remotion/effects/venetian-blinds';@@ -33,7 +33,7 @@ export const MyComp: React.FC = () => {});return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -44,7 +44,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/vignette.mdx b/packages/docs/docs/effects/vignette.mdxindex 697f96f553..424293dc34 100644--- a/packages/docs/docs/effects/vignette.mdx+++ b/packages/docs/docs/effects/vignette.mdx@@ -21,13 +21,12 @@ It respects the source alpha mask. Transparent regions stay transparent.## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {vignette} from '@remotion/effects/vignette';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -40,7 +39,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/wave.mdx b/packages/docs/docs/effects/wave.mdxindex 51a823ebc9..8554c5c4ec 100644--- a/packages/docs/docs/effects/wave.mdx+++ b/packages/docs/docs/effects/wave.mdx@@ -19,7 +19,7 @@ A wave effect that can be applied to canvas-based components such as [`<Video>`]## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, useCurrentFrame} from 'remotion';+import {useCurrentFrame} from 'remotion';import {Video} from '@remotion/media';import {wave} from '@remotion/effects/wave';@@ -27,7 +27,7 @@ export const MyComp: React.FC = () => {const frame = useCurrentFrame();return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -38,7 +38,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/waves.mdx b/packages/docs/docs/effects/waves.mdxindex 9e4a4bb1a1..818d3c4c0a 100644--- a/packages/docs/docs/effects/waves.mdx+++ b/packages/docs/docs/effects/waves.mdx@@ -22,13 +22,13 @@ Colors are composited over the source.```tsx twoslash title="MyComp.tsx"import {waves} from '@remotion/effects/waves';-import {AbsoluteFill, Solid, useCurrentFrame} from 'remotion';+import {Solid, useCurrentFrame} from 'remotion';export const MyComp: React.FC = () => {const frame = useCurrentFrame();return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -46,7 +46,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/white-noise.mdx b/packages/docs/docs/effects/white-noise.mdxindex d7b3cd570f..d910551aab 100644--- a/packages/docs/docs/effects/white-noise.mdx+++ b/packages/docs/docs/effects/white-noise.mdx@@ -29,12 +29,12 @@ The effect preserves the source alpha mask. Transparent regions stay transparent## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, Solid} from 'remotion';+import {Solid} from 'remotion';import {whiteNoise} from '@remotion/effects/white-noise';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -46,7 +46,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/xy-translate.mdx b/packages/docs/docs/effects/xy-translate.mdxindex 50a685217b..89a7248879 100644--- a/packages/docs/docs/effects/xy-translate.mdx+++ b/packages/docs/docs/effects/xy-translate.mdx@@ -21,18 +21,17 @@ It can be applied to components such as [`<Video>`](/docs/media/video), [`<HtmlI## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';import {xyTranslate} from '@remotion/effects/translate';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[xyTranslate({x: 120, y: 80})]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/zigzag.mdx b/packages/docs/docs/effects/zigzag.mdxindex 186182bbdc..2beae67da1 100644--- a/packages/docs/docs/effects/zigzag.mdx+++ b/packages/docs/docs/effects/zigzag.mdx@@ -22,13 +22,13 @@ It uses the same band controls as [`lines()`](/docs/effects/lines), and the same```tsx twoslash title="MyComp.tsx"import {zigzag} from '@remotion/effects/zigzag';-import {AbsoluteFill, Solid, useCurrentFrame} from 'remotion';+import {Solid, useCurrentFrame} from 'remotion';export const MyComp: React.FC = () => {const frame = useCurrentFrame();return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -45,7 +45,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/effects/zoom-blur.mdx b/packages/docs/docs/effects/zoom-blur.mdxindex c45700a7ef..3d65c3314b 100644--- a/packages/docs/docs/effects/zoom-blur.mdx+++ b/packages/docs/docs/effects/zoom-blur.mdx@@ -19,7 +19,7 @@ A radial zoom blur that smears pixels away from a configurable center point. It## Example```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, interpolate, useCurrentFrame} from 'remotion';+import {interpolate, useCurrentFrame} from 'remotion';import {Video} from '@remotion/media';import {zoomBlur} from '@remotion/effects/zoom-blur';@@ -30,7 +30,7 @@ export const MyComp: React.FC = () => {});return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/video.mp4"effects={[@@ -40,7 +40,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/greenscreen.mdx b/packages/docs/docs/greenscreen.mdxindex 3abf4b858c..7061fcae42 100644--- a/packages/docs/docs/greenscreen.mdx+++ b/packages/docs/docs/greenscreen.mdx@@ -18,12 +18,11 @@ Drag the slider below to adjust how close a pixel has to be to the key color toimport {colorKey} from '@remotion/effects/color-key';import {Video} from '@remotion/media';import React from 'react';-import {AbsoluteFill} from 'remotion';// ---cut---export const Greenscreen: React.FC = () => {return (- <AbsoluteFill>+ <><Videosrc="https://remotion.media/greenscreen.mp4"effects={[@@ -32,7 +31,7 @@ export const Greenscreen: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/hls.mdx b/packages/docs/docs/hls.mdxindex b42e26bc34..50fc16424e 100644--- a/packages/docs/docs/hls.mdx+++ b/packages/docs/docs/hls.mdx@@ -12,14 +12,13 @@ crumb: 'Video'Simply pass an `.m3u8` URL as the `src` prop:```tsx twoslash-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';export const HlsExample = () => {return (- <AbsoluteFill>+ <><Video src="https://stream.mux.com/nqGuji1CJuoPoU3iprRRhiy3HXiQN0201HLyliOg44HOU.m3u8" />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/html5-audio.mdx b/packages/docs/docs/html5-audio.mdxindex f605ef2261..14d92d5186 100644--- a/packages/docs/docs/html5-audio.mdx+++ b/packages/docs/docs/html5-audio.mdx@@ -22,13 +22,13 @@ Use this component when you specifically need direct HTML5 audio behavior or fal[Put an audio file into the `public/` folder](/docs/assets) and use [`staticFile()`](/docs/staticfile) to reference it.```tsx twoslash-import {AbsoluteFill, Html5Audio, staticFile} from 'remotion';+import {Html5Audio, staticFile} from 'remotion';export const MyVideo = () => {return (- <AbsoluteFill>+ <><Html5Audio src={staticFile('audio.mp3')} />- </AbsoluteFill>+ </>);};```@@ -42,25 +42,25 @@ Selects this many source frames starting at `trimBefore`. The audio occupies `duAllows you to control the volume of the audio in it's entirety or frame by frame. Read the page on [using audio](/docs/using-audio) to learn more.```tsx twoslash title="Setting a static volume"-import {AbsoluteFill, Html5Audio, staticFile} from 'remotion';+import {Html5Audio, staticFile} from 'remotion';export const MyVideo = () => {return (- <AbsoluteFill>+ <><Html5Audio volume={0.5} src={staticFile('background.mp3')} />- </AbsoluteFill>+ </>);};``````tsx twoslash title="Changing the volume over time"-import {AbsoluteFill, Html5Audio, interpolate, staticFile} from 'remotion';+import {Html5Audio, interpolate, staticFile} from 'remotion';export const MyVideo = () => {return (- <AbsoluteFill>+ <><Html5Audio volume={(f) => interpolate(f, [0, 30], [0, 1], {extrapolateLeft: 'clamp'})} src={staticFile('voice.mp3')} />- </AbsoluteFill>+ </>);};```@@ -85,13 +85,13 @@ By passing `durationInFrames={60}`, the audio plays for 60 source frames.The audio will play the range from `00:02:00` to `00:04:00`, meaning the audio will play for 2 seconds.```tsx twoslash-import {AbsoluteFill, Html5Audio, staticFile} from 'remotion';+import {Html5Audio, staticFile} from 'remotion';export const MyVideo = () => {return (- <AbsoluteFill>+ <><Html5Audio src={staticFile('audio.mp3')} trimBefore={60} durationInFrames={60} />- </AbsoluteFill>+ </>);};```@@ -117,13 +117,13 @@ You can use the `playbackRate` prop to control the speed of the audio. `1` is thWhile Remotion doesn't limit the range of possible playback speeds, in development mode the [`HTMLMediaElement.playbackRate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/playbackRate) API is used which throws errors on extreme values. At the time of writing, Google Chrome throws an exception if the playback rate is below `0.0625` or above `16`.```tsx twoslash-import {AbsoluteFill, Html5Audio, staticFile} from 'remotion';+import {Html5Audio, staticFile} from 'remotion';export const MyVideo = () => {return (- <AbsoluteFill>+ <><Html5Audio src={staticFile('audio.mp3')} playbackRate={2} />- </AbsoluteFill>+ </>);};```@@ -145,14 +145,14 @@ Accepts `true`, `false`, or `undefined`. Default: `true`, matching the browser dThe `muted` prop will be respected. It will lead to no audio being played while still keeping the audio tag mounted. It's value may change over time, for example to only mute a certain section of the audio.```tsx twoslash-import {AbsoluteFill, Html5Audio, staticFile, useCurrentFrame} from 'remotion';+import {Html5Audio, staticFile, useCurrentFrame} from 'remotion';export const MyVideo = () => {const frame = useCurrentFrame();return (- <AbsoluteFill>+ <><Html5Audio src={staticFile('audio.mp3')} muted={frame < 30} />- </AbsoluteFill>+ </>);};```@@ -166,14 +166,14 @@ A name and that will be shown as the label of the sequence in the timeline of thYou can use the `loop` prop to loop audio.```tsx twoslash-import {AbsoluteFill, Html5Audio, staticFile, useCurrentFrame} from 'remotion';+import {Html5Audio, staticFile, useCurrentFrame} from 'remotion';export const MyVideo = () => {const frame = useCurrentFrame();return (- <AbsoluteFill>+ <><Html5Audio loop src={staticFile('audio.mp3')} />- </AbsoluteFill>+ </>);};```@@ -191,14 +191,14 @@ A `toneFrequency` of 0.5 would lower the pitch by half, and a `toneFrequency` ofSelect the audio stream to use. The default is `0`.```tsx twoslash-import {AbsoluteFill, Html5Audio} from 'remotion';+import {Html5Audio} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Html5Audio audioStreamIndex={1} src={'https://remotion.media/multiple-audio-streams.mov'} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/html5-video.mdx b/packages/docs/docs/html5-video.mdxindex f68cce7bf1..6953a120e9 100644--- a/packages/docs/docs/html5-video.mdx+++ b/packages/docs/docs/html5-video.mdx@@ -24,13 +24,13 @@ For new video usage, prefer [`<Video>`](/docs/media/video) from [`@remotion/mediAll the props that the native `<video>` element accepts (except `autoplay` and `controls`) will be forwarded (but of course not all are useful for Remotion). This means you can use all CSS to style the video.```tsx twoslash-import {AbsoluteFill, staticFile, Html5Video} from 'remotion';+import {staticFile, Html5Video} from 'remotion';export const MyComposition = () => {return (- <AbsoluteFill>+ <><Html5Video src={staticFile('video.webm')} />- </AbsoluteFill>+ </>);};```@@ -38,13 +38,13 @@ export const MyComposition = () => {You can load a video from an URL as well:```tsx twoslash-import {AbsoluteFill, Html5Video} from 'remotion';+import {Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Html5Video src="https://remotion.media/BigBuckBunny.mp4" />- </AbsoluteFill>+ </>);};```@@ -73,14 +73,14 @@ The video will play the range from `00:02:00` to `00:04:00`, meaning the video wFor exact behavior, see [Timing and trimming](/docs/timing).```tsx twoslash-import {AbsoluteFill, Html5Video, staticFile} from 'remotion';+import {Html5Video, staticFile} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Html5Video src={staticFile('video.webm')} trimBefore={60} durationInFrames={60} />- </AbsoluteFill>+ </>);};```@@ -110,14 +110,14 @@ This prop has been renamed to [`trimAfter`](#trimafter) in 4.0.319. It will contYou can pass any style you can pass to a native `<video>` element. For example, set its size:```tsx twoslash-import {AbsoluteFill, staticFile, Html5Video} from 'remotion';+import {staticFile, Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Html5Video src={staticFile('video.webm')} style={{height: 720, width: 1280}} />- </AbsoluteFill>+ </>);};```@@ -127,27 +127,27 @@ export const MyComposition = () => {Allows you to control the volume for the whole track or change it on a per-frame basis. Refer to the [using audio](/docs/audio/volume) guide to learn how to use it.```tsx twoslash title="Example using static volume"-import {AbsoluteFill, staticFile, Html5Video} from 'remotion';+import {staticFile, Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Html5Video volume={0.5} src={staticFile('video.webm')} />- </AbsoluteFill>+ </>);};``````tsx twoslash title="Example of a ramp up over 100 frames"-import {AbsoluteFill, interpolate, staticFile, Html5Video} from 'remotion';+import {interpolate, staticFile, Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Html5Video volume={(f) => interpolate(f, [0, 100], [0, 1], {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'})} src={staticFile('video.webm')} />- </AbsoluteFill>+ </>);};```@@ -171,14 +171,14 @@ Controls the speed of the video. `1` is the default and means regular speed, `0.While Remotion doesn't limit the range of possible playback speeds, in development mode the [`HTMLMediaElement.playbackRate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/playbackRate) API is used which throws errors on extreme values. At the time of writing, Google Chrome throws an exception if the playback rate is below `0.0625` or above `16`.```tsx twoslash title="Example of a video playing twice as fast"-import {AbsoluteFill, staticFile, Html5Video} from 'remotion';+import {staticFile, Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Html5Video playbackRate={2} src={staticFile('video.webm')} />- </AbsoluteFill>+ </>);};```@@ -200,13 +200,13 @@ Accepts `true`, `false`, or `undefined`. Default: `true`, matching the browser dYou can drop the audio of the video by adding a `muted` prop:```tsx twoslash title="Example of a muted video"-import {AbsoluteFill, Html5Video} from 'remotion';+import {Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Html5Video muted src="https://remotion.media/BigBuckBunny.mp4" />- </AbsoluteFill>+ </>);};```@@ -218,13 +218,13 @@ This has the benefit that Remotion will not have to download the video file duriMakes the video loop indefinitely.```tsx twoslash title="Example of a looped video"-import {AbsoluteFill, Html5Video} from 'remotion';+import {Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Html5Video loop src="https://remotion.media/BigBuckBunny.mp4" />- </AbsoluteFill>+ </>);};```@@ -251,14 +251,14 @@ A `toneFrequency` of 0.5 would lower the pitch by half, and a `toneFrequency` ofSelect the audio stream to use. The default is `0`.```tsx twoslash-import {AbsoluteFill, Html5Video} from 'remotion';+import {Html5Video} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Html5Video audioStreamIndex={1} src={'https://remotion.media/multiple-audio-streams.mov'} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/img.mdx b/packages/docs/docs/img.mdxindex 9e7a5c918f..4a37d02466 100644--- a/packages/docs/docs/img.mdx+++ b/packages/docs/docs/img.mdx@@ -16,13 +16,13 @@ If you use `<Img>`, Remotion will ensure that the image is loaded before renderi[Put an image into the `public/` folder](/docs/assets) and use [`staticFile()`](/docs/staticfile) to reference it.```tsx twoslash-import {AbsoluteFill, Img, staticFile} from 'remotion';+import {Img, staticFile} from 'remotion';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Img src={staticFile('hi.png')} />- </AbsoluteFill>+ </>);};```@@ -30,13 +30,13 @@ export const MyComp: React.FC = () => {You can also load a remote image:```tsx twoslash-import {AbsoluteFill, Img} from 'remotion';+import {Img} from 'remotion';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Img src={'https://picsum.photos/200/300'} />- </AbsoluteFill>+ </>);};```@@ -48,14 +48,14 @@ Apply [effects](/docs/effects/api) to the image.When `effects` is omitted or an empty array, `<Img>` renders a native `<img>` element. When at least one effect is passed, `<Img>` renders through [`<CanvasImage>`](/docs/canvasimage) and outputs a `<canvas>`.```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, Img, staticFile} from 'remotion';+import {Img, staticFile} from 'remotion';import {blur} from '@remotion/effects/blur';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Img src={staticFile('hi.png')} effects={[blur({radius: 8})]} />- </AbsoluteFill>+ </>);};```@@ -88,18 +88,18 @@ Crops the image from the bottom by a ratio between `0` and `1`. See [`cropBottomTo use the `<Img>` tag in a resilient way, handle the error that occurs when an image can not be loaded:```tsx twoslash-import {AbsoluteFill, Img, staticFile} from 'remotion';+import {Img, staticFile} from 'remotion';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Imgsrc={staticFile('hi.png')}onError={(event) => {// Handle image loading error here}}/>- </AbsoluteFill>+ </>);};```@@ -165,13 +165,13 @@ You can still wrap `<Img>` in an outer [`<Sequence>`](/docs/sequence). Timing [c:::```tsx twoslash title="Clip starting at frame 30, lasting 90 frames"-import {AbsoluteFill, Img, staticFile} from 'remotion';+import {Img, staticFile} from 'remotion';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Img from={30} durationInFrames={90} src={staticFile('hi.png')} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/interactive.mdx b/packages/docs/docs/interactive.mdxindex 2d8bba4f70..a12fb229d8 100644--- a/packages/docs/docs/interactive.mdx+++ b/packages/docs/docs/interactive.mdx@@ -12,13 +12,13 @@ crumb: 'API'Use it when a regular element should be selectable and draggable in the preview:```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, Interactive} from 'remotion';+import {Interactive} from 'remotion';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Interactive.Div style={{backgroundColor: 'white', padding: 24}}>Hello World</Interactive.Div>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/layout-utils/debug.mdx b/packages/docs/docs/layout-utils/debug.mdxindex 26303e8aca..7cd7cfb365 100644--- a/packages/docs/docs/layout-utils/debug.mdx+++ b/packages/docs/docs/layout-utils/debug.mdx@@ -15,7 +15,6 @@ zoom level.<br/><Step>3</Step>Render at the bottom of your component a `<div>` that contains the string and all the properties that you passed to [`measureText()`](/docs/layout-utils/measure-text).```tsx twoslash title="Sample markup"-import {AbsoluteFill} from 'remotion';const MyComp: React.FC = () => {const fontSize = 100;@@ -27,7 +26,7 @@ const MyComp: React.FC = () => {const textTransform = undefined;return (- <AbsoluteFill>+ <><divid="remotion-measurer"style={{@@ -43,7 +42,7 @@ const MyComp: React.FC = () => {>{text}</div>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/maps.mdx b/packages/docs/docs/maps.mdxindex 3c738a1d80..e37830d6ed 100644--- a/packages/docs/docs/maps.mdx+++ b/packages/docs/docs/maps.mdx@@ -28,7 +28,7 @@ Use [`useDelayRender()`](/docs/use-delay-render) to wait for the map to load. Th```tsx twoslashimport {useEffect, useRef, useState} from 'react';-import {AbsoluteFill, useDelayRender, useVideoConfig} from 'remotion';+import {useDelayRender, useVideoConfig} from 'remotion';import * as maplibregl from 'maplibre-gl';import 'maplibre-gl/dist/maplibre-gl.css';@@ -74,9 +74,9 @@ export const MapComposition = () => {}, [handle, continueRender]);return (- <AbsoluteFill>+ <><div ref={ref} style={{width, height, position: 'absolute'}} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/media/audio.mdx b/packages/docs/docs/media/audio.mdxindex 0929bf9a69..5b64700a32 100644--- a/packages/docs/docs/media/audio.mdx+++ b/packages/docs/docs/media/audio.mdx@@ -11,14 +11,14 @@ During rendering, it extracts the exact audio using [Mediabunny](/docs/mediabunn## Example```tsx twoslash-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Audio} from '@remotion/media';export const MyVideo = () => {return (- <AbsoluteFill>+ <><Audio src={staticFile('audio.mp3')} />- </AbsoluteFill>+ </>);};```@@ -26,14 +26,13 @@ export const MyVideo = () => {You can load a video from an URL as well:```tsx twoslash-import {AbsoluteFill} from 'remotion';import {Audio} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Audio src="https://remotion.media/audio.wav" />- </AbsoluteFill>+ </>);};```@@ -57,14 +56,14 @@ You can still wrap `<Audio>` in an outer [`<Sequence>`](/docs/sequence). Timing:::```tsx twoslash title="Clip starting at frame 30, lasting 90 frames"-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Audio} from '@remotion/media';export const MyComposition = () => {return (- <AbsoluteFill>+ <><Audio from={30} durationInFrames={90} src={staticFile('audio.mp3')} />- </AbsoluteFill>+ </>);};```@@ -91,15 +90,15 @@ The audio will play the range from `00:02:00` to `00:04:00`, meaning the audio wFor exact behavior, see [Timing and trimming](/docs/timing).```tsx twoslash-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Audio} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Audio src={staticFile('audio.mp3')} trimBefore={60} durationInFrames={60} />- </AbsoluteFill>+ </>);};```@@ -118,29 +117,29 @@ Allows you to control the volume of the audio in it's entirety or frame by frameRead the page on [using audio](/docs/using-audio) to learn more.```tsx twoslash title="Setting a static volume"-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Audio} from '@remotion/media';export const MyVideo = () => {return (- <AbsoluteFill>+ <><Audio volume={0.5} src={staticFile('background.mp3')} />- </AbsoluteFill>+ </>);};``````tsx twoslash title="Changing the volume over time"-import {AbsoluteFill, interpolate, staticFile, useCurrentFrame} from 'remotion';+import {interpolate, staticFile, useCurrentFrame} from 'remotion';import {Audio} from '@remotion/media';export const MyVideo = () => {const frame = useCurrentFrame();return (- <AbsoluteFill>+ <><Audio volume={interpolate(frame, [0, 30], [0, 1], {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'})} src={staticFile('voice.mp3')} />- </AbsoluteFill>+ </>);};```@@ -185,15 +184,15 @@ export const MyVideo = () => {Controls the speed of the audio. `1` is the default and means regular speed, `0.5` slows down the audio so it's twice as long and `2` speeds up the audio so it's twice as fast.```tsx twoslash title="Example of a audio playing twice as fast"-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Audio} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Audio playbackRate={2} src={'https://remotion.media/audio.mp3'} />- </AbsoluteFill>+ </>);};```@@ -252,15 +251,14 @@ Customize the [number of retries](/docs/delay-render#retrying) of the [`delayRenSelect the audio stream to use. The default is `0`.```tsx twoslash-import {AbsoluteFill} from 'remotion';import {Audio} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Audio audioStreamIndex={1} src={'https://remotion.media/multiple-audio-streams.mov'} />- </AbsoluteFill>+ </>);};```@@ -277,15 +275,14 @@ Accepts `"omit"`, `"same-origin"` (default behavior of `fetch()`) or `"include"`Set to `"include"` if you need to send cookies or authentication headers to a cross-origin audio URL.```tsx twoslash-import {AbsoluteFill} from 'remotion';import {Audio} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Audio requestInit={{credentials: 'include'}} src="https://example.com/protected-audio.mp3" />- </AbsoluteFill>+ </>);};```@@ -298,15 +295,14 @@ Set `cache` to `"no-store"` if a CDN or browser cache returns invalid range requThe value is captured when the component mounts; later updates to the prop are ignored, so passing an inline object is safe.```tsx twoslash-import {AbsoluteFill} from 'remotion';import {Audio} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Audio requestInit={{cache: 'no-store'}} src="https://remotion.media/audio.mp3" />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/media/video.mdx b/packages/docs/docs/media/video.mdxindex 8229dbe78a..712da35ee1 100644--- a/packages/docs/docs/media/video.mdx+++ b/packages/docs/docs/media/video.mdx@@ -13,14 +13,14 @@ This component has [native buffering support](/docs/player/buffer-state) enabled## Example```tsx twoslash-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Video} from '@remotion/media';export const MyVideo = () => {return (- <AbsoluteFill>+ <><Video src={staticFile('video.webm')} />- </AbsoluteFill>+ </>);};```@@ -28,14 +28,13 @@ export const MyVideo = () => {You can load a video from an URL as well:```tsx twoslash-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Video src="https://remotion.media/BigBuckBunny.mp4" />- </AbsoluteFill>+ </>);};```@@ -43,14 +42,13 @@ export const MyComposition = () => {You can also load HLS playlists (`.m3u8`):```tsx twoslash-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Video src="https://stream.mux.com/nqGuji1CJuoPoU3iprRRhiy3HXiQN0201HLyliOg44HOU.m3u8" />- </AbsoluteFill>+ </>);};```@@ -96,14 +94,14 @@ You can still wrap `<Video>` in an outer [`<Sequence>`](/docs/sequence). Timing:::```tsx twoslash title="Clip starting at frame 30, lasting 90 frames"-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Video} from '@remotion/media';export const MyComposition = () => {return (- <AbsoluteFill>+ <><Video from={30} durationInFrames={90} src={staticFile('video.webm')} />- </AbsoluteFill>+ </>);};```@@ -140,15 +138,15 @@ The video will play the range from `00:02:00` to `00:04:00`, meaning the video wFor exact behavior, see [Timing and trimming](/docs/timing).```tsx twoslash-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Video} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Video src={staticFile('video.webm')} trimBefore={60} durationInFrames={60} />- </AbsoluteFill>+ </>);};```@@ -167,29 +165,29 @@ Allows you to control the volume of the audio in it's entirety or frame by frameRead the page on [using audio](/docs/using-audio) to learn more.```tsx twoslash title="Setting a static volume"-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Video} from '@remotion/media';export const MyVideo = () => {return (- <AbsoluteFill>+ <><Video volume={0.5} src={staticFile('video.webm')} />- </AbsoluteFill>+ </>);};``````tsx twoslash title="Changing the volume over time"-import {AbsoluteFill, interpolate, staticFile, useCurrentFrame} from 'remotion';+import {interpolate, staticFile, useCurrentFrame} from 'remotion';import {Video} from '@remotion/media';export const MyVideo = () => {const frame = useCurrentFrame();return (- <AbsoluteFill>+ <><Video volume={interpolate(frame, [0, 30], [0, 1], {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'})} src={'https://remotion.media/video.mp4'} />- </AbsoluteFill>+ </>);};```@@ -235,15 +233,15 @@ export const MyVideo = () => {Controls the speed of the video. `1` is the default and means regular speed, `0.5` slows down the video so it's twice as long and `2` speeds up the video so it's twice as fast.```tsx twoslash title="Example of a video playing twice as fast"-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Video} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Video playbackRate={2} src={'https://remotion.media/video.mp4'} />- </AbsoluteFill>+ </>);};```@@ -259,14 +257,14 @@ Changing `playbackRate` also changes the pitch of the video's audio. Pitch-preseYou can drop the audio of the video by adding a `muted` prop:```tsx twoslash title="Example of a muted video"-import {AbsoluteFill, OffthreadVideo} from 'remotion';+import {OffthreadVideo} from 'remotion';import {Video} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Video muted src="https://remotion.media/BigBuckBunny.mp4" />- </AbsoluteFill>+ </>);};```@@ -276,15 +274,15 @@ export const MyComposition = () => {You can pass any style you can pass to a native HTML `<canvas>` element.```tsx twoslash-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Video} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Video src={staticFile('video.webm')} style={{height: 720, width: 1280}} />- </AbsoluteFill>+ </>);};```@@ -302,15 +300,15 @@ Accepts `'contain'` (default), `'cover'`, `'fill'`, `'none'`, or `'scale-down'`.- `'scale-down'`: The video is sized as if `none` or `contain` were specified, whichever would result in a smaller size.```tsx twoslash-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';import {Video} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Video src={staticFile('video.webm')} style={{width: '100%', height: '100%'}} objectFit="cover" />- </AbsoluteFill>+ </>);};```@@ -351,15 +349,14 @@ Changing either limit recreates the preview player, so prefer a few fixed sizesMakes the video loop indefinitely.```tsx twoslash title="Example of a looped video"-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Video loop src="https://remotion.media/BigBuckBunny.mp4" />- </AbsoluteFill>+ </>);};```@@ -398,15 +395,14 @@ The callback is called with a [`CanvasImageSource`](https://developer.mozilla.orSelect the audio stream to use. The default is `0`.```tsx twoslash-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Video audioStreamIndex={1} src={'https://remotion.media/multiple-audio-streams.mov'} />- </AbsoluteFill>+ </>);};```@@ -423,15 +419,14 @@ Accepts `"omit"`, `"same-origin"` (default behavior of `fetch()`) or `"include"`Set to `"include"` if you need to send cookies or authentication headers to a cross-origin video URL.```tsx twoslash-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Video requestInit={{credentials: 'include'}} src="https://example.com/protected-video.mp4" />- </AbsoluteFill>+ </>);};```@@ -444,15 +439,14 @@ Set `cache` to `"no-store"` if a CDN or browser cache returns invalid range requThe value is captured when the component mounts; later updates to the prop are ignored, so passing an inline object is safe.```tsx twoslash-import {AbsoluteFill} from 'remotion';import {Video} from '@remotion/media';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Video requestInit={{cache: 'no-store'}} src="https://remotion.media/video.mp4" />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/motion-blur/common-mistake.mdx b/packages/docs/docs/motion-blur/common-mistake.mdxindex 959b10f83d..3207b59f7d 100644--- a/packages/docs/docs/motion-blur/common-mistake.mdx+++ b/packages/docs/docs/motion-blur/common-mistake.mdx@@ -15,7 +15,7 @@ export const MyComp = () => {const frame = useCurrentFrame();return (- <AbsoluteFill>+ <><CameraMotionBlur><AbsoluteFillstyle={{@@ -29,7 +29,7 @@ export const MyComp = () => {A</AbsoluteFill></CameraMotionBlur>- </AbsoluteFill>+ </>);};```@@ -60,11 +60,11 @@ const A: React.FC = () => {export const MyComp = () => {return (- <AbsoluteFill>+ <><CameraMotionBlur><A /></CameraMotionBlur>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/offthreadvideo.mdx b/packages/docs/docs/offthreadvideo.mdxindex 4083c651ed..2644aadbc9 100644--- a/packages/docs/docs/offthreadvideo.mdx+++ b/packages/docs/docs/offthreadvideo.mdx@@ -20,13 +20,13 @@ For new video usage, prefer [`<Video>`](/docs/media/video) from [`@remotion/medi## Example```tsx twoslash-import {AbsoluteFill, OffthreadVideo, staticFile} from 'remotion';+import {OffthreadVideo, staticFile} from 'remotion';export const MyVideo = () => {return (- <AbsoluteFill>+ <><OffthreadVideo src={staticFile('video.webm')} />- </AbsoluteFill>+ </>);};```@@ -34,13 +34,13 @@ export const MyVideo = () => {You can load a video from an URL as well:```tsx twoslash-import {AbsoluteFill, OffthreadVideo} from 'remotion';+import {OffthreadVideo} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><OffthreadVideo src="https://remotion.media/BigBuckBunny.mp4" />- </AbsoluteFill>+ </>);};```@@ -69,14 +69,14 @@ The video will play the range from `00:02:00` to `00:04:00`, meaning the video wFor exact behavior, see [Timing and trimming](/docs/timing).```tsx twoslash-import {AbsoluteFill, OffthreadVideo, staticFile} from 'remotion';+import {OffthreadVideo, staticFile} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><OffthreadVideo src={staticFile('video.webm')} trimBefore={60} durationInFrames={60} />- </AbsoluteFill>+ </>);};```@@ -112,27 +112,27 @@ If set to `false` (_default_), frames will be extracted as bitmap (BMP), which iAllows you to control the volume for the whole track or change it on a per-frame basis. Refer to the [using audio](/docs/audio/volume) guide to learn how to use it.```tsx twoslash title="Example using static volume"-import {AbsoluteFill, OffthreadVideo, staticFile} from 'remotion';+import {OffthreadVideo, staticFile} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><OffthreadVideo volume={0.5} src={staticFile('video.webm')} />- </AbsoluteFill>+ </>);};``````tsx twoslash title="Example of a ramp up over 100 frames"-import {AbsoluteFill, interpolate, staticFile, OffthreadVideo} from 'remotion';+import {interpolate, staticFile, OffthreadVideo} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><OffthreadVideo volume={(f) => interpolate(f, [0, 100], [0, 1], {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'})} src={staticFile('video.webm')} />- </AbsoluteFill>+ </>);};```@@ -150,14 +150,14 @@ Can be either `"repeat"` (default, start from 0 on each iteration) or `"extend"`You can pass any style you can pass to a native HTML element. Keep in mind that during rendering, `<OffthreadVideo>` renders an [`<Img>`](/docs/img) tag, but a `<video>` tag is used during preview.```tsx twoslash-import {AbsoluteFill, Img, staticFile} from 'remotion';+import {Img, staticFile} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><Img src={staticFile('video.webm')} style={{height: 720, width: 1280}} />- </AbsoluteFill>+ </>);};```@@ -185,14 +185,14 @@ Controls the speed of the video. `1` is the default and means regular speed, `0.While Remotion doesn't limit the range of possible playback speeds, in development mode the [`HTMLMediaElement.playbackRate`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/playbackRate) API is used which throws errors on extreme values. At the time of writing, Google Chrome throws an exception if the playback rate is below `0.0625` or above `16`.```tsx twoslash title="Example of a video playing twice as fast"-import {AbsoluteFill, OffthreadVideo, staticFile} from 'remotion';+import {OffthreadVideo, staticFile} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><OffthreadVideo playbackRate={2} src={staticFile('video.webm')} />- </AbsoluteFill>+ </>);};```@@ -214,13 +214,13 @@ Accepts `true`, `false`, or `undefined`. Default: `true`, matching the browser dYou can drop the audio of the video by adding a `muted` prop:```tsx twoslash title="Example of a muted video"-import {AbsoluteFill, OffthreadVideo} from 'remotion';+import {OffthreadVideo} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><OffthreadVideo muted src="https://remotion.media/BigBuckBunny.mp4" />- </AbsoluteFill>+ </>);};```@@ -255,14 +255,14 @@ Prior to Remotion 4.0.117, tone mapping was always disabled, and the `toneMappedSelect the audio stream to use. The default is `0`.```tsx twoslash-import {AbsoluteFill, OffthreadVideo} from 'remotion';+import {OffthreadVideo} from 'remotion';// ---cut---export const MyComposition = () => {return (- <AbsoluteFill>+ <><OffthreadVideo audioStreamIndex={1} src={'https://remotion.media/multiple-audio-streams.mov'} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/player/autoplay.mdx b/packages/docs/docs/player/autoplay.mdxindex be7a4d9c58..deb1941826 100644--- a/packages/docs/docs/player/autoplay.mdx+++ b/packages/docs/docs/player/autoplay.mdx@@ -65,16 +65,16 @@ Consider the following scenario:```tsx twoslashimport {Audio, Video} from '@remotion/media';-import {AbsoluteFill, staticFile} from 'remotion';+import {staticFile} from 'remotion';// ---cut---export const MyComp = () => {return (- <AbsoluteFill>+ <><Audio src={staticFile('audio.mp3')} /><Audio from={120} src={staticFile('audio2.mp3')} /><Video from={120} src={staticFile('video.mp4')} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/scaling.mdx b/packages/docs/docs/scaling.mdxindex 596d2df061..9e6de43813 100644--- a/packages/docs/docs/scaling.mdx+++ b/packages/docs/docs/scaling.mdx@@ -59,14 +59,14 @@ You can however opt into a higher backing resolution for the following componentTo support the `scale` option during a render, pass [`usePixelDensity()`](/docs/use-pixel-density), which resolves to the render `scale`:```tsx twoslash title="Supporting scale in the render"-import {AbsoluteFill, Solid, usePixelDensity} from 'remotion';+import {Solid, usePixelDensity} from 'remotion';export const MyComp: React.FC = () => {const pixelDensity = usePixelDensity();return (- <AbsoluteFill>+ <><Solid color="#3344ff" width={1920} height={1080} pixelDensity={pixelDensity} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/sequences.mdx b/packages/docs/docs/sequences.mdxindex edaa1c681e..7ad3f7b33a 100644--- a/packages/docs/docs/sequences.mdx+++ b/packages/docs/docs/sequences.mdx@@ -7,7 +7,7 @@ crumb: 'The power of React'---```twoslash include example-import {interpolate, useCurrentFrame, AbsoluteFill} from 'remotion'+import {interpolate, useCurrentFrame} from 'remotion'const Title: React.FC<{title: string}> = ({title}) => {const frame = useCurrentFrame()@@ -25,7 +25,7 @@ React components allow us to encapsulate video logic and reuse the same visualsConsider a title - to make it reusable, factor it out into its own component:```tsx twoslash title="MyComposition.tsx"-import {AbsoluteFill, interpolate, useCurrentFrame} from 'remotion';+import {interpolate, useCurrentFrame} from 'remotion';const Title: React.FC<{title: string}> = ({title}) => {const frame = useCurrentFrame();@@ -40,9 +40,9 @@ const Title: React.FC<{title: string}> = ({title}) => {export const MyVideo = () => {return (- <AbsoluteFill>+ <><Title title="Hello World" />- </AbsoluteFill>+ </>);};```@@ -58,14 +58,14 @@ import {Sequence} from 'remotion';export const MyVideo = () => {return (- <AbsoluteFill>+ <><Sequence durationInFrames={40}><Title title="Hello" /></Sequence><Sequence from={40}><Title title="World" /></Sequence>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/solid.mdx b/packages/docs/docs/solid.mdxindex a3b56fe061..784764185f 100644--- a/packages/docs/docs/solid.mdx+++ b/packages/docs/docs/solid.mdx@@ -10,13 +10,13 @@ crumb: 'API'Renders a solid-color rectangle on a [`<canvas>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/canvas) element.```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, Solid} from 'remotion';+import {Solid} from 'remotion';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Solid color="#3344ff" width={1920} height={1080} />- </AbsoluteFill>+ </>);};```@@ -50,14 +50,14 @@ Set a higher value to paint to a higher-resolution backing canvas while keepingThis is useful to counteract quality loss when the `<Solid>` is scaled up β for example via the [`scale`](/docs/scaling) render option, or on a high-DPI display in the preview. Pass [`usePixelDensity()`](/docs/use-pixel-density) to use the render `scale` while rendering and `window.devicePixelRatio` while previewing:```tsx twoslash title="MyComp.tsx"-import {AbsoluteFill, Solid, usePixelDensity} from 'remotion';+import {Solid, usePixelDensity} from 'remotion';export const MyComp: React.FC = () => {const pixelDensity = usePixelDensity();return (- <AbsoluteFill>+ <><Solid color="#3344ff" width={1920} height={1080} pixelDensity={pixelDensity} />- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/starburst-guide.mdx b/packages/docs/docs/starburst-guide.mdxindex ffec845e5e..c99a61473d 100644--- a/packages/docs/docs/starburst-guide.mdx+++ b/packages/docs/docs/starburst-guide.mdx@@ -15,20 +15,14 @@ Apply the effect to a [`<Solid>`](/docs/solid) and animate its parameters with [```tsx twoslash title="MyComp.tsx"import {starburst} from '@remotion/effects/starburst';-import {- AbsoluteFill,- interpolate,- Solid,- useCurrentFrame,- useVideoConfig,-} from 'remotion';+import {interpolate, Solid, useCurrentFrame, useVideoConfig} from 'remotion';export const MyComp: React.FC = () => {const frame = useCurrentFrame();const {width, height, durationInFrames} = useVideoConfig();return (- <AbsoluteFill>+ <><Solidwidth={width}height={height}@@ -40,7 +34,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/starburst/starburst-effect.mdx b/packages/docs/docs/starburst/starburst-effect.mdxindex d606bf1f3a..068f65c3d5 100644--- a/packages/docs/docs/starburst/starburst-effect.mdx+++ b/packages/docs/docs/starburst/starburst-effect.mdx@@ -28,11 +28,11 @@ Use it when you want to apply starburst rays through an `effects` array instead```tsx twoslash title="MyComp.tsx"import {starburst} from '@remotion/starburst';-import {AbsoluteFill, Solid} from 'remotion';+import {Solid} from 'remotion';export const MyComp: React.FC = () => {return (- <AbsoluteFill>+ <><Solidwidth={1280}height={720}@@ -47,7 +47,7 @@ export const MyComp: React.FC = () => {}),]}/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/troubleshooting/video-flicker.mdx b/packages/docs/docs/troubleshooting/video-flicker.mdxindex c42cc2c979..f6b67d2450 100644--- a/packages/docs/docs/troubleshooting/video-flicker.mdx+++ b/packages/docs/docs/troubleshooting/video-flicker.mdx@@ -10,11 +10,10 @@ Consider the following markup:```tsx twoslash title="MyComponent.tsx"import {Video} from '@remotion/media';-import {AbsoluteFill} from 'remotion';const MyComponent: React.FC = () => {return (- <AbsoluteFill>+ <><Videofrom={0}durationInFrames={120}@@ -25,7 +24,7 @@ const MyComponent: React.FC = () => {durationInFrames={120}src="https://example.com/video2.mp4"/>- </AbsoluteFill>+ </>);};```diff --git a/packages/docs/docs/video-uploads.mdx b/packages/docs/docs/video-uploads.mdxindex 7e8b27c7e7..1dfcce8f48 100644--- a/packages/docs/docs/video-uploads.mdx+++ b/packages/docs/docs/video-uploads.mdx@@ -17,7 +17,6 @@ const upload = async (file: File) => {};// ---cut---import {Video} from '@remotion/media';-import {AbsoluteFill} from 'remotion';type VideoProps = {videoURL: string;@@ -25,9 +24,9 @@ type VideoProps = {export const MyComponent: React.FC<VideoProps> = ({videoURL}) => {return (- <AbsoluteFill>+ <><Video src={videoURL} />- </AbsoluteFill>+ </>);};```