🎥 Make videos programmatically with React
run prettier over docs
Jonny Burger905b438064a2
diff --git a/packages/docs/docs/animating-properties.md b/packages/docs/docs/animating-properties.mdindex c242bfc7c3..77a3881a96 100644--- a/packages/docs/docs/animating-properties.md+++ b/packages/docs/docs/animating-properties.md@@ -9,26 +9,26 @@ Let's start with a simple example, let's say we want to create a fade in animatiIf we want to fade the text in over 20 frames, we need to gradually change the `opacity` style over time so that it goes from 0 to 1.```tsx twoslash {3, 11}-import {useCurrentFrame} from 'remotion'+import { useCurrentFrame } from "remotion";// ---cut---export const MyVideo = () => {- const frame = useCurrentFrame()+ const frame = useCurrentFrame();- const opacity = frame >= 20 ? 1 : (frame / 20)+ const opacity = frame >= 20 ? 1 : frame / 20;return (<divstyle={{flex: 1,- justifyContent: 'center',- alignItems: 'center',+ justifyContent: "center",+ alignItems: "center",opacity: opacity,}}>Hello World!</div>- )-}+ );+};```## Using the interpolate helper function@@ -42,28 +42,28 @@ The function takes 4 arguments:4. Optional settings```tsx twoslash {5-7, 15}-import {interpolate, useCurrentFrame} from 'remotion'+import { interpolate, useCurrentFrame } from "remotion";export const MyVideo = () => {- const frame = useCurrentFrame()+ const frame = useCurrentFrame();const opacity = interpolate(frame, [0, 20], [0, 1], {- extrapolateRight: 'clamp',- })+ extrapolateRight: "clamp",+ });return (<divstyle={{flex: 1,- justifyContent: 'center',- alignItems: 'center',+ justifyContent: "center",+ alignItems: "center",opacity: opacity,}}>Hello World!</div>- )-}+ );+};```In this example, we map the frames 0 to 20 to their opacity values `(0, 0.05, 0.1, 0.15 ...`) and use the `extrapolateRight` setting to clamp the output so that it never becomes bigger than 1.@@ -73,31 +73,31 @@ In this example, we map the frames 0 to 20 to their opacity values `(0, 0.05, 0.Spring animations are beautiful way to put things into motion and make them natural. Remotion includes a helper function to make spring animations easy! This time, let's animate the scale of the text.```tsx twoslash {6-11, 21}-import {spring, useCurrentFrame, useVideoConfig} from 'remotion'+import { spring, useCurrentFrame, useVideoConfig } from "remotion";export const MyVideo = () => {- const frame = useCurrentFrame()- const {fps} = useVideoConfig()+ const frame = useCurrentFrame();+ const { fps } = useVideoConfig();const scale = spring({fps,from: 0,to: 1,frame,- })+ });return (<divstyle={{flex: 1,- justifyContent: 'center',- alignItems: 'center',+ justifyContent: "center",+ alignItems: "center",}}>- <div style={{transform: `scale(${scale})`}}>Hello World!</div>+ <div style={{ transform: `scale(${scale})` }}>Hello World!</div></div>- )-}+ );+};```You should see the text 'jump in'. The default spring configuration leads to a little bit of overshoot, meaning the text will bounce a little bit. See the reference page about the `spring` function to learn how to customize your spring animations.diff --git a/packages/docs/docs/audio-visualization.md b/packages/docs/docs/audio-visualization.mdindex 58c0081cf4..ba649b6b91 100644--- a/packages/docs/docs/audio-visualization.md+++ b/packages/docs/docs/audio-visualization.md@@ -10,9 +10,9 @@ Using the audio visualization APIs in Remotion 2.0, you can create animations baYou can import an audio file using an `import` statement:```ts twoslash-import {Audio} from 'remotion'+import { Audio } from "remotion";// ---cut----import audio from './audio.mp3'+import audio from "./audio.mp3";````audio` will resolve to a string pointing to an audio file. You may also skip importing and use an `https://` URL to load audio from a remote location, if the audio is allowed to be loaded by the domains CORS policy.@@ -26,17 +26,17 @@ Using the [`visualizeAudio()`](/docs/visualize-audio) API, you can get an audioRefer to the documentation of the above mentioned functions to learn more.```tsx twoslash-import {Audio, useCurrentFrame, useVideoConfig} from 'remotion'-import {useAudioData, visualizeAudio} from '@remotion/media-utils'-import music from './music.mp3'+import { Audio, useCurrentFrame, useVideoConfig } from "remotion";+import { useAudioData, visualizeAudio } from "@remotion/media-utils";+import music from "./music.mp3";export const MyComponent: React.FC = () => {- const frame = useCurrentFrame()- const {width, height, fps} = useVideoConfig()- const audioData = useAudioData(music)+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const audioData = useAudioData(music);if (!audioData) {- return null+ return null;}const visualization = visualizeAudio({@@ -44,7 +44,7 @@ export const MyComponent: React.FC = () => {frame,audioData,numberOfSamples: 16,- }) // [0.22, 0.1, 0.01, 0.01, 0.01, 0.02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]+ }); // [0.22, 0.1, 0.01, 0.01, 0.01, 0.02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]// Render a bar chart for each frequency, the higher the amplitude,// the longer the bar@@ -53,12 +53,14 @@ export const MyComponent: React.FC = () => {<Audio src={music} />{visualization.map((v) => {return (- <div style={{width: 1000 * v, height: 15, backgroundColor: 'blue'}} />- )+ <div+ style={{ width: 1000 * v, height: 15, backgroundColor: "blue" }}+ />+ );})}</div>- )-}+ );+};```## See alsodiff --git a/packages/docs/docs/audio.md b/packages/docs/docs/audio.mdindex 47b1ee834e..da6542e4ee 100644--- a/packages/docs/docs/audio.md+++ b/packages/docs/docs/audio.md@@ -14,8 +14,8 @@ The component also accepts a `volume` props which allows you to control the volu`<Audio>` has two more helper props: `startFrom` and `endAt` for defining the start frame and end frame. Both are optional and do not get forwarded to the native `<audio>` element but tell Remotion which portion of the audio should be included.```tsx twoslash-import {Audio} from 'remotion'-import audio from './audio.mp3'+import { Audio } from "remotion";+import audio from "./audio.mp3";export const MyVideo = () => {return (@@ -27,8 +27,8 @@ export const MyVideo = () => {endAt={120} // if composition is 30fps, then it will end at 4s/></div>- )-}+ );+};```## Controlling volume@@ -50,23 +50,17 @@ _Available from v2.4.4_You can use the browser-native [`<source>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source) tags to provide different media to support a broader range of browsers. While rendering always happens in Chrome, this feature is useful if you are showing a preview in [`<Player />`](/docs/player).```tsx twoslash-import {Audio, interpolate} from 'remotion';+import { Audio, interpolate } from "remotion";// ---cut---const Comp: React.FC = () => {return (<Audio>- <source- src="https://example.com/kid-laugh.mp3"- type="audio/mpeg"- />- <source- src="https://example.com/cow-moo.ogg"- type="audio/ogg"- />+ <source src="https://example.com/kid-laugh.mp3" type="audio/mpeg" />+ <source src="https://example.com/cow-moo.ogg" type="audio/ogg" /></Audio>);-}+};```## See alsodiff --git a/packages/docs/docs/bundle.md b/packages/docs/docs/bundle.mdindex 6d185e6a5d..a991132941 100644--- a/packages/docs/docs/bundle.md+++ b/packages/docs/docs/bundle.md@@ -12,11 +12,11 @@ const bundle: (entryPoint: string,onProgressUpdate?: (progress: number) => void,options?: {- webpackOverride?: WebpackOverrideFn- outDir?: string- enableCaching?: boolean+ webpackOverride?: WebpackOverrideFn;+ outDir?: string;+ enableCaching?: boolean;}-) => Promise<string>+) => Promise<string>;```## Arguments@@ -31,8 +31,8 @@ A callback function that notifies about the progress of the Webpack bundling. Pa```ts twoslashconst onProgressUpdate = (progress: number) => {- console.log(`Webpack bundling progress: ${progress}%`)-}+ console.log(`Webpack bundling progress: ${progress}%`);+};```### `options`@@ -46,14 +46,14 @@ _optional_A function to override the webpack config reducer-style. Takes a function which gives you the current webpack config which you can transform and return a modified version of it. For example:```ts twoslash-import {WebpackOverrideFn} from 'remotion'+import { WebpackOverrideFn } from "remotion";// ---cut---const webpackOverride: WebpackOverrideFn = (webpackConfig) => {return {...webpackConfig,// Override properties- }-}+ };+};```#### `outDir?`diff --git a/packages/docs/docs/cli.md b/packages/docs/docs/cli.mdindex b0f5dbbbb7..cdb4394195 100644--- a/packages/docs/docs/cli.md+++ b/packages/docs/docs/cli.md@@ -174,7 +174,7 @@ npx remotion render --codec=vp8 src/index.tsx HelloWorld out/video.webm## Fig.io autocompletion-Fig adds visual apps, shortcuts, and autocomplete to your existing Terminal. The remotion autocompletion is available on Fig, try i with `npx remotion`, `remotion`, `yarn create video`. Useful if you have a memory lapse.+Fig adds visual apps, shortcuts, and autocomplete to your existing Terminal. The remotion autocompletion is available on Fig, try i with `npx remotion`, `remotion`, `yarn create video`. Useful if you have a memory lapse.## See alsodiff --git a/packages/docs/docs/composition.md b/packages/docs/docs/composition.mdindex 5ba99610e0..9366be3ce0 100644--- a/packages/docs/docs/composition.md+++ b/packages/docs/docs/composition.md@@ -42,12 +42,12 @@ Type your components using the `React.FC<{}>` type and the `defaultProps` prop w```tsx twoslash// @allowUmdGlobalAccess// @filename: ./MyComp.tsx-export const MyComp = () => <></>+export const MyComp = () => <></>;// @filename: index.tsx// ---cut----import {Composition} from 'remotion'-import {MyComp} from './MyComp'+import { Composition } from "remotion";+import { MyComp } from "./MyComp";export const MyVideo = () => {return (@@ -61,8 +61,8 @@ export const MyVideo = () => {durationInFrames={3 * 30}/></>- )-}+ );+};```## Example using `lazyComponent`@@ -73,15 +73,15 @@ export const MyVideo = () => {<><Compositionid="my-comp"- lazyComponent={() => import('./LazyComponent')}+ lazyComponent={() => import("./LazyComponent")}width={1080}height={1080}fps={30}durationInFrames={3 * 30}/></>- )-}+ );+};```## See alsodiff --git a/packages/docs/docs/config.mdx b/packages/docs/docs/config.mdxindex 4c903cf6ed..e021f098e9 100644--- a/packages/docs/docs/config.mdx+++ b/packages/docs/docs/config.mdx@@ -10,11 +10,11 @@ These options will apply to CLI commands such as `npm start` and `npm run build`You can control several behaviors of Remotion here.```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";-Config.Rendering.setConcurrency(8)-Config.Output.setPixelFormat('yuv444p')-Config.Output.setCodec('h265')+Config.Rendering.setConcurrency(8);+Config.Output.setPixelFormat("yuv444p");+Config.Output.setCodec("h265");```## Bundling@@ -26,15 +26,15 @@ _Available from Version 1.1._Allows you to insert your custom Webpack config. [See the page about custom Webpack configs](/docs/webpack) for more information.```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut---Config.Bundling.overrideWebpackConfig((currentConfiguration) => {// Return a new Webpack configurationreturn {...currentConfiguration,// new configuration- }-})+ };+});```### setCachingEnabled()@@ -44,9 +44,9 @@ _Available from Version 2.0._Enable or disable webpack caching. Default is `true` which will make the Webpack step in the first run a bit slower but will massively speed up subsequent runs. We recommend to keep this option enabled in all cases and encourage to report issues on GitHub if you encounter some.```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Bundling.setCachingEnabled(false)+Config.Bundling.setCachingEnabled(false);```The [command line flag](/docs/cli#--bundle-cache) `--bundle-cache` will take precedence over this option.@@ -58,9 +58,9 @@ By default, Remotion will try to find a free port.If you specify a port, but it's not available, Remotion will throw an error.```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Bundling.setPort(3003)+Config.Bundling.setPort(3003);```The [command line flag](/docs/cli#--port) `--port` will take precedence over this option.@@ -80,9 +80,9 @@ Acceptable values:- `verbose`: All of the above, plus browser logs and other debug info.```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Log.setLevel('verbose')+Config.Log.setLevel("verbose");```The [command line flag](/docs/cli#--log) `--log` will take precedence over this option.@@ -96,9 +96,9 @@ _Available from Version 2.1.10._Set how many tracks are being displayed in the timeline at most. This does not affect your video, just the amount of tracks shown when previewing. Default `15`.```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Preview.setMaxTimelineTracks(20)+Config.Preview.setMaxTimelineTracks(20);```## Puppeteer@@ -110,9 +110,9 @@ _Available from Version 1.5._Set a custom Chrome or Chromium executable path. By default Remotion will try to find an existing version of Chrome on your system and if not found, it will download one. This flag is useful if you don't have Chrome installed in a standard location and you want to prevent downloading an additional browser or need [support for the H264 codec](/docs/video#codec-support).```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Puppeteer.setBrowserExecutable('/usr/bin/google-chrome-stable')+Config.Puppeteer.setBrowserExecutable("/usr/bin/google-chrome-stable");```The [command line flag](/docs/cli#--browser-executable) `--browser-executable` will take precedence over this option.@@ -125,9 +125,9 @@ Sets how many Puppeteer instances will work on rendering your video in parallel.Default: `null`, meaning **half of the threads** available on your CPU.```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Rendering.setConcurrency(8)+Config.Rendering.setConcurrency(8);```The [command line flag](/docs/cli#--concurrency) `--concurrency` will take precedence over this option.@@ -147,9 +147,9 @@ Determines which in which image format to render the frames. Either:- `none` - don't render images, just calculate audio information (available from v2.0)```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Rendering.setImageFormat('png')+Config.Rendering.setImageFormat("png");```The [command line flag](/docs/cli#--image-format) `--image-format` will take precedence over this option.@@ -161,17 +161,17 @@ _Available from Version 2.0._Pass a number to render a still frame or a tuple to render a subset of a video. The frame sequence is zero-indexed.```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Rendering.setFrameRange(90) // To render only the 91st frame+Config.Rendering.setFrameRange(90); // To render only the 91st frame```or```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Rendering.setFrameRange([0, 20]) // Render a video only containing the first 21 frames+Config.Rendering.setFrameRange([0, 20]); // Render a video only containing the first 21 frames```The [command line flag](/docs/cli#--frames) `--frames` will take precedence over this option.@@ -181,9 +181,9 @@ The [command line flag](/docs/cli#--frames) `--frames` will take precedence overThe JPEG quality of each frame. Must be a number between 0 and 100. Will not work if you render PNG frames. [Default: 80](https://github.com/chromium/chromium/blob/99314be8152e688bafbbf9a615536bdbb289ea87/headless/lib/browser/protocol/headless_handler.cc#L32).```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Rendering.setQuality(90)+Config.Rendering.setQuality(90);```The [command line flag](/docs/cli#--quality) `--quality` will take precedence over this option.@@ -193,9 +193,9 @@ The [command line flag](/docs/cli#--quality) `--quality` will take precedence ovSet a custom location for a [`.env`](https://www.npmjs.com/package/dotenv) file. You can specify an absolute path or a relative path in which case it gets resolved based on the current working directory.```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Rendering.setDotEnvLocation('.my-env')+Config.Rendering.setDotEnvLocation(".my-env");```The [command line flag](/docs/cli#--env-file) `--env-file` will take precedence over this option.@@ -207,9 +207,9 @@ The [command line flag](/docs/cli#--env-file) `--env-file` will take precedenceSet this to `false` to prevent overwriting Remotion outputs when they already exists.```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Output.setOverwriteOutput(false)+Config.Output.setOverwriteOutput(false);```:::info@@ -222,9 +222,9 @@ Controls the pixel format in FFMPEG. [Read more about it here.](https://trac.ffmDefault value: `yuv420p````ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Output.setPixelFormat('yuv420p')+Config.Output.setPixelFormat("yuv420p");```The [command line flag](/docs/cli#--pixel-format) `--pixel-format` will take precedence over this option.@@ -246,9 +246,9 @@ Choose one of the supported codecs: `h264` _(default)_, `h265`, `vp8`, `vp9`.- `mkv` will export using H264 codec, MKV container format and WAV audio codec. _(available from v2.1.12)_```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Output.setCodec('h265')+Config.Output.setCodec("h265");```The [command line flag](/docs/cli#--codec) `--codec` will take precedence over this option.@@ -265,9 +265,9 @@ See [here](https://video.stackexchange.com/a/14715) for explanation of possibleDefault: `hq````ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Output.setProResProfile('4444')+Config.Output.setProResProfile("4444");```The [command line flag](/docs/cli#--prores-profile) `--prores-profile` will take precedence over this option.@@ -281,9 +281,9 @@ _Available from Version 1.4._Set to true if you want to output an image sequence instead of a video.```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Output.setImageSequence(true)+Config.Output.setImageSequence(true);```The [command line flag](/docs/cli#--sequence) `--sequence` will take precedence over this option.@@ -295,9 +295,9 @@ _Deprecated_. Use `setCodec()` and `setImageSequence()` instead.Either `'mp4'` or `'png-sequence'`.```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Output.setOutputFormat('mp4')+Config.Output.setOutputFormat("mp4");```The [command line flags](/docs/cli) `--sequence` and `--codec` will take precedence over this option.@@ -324,9 +324,9 @@ The range is exponential, so increasing the CRF value +6 results in roughly halfChoose the highest CRF value that still provides an acceptable quality. If the output looks good, then try a higher value. If it looks bad, choose a lower value.```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----Config.Output.setCrf(16)+Config.Output.setCrf(16);```The [command line flag](/docs/cli#--crf) `--crf` will take precedence over this option.diff --git a/packages/docs/docs/data-fetching.md b/packages/docs/docs/data-fetching.mdindex d4ff301a7c..26899e2ce4 100644--- a/packages/docs/docs/data-fetching.md+++ b/packages/docs/docs/data-fetching.md@@ -10,24 +10,24 @@ One of the most groundbreaking things about Remotion is that you can fetch dataThere are two functions, [`delayRender`](/docs/delay-render) and [`continueRender`](/docs/continue-render), which you can use to tell Remotion to not yet render the frame. If you want to asynchronously render a frame, you should call `delayRender()` as soon as possible, before the window `onload` event is fired. The function returns a handle that you need to give Remotion the green light to render later using `continueRender()`.```tsx twoslash-import {useEffect, useState} from 'react'-import {continueRender, delayRender} from 'remotion'+import { useEffect, useState } from "react";+import { continueRender, delayRender } from "remotion";export const MyVideo = () => {- const [data, setData] = useState(null)- const [handle] = useState(() => delayRender())+ const [data, setData] = useState(null);+ const [handle] = useState(() => delayRender());const fetchData = async () => {- const response = await fetch('http://example.com/api')- const json = await response.json()- setData(json)+ const response = await fetch("http://example.com/api");+ const json = await response.json();+ setData(json);- continueRender(handle)- }+ continueRender(handle);+ };useEffect(() => {- fetchData()- }, [])+ fetchData();+ }, []);return (<div>@@ -35,8 +35,8 @@ export const MyVideo = () => {<div>This video has data from an API! {JSON.stringify(data)}</div>) : null}</div>- )-}+ );+};```## Cachingdiff --git a/packages/docs/docs/delay-render.md b/packages/docs/docs/delay-render.mdindex a3678bd208..296dc4badb 100644--- a/packages/docs/docs/delay-render.md+++ b/packages/docs/docs/delay-render.md@@ -23,32 +23,32 @@ This method is useful if you for example want to call an API to fetch data befor## Example```tsx twoslash-import {useEffect, useState} from 'react'-import {continueRender, delayRender} from 'remotion'+import { useEffect, useState } from "react";+import { continueRender, delayRender } from "remotion";export const MyVideo = () => {- const [data, setData] = useState(null)- const [handle] = useState(() => delayRender())+ const [data, setData] = useState(null);+ const [handle] = useState(() => delayRender());const fetchData = async () => {- const response = await fetch('http://example.com/api')- const json = await response.json()- setData(json)+ const response = await fetch("http://example.com/api");+ const json = await response.json();+ setData(json);- continueRender(handle)- }+ continueRender(handle);+ };useEffect(() => {- fetchData()- }, [])+ fetchData();+ }, []);return (<div>{data ? (<div>This video has data from an API! {JSON.stringify(data)}</div>) : null}</div>- )-}+ );+};```## See alsodiff --git a/packages/docs/docs/dynamic-import.md b/packages/docs/docs/dynamic-import.mdindex 2a6c902232..8987015561 100644--- a/packages/docs/docs/dynamic-import.md+++ b/packages/docs/docs/dynamic-import.md@@ -26,13 +26,13 @@ my-video/Note that the following pattern doesn't work:```tsx twoslash-import {Img, useCurrentFrame} from 'remotion'+import { Img, useCurrentFrame } from "remotion";export const DynamicImports: React.FC = () => {- const frame = useCurrentFrame()- const img = './assets/image' + frame + '.png'- return <Img src={require(img)} />-}+ const frame = useCurrentFrame();+ const img = "./assets/image" + frame + ".png";+ return <Img src={require(img)} />;+};``````bash@@ -42,12 +42,12 @@ Error: Cannot find module './image0.png'However the following example **does** work:```tsx twoslash-import {Img, useCurrentFrame} from 'remotion'+import { Img, useCurrentFrame } from "remotion";export const DynamicImports: React.FC = () => {- const frame = useCurrentFrame()- return <Img src={require('./assets/image' + frame + '.png')} />-}+ const frame = useCurrentFrame();+ return <Img src={require("./assets/image" + frame + ".png")} />;+};```Webpack needs to figure out which assets it should bundle and cannot do it in the first example. However, it is smart enough to do so if you place your expression inside the `require()` or `import()` statement. In this case, Webpack will automatically bundle all `.png` files in the `assets/image` folder even if the asset is never used. Therefore you have to be careful to not bundle too many assets.@@ -59,25 +59,25 @@ Please read [the Webpack documentation page](https://webpack.js.org/api/module-mLet's imagine a scenario where the asset that should be imported is completely unknown and will be read at runtime, for example through an [input prop](/docs/get-input-props):```tsx twoslash-import {getInputProps, Img} from 'remotion'+import { getInputProps, Img } from "remotion";const DynamicAsset: React.FC = () => {- const inputProps = getInputProps() // {"imageSrc": "./assets/img0.png"}- return <Img src={require(inputProps.imageSrc)} />-}+ const inputProps = getInputProps(); // {"imageSrc": "./assets/img0.png"}+ return <Img src={require(inputProps.imageSrc)} />;+};```This cannot work because Webpack has no ideas which assets it has to bundle. Therefore the import has to fail.Like above, you can force Webpack to bundle the whole assets folder by putting an expression inside the `require()` statement:```tsx twoslash-import {getInputProps, Img} from 'remotion'+import { getInputProps, Img } from "remotion";const DynamicAsset: React.FC = () => {- const inputProps = getInputProps() // {"imageSrc": "img0.png"}+ const inputProps = getInputProps(); // {"imageSrc": "img0.png"}// Works!- return <Img src={require('./assets/' + inputProps.imageSrc)} />-}+ return <Img src={require("./assets/" + inputProps.imageSrc)} />;+};```## Adding assets after bundling@@ -91,20 +91,20 @@ You can use the following workaround that relies on the fact that Remotion creat3. Rely on the fact that the asset is available via the static HTTP server. Since you only want this during rendering, use the `process.env.NODE_ENV === 'production'` statement to differentiate between development and rendering.```tsx twoslash-import {getInputProps, Img} from 'remotion'+import { getInputProps, Img } from "remotion";export const DynamicAsset: React.FC = () => {- const inputProps = getInputProps() // {"imageSrc": "assets/img0.png"}+ const inputProps = getInputProps(); // {"imageSrc": "assets/img0.png"}return (<Imgsrc={- process.env.NODE_ENV === 'production'+ process.env.NODE_ENV === "production"? `/${inputProps.imageSrc}`- : require('./assets/default-asset.png')+ : require("./assets/default-asset.png")}/>- )-}+ );+};```## Set up an HTTP server@@ -117,12 +117,12 @@ npx serve --cors ./src``````tsx twoslash-import {getInputProps, Img} from 'remotion'+import { getInputProps, Img } from "remotion";const HttpAsset: React.FC = () => {- const inputProps = getInputProps() // {"imageSrc": "assets/img0.png"}- return <Img src={`http://localhost:5000/${inputProps.imageSrc}`} />-}+ const inputProps = getInputProps(); // {"imageSrc": "assets/img0.png"}+ return <Img src={`http://localhost:5000/${inputProps.imageSrc}`} />;+};```## Struggling?diff --git a/packages/docs/docs/easing.md b/packages/docs/docs/easing.mdindex 909730fb25..cd77f95717 100644--- a/packages/docs/docs/easing.md+++ b/packages/docs/docs/easing.md@@ -48,26 +48,26 @@ The following helpers are used to modify other easing functions.## Example```tsx twoslash-import {useCurrentFrame, AbsoluteFill} from 'remotion'+import { useCurrentFrame, AbsoluteFill } from "remotion";// ---cut----import {interpolate, Easing} from 'remotion';+import { interpolate, Easing } from "remotion";const MyVideo: React.FC = () => {- const frame = useCurrentFrame()+ const frame = useCurrentFrame();const interpolated = interpolate(frame, [0, 100], [0, 1], {easing: Easing.bezier(0.8, 0.22, 0.96, 0.65),- extrapolateLeft: 'clamp',- extrapolateRight: 'clamp',- })+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ });return (<AbsoluteFillstyle={{transform: `scale(${interpolated})`,- backgroundColor: 'red',+ backgroundColor: "red",}}/>- )-}+ );+};```---diff --git a/packages/docs/docs/freeze.mdx b/packages/docs/docs/freeze.mdxindex 8f58237bb3..b99a49f6e5 100644--- a/packages/docs/docs/freeze.mdx+++ b/packages/docs/docs/freeze.mdx@@ -30,7 +30,7 @@ The Freeze component is a high order component and accepts, besides it's childre```tsx twoslash// @include: example-BlueSquare// ---cut----import {Freeze} from 'remotion';+import { Freeze } from "remotion";const MyVideo = () => {return (@@ -38,7 +38,7 @@ const MyVideo = () => {<BlueSquare /></Freeze>);-}+};```## Demodiff --git a/packages/docs/docs/get-audio-data.md b/packages/docs/docs/get-audio-data.mdindex 8867165926..965924a2e7 100644--- a/packages/docs/docs/get-audio-data.md+++ b/packages/docs/docs/get-audio-data.md@@ -29,12 +29,12 @@ A string pointing to an audio asset.```ts twoslash// @module: ESNext// @target: ESNext-import {Audio} from "remotion"+import { Audio } from "remotion";// ---cut----import {getAudioData} from '@remotion/media-utils'-import music from './music.mp3'+import { getAudioData } from "@remotion/media-utils";+import music from "./music.mp3";-await getAudioData(music) /* {+await getAudioData(music); /* {channelWaveforms: [Float32Array(4410000), Float32Array(4410000)],sampleRate: 44100,durationInSeconds: 100.0000,@@ -42,7 +42,7 @@ await getAudioData(music) /* {resultId: "0.432878981",isRemote: false} */-await getAudioData('https://example.com/remote-audio.aac') /* {+await getAudioData("https://example.com/remote-audio.aac"); /* {channelWaveforms: [Float32Array(4800000)],sampleRate: 48000,durationInSeconds: 100.0000,diff --git a/packages/docs/docs/get-audio-duration.md b/packages/docs/docs/get-audio-duration.mdindex 8e0b35e7ff..8c3c89aeae 100644--- a/packages/docs/docs/get-audio-duration.md+++ b/packages/docs/docs/get-audio-duration.md@@ -22,11 +22,11 @@ A string pointing to an audio asset```tsx twoslash// @module: ESNext// @target: ESNext-import {Audio} from 'remotion'+import { Audio } from "remotion";// ---cut----import {getAudioDuration} from '@remotion/media-utils'-import music from './music.mp3'+import { getAudioDuration } from "@remotion/media-utils";+import music from "./music.mp3";-await getAudioDuration(music) // 127.452-await getAudioDuration('https://example.com/remote-audio.aac') // 50.24+await getAudioDuration(music); // 127.452+await getAudioDuration("https://example.com/remote-audio.aac"); // 50.24```diff --git a/packages/docs/docs/get-compositions.md b/packages/docs/docs/get-compositions.mdindex 81725a5ff0..cce2ad5888 100644--- a/packages/docs/docs/get-compositions.md+++ b/packages/docs/docs/get-compositions.md@@ -11,10 +11,10 @@ Gets the compositions defined in a Remotion project based on a webpack bundle. Sconst getCompositions: (bundle: string,options: {- inputProps?: object | null- browserInstance?: puppeteer.Browser+ inputProps?: object | null;+ browserInstance?: puppeteer.Browser;}-) => Promise<TComposition[]>+) => Promise<TComposition[]>;```## Arguments@@ -54,18 +54,18 @@ Returns a promise that resolves to an array of available compositions. Example v```ts twoslash[{- id: 'HelloWorld',+ id: "HelloWorld",width: 1920,height: 1080,fps: 30,},{- id: 'Title',+ id: "Title",width: 1080,height: 1080,fps: 30,},-]+];```## See alsodiff --git a/packages/docs/docs/get-input-props.md b/packages/docs/docs/get-input-props.mdindex 8208a6dc99..a68404476b 100644--- a/packages/docs/docs/get-input-props.md+++ b/packages/docs/docs/get-input-props.md@@ -24,9 +24,9 @@ npx remotion render --props='{"hello": "world"}' src/index.tsx my-composition ouYou can then access the props in JavaScript:```tsx twoslash-const getInputProps = () => ({hello: 'world'} as const)+const getInputProps = () => ({ hello: "world" } as const);// ---cut----const {hello} = getInputProps() // "world"+const { hello } = getInputProps(); // "world"```In this example, the props also get passed to the component of the composition with the id `my-composition`.diff --git a/packages/docs/docs/get-video-metadata.md b/packages/docs/docs/get-video-metadata.mdindex fdeb554c94..d2a7218005 100644--- a/packages/docs/docs/get-video-metadata.md+++ b/packages/docs/docs/get-video-metadata.md@@ -28,19 +28,19 @@ A string pointing to an asset.```tsx twoslash// @module: ESNext// @target: ESNext-import {Audio} from 'remotion'+import { Audio } from "remotion";// ---cut----import {getVideoMetadata} from '@remotion/media-utils'-import video from '../video.mp4'+import { getVideoMetadata } from "@remotion/media-utils";+import video from "../video.mp4";-await getVideoMetadata(video) /* {+await getVideoMetadata(video); /* {durationInSeconds: 100.00,width: 1280,height: 720,aspectRatio: 1.77777778,isRemote: false} */-await getVideoMetadata('https://example.com/remote-audio.webm') /* {+await getVideoMetadata("https://example.com/remote-audio.webm"); /* {durationInSeconds: 40.213,width: 1920,height: 1080,diff --git a/packages/docs/docs/get-waveform-portion.md b/packages/docs/docs/get-waveform-portion.mdindex c1404f2f48..beb23fa50f 100644--- a/packages/docs/docs/get-waveform-portion.md+++ b/packages/docs/docs/get-waveform-portion.md@@ -30,12 +30,12 @@ An object with the following arguments:```tsx twoslash// @module: ESNext// @target: ESNext-import {Audio} from 'remotion'+import { Audio } from "remotion";// ---cut----import {getAudioData, getWaveformPortion} from '@remotion/media-utils'-import music from './music.mp3'+import { getAudioData, getWaveformPortion } from "@remotion/media-utils";+import music from "./music.mp3";-const audioData = await getAudioData(music) /* {+const audioData = await getAudioData(music); /* {channelWaveforms: [Float32Array(4410000), Float32Array(4410000)],sampleRate: 44100,durationInSeconds: 100.0000,@@ -49,10 +49,10 @@ const waveformPortion = await getWaveformPortion({// Will select time range of 20-40 secondsstartTimeInSeconds: 20,durationInSeconds: 20,- numberOfSamples: 10-}) // [{index: 0, amplitude: 1.2203}, ... {index: 9, amplitude: 3.2211}]+ numberOfSamples: 10,+}); // [{index: 0, amplitude: 1.2203}, ... {index: 9, amplitude: 3.2211}]-console.log(waveformPortion.length) // 10+console.log(waveformPortion.length); // 10```## Alternativesdiff --git a/packages/docs/docs/getting-started.md b/packages/docs/docs/getting-started.mdindex dc5af8c4be..0b22e7d0d2 100644--- a/packages/docs/docs/getting-started.md+++ b/packages/docs/docs/getting-started.md@@ -57,7 +57,8 @@ Linux users need to install some additional packages to get Chrome/Puppeteer worapt install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget libgbm-dev```-**Arch linux**+**Arch linux**+```bashsudo pacman -S dconf alsa-lib atk glibc cairo libcups dbus expat fontconfig gcc gdk-pixbuf2 glib2 gtk3 nspr pango gcc-libs libx11 libxcomposite libxcursor libxdamage libxext libxfixes libxi libxrandr libxrender libxss libxtst ca-certificates ttf-liberation libappindicator-gtk3 nss lsb-release xdg-utils wget mesa```diff --git a/packages/docs/docs/gif.md b/packages/docs/docs/gif.mdindex 517208b406..54fa5ce44b 100644--- a/packages/docs/docs/gif.md+++ b/packages/docs/docs/gif.md@@ -51,12 +51,12 @@ Allows to pass in custom CSS styles.## Example```tsx twoslash-import {useVideoConfig} from 'remotion'+import { useVideoConfig } from "remotion";// ---cut----import {Gif} from '@remotion/gif'+import { Gif } from "@remotion/gif";export const MyComponent: React.FC = () => {- const {width, height} = useVideoConfig()+ const { width, height } = useVideoConfig();return (<Gif@@ -65,6 +65,6 @@ export const MyComponent: React.FC = () => {height={height}fit="fill"/>- )-}+ );+};```diff --git a/packages/docs/docs/iframe.md b/packages/docs/docs/iframe.mdindex ee876315ce..b425f7ae75 100644--- a/packages/docs/docs/iframe.md+++ b/packages/docs/docs/iframe.md@@ -9,11 +9,11 @@ The difference is that if you use the component from Remotion, that Remotion wil## Example```tsx twoslash-import {IFrame} from 'remotion'+import { IFrame } from "remotion";export const MyComp: React.FC = () => {- return <IFrame src="https://remotion.dev" />-}+ return <IFrame src="https://remotion.dev" />;+};```## See alsodiff --git a/packages/docs/docs/img.md b/packages/docs/docs/img.mdindex 774ced850c..a4a5933412 100644--- a/packages/docs/docs/img.md+++ b/packages/docs/docs/img.md@@ -9,12 +9,12 @@ The difference is that if you use the component from Remotion, that Remotion wil## Example```tsx twoslash-import {Img} from 'remotion'-import hi from './hi.png'+import { Img } from "remotion";+import hi from "./hi.png";export const MyComp: React.FC = () => {- return <Img src={hi} />-}+ return <Img src={hi} />;+};```## See alsodiff --git a/packages/docs/docs/importing-assets.md b/packages/docs/docs/importing-assets.mdindex 9db4aee37f..ae34e78fed 100644--- a/packages/docs/docs/importing-assets.md+++ b/packages/docs/docs/importing-assets.md@@ -15,12 +15,12 @@ Remotion allows you to include several types of files in your project:Require images using an `import` statement and pass them to the [`<Img/>`](/docs/img) tag.```tsx twoslash-import {Img} from 'remotion'-import logo from './logo.png'+import { Img } from "remotion";+import logo from "./logo.png";export const MyComp: React.FC = () => {- return <Img src={logo} />-}+ return <Img src={logo} />;+};```## Using image sequences@@ -28,7 +28,7 @@ export const MyComp: React.FC = () => {If you have a series of images, for example exported from another program like After Effects or Rotato, you can use a dynamic `require` statement to import the images as they are needed.```tsx twoslash-import {useCurrentFrame} from 'remotion'+import { useCurrentFrame } from "remotion";/*Assuming your file structure is:@@ -40,11 +40,11 @@ import {useCurrentFrame} from 'remotion'*/const MyComp: React.FC = () => {- const frame = useCurrentFrame()- const src = require('./assets/frame' + frame + '.png')+ const frame = useCurrentFrame();+ const src = require("./assets/frame" + frame + ".png");- return <img src={src} />-}+ return <img src={src} />;+};```:::tip@@ -56,12 +56,12 @@ Avoid writing a require statement that requires a file that doesn't exist. If yoImport your files using an import statement. Use the [`<Video />`/docs/video) component to keep the timeline and your video in sync.```tsx twoslash-import {Video} from 'remotion'-import vid from './vid.webm'+import { Video } from "remotion";+import vid from "./vid.webm";export const MyComp: React.FC = () => {- return <Video src={vid} />-}+ return <Video src={vid} />;+};```Be aware that if you are rendering using Chromium (as opposed to Chrome), the codec for MP4 videos is not included. Read the section on the [`<Video/ >`](/docs/video#codec-support) page for more information.@@ -71,12 +71,12 @@ Be aware that if you are rendering using Chromium (as opposed to Chrome), the coImport your audio using an `import` statement and pass it to the [`<Audio/ >`](/docs/audio) component.```tsx twoslash-import {Audio} from 'remotion'-import tune from './tune.mp3'+import { Audio } from "remotion";+import tune from "./tune.mp3";export const MyComp: React.FC = () => {- return <Audio src={tune} />-}+ return <Audio src={tune} />;+};```See the [audio guide](/docs/using-audio) for guidance on including audio.diff --git a/packages/docs/docs/interpolate-colors.md b/packages/docs/docs/interpolate-colors.mdindex b786807338..6246253a6e 100644--- a/packages/docs/docs/interpolate-colors.md+++ b/packages/docs/docs/interpolate-colors.md@@ -26,19 +26,13 @@ In this example, we are interpolating colors from red to yellow. At frame 0 (theUsing the following snippet, we can calculate the current color for any frame:```tsx twoslash-import {interpolateColors, useCurrentFrame} from 'remotion'+import { interpolateColors, useCurrentFrame } from "remotion";-const frame = useCurrentFrame() / 10+const frame = useCurrentFrame() / 10;-const color = interpolateColors(frame,- [0, 20],- ['red', 'yellow'],-) // rgba(255, 128, 0, 1)+const color = interpolateColors(frame, [0, 20], ["red", "yellow"]); // rgba(255, 128, 0, 1)-const color2 = interpolateColors(frame,- [0, 20],- ['#ff0000', '#ffff00'],-) // rgba(255, 128, 0, 1)+const color2 = interpolateColors(frame, [0, 20], ["#ff0000", "#ffff00"]); // rgba(255, 128, 0, 1)```## Example: interpolate `rgb` or `rgba` colors@@ -48,21 +42,23 @@ In this example, we are interpolating colors from red to yellow. At frame 0 (theUsing the following snippet, we can calculate the current color for any frame:```tsx twoslash-import {useCurrentFrame, interpolateColors} from 'remotion'+import { useCurrentFrame, interpolateColors } from "remotion";-const frame = useCurrentFrame() // 10+const frame = useCurrentFrame(); // 10// RGB colors-const color = interpolateColors(frame,+const color = interpolateColors(+ frame,[0, 20],- ['rgb(255, 0, 0)', 'rgb(255, 255, 0)'],-) // rgba(255, 128, 0, 1)+ ["rgb(255, 0, 0)", "rgb(255, 255, 0)"]+); // rgba(255, 128, 0, 1)// RGBA colors-const color2 = interpolateColors(frame,+const color2 = interpolateColors(+ frame,[0, 20],- ['rgba(255, 0, 0, 1)', 'rgba(255, 255, 0, 0)'],-) // rgba(255, 128, 0, 0.5)+ ["rgba(255, 0, 0, 1)", "rgba(255, 255, 0, 0)"]+); // rgba(255, 128, 0, 0.5)```## Example: interpolate `hsl` or `hsla` colors@@ -72,20 +68,22 @@ In this example, we are interpolating colors from red to yellow. At frame 0 (theUsing the following snippet, we can calculate the current color for any frame:```ts twoslash-import {useCurrentFrame, interpolateColors} from 'remotion'+import { useCurrentFrame, interpolateColors } from "remotion";-const frame = useCurrentFrame() // 10+const frame = useCurrentFrame(); // 10//hsl example-const color = interpolateColors(frame,+const color = interpolateColors(+ frame,[0, 20],- ['hsl(0, 100%, 50%)', 'hsl(60, 100%, 50%)'],-) // rgba(255, 128, 0, 1)+ ["hsl(0, 100%, 50%)", "hsl(60, 100%, 50%)"]+); // rgba(255, 128, 0, 1)//hsla example-const color2 = interpolateColors(frame,+const color2 = interpolateColors(+ frame,[0, 20],- ['hsla(0, 100%, 50%, 1)', 'hsla(60, 100%, 50%, 1)'],-) // rgba(255, 128, 0, 1)+ ["hsla(0, 100%, 50%, 1)", "hsla(60, 100%, 50%, 1)"]+); // rgba(255, 128, 0, 1)```## Example: interpolate color names@@ -93,14 +91,11 @@ const color2 = interpolateColors(frame,Interpolating CSS color names is also supported.```ts twoslash-import {useCurrentFrame, interpolateColors} from 'remotion'+import { useCurrentFrame, interpolateColors } from "remotion";-const frame = useCurrentFrame() // 10+const frame = useCurrentFrame(); // 10-const color = interpolateColors(frame,- [0, 20],- ['red', 'yellow'],-) // rgba(255, 128, 0, 1)+const color = interpolateColors(frame, [0, 20], ["red", "yellow"]); // rgba(255, 128, 0, 1)```## See alsodiff --git a/packages/docs/docs/interpolate.mdx b/packages/docs/docs/interpolate.mdxindex b92dcfac27..24dc087ed4 100644--- a/packages/docs/docs/interpolate.mdx+++ b/packages/docs/docs/interpolate.mdx@@ -23,13 +23,10 @@ At frame 20, we want the opacity to be 1.Using the following snippet, we can calculate the current opacity for any frame:```ts twoslash-import {interpolate, useCurrentFrame} from 'remotion'+import { interpolate, useCurrentFrame } from "remotion";-const frame = useCurrentFrame() // 10-const opacity = interpolate(frame,- [0, 20],- [0, 1],-) // 0.5+const frame = useCurrentFrame(); // 10+const opacity = interpolate(frame, [0, 20], [0, 1]); // 0.5```## Example: Fade in and out@@ -41,16 +38,16 @@ At the end, the opacity should be 0.We can interpolate over multiple points in one go and use [`useVideoConfig()`](/docs/use-video-config) to determine the duration of the composition.```ts twoslash-import {interpolate, useCurrentFrame, useVideoConfig} from 'remotion'+import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";-const frame = useCurrentFrame()-const {durationInFrames} = useVideoConfig()+const frame = useCurrentFrame();+const { durationInFrames } = useVideoConfig();const opacity = interpolate(frame,[0, 20, durationInFrames - 20, durationInFrames],-// v--v---v----------------------v- [0, 1, 1, 0],-)+ // v--v---v----------------------v+ [0, 1, 1, 0]+);```## Example: interpolate a spring animation@@ -82,18 +79,16 @@ Given that knowledge, we can interpolate the spring value to go from 0 to 200.```ts twoslash// @include: example-spring// ---cut----const marginLeft = interpolate(driver, [0, 1], [0, 200])+const marginLeft = interpolate(driver, [0, 1], [0, 200]);```We can then apply it to an HTML element.```tsx twoslash {1}// @include: example-spring-const marginLeft = interpolate(driver, [0, 1], [0, 200])+const marginLeft = interpolate(driver, [0, 1], [0, 200]);// ---cut----const Component: React.FC = () => (- <div style={{marginLeft}}></div>-)+const Component: React.FC = () => <div style={{ marginLeft }}></div>;```## Example: Prevent the output from going outside the output range@@ -101,20 +96,22 @@ const Component: React.FC = () => (Consider the following interpolation which is supposed to animate the scale over 20 frames:```tsx twoslash-import {interpolate, useCurrentFrame} from 'remotion'-const frame = useCurrentFrame()+import { interpolate, useCurrentFrame } from "remotion";+const frame = useCurrentFrame();// ---cut----const scale = interpolate(frame, [0, 20], [0, 1])+const scale = interpolate(frame, [0, 20], [0, 1]);```This works, but after 20 frames, the value keeps growing. For example, at frame 40, the scale will be `2`.To prevent this, this we can use the `extrapolateLeft` and `extrapolateRight` options and set them to `'clamp'` to prevent the result going outside the output range.```tsx twoslash-import {interpolate, useCurrentFrame} from 'remotion'-const frame = useCurrentFrame()+import { interpolate, useCurrentFrame } from "remotion";+const frame = useCurrentFrame();// ---cut----const scale = interpolate(frame, [0, 20], [0, 1], {extrapolateRight: 'clamp'})+const scale = interpolate(frame, [0, 20], [0, 1], {+ extrapolateRight: "clamp",+});```## Reference@@ -147,11 +144,11 @@ Same as [extrapolateLeft](#extrapolateleft), except for values outside right theExample:```tsx twoslash-import {interpolate} from 'remotion'+import { interpolate } from "remotion";// ---cut----interpolate(1.5, [0, 1], [0, 2], {extrapolateRight: 'extend'}) // 3-interpolate(1.5, [0, 1], [0, 2], {extrapolateRight: 'clamp'}) // 2-interpolate(1.5, [0, 1], [0, 2], {extrapolateRight: 'identity'}) // 1.5+interpolate(1.5, [0, 1], [0, 2], { extrapolateRight: "extend" }); // 3+interpolate(1.5, [0, 1], [0, 2], { extrapolateRight: "clamp" }); // 2+interpolate(1.5, [0, 1], [0, 2], { extrapolateRight: "identity" }); // 1.5```#### easing@@ -162,23 +159,23 @@ Function which allows you to customize the input, for example to apply a certainBy default, the input is left unmodified, resulting in a pure linear interpolation. [Read the documentation for the built-in easing functions](/docs/easing).```ts twoslash-import {useCurrentFrame} from 'remotion'-const frame = useCurrentFrame()+import { useCurrentFrame } from "remotion";+const frame = useCurrentFrame();// ---cut----import {interpolate, Easing} from 'remotion'+import { interpolate, Easing } from "remotion";interpolate(frame, [0, 100], [0, 1], {easing: Easing.bezier(0.8, 0.22, 0.96, 0.65),- extrapolateLeft: 'clamp',- extrapolateRight: 'clamp',-})+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+});//this is Remotion2.0 featureinterpolate(frame, [0, 10, 40, 100], [0, 0.2, 0.6, 1], {easing: Easing.bezier(0.8, 0.22, 0.96, 0.65),- extrapolateLeft: 'clamp',- extrapolateRight: 'clamp',-})+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+});```## See alsodiff --git a/packages/docs/docs/legacy-babel-loader.md b/packages/docs/docs/legacy-babel-loader.mdindex d209da4456..00931b3dd5 100644--- a/packages/docs/docs/legacy-babel-loader.md+++ b/packages/docs/docs/legacy-babel-loader.md@@ -18,13 +18,13 @@ npm i @remotion/babel-loader``````ts twoslash title="remotion.config.ts"-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut----import {replaceLoadersWithBabel} from '@remotion/babel-loader'+import { replaceLoadersWithBabel } from "@remotion/babel-loader";Config.Bundling.overrideWebpackConfig((currentConfiguration) => {- return replaceLoadersWithBabel(currentConfiguration)-})+ return replaceLoadersWithBabel(currentConfiguration);+});```## See alsodiff --git a/packages/docs/docs/measure-spring.md b/packages/docs/docs/measure-spring.mdindex 04f9adec78..d26116e24d 100644--- a/packages/docs/docs/measure-spring.md+++ b/packages/docs/docs/measure-spring.md@@ -8,18 +8,18 @@ _Available from v2.0.8_Based on a [spring()](/docs/spring) configuration and the frame rate, return how long it takes for a spring animation to settle.```tsx twoslash-import {measureSpring, SpringConfig} from 'remotion'+import { measureSpring, SpringConfig } from "remotion";const config: Partial<SpringConfig> = {damping: 200,-}+};measureSpring({fps: 30,config: {damping: 200,},-}) // => 23+}); // => 23```:::infodiff --git a/packages/docs/docs/overwriting-webpack-config.md b/packages/docs/docs/overwriting-webpack-config.mdindex a5abcb70c4..400b5712c8 100644--- a/packages/docs/docs/overwriting-webpack-config.md+++ b/packages/docs/docs/overwriting-webpack-config.md@@ -18,7 +18,7 @@ In your `remotion.config.ts` file, you can call `Config.Bundler.overrideWebpackCOverriding the Webpack config uses the reducer pattern - pass in a function that takes as it's argument a Webpack configuration and return a new Webpack configuration.```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";Config.Bundling.overrideWebpackConfig((currentConfiguration) => {return {@@ -30,8 +30,8 @@ Config.Bundling.overrideWebpackConfig((currentConfiguration) => {// Add more loaders here],},- }-})+ };+});```:::info@@ -45,7 +45,7 @@ Using the reducer pattern will help with type safety, give you auto-complete, enThe following `remotion.config.ts` file shows how to enable support for MDX. Installation of `mdx-loader babel-loader @babel/preset-env @babel/preset-react` is required.```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut---Config.Bundling.overrideWebpackConfig((currentConfiguration) => {return {@@ -60,26 +60,26 @@ Config.Bundling.overrideWebpackConfig((currentConfiguration) => {test: /\.mdx?$/,use: [{- loader: 'babel-loader',+ loader: "babel-loader",options: {presets: [- '@babel/preset-env',+ "@babel/preset-env",[- '@babel/preset-react',+ "@babel/preset-react",{- runtime: 'automatic',+ runtime: "automatic",},],],},},- 'mdx-loader',+ "mdx-loader",],},],},- }-})+ };+});```:::info@@ -117,7 +117,7 @@ yarn add postcss-loader postcss postcss-preset-env tailwindcss autoprefixer2. Add the following to your [`remotion.config.ts`](/docs/config) file:```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut---Config.Bundling.overrideWebpackConfig((currentConfiguration) => {return {@@ -129,24 +129,28 @@ Config.Bundling.overrideWebpackConfig((currentConfiguration) => {? currentConfiguration.module.rules: []).filter((rule) => {- if (rule === '...') {- return false+ if (rule === "...") {+ return false;}- if (rule.test?.toString().includes('.css')) {- return false+ if (rule.test?.toString().includes(".css")) {+ return false;}- return true+ return true;}),{test: /\.css$/i,use: [- 'style-loader',- 'css-loader',+ "style-loader",+ "css-loader",{- loader: 'postcss-loader',+ loader: "postcss-loader",options: {postcssOptions: {- plugins: ['postcss-preset-env', 'tailwindcss', 'autoprefixer'],+ plugins: [+ "postcss-preset-env",+ "tailwindcss",+ "autoprefixer",+ ],},},},@@ -154,8 +158,8 @@ Config.Bundling.overrideWebpackConfig((currentConfiguration) => {},],},- }-})+ };+});```3. Create a file `src/style.css` with the following content:@@ -211,7 +215,7 @@ yarn add sass sass-loader2. Add the following to your [`remotion.config.ts`](/docs/config) file:```ts twoslash-import {Config} from 'remotion'+import { Config } from "remotion";// ---cut---Config.Bundling.overrideWebpackConfig((currentConfiguration) => {return {@@ -225,15 +229,15 @@ Config.Bundling.overrideWebpackConfig((currentConfiguration) => {{test: /\.s[ac]ss$/i,use: [- {loader: 'style-loader'},- {loader: 'css-loader'},- {loader: 'sass-loader', options: {sourceMap: true}},+ { loader: "style-loader" },+ { loader: "css-loader" },+ { loader: "sass-loader", options: { sourceMap: true } },],},],},- }-})+ };+});```3. Restart the preview server.diff --git a/packages/docs/docs/parametrized-rendering.md b/packages/docs/docs/parametrized-rendering.mdindex 3cab781a2d..bac4d28623 100644--- a/packages/docs/docs/parametrized-rendering.md+++ b/packages/docs/docs/parametrized-rendering.md@@ -31,14 +31,15 @@ When registering the component as a sequence, you can define the default props:```tsx twoslash {13-16}// @filename: MyComponent.tsx-import React from 'react';-export const MyComponent: React.FC<{propOne: string; propTwo: number;}> = () => null;+import React from "react";+export const MyComponent: React.FC<{ propOne: string; propTwo: number }> = () =>+ null;// @filename: Root.tsx-import React from 'react';+import React from "react";// ---cut----import {Composition} from 'remotion';-import {MyComponent} from './MyComponent';+import { Composition } from "remotion";+import { MyComponent } from "./MyComponent";export const Root = () => {return (@@ -51,13 +52,13 @@ export const Root = () => {durationInFrames={30}component={MyComponent}defaultProps={{- propOne: 'Hi',+ propOne: "Hi",propTwo: 10,}}/></>- )-}+ );+};```By using `React.FC`, you can ensure type safety and avoid errors caused by typos.@@ -91,11 +92,11 @@ When server-rendering using `renderFrames`, you can pass props using the `inputP```tsx twoslash {9-11}// @module: esnext// @target: es2017-const video = {fps: 30, durationInFrames: 30, width: 1080, height: 1080}-const bundled = '/path/to/bundle'-const framesDir = '/path/to/frames'+const video = { fps: 30, durationInFrames: 30, width: 1080, height: 1080 };+const bundled = "/path/to/bundle";+const framesDir = "/path/to/frames";// ---cut----import {renderFrames} from '@remotion/renderer'+import { renderFrames } from "@remotion/renderer";await renderFrames({config: video,@@ -104,19 +105,19 @@ await renderFrames({onFrameUpdate: (f) => undefined,onError: (info) => {if (info.frame === null) {- console.error('Got error while initalizing video rendering', info.error)+ console.error("Got error while initalizing video rendering", info.error);} else {- console.error('Got error at frame ', info.frame, info.error)+ console.error("Got error at frame ", info.frame, info.error);}},parallelism: null,outputDir: framesDir,inputProps: {- titleText: 'Hello World',+ titleText: "Hello World",},- compositionId: 'HelloWorld',- imageFormat: 'jpeg',-})+ compositionId: "HelloWorld",+ imageFormat: "jpeg",+});```### Passing input props in GitHub Actionsdiff --git a/packages/docs/docs/player.md b/packages/docs/docs/player.mdindex e26bbfe5c8..bac5ed698e 100644--- a/packages/docs/docs/player.md+++ b/packages/docs/docs/player.md@@ -149,22 +149,22 @@ You may attach a ref to the player and control it in an imperative manner.// @allowUmdGlobalAccess// @filename: MyComposition.tsx-export const MyComposition: React.FC = () => null+export const MyComposition: React.FC = () => null;// @filename: index.tsx// ---cut----import {useEffect, useRef} from 'react'-import {Player, PlayerRef} from '@remotion/player'-import {MyComposition} from './MyComposition'+import { useEffect, useRef } from "react";+import { Player, PlayerRef } from "@remotion/player";+import { MyComposition } from "./MyComposition";const MyComp: React.FC = () => {const playerRef = useRef<PlayerRef>(null);useEffect(() => {if (playerRef.current) {- console.log(playerRef.current.getCurrentFrame())+ console.log(playerRef.current.getCurrentFrame());}- }, [])+ }, []);return (<Player@@ -176,8 +176,8 @@ const MyComp: React.FC = () => {component={MyComposition}// Many other optional props are available./>- )-}+ );+};```The following methods are available on the player ref:@@ -205,8 +205,8 @@ _Available from v2.4.2_Gets the container `HTMLDivElement` of the player. Useful if you'd like to manually attach listeners to the player element.```tsx twoslash-import {useRef, useEffect} from 'react'-import {PlayerRef} from '@remotion/player'+import { useRef, useEffect } from "react";+import { PlayerRef } from "@remotion/player";// ---cut---const playerRef = useRef<PlayerRef>(null);@@ -220,13 +220,13 @@ useEffect(() => {}const onClick = () => {- console.log('player got clicked');+ console.log("player got clicked");};- container.addEventListener('click', onClick)+ container.addEventListener("click", onClick);return () => {- container.removeEventListener('click', onClick);- }+ container.removeEventListener("click", onClick);+ };}, []);```@@ -289,35 +289,35 @@ Stop listening to an event. See the [Events](#events) section to see the functioUsing a [player ref](#playerref), you can bind event listeners to get notified of certain events of the player.```tsx twoslash-import {useRef, useEffect} from 'react'-import {PlayerRef} from '@remotion/player'+import { useRef, useEffect } from "react";+import { PlayerRef } from "@remotion/player";// ---cut---const playerRef = useRef<PlayerRef>(null);useEffect(() => {if (!playerRef.current) {- return+ return;}- playerRef.current.addEventListener('play', () => {- console.log('playing')- })- playerRef.current.addEventListener('pause', () => {- console.log('pausing')- })+ playerRef.current.addEventListener("play", () => {+ console.log("playing");+ });+ playerRef.current.addEventListener("pause", () => {+ console.log("pausing");+ });// See below for difference between `seeked` and `timeupdate`- playerRef.current.addEventListener('seeked', (e) => {- console.log('seeked to ' + e.detail.frame)- })- playerRef.current.addEventListener('timeupdate', (e) => {- console.log('time has updated to ' + e.detail.frame)- })- playerRef.current.addEventListener('ended', (e) => {- console.log('ended')- })- playerRef.current.addEventListener('error', (e) => {- console.log('error', e.detail.error)- })+ playerRef.current.addEventListener("seeked", (e) => {+ console.log("seeked to " + e.detail.frame);+ });+ playerRef.current.addEventListener("timeupdate", (e) => {+ console.log("time has updated to " + e.detail.frame);+ });+ playerRef.current.addEventListener("ended", (e) => {+ console.log("ended");+ });+ playerRef.current.addEventListener("error", (e) => {+ console.log("error", e.detail.error);+ });}, []);```@@ -326,16 +326,16 @@ useEffect(() => {Fired when the time position changes. You may get the current frame by reading it from `e.detail.frame`.```tsx twoslash-import {useRef, useEffect} from 'react'-import {PlayerRef} from '@remotion/player'-const playerRef = useRef<PlayerRef>(null)+import { useRef, useEffect } from "react";+import { PlayerRef } from "@remotion/player";+const playerRef = useRef<PlayerRef>(null);if (!playerRef.current) {- throw new Error()+ throw new Error();}// ---cut----playerRef.current.addEventListener('seeked', (e) => {- console.log('seeked to ' + e.detail.frame) // seeked to 120-})+playerRef.current.addEventListener("seeked", (e) => {+ console.log("seeked to " + e.detail.frame); // seeked to 120+});```This event fires on every single frame update. Don't update your UI based on this event as it will cause a lot of rerenders. Use the [`timeupdate`](#timeupdate) event instead.@@ -357,16 +357,16 @@ Fires when the video has paused or ended.Fires periodically when the video is playing. Unlike the [`seeked`](#seeked) event, frames are skipped, and the event is throttled to only fire a few times a second.```tsx twoslash-import {useRef, useEffect} from 'react'-import {PlayerRef} from '@remotion/player'-const playerRef = useRef<PlayerRef>(null)+import { useRef, useEffect } from "react";+import { PlayerRef } from "@remotion/player";+const playerRef = useRef<PlayerRef>(null);if (!playerRef.current) {- throw new Error()+ throw new Error();}// ---cut----playerRef.current.addEventListener('timeupdate', (e) => {- console.log('current frame is ' + e.detail.frame) // current frame is 120-})+playerRef.current.addEventListener("timeupdate", (e) => {+ console.log("current frame is " + e.detail.frame); // current frame is 120+});```### `error`@@ -376,13 +376,13 @@ Fires when an error or uncaught exception has happened in the video.You may get the error by reading the `e.detail.error` value:```tsx twoslash-import {useRef, useEffect} from 'react'-import {PlayerRef} from '@remotion/player'-const ref = useRef<PlayerRef>(null)+import { useRef, useEffect } from "react";+import { PlayerRef } from "@remotion/player";+const ref = useRef<PlayerRef>(null);// ---cut----ref.current?.addEventListener('error', (e) => {- console.log('error ', e.detail.error) // error [Error: undefined is not a function]-})+ref.current?.addEventListener("error", (e) => {+ console.log("error ", e.detail.error); // error [Error: undefined is not a function]+});```## Handling errorsdiff --git a/packages/docs/docs/random.md b/packages/docs/docs/random.mdindex 364fb586bf..5e0166f406 100644--- a/packages/docs/docs/random.md+++ b/packages/docs/docs/random.md@@ -6,20 +6,20 @@ title: random()The `random()` API will give your deterministic pseudorandom values. Unlike the `Math.random()` function, Remotions function takes in a seed which can be a `number` or a `string`. If the seed is the same, the output is always the same.```ts twoslash-import {random} from 'remotion'+import { random } from "remotion";-const rand = random(1) // 0.07301638228818774-const rand2 = random(1) // still 0.07301638228818774+const rand = random(1); // 0.07301638228818774+const rand2 = random(1); // still 0.07301638228818774const randomCoordinates = new Array(10).fill(true).map((a, i) => {return {x: random(`random-x-${i}`),y: random(`random--${i}`),- }-}) // will always be [{x: 0.2887063352391124, y: 0.18660089606419206}, ...]+ };+}); // will always be [{x: 0.2887063352391124, y: 0.18660089606419206}, ...]// @ts-expect-error-random() // Error: random() argument must be a number or a string+random(); // Error: random() argument must be a number or a string```## Use cases@@ -31,10 +31,10 @@ Randomness can be used to create interesting visualizations, such as particle efCalling `Math.random()` results in an ESLint warning in Remotion since often it leads to bugs in rendering. If you are sure you want a true random number, and want to bypass this message without adding an ignore comment, use `random(null)````ts twoslash-const random = (seed: number | string | null) => Math.random()+const random = (seed: number | string | null) => Math.random();// ---cut---// Passing null will result in a different value every time.-random(null) === random(null) // false+random(null) === random(null); // false```## See alsodiff --git a/packages/docs/docs/register-root.md b/packages/docs/docs/register-root.mdindex 414b23f2d3..21a2704634 100644--- a/packages/docs/docs/register-root.md+++ b/packages/docs/docs/register-root.md@@ -13,35 +13,35 @@ The list of compositions can be updated without reloading the page, but calling```tsx twoslash title="index.ts"// @filename: ./Video.tsx-export const RemotionVideo = () => <></>+export const RemotionVideo = () => <></>;// @filename: index.tsx// ---cut----import {registerRoot} from 'remotion'-import {RemotionVideo} from './Video'+import { registerRoot } from "remotion";+import { RemotionVideo } from "./Video";-registerRoot(RemotionVideo)+registerRoot(RemotionVideo);``````tsx twoslash title="Video.tsx"// @allowUmdGlobalAccess// @filename: MyComponent.tsx-export default () => <></>+export default () => <></>;// @filename: MyOtherComponent.tsx-export default () => <></>+export default () => <></>;// @filename: index.tsxconst Composition: React.FC<{- id: string- fps: number- height: number- width: number- component: () => JSX.Element-}> = () => <></>+ id: string;+ fps: number;+ height: number;+ width: number;+ component: () => JSX.Element;+}> = () => <></>;// ---cut----import MyComponent from './MyComponent'-import MyOtherComponent from './MyOtherComponent'+import MyComponent from "./MyComponent";+import MyOtherComponent from "./MyOtherComponent";export const RemotionVideo = () => {return (@@ -61,8 +61,8 @@ export const RemotionVideo = () => {component={MyOtherComponent}/></>- )-}+ );+};```## See alsodiff --git a/packages/docs/docs/sequence.md b/packages/docs/docs/sequence.mdindex 53428f408f..7cfc28bfed 100644--- a/packages/docs/docs/sequence.md+++ b/packages/docs/docs/sequence.md@@ -41,8 +41,8 @@ All the examples below are based on the following animation of a blue square:// @include: example-BlueSquare// ---cut---const MyVideo = () => {- return <BlueSquare />-}+ return <BlueSquare />;+};```### Delay@@ -54,15 +54,15 @@ If you would like to delay the content by say 30 frames, you can wrap it in <br/```tsx twoslash// @include: example-BlueSquare-import {Sequence} from 'remotion'+import { Sequence } from "remotion";// ---cut---const MyVideo = () => {return (- <Sequence from={30} >+ <Sequence from={30}><BlueSquare /></Sequence>- )-}+ );+};```### Trim end@@ -90,7 +90,7 @@ You need to wrap the videos in two sequences. To the inner one we pass a negativ```tsx twoslash// @include: example-BlueSquare-import {Sequence} from 'remotion'+import { Sequence } from "remotion";// ---cut---const TrimAndDelayExample: React.FC = () => {return (@@ -99,8 +99,8 @@ const TrimAndDelayExample: React.FC = () => {<BlueSquare /></Sequence></Sequence>- )-}+ );+};```## Play Sequences sequentiallydiff --git a/packages/docs/docs/sequences.md b/packages/docs/docs/sequences.mdindex b73c5f76d6..7c813ab6af 100644--- a/packages/docs/docs/sequences.md+++ b/packages/docs/docs/sequences.md@@ -27,11 +27,11 @@ In order to make a title reusable, we first factor it out into it's own componenexport const MyVideo = () => {return (- <div style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>+ <div style={{ flex: 1, justifyContent: "center", alignItems: "center" }}><Title title="Hello World" /></div>- )-}+ );+};```Now we can use the `<Sequence>` component to limit the duration of the first title and time-shift the appearance of the second title.@@ -39,16 +39,16 @@ Now we can use the `<Sequence>` component to limit the duration of the first tit```tsx twoslash// @include: example-Title// ---cut----import {Sequence} from 'remotion'+import { Sequence } from "remotion";export const MyVideo = () => {return (<divstyle={{flex: 1,- justifyContent: 'center',- alignItems: 'center',- backgroundColor: 'white',+ justifyContent: "center",+ alignItems: "center",+ backgroundColor: "white",}}><Sequence from={0} durationInFrames={40}>@@ -58,8 +58,8 @@ export const MyVideo = () => {<Title title="World" /></Sequence></div>- )-}+ );+};```You should see two titles appearing after each other. Titles which are not shown during a frame are unmounted.diff --git a/packages/docs/docs/series.md b/packages/docs/docs/series.mdindex 078b4c7090..dfbe7b6acb 100644--- a/packages/docs/docs/series.md+++ b/packages/docs/docs/series.md@@ -22,7 +22,7 @@ const Square: React.FC<{color: string}> = () => <div></div>```tsx twoslash// @include: example-Square// ---cut----import {Series} from 'remotion';+import { Series } from "remotion";const Example: React.FC = () => {return (diff --git a/packages/docs/docs/spring.md b/packages/docs/docs/spring.mdindex dd85a25f9b..87f0d2b393 100644--- a/packages/docs/docs/spring.md+++ b/packages/docs/docs/spring.md@@ -8,10 +8,10 @@ Delightful and smooth animation primitive. Calculates a position based on physicExample:```tsx twoslash-import {spring, useCurrentFrame, useVideoConfig} from 'remotion'+import { spring, useCurrentFrame, useVideoConfig } from "remotion";// ---cut----const frame = useCurrentFrame()-const videoConfig = useVideoConfig()+const frame = useCurrentFrame();+const videoConfig = useVideoConfig();const value = spring({frame,@@ -21,7 +21,7 @@ const value = spring({config: {stiffness: 100,},-})+});```## Parametersdiff --git a/packages/docs/docs/ssr.md b/packages/docs/docs/ssr.mdindex 5fd889f04a..94a74a88cc 100644--- a/packages/docs/docs/ssr.md+++ b/packages/docs/docs/ssr.md@@ -16,22 +16,22 @@ The NPM package `@remotion/renderer` provides you with an API for rendering theFollow this commented example to see how to render a video:```tsx twoslash-import fs from 'fs'-import os from 'os'-import path from 'path'-import {bundle} from '@remotion/bundler'+import fs from "fs";+import os from "os";+import path from "path";+import { bundle } from "@remotion/bundler";import {getCompositions,renderFrames,stitchFramesToVideo,-} from '@remotion/renderer'+} from "@remotion/renderer";const start = async () => {// The composition you want to render- const compositionId = 'HelloWorld'+ const compositionId = "HelloWorld";// Create a webpack bundle of the entry file.- const bundleLocation = await bundle(require.resolve('./src/index'))+ const bundleLocation = await bundle(require.resolve("./src/index"));// Extract all the compositions you have defined in your project// from the webpack bundle.@@ -40,43 +40,46 @@ const start = async () => {// in the composition list. Use this if you want to dynamically set the duration or// dimensions of the video.inputProps: {- custom: 'data',+ custom: "data",},- })+ });// Select the composition you want to render.- const composition = comps.find((c) => c.id === compositionId)+ const composition = comps.find((c) => c.id === compositionId);// Ensure the composition existsif (!composition) {- throw new Error(`No composition with the ID ${compositionId} found`)+ throw new Error(`No composition with the ID ${compositionId} found`);}// We create a temporary directory for storing the framesconst framesDir = await fs.promises.mkdtemp(- path.join(os.tmpdir(), 'remotion-')- )+ path.join(os.tmpdir(), "remotion-")+ );// We create JPEGs for all frames- const {assetsInfo} = await renderFrames({+ const { assetsInfo } = await renderFrames({config: composition,// Path of the webpack bundle you have createdwebpackBundle: bundleLocation,// Get's called after bundling is finished and the// actual rendering starts.- onStart: () => console.log('Rendering frames...'),+ onStart: () => console.log("Rendering frames..."),// Handle errors in your React codeonError: (info) => {if (info.frame === null) {- console.error('Got error while initalizing video rendering', info.error)+ console.error(+ "Got error while initalizing video rendering",+ info.error+ );} else {- console.error('Got error at frame ', info.frame, info.error)+ console.error("Got error at frame ", info.frame, info.error);}},onFrameUpdate: (f) => {// Log a message whenever 10 frames have rendered.if (f % 10 === 0) {- console.log(`Rendered frame ${f}`)+ console.log(`Rendered frame ${f}`);}},// How many CPU threads to use. `null` will use a sane default (half of the available threads)@@ -85,12 +88,12 @@ const start = async () => {outputDir: framesDir,// React props passed to the root component of the sequence. Will be merged with the `defaultProps` of a composition.inputProps: {- titleText: 'Hello World'+ titleText: "Hello World",},compositionId,// Can be either 'jpeg' or 'png'. JPEG is faster, but has no transparency.- imageFormat: 'jpeg'- })+ imageFormat: "jpeg",+ });// Add this step if you want to make an MP4 out of the rendered frames.await stitchFramesToVideo({@@ -105,19 +108,19 @@ const start = async () => {height: composition.height,width: composition.width,// Must match the value above for the image format- imageFormat: 'jpeg',+ imageFormat: "jpeg",// Pass in the desired output path of the video. Et voilà !- outputLocation: path.join(framesDir, 'out.mp4'),+ outputLocation: path.join(framesDir, "out.mp4"),// FFMPEG pixel format- pixelFormat: 'yuv420p',+ pixelFormat: "yuv420p",// Information needed to construct audio correctly.assetsInfo,// Hook into the FFMPEG progress- onProgress: (frame) => undefined- })-}+ onProgress: (frame) => undefined,+ });+};-start()+start();```:::warningdiff --git a/packages/docs/docs/still.md b/packages/docs/docs/still.mdindex 61054aa747..1e6ae8a87c 100644--- a/packages/docs/docs/still.md+++ b/packages/docs/docs/still.md@@ -12,12 +12,12 @@ The `<Still />` component has the same API as a [`<Composition />`](/docs/compos```tsx twoslash// @allowUmdGlobalAccess// @filename: ./MyComp.tsx-export const MyComp = () => <></>+export const MyComp = () => <></>;// @filename: index.tsx// ---cut----import {Composition, Still} from 'remotion'-import {MyComp} from './MyComp'+import { Composition, Still } from "remotion";+import { MyComp } from "./MyComp";export const MyVideo = () => {return (@@ -30,15 +30,10 @@ export const MyVideo = () => {fps={30}durationInFrames={3 * 30}/>- <Still- id="my-image"- component={MyComp}- width={1080}- height={1080}- />+ <Still id="my-image" component={MyComp} width={1080} height={1080} /></>- )-}+ );+};```## See alsodiff --git a/packages/docs/docs/stitch-frames-to-video.md b/packages/docs/docs/stitch-frames-to-video.mdindex 47f7347cca..babe090a90 100644--- a/packages/docs/docs/stitch-frames-to-video.md+++ b/packages/docs/docs/stitch-frames-to-video.md@@ -9,21 +9,21 @@ Takes a series of images and audio information generated by [`renderFrames()`](/```tsconst stitchFramesToVideo: (options: {- dir: string- fps: number- width: number- height: number- outputLocation: string- force: boolean- assetsInfo: RenderAssetInfo- imageFormat?: 'png' | 'jpeg' | 'none'- pixelFormat?: PixelFormat- codec?: Codec- crf?: number- onProgress?: (progress: number) => void- onDownload?: (src: number) => void- verbose?: boolean-}) => Promise<void>+ dir: string;+ fps: number;+ width: number;+ height: number;+ outputLocation: string;+ force: boolean;+ assetsInfo: RenderAssetInfo;+ imageFormat?: "png" | "jpeg" | "none";+ pixelFormat?: PixelFormat;+ codec?: Codec;+ crf?: number;+ onProgress?: (progress: number) => void;+ onDownload?: (src: number) => void;+ verbose?: boolean;+}) => Promise<void>;```## Arguments@@ -94,8 +94,8 @@ Callback function which informs about the encoding progress. The `frameNumber` v```ts twoslashconst onProgress = (frameNumber: number) => {- console.log(`Encoding progress: on ${frameNumber} frame`)-}+ console.log(`Encoding progress: on ${frameNumber} frame`);+};```### `onDownload?`@@ -106,8 +106,8 @@ Notifies when a remote asset needs to be downloaded in order to extract the audi```ts twoslashconst onDownload = (src: string) => {- console.log(`Downloading ${src}...`)-}+ console.log(`Downloading ${src}...`);+};```### `verbose`diff --git a/packages/docs/docs/the-fundamentals.md b/packages/docs/docs/the-fundamentals.mdindex 62c7ec883b..d0b22edf16 100644--- a/packages/docs/docs/the-fundamentals.md+++ b/packages/docs/docs/the-fundamentals.md@@ -37,17 +37,17 @@ A video has 4 properties:These properties are variable and you can reuse a component multiple times with different properties. This is why you better not hard-code these properties, but instead derive them from the `useVideoConfig` hook:```tsx twoslash-import {useVideoConfig} from 'remotion'+import { useVideoConfig } from "remotion";export const MyVideo = () => {- const {fps, durationInFrames, width, height} = useVideoConfig()+ const { fps, durationInFrames, width, height } = useVideoConfig();return (- <div style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>+ <div style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>This video is {durationInFrames / fps} seconds long.</div>- )-}+ );+};```A video's first frame is `0` and it's last frame is `durationInFrames - 1`.@@ -57,7 +57,7 @@ A video's first frame is `0` and it's last frame is `durationInFrames - 1`.Compositions are components with the above mentioned metadata. You can define compositions in `src/Video.tsx` to make them show up in the left sidebar.```tsx twoslash-import {Composition} from 'remotion'+import { Composition } from "remotion";// @include: example-MyVideo// ---cut---@@ -73,8 +73,8 @@ export const RemotionVideo: React.FC = () => {height={1080}/></>- )-}+ );+};```Remember that if you like, you can register multiple compositions that rely on the same component. For example, if you like to make a square video for social media feeds, and a portrait video for Stories, you can reuse the component and try to make it 'responsive'.diff --git a/packages/docs/docs/three-canvas.md b/packages/docs/docs/three-canvas.mdindex 202379ce0c..46dd697421 100644--- a/packages/docs/docs/three-canvas.md+++ b/packages/docs/docs/three-canvas.md@@ -16,12 +16,12 @@ A browser bug [would normally cause the layout to be broken](https://github.com/A spinning, color changing, scaling cube. This example can also be found in the `examples` folder of the Remotion repo.```tsx twoslash-import {interpolate, useCurrentFrame, useVideoConfig} from 'remotion'-import {ThreeCanvas} from '@remotion/three'+import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";+import { ThreeCanvas } from "@remotion/three";const ThreeBasic: React.FC = () => {- const frame = useCurrentFrame()- const {width, height} = useVideoConfig()+ const frame = useCurrentFrame();+ const { width, height } = useVideoConfig();return (<ThreeCanvas@@ -29,9 +29,9 @@ const ThreeBasic: React.FC = () => {width={width}height={height}style={{- backgroundColor: 'white',+ backgroundColor: "white",}}- camera={{fov: 75, position: [0, 0, 470]}}+ camera={{ fov: 75, position: [0, 0, 470] }}><ambientLight intensity={0.15} /><pointLight args={[undefined, 0.4]} position={[200, 200, 0]} />@@ -50,8 +50,8 @@ const ThreeBasic: React.FC = () => {/></mesh></ThreeCanvas>- )-}+ );+};-export default ThreeBasic+export default ThreeBasic;```diff --git a/packages/docs/docs/transparent-videos.mdx b/packages/docs/docs/transparent-videos.mdxindex 53ee46b7cd..84bd24fe48 100644--- a/packages/docs/docs/transparent-videos.mdx+++ b/packages/docs/docs/transparent-videos.mdx@@ -35,11 +35,11 @@ In order to create a transparent video, you need at least version 1.4 of RemotioIf you want to set these options and persist them, add this to your `remotion.config.ts` file (create it if you don't yet have one);```tsx twoslash-import {Config} from 'remotion'+import { Config } from "remotion";-Config.Rendering.setImageFormat('png')-Config.Output.setPixelFormat('yuva420p')-Config.Output.setCodec('vp8')+Config.Rendering.setImageFormat("png");+Config.Output.setPixelFormat("yuva420p");+Config.Output.setCodec("vp8");```You can also set the settings on the command line:@@ -56,12 +56,12 @@ ProRes is supported by Final Cut Pro, Adobe Premiere and Davinci Resolve.Supported since v2.1.7, you can set the codec to `prores` and choose a ProRes profile with alpha support: Either: `4444` or `4444-hq`. The pixel format must be `yuva444p10le`.```tsx twoslash-import {Config} from 'remotion'+import { Config } from "remotion";-Config.Rendering.setImageFormat('png')-Config.Output.setPixelFormat('yuva444p10le')-Config.Output.setCodec('prores')-Config.Output.setProResProfile('4444')+Config.Rendering.setImageFormat("png");+Config.Output.setPixelFormat("yuva444p10le");+Config.Output.setCodec("prores");+Config.Output.setProResProfile("4444");```You can also set the settings on the command line:@@ -81,7 +81,7 @@ Given the poor browser support, consider making two versions of a video, one witIt's a good practice to set a default when defining the composition:```tsx twoslash {7-9}-import {Composition} from 'remotion'+import { Composition } from "remotion";// @include: example-MyVideo// ---cut---<Composition@@ -94,7 +94,7 @@ import {Composition} from 'remotion'defaultProps={{transparent: true,}}-/>+/>;```You can then have separate render commands in your package.json:diff --git a/packages/docs/docs/use-audio-data.md b/packages/docs/docs/use-audio-data.mdindex 9c8cba9549..5272e525a1 100644--- a/packages/docs/docs/use-audio-data.md+++ b/packages/docs/docs/use-audio-data.md@@ -26,20 +26,20 @@ A string pointing to an audio asset.## Example```tsx twoslash-import {Audio} from 'remotion'+import { Audio } from "remotion";// ---cut----import {useAudioData} from '@remotion/media-utils';-import music from './music.mp3';+import { useAudioData } from "@remotion/media-utils";+import music from "./music.mp3";export const MyComponent: React.FC = () => {- const audioData = useAudioData(music)+ const audioData = useAudioData(music);if (!audioData) {- return null+ return null;}- return <div>This file has a {audioData.sampleRate} sampleRate.</div>-}+ return <div>This file has a {audioData.sampleRate} sampleRate.</div>;+};```## See alsodiff --git a/packages/docs/docs/use-current-frame.md b/packages/docs/docs/use-current-frame.mdindex 0245713287..42b5314cb2 100644--- a/packages/docs/docs/use-current-frame.md+++ b/packages/docs/docs/use-current-frame.md@@ -10,20 +10,20 @@ If the component you are writing is wrapped in a `<Sequence>`, `useCurrentFrame`Say the timeline marker is positioned at frame 25. In the example below, `useCurrentFrame` will return `25`, except within the Subtitle component, where it will return `15` because it is within a sequence that starts at frame 10.```tsx twoslash-import {Sequence, useCurrentFrame} from 'remotion'+import { Sequence, useCurrentFrame } from "remotion";const Title = () => {- const frame = useCurrentFrame() // 25- return <div>{frame}</div>-}+ const frame = useCurrentFrame(); // 25+ return <div>{frame}</div>;+};const Subtitle = () => {- const frame = useCurrentFrame() // 15- return <div>{frame}</div>-}+ const frame = useCurrentFrame(); // 15+ return <div>{frame}</div>;+};const MyVideo = () => {- const frame = useCurrentFrame() // 25+ const frame = useCurrentFrame(); // 25return (<div>@@ -32,8 +32,8 @@ const MyVideo = () => {<Subtitle /></Sequence></div>- )-}+ );+};```## See alsodiff --git a/packages/docs/docs/use-video-texture.md b/packages/docs/docs/use-video-texture.mdindex 716abee40a..a3ebc479cd 100644--- a/packages/docs/docs/use-video-texture.md+++ b/packages/docs/docs/use-video-texture.md@@ -8,45 +8,47 @@ Allows you to use a video in React Three Fiber that is synchronized with RemotioTo use a video in a Three.JS context, you first have to render it and assign it a ref. If you only want to use it in a React Three Fiber Scene, you can make it invisible by adding a `{position: "absolute", opacity: 0}` style.```tsx twoslash-import {useRef} from 'react'-import {Video} from 'remotion'-import src from './vid.mp4'+import { useRef } from "react";+import { Video } from "remotion";+import src from "./vid.mp4";const MyVideo = () => {- const videoRef = useRef<HTMLVideoElement | null>(null)+ const videoRef = useRef<HTMLVideoElement | null>(null);return (<Videoref={videoRef}src={src}- style={{position: 'absolute', opacity: 0}}+ style={{ position: "absolute", opacity: 0 }}/>- )-}+ );+};```To convert the video to a video texture, place the `useVideoTexture()` hook in the same component.```tsx twoslash-const videoRef: React.MutableRefObject<HTMLVideoElement | null> = React.useRef(null)+const videoRef: React.MutableRefObject<HTMLVideoElement | null> =+ React.useRef(null);// ---cut----import {useVideoTexture} from '@remotion/three'+import { useVideoTexture } from "@remotion/three";// ...-const texture = useVideoTexture(videoRef)+const texture = useVideoTexture(videoRef);```The return type of it is a `THREE.VideoTexture | null` which you can assign as a `map` to for example `meshBasicMaterial`. We recommend to only render the material when the texture is not `null` to prevent bugs.```tsx twoslash-import {useVideoTexture} from '@remotion/three'-const videoRef: React.MutableRefObject<HTMLVideoElement | null> = React.useRef(null)-const videoTexture = useVideoTexture(videoRef)+import { useVideoTexture } from "@remotion/three";+const videoRef: React.MutableRefObject<HTMLVideoElement | null> =+ React.useRef(null);+const videoTexture = useVideoTexture(videoRef);// ---cut----{videoTexture ? (- <meshBasicMaterial map={videoTexture} />-) : null}+{+ videoTexture ? <meshBasicMaterial map={videoTexture} /> : null;+}```## See alsodiff --git a/packages/docs/docs/using-audio.md b/packages/docs/docs/using-audio.mdindex d3073074be..99bcd6c447 100644--- a/packages/docs/docs/using-audio.md+++ b/packages/docs/docs/using-audio.md@@ -8,16 +8,16 @@ id: using-audioYou can import an audio file using an `import` statement:```ts twoslash-import {Audio} from 'remotion' // needed to import audio files+import { Audio } from "remotion"; // needed to import audio files// ---cut----import audio from './audio.mp3'+import audio from "./audio.mp3";```You may add an [`<Audio/>`](/docs/audio) tag to your composition to add sound to it.```tsx twoslash {7}-import {Audio} from 'remotion'-import audio from './audio.mp3'+import { Audio } from "remotion";+import audio from "./audio.mp3";export const MyComposition: React.FC = () => {return (@@ -25,8 +25,8 @@ export const MyComposition: React.FC = () => {<h1>Hello World!</h1><Audio src={audio} /></div>- )-}+ );+};```The audio will play from the start, at full volume and as long as the duration of the composition or the duration of the audio is long, whatever is shorter.@@ -41,8 +41,8 @@ You can use the [`<Sequence />`](/docs/sequence) API to cut and trim audio.As a convienience, the `<Audio />` tag supports the `startFrom` and `endAt` props.```tsx twoslash {9-10}-import {Audio} from 'remotion'-import audio from './audio.mp3'+import { Audio } from "remotion";+import audio from "./audio.mp3";export const MyVideo = () => {return (@@ -54,8 +54,8 @@ export const MyVideo = () => {endAt={120} // if your composition is 30fps, then it will end at 4s/></div>- )-}+ );+};```## Delaying audio@@ -64,8 +64,8 @@ Use a `<Sequence>` with a positive `from` attribute to delay the audio from playIn the following example, the audio will start playing (from the beginning) after 100 frames.```tsx twoslash {8}-import {Audio, Sequence} from 'remotion'-import audio from './audio.mp3'+import { Audio, Sequence } from "remotion";+import audio from "./audio.mp3";export const MyVideo = () => {return (@@ -75,8 +75,8 @@ export const MyVideo = () => {<Audio src={audio} /></Sequence></div>- )-}+ );+};```## Controlling volume@@ -85,8 +85,8 @@ You can use the `volume` prop to control the volume.**The simplest way is to pass a number between 0 and 1**. `1` is the maximum volume, values over 1 are allowed but will not increase the volume further. Volumes under 0 are not allowed.```tsx twoslash {7}-import {Audio} from 'remotion'-import audio from './audio.mp3'+import { Audio } from "remotion";+import audio from "./audio.mp3";export const MyVideo = () => {return (@@ -94,36 +94,38 @@ export const MyVideo = () => {<div>Hello World!</div><Audio src={audio} volume={0.5} /></div>- )-}+ );+};```You can also **change volume over time**, in this example we are using the [interpolate()](/docs/interpolate) function. Note that because values below 0 are not allowed, we need to set the `extrapolateLeft: 'clamp'` option to ensure no negative values.```tsx twoslash {11}-import {Audio, interpolate, useCurrentFrame} from 'remotion'-import audio from './audio.mp3'+import { Audio, interpolate, useCurrentFrame } from "remotion";+import audio from "./audio.mp3";export const MyVideo = () => {- const frame = useCurrentFrame()+ const frame = useCurrentFrame();return (<div><div>Hello World!</div><Audiosrc={audio}- volume={interpolate(frame, [0, 30], [0, 1], {extrapolateLeft: 'clamp'})}+ volume={interpolate(frame, [0, 30], [0, 1], {+ extrapolateLeft: "clamp",+ })}/></div>- )-}+ );+};```You may also pass a **callback function** that returns the volume based an arbitrary frame number. This has the benefit that Remotion is able to **draw a volume curve in the timeline**!```tsx twoslash {9}-import {Audio, interpolate} from 'remotion'-import audio from './audio.mp3'+import { Audio, interpolate } from "remotion";+import audio from "./audio.mp3";export const MyVideo = () => {return (@@ -131,11 +133,13 @@ export const MyVideo = () => {<div>Hello World!</div><Audiosrc={audio}- volume={(f) => interpolate(f, [0, 30], [0, 1], {extrapolateLeft: 'clamp'})}+ volume={(f) =>+ interpolate(f, [0, 30], [0, 1], { extrapolateLeft: "clamp" })+ }/></div>- )-}+ );+};```Note that if you pass in a callback function, the first frame on which audio is being played is always the frame `0`.@@ -145,19 +149,19 @@ Note that if you pass in a callback function, the first frame on which audio isYou may pass in the `muted` and it may change over time. When `muted` is true, audio will be omitted at that time. In the following example, we are muting the track between frame 40 and 60.```tsx twoslash {9}-import {Audio, useCurrentFrame} from 'remotion'-import audio from './audio.mp3'+import { Audio, useCurrentFrame } from "remotion";+import audio from "./audio.mp3";export const MyVideo = () => {- const frame = useCurrentFrame()+ const frame = useCurrentFrame();return (<div><div>Hello World!</div><Audio src={audio} muted={frame >= 40 && frame <= 60} /></div>- )-}+ );+};```## Use audio from `<Video />` tagsdiff --git a/packages/docs/docs/using-fonts.md b/packages/docs/docs/using-fonts.mdindex d5e1e1bea9..0eba6ad7f0 100644--- a/packages/docs/docs/using-fonts.md+++ b/packages/docs/docs/using-fonts.md@@ -12,11 +12,11 @@ You can use fonts by loading them in a CSS file using @font-face. Web fonts ofte``````tsx twoslash title="MyComp.tsx"-import './font.css'+import "./font.css";const MyComp: React.FC = () => {- return <div style={{fontFamily: 'Bangers'}}>Hello</div>-}+ return <div style={{ fontFamily: "Bangers" }}>Hello</div>;+};```**Important when using Webfonts:**@@ -36,11 +36,11 @@ const MyComp: React.FC = () => {``````tsx twoslash title="MyComp.tsx"-import './font.css'+import "./font.css";const MyComp: React.FC = () => {- return <div style={{fontFamily: 'Bangers'}}>Hello</div>-}+ return <div style={{ fontFamily: "Bangers" }}>Hello</div>;+};```### File requirementsdiff --git a/packages/docs/docs/video.md b/packages/docs/docs/video.mdindex 3a7834c1fe..763666358b 100644--- a/packages/docs/docs/video.md+++ b/packages/docs/docs/video.md@@ -14,8 +14,8 @@ Use an import or require to load an video file and pass it as the `src` prop. Al`<Video>` has two more helper props: `startFrom` and `endAt` to define when the video should start and end. Both are optional and do not get forwarded to the native `<video>` element but tell Remotion which portion of the video to use.```tsx twoslash-import {Video} from 'remotion'-import video from './video.webm'+import { Video } from "remotion";+import video from "./video.webm";export const MyVideo = () => {return (@@ -25,11 +25,11 @@ export const MyVideo = () => {src={video}startFrom={59} // if video is 30fps, then it will start at 2sendAt={120} // if video is 30fps, then it will end at 4s- style={{height: 1080 / 2, width: 1920 / 2}}+ style={{ height: 1080 / 2, width: 1920 / 2 }}/></div>- )-}+ );+};```## Codec support@@ -62,24 +62,18 @@ _Available from v2.4.4_You can use the browser-native [`<source>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source) tags to provide different media to support a broader range of browsers. While rendering always happens in Chrome, this feature is useful if you are showing a preview in [`<Player />`](/docs/player).```tsx twoslash-import {Video, interpolate} from 'remotion';-const source1 = "https://example.com/kid-laugh.mp3"+import { Video, interpolate } from "remotion";+const source1 = "https://example.com/kid-laugh.mp3";// ---cut---const Comp: React.FC = () => {return (<Video>- <source- src="https://example.com/me-at-the-zoo.mp4"- type="video/mp4"- />- <source- src="https://example.com/big-buck-bunny.webm"- type="video/webm"- />+ <source src="https://example.com/me-at-the-zoo.mp4" type="video/mp4" />+ <source src="https://example.com/big-buck-bunny.webm" type="video/webm" /></Video>);-}+};```## See alsodiff --git a/packages/docs/docs/visualize-audio.md b/packages/docs/docs/visualize-audio.mdindex 73cd202a93..c8e1cddf5c 100644--- a/packages/docs/docs/visualize-audio.md+++ b/packages/docs/docs/visualize-audio.md@@ -34,17 +34,17 @@ Usually the values on left side of the array can become much larger than the valIn this example, we render a bar chart visualizing the audio spectrum of an audio file we imported using [`useAudioData()`](/docs/use-audio-data) and `visualizeAudio()`.```tsx twoslash-import {Audio, useCurrentFrame, useVideoConfig} from 'remotion'-import {useAudioData, visualizeAudio} from '@remotion/media-utils'-import music from './music.mp3'+import { Audio, useCurrentFrame, useVideoConfig } from "remotion";+import { useAudioData, visualizeAudio } from "@remotion/media-utils";+import music from "./music.mp3";export const MyComponent: React.FC = () => {- const frame = useCurrentFrame()- const {width, height, fps} = useVideoConfig()- const audioData = useAudioData(music)+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const audioData = useAudioData(music);if (!audioData) {- return null+ return null;}const visualization = visualizeAudio({@@ -52,7 +52,7 @@ export const MyComponent: React.FC = () => {frame,audioData,numberOfSamples: 16,- }) // [0.22, 0.1, 0.01, 0.01, 0.01, 0.02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]+ }); // [0.22, 0.1, 0.01, 0.01, 0.01, 0.02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]// Render a bar chart for each frequency, the higher the amplitude,// the longer the bar@@ -61,12 +61,14 @@ export const MyComponent: React.FC = () => {<Audio src={music} />{visualization.map((v) => {return (- <div style={{width: 1000 * v, height: 15, backgroundColor: 'blue'}} />- )+ <div+ style={{ width: 1000 * v, height: 15, backgroundColor: "blue" }}+ />+ );})}</div>- )-}+ );+};```## See alsodiff --git a/packages/docs/src/data/showcase-videos.tsx b/packages/docs/src/data/showcase-videos.tsxindex e70f7b1eeb..700dda2ec4 100644--- a/packages/docs/src/data/showcase-videos.tsx+++ b/packages/docs/src/data/showcase-videos.tsx@@ -104,8 +104,7 @@ export const showcaseVideos: ShowcaseVideo[] = [},{type: "video",- url:- "https://twitter.com/FlorentPergoud/status/1371874105281159178?s=20",+ url: "https://twitter.com/FlorentPergoud/status/1371874105281159178?s=20",},],author: {@@ -270,8 +269,7 @@ export const showcaseVideos: ShowcaseVideo[] = [},{type: "source_code",- url:- "https://github.com/c0/remotion-playground/blob/main/src/GooBallCSS.jsx",+ url: "https://github.com/c0/remotion-playground/blob/main/src/GooBallCSS.jsx",},],author: {@@ -315,8 +313,7 @@ export const showcaseVideos: ShowcaseVideo[] = [},{type: "website",- url:- "https://www.youtube.com/channel/UCRBZkDc7udWuxrvedrFUbCQ/featured",+ url: "https://www.youtube.com/channel/UCRBZkDc7udWuxrvedrFUbCQ/featured",},],author: {@@ -408,8 +405,7 @@ export const showcaseVideos: ShowcaseVideo[] = [},{type: "website",- url:- "https://www.quantargo.com/blog/2021-02-26-new-course-advanced-data-transformation/",+ url: "https://www.quantargo.com/blog/2021-02-26-new-course-advanced-data-transformation/",},],author: {@@ -657,13 +653,11 @@ export const showcaseVideos: ShowcaseVideo[] = [links: [{type: "video",- url:- "https://discord.com/channels/809501355504959528/817306292590215181/820365999697952790",+ url: "https://discord.com/channels/809501355504959528/817306292590215181/820365999697952790",},],author: {- url:- "https://discord.com/channels/809501355504959528/817306292590215181/820365999697952790",+ url: "https://discord.com/channels/809501355504959528/817306292590215181/820365999697952790",name: "Suthar",},},@@ -753,13 +747,11 @@ export const showcaseVideos: ShowcaseVideo[] = [links: [{type: "video",- url:- "https://www.udemy.com/course/the-cloud-architects-guide-to-cloudfront/",+ url: "https://www.udemy.com/course/the-cloud-architects-guide-to-cloudfront/",},{type: "website",- url:- "https://www.udemy.com/course/the-cloud-architects-guide-to-cloudfront/",+ url: "https://www.udemy.com/course/the-cloud-architects-guide-to-cloudfront/",},],author: {@@ -922,8 +914,7 @@ export const showcaseVideos: ShowcaseVideo[] = [links: [{type: "video",- url:- "https://cdn.ecoeats.uk/videos/merchant-features/06c07944-6d13-4188-8356-d42d744ba54e/raw-pressed-market-street.mp4",+ url: "https://cdn.ecoeats.uk/videos/merchant-features/06c07944-6d13-4188-8356-d42d744ba54e/raw-pressed-market-street.mp4",},],author: {@@ -1010,8 +1001,7 @@ export const showcaseVideos: ShowcaseVideo[] = [},{type: "website",- url:- "https://gorhom.github.io/react-native-bottom-sheet/blog/bottom-sheet-v4/",+ url: "https://gorhom.github.io/react-native-bottom-sheet/blog/bottom-sheet-v4/",},],author: {diff --git a/packages/docs/src/pages/showcase/index.tsx b/packages/docs/src/pages/showcase/index.tsxindex 84fe7af2c5..8dc4eb7247 100644--- a/packages/docs/src/pages/showcase/index.tsx+++ b/packages/docs/src/pages/showcase/index.tsx@@ -46,9 +46,8 @@ const Showcase = () => {const mobileLayout = (containerSize?.width ?? Infinity) < 1200;const mobileHeight = mobileLayout ? containerSize.width : null;- const [userHasInteractedWithPage, setUserHasInteractedWithPage] = useState(- false- );+ const [userHasInteractedWithPage, setUserHasInteractedWithPage] =+ useState(false);const [video, setVideo] = useState<ShowcaseVideo | null>(() => {if (typeof window === "undefined") {return null;