π₯ Make videos programmatically with React
compatibility tables
Jonny Burger071aa3861715
diff --git a/packages/docs/docs/absolute-fill.mdx b/packages/docs/docs/absolute-fill.mdxindex 91223ece4f..48e22342a3 100644--- a/packages/docs/docs/absolute-fill.mdx+++ b/packages/docs/docs/absolute-fill.mdx@@ -73,6 +73,10 @@ In order to make this behave like you expect (row layout):We detect conflicting Tailwind classes and disable the corresponding inline styles if they are present from Remotion v4.0.249.Review the source code below to see how we detect Tailwind classes.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering serverSideRendering player studio hideServers/>+## See also- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/AbsoluteFill.tsx)diff --git a/packages/docs/docs/animatedimage.mdx b/packages/docs/docs/animatedimage.mdxindex c5983e4b73..8d65ea76af 100644--- a/packages/docs/docs/animatedimage.mdx+++ b/packages/docs/docs/animatedimage.mdx@@ -86,6 +86,10 @@ You can add a [React ref](https://react.dev/learn/manipulating-the-dom-with-refs- `<AnimatedImage>` uses the [`ImageDecoder`](https://developer.mozilla.org/en-US/docs/Web/API/ImageDecoder) Web API, which has limited browser support.- `<AnimatedImage>` does not support the `onLoad` prop.+## Compatibility++<CompatibilityTable chrome firefox safari={false} nodejs="" bun="" serverlessFunctions="" clientSideRendering serverSideRendering player studio hideServers />+## See also- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/animated-image/AnimatedImage.tsx)diff --git a/packages/docs/docs/artifact.mdx b/packages/docs/docs/artifact.mdxindex 903f446f58..f6acf8dabf 100644--- a/packages/docs/docs/artifact.mdx+++ b/packages/docs/docs/artifact.mdx@@ -80,6 +80,10 @@ export const MyComp: React.FC = () => {See the [Emitting Thumbnails](/docs/artifacts#emitting-thumbnails) page for more important information.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering serverSideRendering player="No-op" studio="No-op" hideServers />+## See also- [Emitting Artifacts](/docs/artifacts)diff --git a/packages/docs/docs/calculate-metadata.mdx b/packages/docs/docs/calculate-metadata.mdxindex 64f520c749..0fe957ab25 100644--- a/packages/docs/docs/calculate-metadata.mdx+++ b/packages/docs/docs/calculate-metadata.mdx@@ -118,6 +118,10 @@ The function must resolve within the [timeout](/docs/delay-render#timeout).The function will get executed every time the props in the [Remotion Studio](/docs/visual-editing) changes.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs bun serverlessFunctions clientSideRendering serverSideRendering player={false} studio />+## See also- [`<Composition>`](/docs/composition)diff --git a/packages/docs/docs/cancel-render.mdx b/packages/docs/docs/cancel-render.mdxindex 507e071562..6be7762463 100644--- a/packages/docs/docs/cancel-render.mdx+++ b/packages/docs/docs/cancel-render.mdx@@ -65,9 +65,9 @@ const MyComp: React.FC = () => {## `cancelRender()` throws an error-`cancelRender()` also throws an error, so any code after it will not be executed.-In [browser rendering](/docs/miscellaneous/render-in-browser), this might lead to an unhandled error that will create noise in your console or error overlay.+`cancelRender()` also throws an error, so any code after it will not be executed.+In [client-side rendering](/docs/miscellaneous/render-in-browser), this is not caught by [`renderMediaOnWeb()`](/docs/web-renderer/render-media-on-web) or [`renderStillOnWeb()`](/docs/web-renderer/render-still-on-web) and is an unhandled error.Wrap `cancelRender()` in a `try`/`catch` block to avoid this:```tsx twoslash title="β Best practice - wrap cancelRender() in a try/catch block" {4-7}@@ -82,6 +82,10 @@ try {}```+## Compatibility++<CompatibilityTable chrome firefox safari nodejs={false} bun={false} serverlessFunctions={false} clientSideRendering serverSideRendering player="Throws error" studio="Throws error" hideBrowsers />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/cancel-render.ts)diff --git a/packages/docs/docs/composition.mdx b/packages/docs/docs/composition.mdxindex b6fa11e3c3..7d6e2bec2b 100644--- a/packages/docs/docs/composition.mdx+++ b/packages/docs/docs/composition.mdx@@ -2,7 +2,7 @@image: /generated/articles-docs-composition.pngid: compositiontitle: <Composition>-crumb: "API"+crumb: 'API'---This is the component to use to register a video to make it renderable and make it show up in the sidebar of the Remotion development interface.@@ -13,20 +13,12 @@ A composition represents the video you want to create, as a collection of clipsconst Component: React.FC = () => null;// ---cut----import { Composition } from "remotion";+import {Composition} from 'remotion';export const RemotionRoot: React.FC = () => {return (<>- <Composition- component={Component}- durationInFrames={300}- width={1080}- height={1080}- fps={30}- id="test-render"- defaultProps={{}}- />+ <Composition component={Component} durationInFrames={300} width={1080} height={1080} fps={30} id="test-render" defaultProps={{}} />{/* Additional compositions can be rendered */}</>);@@ -108,20 +100,13 @@ 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 (<>- <Composition- id="my-comp"- component={MyComp}- width={1080}- height={1080}- fps={30}- durationInFrames={3 * 30}- />+ <Composition id="my-comp" component={MyComp} width={1080} height={1080} fps={30} durationInFrames={3 * 30} /></>);};@@ -133,14 +118,7 @@ export const MyVideo = () => {export const MyVideo = () => {return (<>- <Composition- id="my-comp"- lazyComponent={() => import("./LazyComponent")}- width={1080}- height={1080}- fps={30}- durationInFrames={3 * 30}- />+ <Composition id="my-comp" lazyComponent={() => import('./LazyComponent')} width={1080} height={1080} fps={30} durationInFrames={3 * 30} /></>);};@@ -151,41 +129,31 @@ export const MyVideo = () => {You can use the [`<Folder />`](/docs/folder) component to organize your compositions in the sidebar.```tsx twoslash-import React from "react";+import React from 'react';const Component: React.FC = () => null;// ---cut----import { Composition, Folder } from "remotion";+import {Composition, Folder} from 'remotion';export const Video = () => {return (<><Folder name="Visuals">- <Composition- id="CompInFolder"- durationInFrames={100}- fps={30}- width={1080}- height={1080}- component={Component}- />+ <Composition id="CompInFolder" durationInFrames={100} fps={30} width={1080} height={1080} component={Component} /></Folder>- <Composition- id="CompOutsideFolder"- durationInFrames={100}- fps={30}- width={1080}- height={1080}- component={Component}- />+ <Composition id="CompOutsideFolder" durationInFrames={100} fps={30} width={1080} height={1080} component={Component} /></>);};```+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering={false} serverSideRendering player={false} studio hideServers />+## See also- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/Composition.tsx)-- [registerRoot()](/docs/register-root)+- [`registerRoot()`](/docs/register-root)- [The fundamentals](/docs/the-fundamentals)- [CLI options](/docs/cli)- [`<Sequence />`](/docs/sequence)diff --git a/packages/docs/docs/continue-render.mdx b/packages/docs/docs/continue-render.mdxindex 13ca082d1d..210e35c21b 100644--- a/packages/docs/docs/continue-render.mdx+++ b/packages/docs/docs/continue-render.mdx@@ -7,9 +7,13 @@ crumb: 'API'import {Redirect} from '@docusaurus/router';-Using `continueRender`, you can unblock a rendering that has been deferred using [`delayRender()`](/docs/delay-render).+Using `continueRender`, you can unblock a rendering that has been deferred using [`delayRender()`](/docs/delay-render).To learn how to use the function, read the documentation of [`delayRender()`](/docs/delay-render).+## Compatibility++<CompatibilityTable chrome firefox safari nodejs={'No-op'} bun={'No-op'} serverlessFunctions="No-op" clientSideRendering="Use useContinueRender()" serverSideRendering player="No-op" studio="No-op" hideServers />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/delay-render.ts)diff --git a/packages/docs/docs/delay-render.mdx b/packages/docs/docs/delay-render.mdxindex dda914aa24..b027961ce2 100644--- a/packages/docs/docs/delay-render.mdx+++ b/packages/docs/docs/delay-render.mdx@@ -253,6 +253,10 @@ const MyComp: React.FC = () => {};```+## Compatibility++<CompatibilityTable chrome firefox safari nodejs={'No-op'} bun={'No-op'} serverlessFunctions="No-op" clientSideRendering="Use useDelayRender()" serverSideRendering player="No-op" studio="No-op" hideServers />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/delay-render.ts)diff --git a/packages/docs/docs/easing.mdx b/packages/docs/docs/easing.mdxindex 1132a34b4e..b830d577c4 100644--- a/packages/docs/docs/easing.mdx+++ b/packages/docs/docs/easing.mdx@@ -304,6 +304,10 @@ Makes any easing function symmetrical. The easing function will run forwards forThe Easing API is the exact same as the one from [React Native](https://reactnative.dev/docs/easing) and the documentation has been copied over. Credit goes to them for this excellent API.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs bun serverlessFunctions clientSideRendering serverSideRendering player studio />+## See also- [Source code for this helper](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/easing.ts)diff --git a/packages/docs/docs/folder.mdx b/packages/docs/docs/folder.mdxindex 69031c4fb4..950bf322a6 100644--- a/packages/docs/docs/folder.mdx+++ b/packages/docs/docs/folder.mdx@@ -2,7 +2,7 @@image: /generated/articles-docs-folder.pngtitle: <Folder>id: folder-crumb: "API"+crumb: 'API'---_Available from v3.0.1_@@ -12,32 +12,18 @@ By wrapping a [`<Composition />`](/docs/composition) inside a `<Folder />`, you## Example```tsx twoslash-import React from "react";+import React from 'react';const Component: React.FC = () => null;// ---cut----import { Composition, Folder } from "remotion";+import {Composition, Folder} from 'remotion';export const Video = () => {return (<><Folder name="Visuals">- <Composition- id="CompInFolder"- durationInFrames={100}- fps={30}- width={1080}- height={1080}- component={Component}- />+ <Composition id="CompInFolder" durationInFrames={100} fps={30} width={1080} height={1080} component={Component} /></Folder>- <Composition- id="CompOutsideFolder"- durationInFrames={100}- fps={30}- width={1080}- height={1080}- component={Component}- />+ <Composition id="CompOutsideFolder" durationInFrames={100} fps={30} width={1080} height={1080} component={Component} /></>);};@@ -45,7 +31,7 @@ export const Video = () => {will create a tree structure in the sidebar that looks like this:-<img src="/img/folders.png"/>+<img src="/img/folders.png" />## Folder behavior@@ -53,6 +39,10 @@ will create a tree structure in the sidebar that looks like this:- Folder names can only contain `a-z`, `A-Z`, `0-9` and `-`.- Folders can be nested.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs={false} bun={false} serverlessFunctions={false} clientSideRendering={false} serverSideRendering player={false} studio hideServers />+## See also- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/Folder.tsx)diff --git a/packages/docs/docs/freeze.mdx b/packages/docs/docs/freeze.mdxindex b74945993e..8bb6ca4773 100644--- a/packages/docs/docs/freeze.mdx+++ b/packages/docs/docs/freeze.mdx@@ -67,6 +67,10 @@ const MyVideo = () => {<FreezeExample />+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering serverSideRendering player studio hideServers />+## See also- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/freeze.tsx)diff --git a/packages/docs/docs/get-input-props.mdx b/packages/docs/docs/get-input-props.mdxindex 337d5cb461..dee996eee0 100644--- a/packages/docs/docs/get-input-props.mdx+++ b/packages/docs/docs/get-input-props.mdx@@ -67,6 +67,10 @@ export const Root: React.FC = () => {In this example, the props also get passed to the component of the composition with the id `my-composition`.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs={'No-op, returns {}'} bun={'No-op, returns {}'} serverlessFunctions={'No-op, returns {}'} clientSideRendering={'No-op, returns {}'} serverSideRendering player={'No-op, returns {}'} studio />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/config/input-props.ts)diff --git a/packages/docs/docs/get-remotion-environment.mdx b/packages/docs/docs/get-remotion-environment.mdxindex b0dceea99b..4e90962b3d 100644--- a/packages/docs/docs/get-remotion-environment.mdx+++ b/packages/docs/docs/get-remotion-environment.mdx@@ -49,9 +49,13 @@ export const MyComp: React.FC = () => {A more realistic use case: You might want to debounce a request during editing in the Remotion Studio, but not during rendering. See: [debouncing requests](/docs/data-fetching#debouncing-requests)+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="All false" bun="All false" serverlessFunctions="All false" clientSideRendering="Use useRemotionEnvironment()" serverSideRendering player studio />+## See also-- [useRemotionEnvironment()](/docs/use-remotion-environment) - a new preferred way to get the environment information- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/get-remotion-environment.ts)-- [useVideoConfig()](/docs/use-video-config)+- [`useRemotionEnvironment()`](/docs/use-remotion-environment) - a new preferred way to get the environment information+- [`useVideoConfig()`](/docs/use-video-config)- [`<OffthreadVideo/> while rendering`](/docs/video-tags#using-a-different-tag-in-preview-and-rendering)diff --git a/packages/docs/docs/get-static-files.mdx b/packages/docs/docs/get-static-files.mdxindex 995db54ed6..c2fff3f031 100644--- a/packages/docs/docs/get-static-files.mdx+++ b/packages/docs/docs/get-static-files.mdx@@ -80,6 +80,10 @@ For performance, only the first 10000 items are fetched and displayed.Before v4.0.64, only the first 1000 items were displayed.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs={'Empty array'} bun={'Empty array'} serverlessFunctions={'Empty array'} clientSideRendering="If in Studio, otherwise empty array" serverSideRendering player={'Empty array'} studio />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/get-static-files.ts)diff --git a/packages/docs/docs/html5-audio.mdx b/packages/docs/docs/html5-audio.mdxindex 4ee1530358..9a277191df 100644--- a/packages/docs/docs/html5-audio.mdx+++ b/packages/docs/docs/html5-audio.mdx@@ -232,6 +232,10 @@ Deprecated since v4.0.279: This prop intended to opt into setting the volume toThe option does not make sense anymore, because it is now possible to set the volume higher than `1`.To prevent synthetic amplification, set a volume not higher than 1.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering={false} serverSideRendering player studio hideServers />+## See also- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/audio/Audio.tsx)diff --git a/packages/docs/docs/html5-video.mdx b/packages/docs/docs/html5-video.mdxindex 6471e1e988..1a0c602bae 100644--- a/packages/docs/docs/html5-video.mdx+++ b/packages/docs/docs/html5-video.mdx@@ -317,6 +317,10 @@ See: [Which video formats does Remotion support?](/docs/miscellaneous/video-formTo decide which tag to use, see: [Comparison of video tags](/docs/video-tags)+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering={false} serverSideRendering player studio hideServers />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/video/Video.tsx)diff --git a/packages/docs/docs/iframe.mdx b/packages/docs/docs/iframe.mdxindex 69a1fcec94..f0051b8e09 100644--- a/packages/docs/docs/iframe.mdx+++ b/packages/docs/docs/iframe.mdx@@ -2,7 +2,7 @@image: /generated/articles-docs-iframe.pngtitle: <IFrame>id: iframe-crumb: "API"+crumb: 'API'---The `<IFrame />` can be used like the regular `<iframe>` HTML tag.@@ -15,7 +15,7 @@ Ideally, the website should not have any animations, since only animations using## Example```tsx twoslash-import { IFrame } from "remotion";+import {IFrame} from 'remotion';export const MyComp: React.FC = () => {return <IFrame src="https://remotion.dev" />;@@ -37,6 +37,10 @@ Customize the [timeout](/docs/delay-render#modifying-the-timeout) of the [`delayCustomize the [number of retries](/docs/delay-render#retrying) of the [`delayRender()`](/docs/delay-render) call that this component makes.Prefer the [`maxRetries`](/docs/img#maxretries) prop over this.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering={false} serverSideRendering player studio hideServers />+## See also- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/IFrame.tsx)diff --git a/packages/docs/docs/img.mdx b/packages/docs/docs/img.mdxindex f4dcd9af6c..ac7ab20149 100644--- a/packages/docs/docs/img.mdx+++ b/packages/docs/docs/img.mdx@@ -106,6 +106,10 @@ In earlier versions, failing to load an image would lead to an error message in- The maximum resolution that Chrome can display is `2^29` pixels (539 megapixels) <sup><a href="https://stackoverflow.com/questions/57223559/what-is-the-maximum-image-dimensions-supported-in-desktop-chrome#:~:text=than%202%5E29-,(539MP)">[source]</a></sup>. Remotion inherits this restriction.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering serverSideRendering player studio hideServers />+## See also- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/Img.tsx)diff --git a/packages/docs/docs/interpolate-colors.mdx b/packages/docs/docs/interpolate-colors.mdxindex f0946e8b3c..7ebc09652c 100644--- a/packages/docs/docs/interpolate-colors.mdx+++ b/packages/docs/docs/interpolate-colors.mdx@@ -2,104 +2,92 @@image: /generated/articles-docs-interpolate-colors.pngtitle: interpolateColors()id: interpolate-colors-crumb: "API"+crumb: 'API'---_Available from v2.0.3_Allows you to map a range of values to colors using a concise syntax.-## Reference+## API-### Params+Takes three arguments:1. The input value.2. The range of values that you expect the input to assume.3. The range of output colors that you want the input to map to.-### Returns+## Returns-`interpolateColors()` returns a `rgba` color string. eg: `rgba(255, 100, 12, 1)`+A `rgba` color string. eg: `rgba(255, 100, 12, 1)`-## Example: interpolate colors+## ExampleIn this example, we are interpolating colors from red to yellow. At frame 0 (the start of the video), we want the color to be `red`. At frame 20, we want the color to be `yellow`.Using 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 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+## Interpolating `rgb` or `rgba` colorsIn this example, we are interpolating colors from red to yellow. At frame 0 (the start of the video), we want the color to be `red` (`rgb(255, 0, 0)`). At frame 20, we want the color to be `yellow` (`rgba(255, 255, 0)`).Using 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// RGB colors-const color = interpolateColors(- frame,- [0, 20],- ["rgb(255, 0, 0)", "rgb(255, 255, 0)"]-); // rgba(255, 128, 0, 1)+const color = interpolateColors(frame, [0, 20], ['rgb(255, 0, 0)', 'rgb(255, 255, 0)']); // rgba(255, 128, 0, 1)// RGBA colors-const color2 = interpolateColors(- frame,- [0, 20],- ["rgba(255, 0, 0, 1)", "rgba(255, 255, 0, 0)"]-); // rgba(255, 128, 0, 0.5)+const color2 = interpolateColors(frame, [0, 20], ['rgba(255, 0, 0, 1)', 'rgba(255, 255, 0, 0)']); // rgba(255, 128, 0, 0.5)```-## Example: interpolate `hsl` or `hsla` colors+## Interpolating `hsl` or `hsla` colorsIn this example, we are interpolating colors from red to yellow. At frame 0 (the start of the video), we want the color to be `red` (`hsl(0, 100%, 50%)`). At frame 20, we want the color to be `yellow` (`hsl(60, 100%, 50%)`).Using 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//hsl example-const color = interpolateColors(- frame,- [0, 20],- ["hsl(0, 100%, 50%)", "hsl(60, 100%, 50%)"]-); // rgba(255, 128, 0, 1)+const color = interpolateColors(frame, [0, 20], ['hsl(0, 100%, 50%)', 'hsl(60, 100%, 50%)']); // rgba(255, 128, 0, 1)//hsla example-const color2 = interpolateColors(- frame,- [0, 20],- ["hsla(0, 100%, 50%, 1)", "hsla(60, 100%, 50%, 1)"]-); // rgba(255, 128, 0, 1)+const color2 = interpolateColors(frame, [0, 20], ['hsla(0, 100%, 50%, 1)', 'hsla(60, 100%, 50%, 1)']); // rgba(255, 128, 0, 1)```-## Example: interpolate color names+## Interpolating color namesInterpolating CSS color names is also supported.```ts twoslash-import { useCurrentFrame, interpolateColors } from "remotion";+import {useCurrentFrame, interpolateColors} from 'remotion';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)```+## Compatibility++<CompatibilityTable chrome firefox safari nodejs bun serverlessFunctions clientSideRendering serverSideRendering player studio />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/interpolate-colors.ts)diff --git a/packages/docs/docs/interpolate.mdx b/packages/docs/docs/interpolate.mdxindex 1f2040877b..6a11706aca 100644--- a/packages/docs/docs/interpolate.mdx+++ b/packages/docs/docs/interpolate.mdx@@ -2,15 +2,10 @@image: /generated/articles-docs-interpolate.pngtitle: interpolate()id: interpolate-crumb: "API"+crumb: 'API'----<YouTube- minutes={6}- href="https://www.youtube.com/watch?v=sff_CdWw_-c"- thumb="https://i.ytimg.com/vi/sff_CdWw_-c/hqdefault.jpg?sqp=-oaymwEcCPYBEIoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDPXdTFxf6qNNfkSr_91y0xVTXaXQ"- title="How to interpolate()"-/>+<YouTube minutes={6} href="https://www.youtube.com/watch?v=sff_CdWw_-c" thumb="https://i.ytimg.com/vi/sff_CdWw_-c/hqdefault.jpg?sqp=-oaymwEcCPYBEIoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDPXdTFxf6qNNfkSr_91y0xVTXaXQ" title="How to interpolate()" />Allows you to map a range of values to another using a concise syntax.@@ -23,7 +18,7 @@ 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(); // 10const opacity = interpolate(frame, [0, 20], [0, 1]); // 0.5@@ -38,10 +33,10 @@ 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 {durationInFrames} = useVideoConfig();const opacity = interpolate(frame,[0, 20, durationInFrames - 20, durationInFrames],@@ -88,7 +83,7 @@ We can then apply it to an HTML element.// @include: example-springconst 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@@ -96,7 +91,7 @@ const Component: React.FC = () => <div style={{ marginLeft }}></div>;Consider the following interpolation which is supposed to animate the scale over 20 frames:```tsx twoslash-import { interpolate, useCurrentFrame } from "remotion";+import {interpolate, useCurrentFrame} from 'remotion';const frame = useCurrentFrame();// ---cut---const scale = interpolate(frame, [0, 20], [0, 1]);@@ -106,26 +101,24 @@ This works, but after 20 frames, the value keeps growing. For example, at frameTo 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";+import {interpolate, useCurrentFrame} from 'remotion';const frame = useCurrentFrame();// ---cut---const scale = interpolate(frame, [0, 20], [0, 1], {- extrapolateRight: "clamp",+ extrapolateRight: 'clamp',});```-## Reference+## API-### Params+Takes four arguments:1. The input value.2. The range of values that you expect the input to assume.3. The range of output values that you want the input to map to.-4. Options object.+4. Options object:-### Options--#### extrapolateLeft+### extrapolateLeft?_Default_: `extend`@@ -136,7 +129,7 @@ What should happen if the input value is outside the left side of the input rang- `wrap`: Loops the value change.- `identity`: Return the input value instead.-#### extrapolateRight+### extrapolateRight?_Default_: `extend`@@ -145,15 +138,15 @@ 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: "wrap" }); // 1+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: 'wrap'}); // 1```-#### easing+### easing?_Default_: `(x) => x`@@ -161,22 +154,22 @@ 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";+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',});```@@ -185,12 +178,16 @@ interpolate(frame, [0, 10, 40, 100], [0, 0.2, 0.6, 1], {Since `v3.3.77`, types for the options are exported from Remotion.```tsx twoslash-import { ExtrapolateType, InterpolateOptions } from "remotion";+import {ExtrapolateType, InterpolateOptions} from 'remotion';-const extrapolate: ExtrapolateType = "clamp";-const option: InterpolateOptions = { extrapolateLeft: extrapolate };+const extrapolate: ExtrapolateType = 'clamp';+const option: InterpolateOptions = {extrapolateLeft: extrapolate};```+## Compatibility++<CompatibilityTable chrome firefox safari nodejs bun serverlessFunctions clientSideRendering serverSideRendering player studio />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/interpolate.ts)diff --git a/packages/docs/docs/loop.mdx b/packages/docs/docs/loop.mdxindex 9f0e144a5f..eb994dd9f3 100644--- a/packages/docs/docs/loop.mdx+++ b/packages/docs/docs/loop.mdx@@ -2,13 +2,10 @@image: /generated/articles-docs-loop.pngid: looptitle: <Loop>-crumb: "API"+crumb: 'API'----import {- LoopExamples,- BlueSquare,-} from "../components/LoopExamples/LoopExamples";+import {LoopExamples, BlueSquare} from '../components/LoopExamples/LoopExamples';```twoslash include exampleconst BlueSquare: React.FC = () => <div></div>@@ -21,7 +18,7 @@ The `<Loop />` component allows you to quickly lay out an animation so it repeat```tsx twoslash title="MyComp.tsx"// @include: example-BlueSquare-import { Loop } from "remotion";+import {Loop} from 'remotion';// ---cut---const MyComp = () => {return (@@ -86,7 +83,7 @@ const MyComp = () => {```tsx twoslash// @include: example-BlueSquare-import { Loop } from "remotion";+import {Loop} from 'remotion';// ---cut---const MyComp = () => {return (@@ -104,7 +101,7 @@ const MyComp = () => {```tsx twoslash// @include: example-BlueSquare-import { Loop } from "remotion";+import {Loop} from 'remotion';// ---cut---const MyComp = () => {return (@@ -122,7 +119,7 @@ const MyComp = () => {```tsx twoslash// @include: example-BlueSquare-import { Loop } from "remotion";+import {Loop} from 'remotion';// ---cut---const MyComp = () => {return (@@ -146,8 +143,8 @@ If inside a loop, an object with two properties is returned:- `iteration`: The current iteration of the loop, starting at 0.```tsx twoslash-import React from "react";-import { Loop, useCurrentFrame } from "remotion";+import React from 'react';+import {Loop, useCurrentFrame} from 'remotion';const LoopedVideo: React.FC = () => {return (@@ -172,6 +169,10 @@ const Child = () => {};```+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering serverSideRendering player studio hideServers />+## See also- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/loop/index.tsx)diff --git a/packages/docs/docs/measure-spring.mdx b/packages/docs/docs/measure-spring.mdxindex f2d381adff..bbd851bd96 100644--- a/packages/docs/docs/measure-spring.mdx+++ b/packages/docs/docs/measure-spring.mdx@@ -62,6 +62,10 @@ _optional - default: `1`_The end value of the animation. Note that depending on the parameters, spring animations may overshoot the target a bit, before they bounce back to their final target.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs bun serverlessFunctions clientSideRendering serverSideRendering player studio />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/spring/measure-spring.ts)diff --git a/packages/docs/docs/offthreadvideo.mdx b/packages/docs/docs/offthreadvideo.mdxindex d14f3ad402..11c9f42150 100644--- a/packages/docs/docs/offthreadvideo.mdx+++ b/packages/docs/docs/offthreadvideo.mdx@@ -426,6 +426,10 @@ The following codecs can be read by `<OffthreadVideo>`:- AV1 (from _v4.0.6_)- ProRes+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering={false} serverSideRendering player studio hideServers />+## See also- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/video/OffthreadVideo.tsx)diff --git a/packages/docs/docs/prefetch.mdx b/packages/docs/docs/prefetch.mdxindex e3074d9ab8..c4e3b0621c 100644--- a/packages/docs/docs/prefetch.mdx+++ b/packages/docs/docs/prefetch.mdx@@ -137,6 +137,10 @@ This can lead to the video file not playing correctly in the browser. If you canThis issue may arise in Safari specifically. We recommend testing your implementation in Safari after you coded it.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs={'No-op'} bun={'No-op'} serverlessFunctions="No-op" clientSideRendering={'No-op'} serverSideRendering={'No-op'} player studio />+## See also- [`@remotion/preload`](/docs/preload)diff --git a/packages/docs/docs/random.mdx b/packages/docs/docs/random.mdxindex a36435a3bb..293f03bd53 100644--- a/packages/docs/docs/random.mdx+++ b/packages/docs/docs/random.mdx@@ -39,6 +39,10 @@ const random = (seed: number | string | null) => Math.random();random(null) === random(null); // false```+## Compatibility++<CompatibilityTable chrome firefox safari nodejs bun serverlessFunctions clientSideRendering serverSideRendering player studio />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/random.ts)diff --git a/packages/docs/docs/register-root.mdx b/packages/docs/docs/register-root.mdxindex 5c8248ca5c..7b223480cc 100644--- a/packages/docs/docs/register-root.mdx+++ b/packages/docs/docs/register-root.mdx@@ -2,7 +2,7 @@image: /generated/articles-docs-register-root.pngid: register-roottitle: registerRoot()-crumb: "API"+crumb: 'API'---`registerRoot` is a function that registers the root component of the Remotion project. In the root component, one or multiple compositions should be returned (in the case of multiple compositions, they should be wrapped in a React Fragment).@@ -19,8 +19,8 @@ export const RemotionRoot = () => <></>;// @filename: index.ts// ---cut----import { registerRoot } from "remotion";-import { RemotionRoot } from "./Root";+import {registerRoot} from 'remotion';+import {RemotionRoot} from './Root';registerRoot(RemotionRoot);```@@ -34,30 +34,16 @@ export default () => <></>;export default () => <></>;// @filename: index.tsx-import { Composition } from "remotion";+import {Composition} from 'remotion';// ---cut----import MyComponent from "./MyComponent";-import MyOtherComponent from "./MyOtherComponent";+import MyComponent from './MyComponent';+import MyOtherComponent from './MyOtherComponent';export const RemotionRoot = () => {return (<>- <Composition- id="comp"- fps={30}- height={1080}- width={1920}- durationInFrames={90}- component={MyComponent}- />- <Composition- id="anothercomp"- fps={30}- height={1080}- width={1920}- durationInFrames={90}- component={MyOtherComponent}- />+ <Composition id="comp" fps={30} height={1080} width={1920} durationInFrames={90} component={MyComponent} />+ <Composition id="anothercomp" fps={30} height={1080} width={1920} durationInFrames={90} component={MyOtherComponent} /></>);};@@ -75,14 +61,18 @@ export const RemotionRoot = () => <></>;const loadWebAssembly = () => Promise.resolve();// ---cut----import { continueRender, delayRender, registerRoot } from "remotion";-import { RemotionRoot } from "./Root";+import {continueRender, delayRender, registerRoot} from 'remotion';+import {RemotionRoot} from './Root';loadWebAssembly().then(() => {registerRoot(RemotionRoot);});```+## Compatibility++<CompatibilityTable chrome firefox safari nodejs={false} bun={false} serverlessFunctions={false} clientSideRendering={false} serverSideRendering player={false} studio />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/register-root.ts)diff --git a/packages/docs/docs/sequence.mdx b/packages/docs/docs/sequence.mdxindex 8e064aa1c7..2821b7d18e 100644--- a/packages/docs/docs/sequence.mdx+++ b/packages/docs/docs/sequence.mdx@@ -40,28 +40,9 @@ const MyTrailer = () => {};```-<sub>- <em>- <code><Intro></code>- </em>{' '}- will show from frame 0-29.-</sub>-<br />-<sub>- <em>- <code><Clip></code>- </em>{' '}- will show from frame 30 on until frame 59.-</sub>-<br />-<sub>- <em>- <code><Outro></code>- </em>{' '}- will show from frame 60 on until the end of the composition.-</sub>-<br />-<br />+- `<Intro>` will show from frame 0β29.+- `<Clip>` will show from frame 30 until frame 59.+- `<Outro>` will show from frame 60 until the end of the composition.All children of a `<Sequence>` that call [`useCurrentFrame()`](/docs/use-current-frame) will receive a value that is shifted by [`from`](#from).@@ -82,15 +63,8 @@ const MyTrailer = () => {};```-<sub>- At frame <code>0</code>, this would render <code><div>0</div></code>.-</sub>-<br />-<sub>- At frame <code>30</code>, this would render <code><div>30</div><div>0</div></code>.-</sub>-<br />-<br />+- At frame `0`, this would render `<div>0</div>`.+- At frame `30`, this would render `<div>30</div><div>0</div>`.Using the [`durationInFrames`](#durationinframes) prop, you can define for how long the children of a `<Sequence>` should be mounted.@@ -207,78 +181,56 @@ See the [`<Series />`](/docs/series) helper component, which helps you calculateThe Sequence component is a high order component and accepts, besides children, the following props:-### `from`+### `from?`-_optional_ (From v3.2.36, _required_ in previous versions)+(optional from v3.2.36, _required_ in previous versions)At which frame it's children should assume the video starts. When the sequence is at `frame`, it's children are at frame `0`.From v3.2.36 onwards, this prop will be optional; by default, it will be 0.-### `durationInFrames`--_optional_+### `durationInFrames?`For how many frames the sequence should be displayed. Children are unmounted if they are not within the time range of display. By default it will be `Infinity` to avoid limit the duration of the sequence.-### `height`<AvailableFrom v="4.0.80"/>--_optional_+### `height?`<AvailableFrom v="4.0.80"/>Gives the sequence a specific `style={{height: height}}` style and overrides `height` that is returned by the [`useVideoConfig()`](/docs/use-video-config) hook in child components. Useful for including a component that was designed for a specific height.-### `width`<AvailableFrom v="4.0.80"/>--_optional_+### `width?`<AvailableFrom v="4.0.80"/>Gives the sequence a specific `style={{width: width}}` style and overrides `width` that is returned by the [`useVideoConfig()`](/docs/use-video-config) hook in child components. Useful for including a component that was designed for a specific width.-### `name`--_optional_+### `name?`You can give your sequence a name and it will be shown as the label of the sequence in the timeline of the Remotion Studio. This property is purely for helping you keep track of sequences in the timeline.-### `layout`--_optional_+### `layout?`Either `"absolute-fill"` _(default)_ or `"none"`. By default, your sequences will be absolutely positioned, so they will overlay each other. If you would like to opt out of it and handle layouting yourself, pass `layout="none"`. Available since v1.4.-### `style`<AvailableFrom v="3.0.27"/>--_optional_+### `style?`<AvailableFrom v="3.0.27"/>CSS styles to be applied to the container. If `layout` is set to `none`, there is no container and setting this style is not allowed.-### `className`<AvailableFrom v="3.3.45"/>--_optional_+### `className?`<AvailableFrom v="3.3.45"/>A class name to be applied to the container. If `layout` is set to `none`, there is no container and setting this style is not allowed.-### `premountFor`<AvailableFrom v="4.0.140" />--_optional_+### `premountFor?`<AvailableFrom v="4.0.140" />[Premount](/docs/player/premounting) the sequence for a set number of frames.-### `postmountFor`<AvailableFrom v="4.0.340" />--_optional_+### `postmountFor?`<AvailableFrom v="4.0.340" />Same as `premountFor`, but for after the sequence has ended.Use this only if you expect the user to frequently seek backwards in the timeline and you want to avoid flickers for this behavior.-### `styleWhilePremounted`<AvailableFrom v="4.0.252" />--_optional_+### `styleWhilePremounted?`<AvailableFrom v="4.0.252" />CSS styles to be applied to the container while the sequence is premounted.The `style` is still applied, but `styleWhilePremounted` can override properties.-### `showInTimeline`<AvailableFrom v="4.0.110" />--_optional_+### `showInTimeline?`<AvailableFrom v="4.0.110" />If set to `false`, the track will not be shown in the Studio's timeline.Child `<Sequence>`'s will show by default, unless `showInTimeline` is also set to false.@@ -306,7 +258,12 @@ const MyComp = () => {## Note for `@remotion/three`-A `<Sequence>` by default will return a `<div>` component which is not allowed inside a [`<ThreeCanvas>`](/docs/three-canvas). Avoid an error by passing `layout="none"` to `<Sequence>`. Example: `<Sequence layout="none">`.+A `<Sequence>` by default will return a `<div>` component which is not allowed inside a [`<ThreeCanvas>`](/docs/three-canvas).+Avoid an error by passing `layout="none"` to `<Sequence>`. Example: `<Sequence layout="none">`.++## Compatibility++<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering serverSideRendering player studio hideServers />## See alsodiff --git a/packages/docs/docs/series.mdx b/packages/docs/docs/series.mdxindex 5a453b1649..1146b3a07f 100644--- a/packages/docs/docs/series.mdx+++ b/packages/docs/docs/series.mdx@@ -2,12 +2,12 @@image: /generated/articles-docs-series.pngid: seriestitle: <Series>-crumb: "API"+crumb: 'API'---_Available from v.2.3.1_-import { SeriesExample } from "../components/SeriesExamples/SeriesExample";+import {SeriesExample} from '../components/SeriesExamples/SeriesExample';Using this component, you can easily stitch together scenes that should play sequentially after another.@@ -23,19 +23,19 @@ const Square: React.FC<{color: string}> = () => <div></div>```tsx twoslash title="src/Example.tsx"// @include: example-Square// ---cut----import { Series } from "remotion";+import {Series} from 'remotion';export const Example: React.FC = () => {return (<Series><Series.Sequence durationInFrames={40}>- <Square color={"#3498db"} />+ <Square color={'#3498db'} /></Series.Sequence><Series.Sequence durationInFrames={20}>- <Square color={"#5ff332"} />+ <Square color={'#5ff332'} /></Series.Sequence><Series.Sequence durationInFrames={70}>- <Square color={"#fdc321"} />+ <Square color={'#fdc321'} /></Series.Sequence></Series>);@@ -48,19 +48,16 @@ export const Example: React.FC = () => {## API-The `<Series />` component takes no props may only contain a list of `<Series.Sequence />` instances. A `<Series.Sequence />` component takes the following props:+The `<Series />` component takes no props. It may only contain a list of `<Series.Sequence />` instances.+A `<Series.Sequence />` component accepts the following props:-This component is a high order component, and accepts, besides it's children, the following props:--### `durationInFrames`+### `durationInFrames?`For how many frames the sequence should be displayed. Children are unmounted if they are not within the time range of display.Only the last `<Series.Sequence />` instance is allowed to have `Infinity` as a duration, all previous one must have a positive integer.-### `offset`--_optional_+### `offset?`Pass a positive number to delay the beginning of the sequence. Pass a negative number to start the sequence earlier, and to overlay the sequence with the one that comes before.@@ -69,33 +66,23 @@ The offset does not apply to sequences that come before, but the sequences that**Example 1**: Pass `10` to delay the sequence by 10 frames and create a blank space of 10 frames before it.**Example 2**: Pass `-10` to start the sequence earlier and overlay the sequence on top of the previous one for 10 frames.-### `layout`--_optional_+### `layout?`Either `"absolute-fill"` _(default)_ or `"none"` By default, your sequences will be absolutely positioned, so they will overlay each other. If you would like to opt out of it and handle layouting yourself, pass `layout="none"`.-### `style`<AvailableFrom v="3.3.4"/>--_optional_+### `style?`<AvailableFrom v="3.3.4"/>CSS styles to be applied to the container. If `layout` is set to `none`, there is no container and setting this style is not allowed.-### `className`<AvailableFrom v="3.3.45"/>--_optional_+### `className?`<AvailableFrom v="3.3.45"/>A class name to be applied to the container. If `layout` is set to `none`, there is no container and setting this style is not allowed.-### `premountFor`<AvailableFrom v="4.0.140"/>--_optional_+### `premountFor?`<AvailableFrom v="4.0.140"/>[Premount](/docs/player/premounting) the sequence for a set number of frames.-### `ref`<AvailableFrom v="3.3.4" />--_optional_+### `ref?`<AvailableFrom v="3.3.4" />You can add a [React ref](https://react.dev/learn/manipulating-the-dom-with-refs) to a `<Series.Sequence>`. If you use TypeScript, you need to type it with `HTMLDivElement`:@@ -104,8 +91,8 @@ const Square: React.FC<{color: string;}> = () => null;// ---cut----import React, { useRef } from "react";-import { Series } from "remotion";+import React, {useRef} from 'react';+import {Series} from 'remotion';export const Example: React.FC = () => {const first = useRef<HTMLDivElement>(null);@@ -114,19 +101,23 @@ export const Example: React.FC = () => {return (<Series><Series.Sequence durationInFrames={40} ref={first}>- <Square color={"#3498db"} />+ <Square color={'#3498db'} /></Series.Sequence><Series.Sequence durationInFrames={20} ref={second}>- <Square color={"#5ff332"} />+ <Square color={'#5ff332'} /></Series.Sequence><Series.Sequence durationInFrames={70}>- <Square color={"#fdc321"} />+ <Square color={'#fdc321'} /></Series.Sequence></Series>);};```+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering serverSideRendering player studio hideServers />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/series/index.tsx)diff --git a/packages/docs/docs/staticfile.mdx b/packages/docs/docs/staticfile.mdxindex d263bc75c1..571ffcbbc1 100644--- a/packages/docs/docs/staticfile.mdx+++ b/packages/docs/docs/staticfile.mdx@@ -89,6 +89,10 @@ staticFile('my-image#portrait.png'); // "/my-image%23portrait.png"The image will now be loaded properly, however, you must avoid to encode the filename yourself.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="Uses / as prefix" bun="Uses / as prefix" serverlessFunctions="Uses / as prefix" clientSideRendering serverSideRendering player="Uses / as prefix" studio />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/static-file.ts)diff --git a/packages/docs/docs/still.mdx b/packages/docs/docs/still.mdxindex 47d995b411..744c06db8c 100644--- a/packages/docs/docs/still.mdx+++ b/packages/docs/docs/still.mdx@@ -2,7 +2,7 @@image: /generated/articles-docs-still.pngid: stilltitle: <Still>-crumb: "API"+crumb: 'API'---A `<Still />` is a single-frame [`<Composition />`](/docs/composition). It is a convenient way to define a composition that renders an image rather than a video.@@ -18,26 +18,23 @@ 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 (<>- <Composition- id="my-video"- component={MyComp}- width={1080}- height={1080}- fps={30}- durationInFrames={3 * 30}- />+ <Composition id="my-video" component={MyComp} width={1080} height={1080} fps={30} durationInFrames={3 * 30} /><Still id="my-image" component={MyComp} width={1080} height={1080} /></>);};```+## Compatibility++<CompatibilityTable chrome firefox safari nodejs={false} bun={false} serverlessFunctions={false} clientSideRendering={false} serverSideRendering player={false} studio />+## See also- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/Still.tsx)diff --git a/packages/docs/docs/use-buffer-state.mdx b/packages/docs/docs/use-buffer-state.mdxindex b1804964b7..a5f5b5a40d 100644--- a/packages/docs/docs/use-buffer-state.mdx+++ b/packages/docs/docs/use-buffer-state.mdx@@ -2,7 +2,7 @@image: /generated/articles-docs-use-buffer-state.pngtitle: useBufferState()id: use-buffer-state-crumb: "API"+crumb: 'API'---_available from 4.0.111_@@ -10,8 +10,8 @@ _available from 4.0.111_You can use this hook inside your [composition](/docs/terminology/composition) to retrieve functions that can inform the Player that your component is currently loading data.```tsx twoslash title="MyComp.tsx"-import React from "react";-import { useBufferState } from "remotion";+import React from 'react';+import {useBufferState} from 'remotion';const MyComp: React.FC = () => {const buffer = useBufferState();@@ -48,8 +48,8 @@ The user might seek to a different portion of the video which is immediately avaUse the cleanup function of <code>useEffect()</code> to clear the handle when your component is unmounted.```tsx twoslash title="β Causes problems with React strict mode"-import React, { useState } from "react";-import { useBufferState } from "remotion";+import React, {useState} from 'react';+import {useBufferState} from 'remotion';const MyComp: React.FC = () => {const buffer = useBufferState();@@ -70,8 +70,8 @@ const MyComp: React.FC = () => {While the following implementation works in production, it fails in development if you are inside React Strict mode, because the `useState()` hook is called twice, which causes the first invocation of the buffer to never be cleared and the video to buffer forever.```tsx twoslash title="β Doesn't clear the buffer handle when seeking to a different portion of a video"-import React, { useState } from "react";-import { useBufferState } from "remotion";+import React, {useState} from 'react';+import {useBufferState} from 'remotion';const MyComp: React.FC = () => {const buffer = useBufferState();@@ -98,8 +98,8 @@ const MyComp: React.FC = () => {If you are loading data, you might want to both delay the screenshotting of your component during rendering and start a buffering state during Preview, in which case you need to use both APIs together.```tsx twoslash title="Using delayRender() and delayPlayback() together"-import React from "react";-import { useBufferState, delayRender, continueRender } from "remotion";+import React from 'react';+import {useBufferState, delayRender, continueRender} from 'remotion';const MyComp: React.FC = () => {const buffer = useBufferState();@@ -122,6 +122,10 @@ const MyComp: React.FC = () => {};```+## Compatibility++<CompatibilityTable chrome firefox safari nodejs={''} bun={''} serverlessFunctions="" clientSideRendering={'No-op'} serverSideRendering={'No-op'} player studio hideServers />+## See also- [Buffer state](/docs/player/buffer-state)diff --git a/packages/docs/docs/use-current-frame.mdx b/packages/docs/docs/use-current-frame.mdxindex 8f2b5846d1..b6a43c01cd 100644--- a/packages/docs/docs/use-current-frame.mdx+++ b/packages/docs/docs/use-current-frame.mdx@@ -2,7 +2,7 @@image: /generated/articles-docs-use-current-frame.pngtitle: useCurrentFrame()id: use-current-frame-crumb: "API"+crumb: 'API'---With this hook, you can retrieve the current frame of the video. Frames are 0-indexed, meaning the first frame is `0`, the last frame is the duration of the composition in frames minus one. To learn more about how Remotion works with time, read the page about [the fundamentals](/docs/the-fundamentals).@@ -12,7 +12,7 @@ If the component you are writing is wrapped in a [`<Sequence>`](/docs/sequence),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@@ -45,11 +45,11 @@ Using `<Sequence />`'s, you can compose multiple elements together and time-shifIn rare circumstances, you want access to the absolute frame of the timeline inside a sequence, use `useCurrentFrame()` at the top-level component and then pass it down as a prop to the children of the `<Sequence />`.```tsx twoslash-import { Sequence, useCurrentFrame } from "remotion";+import {Sequence, useCurrentFrame} from 'remotion';// ---cut----const Subtitle: React.FC<{ absoluteFrame: number }> = ({ absoluteFrame }) => {+const Subtitle: React.FC<{absoluteFrame: number}> = ({absoluteFrame}) => {console.log(useCurrentFrame()); // 15console.log(absoluteFrame); // 25@@ -67,6 +67,10 @@ const MyVideo = () => {};```+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering serverSideRendering player studio hideServers />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/use-current-frame.ts)diff --git a/packages/docs/docs/use-current-scale.mdx b/packages/docs/docs/use-current-scale.mdxindex c7cd7ca42e..45cc990f4c 100644--- a/packages/docs/docs/use-current-scale.mdx+++ b/packages/docs/docs/use-current-scale.mdx@@ -2,7 +2,7 @@image: /generated/articles-docs-use-current-scale.pngtitle: useCurrentScale()id: use-current-scale-crumb: "API"+crumb: 'API'---# useCurrentScale()<AvailableFrom v="4.0.125" />@@ -14,7 +14,7 @@ In the [Studio](/docs/terminology/studio), it will correspond to the zoom levelIn the [Player](/docs/terminology/player), it will correspond to the scale that is needed to fit the video canvas in the Player.```tsx twoslash title="MyComp.tsx"-import { Sequence, useCurrentScale } from "remotion";+import {Sequence, useCurrentScale} from 'remotion';const MyVideo = () => {const scale = useCurrentScale();@@ -28,15 +28,19 @@ If you want to avoid this error and return a default scale, you can pass an optiIn this case, the hook will return `1`.```tsx twoslash title="MyComp.tsx"-import { useCurrentScale } from "remotion";+import {useCurrentScale} from 'remotion';const MyRegularReactComponent = () => {- const scale = useCurrentScale({ dontThrowIfOutsideOfRemotion: true });+ const scale = useCurrentScale({dontThrowIfOutsideOfRemotion: true});return <div>The current scale is {scale}</div>;};```+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="Returns 1" bun="Returns 1" serverlessFunctions="Returns 1" clientSideRendering="Returns 1" serverSideRendering="Returns 1" player studio />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/use-current-scale.ts)diff --git a/packages/docs/docs/use-delay-render.mdx b/packages/docs/docs/use-delay-render.mdxindex 380c105167..fb3826870a 100644--- a/packages/docs/docs/use-delay-render.mdx+++ b/packages/docs/docs/use-delay-render.mdx@@ -31,6 +31,10 @@ import {useDelayRender, continueRender, delayRender} from 'remotion';With this hook, we can scope the delays to a specific render.This makes it future-proof for [browser rendering](/docs/miscellaneous/render-in-browser).<br /> It is recommended to use this hook instead of the global `delayRender()` function.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs={''} bun={''} serverlessFunctions="" clientSideRendering serverSideRendering player="No-op" studio="No-op" hideServers />+## See also- [`delayRender()`](/docs/delay-render) - The underlying APIdiff --git a/packages/docs/docs/use-remotion-environment.mdx b/packages/docs/docs/use-remotion-environment.mdxindex 0b2c1464b3..41f5e6254a 100644--- a/packages/docs/docs/use-remotion-environment.mdx+++ b/packages/docs/docs/use-remotion-environment.mdx@@ -50,6 +50,10 @@ While `getRemotionEnvironment()` works for the current use cases, `useRemotionEnThe hook helps to scope the environment information to the context of component that calls it, rather than globally.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering serverSideRendering player studio hideServers />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/use-remotion-environment.ts)diff --git a/packages/docs/docs/use-video-config.mdx b/packages/docs/docs/use-video-config.mdxindex df34d4497c..c6ec620895 100644--- a/packages/docs/docs/use-video-config.mdx+++ b/packages/docs/docs/use-video-config.mdx@@ -2,7 +2,7 @@image: /generated/articles-docs-use-video-config.pngtitle: useVideoConfig()id: use-video-config-crumb: "API"+crumb: 'API'---With this hook, you can retrieve some info about the composition you are in.@@ -10,11 +10,11 @@ With this hook, you can retrieve some info about the composition you are in.## Example```tsx twoslash-import React from "react";-import { useVideoConfig } from "remotion";+import React from 'react';+import {useVideoConfig} from 'remotion';export const MyComp: React.FC = () => {- const { width, height, fps, durationInFrames } = useVideoConfig();+ const {width, height, fps, durationInFrames} = useVideoConfig();console.log(width); // 1920console.log(height); // 1080console.log(fps); // 30;@@ -60,9 +60,13 @@ The props that were passed to the composition, after [all transformations](/docsThe default codec that is used for rendering this composition. Use [`calculateMetadata()`](/docs/calculate-metadata) to modify it.-## See also-These properties are controlled by passing them as props to [`<Composition>`](/docs/composition). Read the page about [the fundamentals](/docs/the-fundamentals) to read how to setup a Remotion project.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering serverSideRendering player studio hideServers />++## See also+- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/use-video-config.ts)-- [useCurrentFrame()](/docs/use-current-frame)+- [`useCurrentFrame()`](/docs/use-current-frame)diff --git a/packages/docs/docs/version.mdx b/packages/docs/docs/version.mdxindex c8c7a13675..12d9407990 100644--- a/packages/docs/docs/version.mdx+++ b/packages/docs/docs/version.mdx@@ -24,6 +24,10 @@ import { VERSION } from "remotion/version";console.log(VERSION); // "4.0.57";```+## Compatibility++<CompatibilityTable chrome firefox safari nodejs bun serverlessFunctions clientSideRendering serverSideRendering player studio />+## See also- [Source code for this constant](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/version.ts)diff --git a/packages/docs/docs/watch-static-file.mdx b/packages/docs/docs/watch-static-file.mdxindex dcb8c819d8..f9a5fa8a15 100644--- a/packages/docs/docs/watch-static-file.mdx+++ b/packages/docs/docs/watch-static-file.mdx@@ -50,6 +50,10 @@ A name of the file in `/public` folder to watch for changes.A callback function that will be called when the file is modified. As an argument, a [`StaticFile`](/docs/getstaticfiles#api) or `null` is passed.+## Compatibility++<CompatibilityTable chrome firefox safari nodejs={""} bun={""} serverlessFunctions="" clientSideRendering={false} serverSideRendering={false} player={false} studio hideBrowsers hideServers />+## See also- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/core/src/watch-static-file.ts)diff --git a/packages/docs/src/components/CompatibilityTable.tsx b/packages/docs/src/components/CompatibilityTable.tsxindex 5946eb1c95..2befcaf89b 100644--- a/packages/docs/src/components/CompatibilityTable.tsx+++ b/packages/docs/src/components/CompatibilityTable.tsx@@ -141,6 +141,8 @@ type Props = {readonly serverSideRendering: CompatValue;readonly player: CompatValue;readonly studio: CompatValue;+ readonly hideBrowsers?: boolean;+ readonly hideServers?: boolean;};type Item = {key: keyof Props; label: string; icon?: React.FC; link?: string};@@ -154,7 +156,7 @@ const browsers: Item[] = [const servers: Item[] = [{key: 'nodejs', label: 'Node.js', icon: NodejsIcon},{key: 'bun', label: 'Bun', icon: BunIcon},- {key: 'serverlessFunctions', label: 'Serverless'},+ {key: 'serverlessFunctions', label: 'Serverless Functions'},];const environments: Item[] = [@@ -172,9 +174,13 @@ const environments: Item[] = [{key: 'studio', label: 'Studio', link: '/docs/studio'},];-const allItems = [...browsers, ...servers, ...environments];-export const CompatibilityTable: React.FC<Props> = (props) => {+ const {hideBrowsers, hideServers} = props;++ const visibleBrowsers = hideBrowsers ? [] : browsers;+ const visibleServers = hideServers ? [] : servers;+ const allItems = [...visibleBrowsers, ...visibleServers, ...environments];+for (const {key, label} of allItems) {if (props[key] === undefined) {throw new Error(`CompatibilityTable: "${label}" (${key}) is required`);@@ -185,12 +191,16 @@ export const CompatibilityTable: React.FC<Props> = (props) => {<table style={table}><thead><tr>- <th colSpan={browsers.length} style={sectionTh}>- Browsers- </th>- <th colSpan={servers.length} style={sectionTh}>- Servers- </th>+ {!hideBrowsers && (+ <th colSpan={browsers.length} style={sectionTh}>+ Browsers+ </th>+ )}+ {!hideServers && (+ <th colSpan={servers.length} style={sectionTh}>+ Servers+ </th>+ )}<th colSpan={environments.length} style={sectionTh}>Environments</th>