π₯ Make videos programmatically with React
fix some formatting
Jonny Burgeraf935d640dee
diff --git a/.prettierignore b/.prettierignoreindex ecaf431135..bf4ce5fbdd 100644--- a/.prettierignore+++ b/.prettierignore@@ -5,3 +5,8 @@ packages/docs/docs/transitions/presentations/custom.mdxpackages/docs/docs/studio-app.mdxpackages/docs/docs/cloudrun/cli/regions.mdxpackages/docs/docs/flickering.mdx+packages/docs/docs/lambda/feb-2023-incident.mdx+packages/docs/docs/lambda/how-lambda-works.mdx+packages/docs/docs/lambda/s3-public-access.mdx+packages/docs/docs/player-into-remotion-project.mdx+packages/docs/docs/miscellaneous/cloud-gpu-docker.mdxdiff --git a/packages/docs/docs/cloudrun/permissions.mdx b/packages/docs/docs/cloudrun/permissions.mdxindex 4509700feb..b5dfa902f5 100644--- a/packages/docs/docs/cloudrun/permissions.mdx+++ b/packages/docs/docs/cloudrun/permissions.mdx@@ -2,14 +2,24 @@image: /generated/articles-docs-cloudrun-permissions.pngsidebar_label: Permissionstitle: Permissions-crumb: "Cloud Run"+crumb: 'Cloud Run'---<ExperimentalBadge>-<p>Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs may change in any version and documentation is not yet finished. See the <a href="https://remotion.dev/changelog">changelog to stay up to date with breaking changes</a>.</p>+ <p>+ Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs+ may change in any version and documentation is not yet finished. See the{' '}+ <a href="https://remotion.dev/changelog">+ changelog to stay up to date with breaking changes+ </a>+ .+ </p></ExperimentalBadge>-import {SAPermissionList, SAPermissionTable} from '../../components/cloudrun/sa-permissions.tsx';+import {+ SAPermissionList,+ SAPermissionTable,+} from '../../components/cloudrun/sa-permissions.tsx';This document describes the necessary permissions for Remotion Cloud Run and explains to those interested why the permissions are necessary.@@ -24,9 +34,11 @@ To view and manually edit roles in your GCP project, go to the [Roles page withiTo view and manually edit permissions/roles assigned to Users or Service Accounts in your GCP project, go to the [IAM page within IAM Admin](https://console.cloud.google.com/iam-admin/iam).<details>-<summary>Show full Remotion API Service Account permissions list for the latest Remotion Cloud Run version.-</summary>-<SAPermissionList />+ <summary>+ Show full Remotion API Service Account permissions list for the latest+ Remotion Cloud Run version.+ </summary>+ <SAPermissionList /></details>:::infodiff --git a/packages/docs/docs/flickering.mdx b/packages/docs/docs/flickering.mdxindex 25b20d65ae..0869c40af7 100644--- a/packages/docs/docs/flickering.mdx+++ b/packages/docs/docs/flickering.mdx@@ -41,9 +41,7 @@ times.<br /><Step>3</Step> A component should not animate when the video is paused.<br />-<Step>4</Step> A component should not rely on randomness - Exception: <a href="/docs/random">- <code>random()</code>-</a>+<Step>4</Step> A component should not rely on randomness - Exception: <a href="/docs/random"><code>random()</code></a>### Bypass multithreading@@ -58,43 +56,21 @@ Otherwise, it will take a screenshot of a loading state.### Solution-<Step>1</Step> Use the <a>- <code><Img></code>-</a>-, <a>- <code><Video></code>-</a>-, <a>- <code><OffthreadVideo></code>-</a>-, <a>- <code><Audio></code>-</a>-, <a>- <code><Iframe></code>-</a> and <a>- <code><Gif></code>-</a> as they wait for the assets to be loaded. <br />+<Step>1</Step> Use the <a><code><Img></code></a>+, <a><code><Video></code></a>+, <a><code><OffthreadVideo></code></a>+, <a><code><Audio></code></a>+, <a><code><Iframe></code></a> and <a><code><Gif></code></a> as they wait for the assets to be loaded. <br /><Step>2</Step> When loading data, use the <a href="/docs/delay-render"><code>delayRender()</code></a> function.<br />-<Step>3</Step> Ensure you correctly wait <a href="/docs/fonts">- for fonts to load-</a>+<Step>3</Step> Ensure you correctly wait <a href="/docs/fonts">for fonts to load</a>.<br />-<Step>4</Step> Only call <a href="/docs/layout-utils/fit-text">- <code>fitText()</code>-</a>, <a href="/docs/layout-utils/fill-text-box">- <code>fillTextBox()</code>-</a> and <a href="/docs/layout-utils/measure-text">- <code>measureText()</code>-</a> once fonts are loaded.+<Step>4</Step> Only call <a href="/docs/layout-utils/fit-text"><code>fitText()</code></a>, <a href="/docs/layout-utils/fill-text-box"><code>fillTextBox()</code></a> and <a href="/docs/layout-utils/measure-text"><code>measureText()</code></a> once fonts are loaded.<br />-<Step>5</Step> Avoid using the <a href="/docs/troubleshooting/background-image">- <code>background-image</code> and <code>mask-image</code> CSS properties-</a>.+<Step>5</Step> Avoid using the <a href="/docs/troubleshooting/background-image"><code>background-image</code> and <code>mask-image</code> CSS properties</a>.## Flickering `<Video>` tagdiff --git a/packages/docs/docs/lambda/cli/compositions.mdx b/packages/docs/docs/lambda/cli/compositions.mdxindex 991a491069..601036c0cd 100644--- a/packages/docs/docs/lambda/cli/compositions.mdx+++ b/packages/docs/docs/lambda/cli/compositions.mdx@@ -2,7 +2,7 @@image: /generated/articles-docs-lambda-cli-compositions.pngtitle: npx remotion lambda compositionssidebar_label: compositions-crumb: "Lambda CLI Reference"+crumb: 'Lambda CLI Reference'---_Available from v3.3.2._@@ -18,26 +18,41 @@ npx remotion lambda compositions <serve-url>- Obtain a [Serve URL](/docs/terminology/serve-url) using the [`sites create`](/docs/lambda/cli/sites#create) command or by calling [`deploySite()`](/docs/lambda/deploysite).<details>-<summary>Show output-</summary>-<pre>-looped 60 1080x1080 200 (3.33 sec)<br/>-cancel-render 30 920x720 100 (3.33 sec)<br/>-iframe 30 1080x1080 10 (0.33 sec)<br/>-stagger-test 30 1280x720 100 (3.33 sec)<br/>-freeze-example 30 1280x720 300 (10.00 sec)<br/>-base-spring 30 1080x1080 100 (3.33 sec)<br/>-spring-with-duration 30 1080x1080 100 (3.33 sec)<br/>-missing-img 30 1080x1080 10 (0.33 sec)<br/>-ten-frame-tester 30 1080x1080 10 (0.33 sec)<br/>-framer 30 1080x1080 100 (3.33 sec)<br/>-skip-zero-frame 30 1280x720 100 (3.33 sec)<br/>-scripts 30 1280x720 100 (3.33 sec)<br/>-many-audio 30 1280x720 30 (1.00 sec)<br/>-error-on-frame-10 30 1280x720 1000000 (33333.33 sec)<br/>-wrapped-in-context 1280x720 Still<br/>-drop-dots 30 1080x1080 5400 (180.00 sec)<br/>-</pre>+ <summary>Show output</summary>+ <pre>+ looped 60 1080x1080 200 (3.33 sec)+ <br />+ cancel-render 30 920x720 100 (3.33 sec)+ <br />+ iframe 30 1080x1080 10 (0.33 sec)+ <br />+ stagger-test 30 1280x720 100 (3.33 sec)+ <br />+ freeze-example 30 1280x720 300 (10.00 sec)+ <br />+ base-spring 30 1080x1080 100 (3.33 sec)+ <br />+ spring-with-duration 30 1080x1080 100 (3.33 sec)+ <br />+ missing-img 30 1080x1080 10 (0.33 sec)+ <br />+ ten-frame-tester 30 1080x1080 10 (0.33 sec)+ <br />+ framer 30 1080x1080 100 (3.33 sec)+ <br />+ skip-zero-frame 30 1280x720 100 (3.33 sec)+ <br />+ scripts 30 1280x720 100 (3.33 sec)+ <br />+ many-audio 30 1280x720 30 (1.00 sec)+ <br />+ error-on-frame-10 30 1280x720 1000000 (33333.33 sec)+ <br />+ wrapped-in-context 1280x720 Still+ <br />+ drop-dots 30 1080x1080 5400 (180.00 sec)+ <br />+ </pre></details>## `remotion lambda compositions` vs. `remotion compositions`diff --git a/packages/docs/docs/lambda/cli/policies.mdx b/packages/docs/docs/lambda/cli/policies.mdxindex 02fc08b9db..fea77ac4b5 100644--- a/packages/docs/docs/lambda/cli/policies.mdx+++ b/packages/docs/docs/lambda/cli/policies.mdx@@ -2,9 +2,9 @@image: /generated/articles-docs-lambda-cli-policies.pngid: policiessidebar_label: policies-title: "npx remotion lambda policies"+title: 'npx remotion lambda policies'slug: /lambda/cli/policies-crumb: "Lambda CLI Reference"+crumb: 'Lambda CLI Reference'---import {RolePolicy} from '../../../components/lambda/role-permissions.tsx';@@ -27,8 +27,7 @@ npx remotion lambda policies role```<details>-<summary>Show output-</summary>+ <summary>Show output</summary><RolePolicy /></details>@@ -39,8 +38,7 @@ npx remotion lambda policies user```<details>-<summary>Show output-</summary>+ <summary>Show output</summary><UserPolicy /></details>diff --git a/packages/docs/docs/lambda/cli/quotas.mdx b/packages/docs/docs/lambda/cli/quotas.mdxindex d0d4df77a6..1d30f7c226 100644--- a/packages/docs/docs/lambda/cli/quotas.mdx+++ b/packages/docs/docs/lambda/cli/quotas.mdx@@ -2,9 +2,9 @@image: /generated/articles-docs-lambda-cli-quotas.pngid: quotassidebar_label: quotas-title: "npx remotion lambda quotas"+title: 'npx remotion lambda quotas'slug: /lambda/cli/quotas-crumb: "Lambda CLI Reference"+crumb: 'Lambda CLI Reference'---Displays the AWS Lambda concurrency and burst limits currently being applied to your account and region. You can use the `increase` command to send a request to AWS asking them to increase their quotas.@@ -21,8 +21,7 @@ npx remotion lambda quotas```<details>-<summary>Show example output-</summary>+<summary>Show example output</summary><pre>Region = us-east-1diff --git a/packages/docs/docs/lambda/cli/regions.mdx b/packages/docs/docs/lambda/cli/regions.mdxindex ada65bed25..044338ace8 100644--- a/packages/docs/docs/lambda/cli/regions.mdx+++ b/packages/docs/docs/lambda/cli/regions.mdx@@ -2,8 +2,8 @@image: /generated/articles-docs-lambda-cli-regions.pngid: regionssidebar_label: regions-title: "npx remotion lambda regions"-crumb: "Lambda CLI Reference"+title: 'npx remotion lambda regions'+crumb: 'Lambda CLI Reference'---Prints the AWS regions supported by the current version of Remotion Lambda. Useful for bash scripts.@@ -13,10 +13,13 @@ npx remotion lambda regions```<details>-<summary>Show output-</summary>-<pre>-eu-central-1 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-north-1 us-east-1 us-east-2 us-west-1 us-west-2 af-south-1 ap-south-1 ap-east-1 ap-southeast-1 ap-southeast-2 ap-northeast-3 ap-northeast-1 ap-northeast-2 ca-central-1 me-south-1 sa-east-1</pre>+ <summary>Show output</summary>+ <pre>+ eu-central-1 eu-west-1 eu-west-2 eu-west-3 eu-south-1 eu-north-1 us-east-1+ us-east-2 us-west-1 us-west-2 af-south-1 ap-south-1 ap-east-1 ap-southeast-1+ ap-southeast-2 ap-northeast-3 ap-northeast-1 ap-northeast-2 ca-central-1+ me-south-1 sa-east-1+ </pre></details>## Flagsdiff --git a/packages/docs/docs/lambda/feb-2023-incident.mdx b/packages/docs/docs/lambda/feb-2023-incident.mdxindex 1e32db8877..afa2978b5f 100644--- a/packages/docs/docs/lambda/feb-2023-incident.mdx+++ b/packages/docs/docs/lambda/feb-2023-incident.mdx@@ -51,41 +51,53 @@ Locking a runtime on AWS Lambda is only possible since January 23rd, 2023, henceTo apply the fix, you need to:-<Step>1</Step> upgrade Remotion: <br/><br/>+<Step>1</Step> upgrade Remotion: <br />+<br />```bashnpx remotion upgrade```-<Step>2</Step> change your policies to give your user the <code>lambda:PutRuntimeManagementConfig</code> permission. The easiest way is to copy the following user policy: <br/><br/>+<Step>2</Step> change your policies to give your user the <code>+ lambda:PutRuntimeManagementConfig+</code> permission. The easiest way is to copy the following user policy: <br />+<br /><details>-<summary>Show full user permissions JSON file for latest Remotion Lambda version-</summary>-<UserPolicy />+ <summary>+ Show full user permissions JSON file for latest Remotion Lambda version+ </summary>+ <UserPolicy /></details>or type in `npx remotion lambda policies user` after upgrading Remotion Lambda.Go to the [Users](https://us-east-1.console.aws.amazon.com/iamv2/home?region=us-east-1#/users) section in the AWS console and overwrite the JSON policy of your Remotion Lambda user with the above copied JSON.-<Step>3</Step> Redeploy your functions. You don't need to delete your old functions as it might cause downtime for your application. <br/>+<Step>3</Step> Redeploy your functions. You don't need to delete your old functions+as it might cause downtime for your application. <br />-<Step>4</Step> As a reminder, you also need to redeploy your site when you upgrade to a higher Remotion version. <br/>+<Step>4</Step> As a reminder, you also need to redeploy your site when you upgrade+to a higher Remotion version. <br />-<Step>5</Step> If any values are hardcoded, update the function and site name in your application code.+<Step>5</Step> If any values are hardcoded, update the function and site name in+your application code.### Option 2: Manually update the runtime in the AWS consoleAlternatively, for each of your Lambda functions, you can lock the runtime version in the AWS console:-<Step>1</Step> Go to the function in the AWS dashboard and click "Edit Runtime management configuration".<br/><br/>+<Step>1</Step> Go to the function in the AWS dashboard and click "Edit Runtime management+configuration".+<br />+<br /><img src="/img/runtimesettings.png" />-<Step>2</Step> Set it to "Manual". <br/>+<Step>2</Step> Set it to "Manual". <br />-<Step>3</Step> Set the runtime to <code>arn:aws:lambda:[region]::runtime:69000d3430a08938bcab71617dffcb8ea551a2cbc36c59f38c52a1ea087e461b</code>. Replace <code>[region]</code> with the code for the AWS region (e.g. <code>us-east-1</code>) <br/>+<Step>3</Step> Set the runtime to <code>arn:aws:lambda:[region]::runtime:69000d3430a08938bcab71617dffcb8ea551a2cbc36c59f38c52a1ea087e461b</code>+. Replace <code>[region]</code> with the code for the AWS region (e.g. <code>us-east-1</code>) <br /><Step>4</Step> Click "Save". Repeat this for any functions you have deployed.diff --git a/packages/docs/docs/lambda/how-lambda-works.mdx b/packages/docs/docs/lambda/how-lambda-works.mdxindex b1c7aa735e..98cf6b2c13 100644--- a/packages/docs/docs/lambda/how-lambda-works.mdx+++ b/packages/docs/docs/lambda/how-lambda-works.mdx@@ -2,7 +2,7 @@image: /generated/articles-docs-lambda-how-lambda-works.pngid: how-lambda-workstitle: How Remotion Lambda works-crumb: "Lambda"+crumb: 'Lambda'---This document describes the procedure that gets executed when a Remotion Lambda video render is triggered.@@ -67,7 +67,4 @@ Keep this in mind when designing your solution and consider using a CDN to serve----<sup>1)</sup> An API for avoiding the S3 bandwidth charge is <a href="https://github.com/remotion-dev/remotion/issues/3817">- planned-</a>-.+<sup>1)</sup> An API for avoiding the S3 bandwidth charge is <a href="https://github.com/remotion-dev/remotion/issues/3817">planned</a>.diff --git a/packages/docs/docs/lambda/permissions.mdx b/packages/docs/docs/lambda/permissions.mdxindex 5e5646c79b..6abbc3e713 100644--- a/packages/docs/docs/lambda/permissions.mdx+++ b/packages/docs/docs/lambda/permissions.mdx@@ -2,7 +2,7 @@image: /generated/articles-docs-lambda-permissions.pngsidebar_label: Permissionstitle: Permissions-crumb: "Lambda"+crumb: 'Lambda'---import {UserPolicy} from '../../components/lambda/user-permissions.tsx';@@ -17,9 +17,10 @@ For a step by step guide on how to set up permissions, [follow the setup guide](This policy should be assigned to the **AWS user**. To do so, go to the [AWS console](https://console.aws.amazon.com/console/home) β [IAM](https://console.aws.amazon.com/iam/home) β [Users](https://console.aws.amazon.com/iamv2/home#/users) β Your created Remotion user β Permissions tab β Add inline policy β JSON.<details>-<summary>Show full user permissions JSON file for latest Remotion Lambda version-</summary>-<UserPolicy />+ <summary>+ Show full user permissions JSON file for latest Remotion Lambda version+ </summary>+ <UserPolicy /></details>:::info@@ -33,7 +34,8 @@ This policy should be assigned to the **role `remotion-lambda-role`** in your AWTo assign, go to [AWS console](https://console.aws.amazon.com/console/home) β [IAM](https://console.aws.amazon.com/iam/home) β [Roles](https://console.aws.amazon.com/iamv2/home#/roles) β [`remotion-lambda-role`](https://console.aws.amazon.com/iam/home#/roles/remotion-lambda-role) β Permissions tab β [Add inline policy](https://console.aws.amazon.com/iam/home#/roles/remotion-lambda-role$createPolicy?step=edit).<details>-<summary>Show full role permissions JSON file for latest Remotion Lambda version+ <summary>+ Show full role permissions JSON file for latest Remotion Lambda version</summary><RolePolicy /></details>diff --git a/packages/docs/docs/lambda/s3-public-access.mdx b/packages/docs/docs/lambda/s3-public-access.mdxindex 5e80e18241..91ad135a98 100644--- a/packages/docs/docs/lambda/s3-public-access.mdx+++ b/packages/docs/docs/lambda/s3-public-access.mdx@@ -15,13 +15,13 @@ To make bucket creation work again, you need to upgrade to a newer Remotion versUsers might see an error:-```bash+```shInvalidBucketAclWithObjectOwnership: Bucket cannot have ACLs set with ObjectOwnership's BucketOwnerEnforced setting.```or-```bash+```shellAccessDenied: Access Denied```@@ -33,7 +33,8 @@ AWS does make all buckets private by default and Remotion tries to create a publ## Resolution-<Step>1</Step> Upgrade to Remotion <code>v3.3.87</code> or later. <br/><br/>+<Step>1</Step> Upgrade to Remotion <code>v3.3.87</code> or later. <br />+<br />```bashnpx remotion upgrade@@ -43,12 +44,15 @@ npx remotion upgradeNote: When you upgrade Remotion, you will need to deploy new functions as well.:::-<Step>2</Step> change your policies to give your user the <code> s3:PutBucketOwnershipControls</code> and <code>s3:PutBucketPublicAccessBlock</code> permission. The easiest way is to copy the following user policy: <br/><br/>+<Step>2</Step> change your policies to give your user the <code>s3:PutBucketOwnershipControls</code> and <code>s3:PutBucketPublicAccessBlock</code> permission. The easiest way+is to copy the following user policy: <br />+<br /><details>-<summary>Show full user permissions JSON file for latest Remotion Lambda version-</summary>-<UserPolicy />+ <summary>+ Show full user permissions JSON file for latest Remotion Lambda version+ </summary>+ <UserPolicy /></details>or type in `npx remotion lambda policies user` after upgrading Remotion Lambda.@@ -57,11 +61,14 @@ Go to the [Users](https://us-east-1.console.aws.amazon.com/iamv2/home?region=us-You can verify that it worked by running `npx remotion lambda policies validate`.-<Step>3</Step> Redeploy your functions. You don't need to delete your old functions as it might cause downtime for your application. <br/>+<Step>3</Step> Redeploy your functions. You don't need to delete your old functions+as it might cause downtime for your application. <br />-<Step>4</Step> As a reminder, you also need to redeploy your site when you upgrade to a higher Remotion version. <br/>+<Step>4</Step> As a reminder, you also need to redeploy your site when you upgrade+to a higher Remotion version. <br />-<Step>5</Step> If any values are hardcoded, update the function and site name in your application code.+<Step>5</Step> If any values are hardcoded, update the function and site name in+your application code.## Questions?diff --git a/packages/docs/docs/lambda/without-iam/index.mdx b/packages/docs/docs/lambda/without-iam/index.mdxindex 0854045306..3593cbaa3b 100644--- a/packages/docs/docs/lambda/without-iam/index.mdx+++ b/packages/docs/docs/lambda/without-iam/index.mdx@@ -1,8 +1,8 @@---image: /generated/articles-docs-lambda-without-iam-index.pngtitle: Using Lambda with IAM roles-sidebar_label: "With IAM Roles"-crumb: "Lambda without IAM"+sidebar_label: 'With IAM Roles'+crumb: 'Lambda without IAM'---import {UserPolicy} from '../../../components/lambda/user-permissions.tsx';@@ -34,9 +34,10 @@ The steps below provide authorization for the Lambda function to execute `render- Click on JSON- Copy the JSON policy template below:<details>- <summary>Show full role permissions JSON file for latest Remotion Lambda version- </summary>- <UserPolicy />+ <summary>+ Show full role permissions JSON file for latest Remotion Lambda version+ </summary>+ <UserPolicy /></details>- Click next. On the tags page, you don't need to fill in anything. Click next again.- Give the policy the name `remotion-executionrole-policy`. The other fields can be left as they are.@@ -78,18 +79,18 @@ Use the `outName` property to select a different bucket. See: [Custom output des// @target: es2017// ---cut----import { renderMediaOnLambda } from "@remotion/lambda/client";+import {renderMediaOnLambda} from '@remotion/lambda/client';-const { bucketName, renderId } = await renderMediaOnLambda({- region: "us-east-1",- functionName: "remotion-render-bds9aab",- composition: "MyVideo",+const {bucketName, renderId} = await renderMediaOnLambda({+ region: 'us-east-1',+ functionName: 'remotion-render-bds9aab',+ composition: 'MyVideo',serveUrl:- "https://remotionlambda-qg35eyp1s1.s3.eu-central-1.amazonaws.com/sites/bf2jrbfkw",- codec: "h264",+ 'https://remotionlambda-qg35eyp1s1.s3.eu-central-1.amazonaws.com/sites/bf2jrbfkw',+ codec: 'h264',outName: {- key: "my-output",- bucketName: "output-bucket",+ key: 'my-output',+ bucketName: 'output-bucket',},});```diff --git a/packages/docs/docs/miscellaneous/cloud-gpu-docker.mdx b/packages/docs/docs/miscellaneous/cloud-gpu-docker.mdxindex 3e02efebc4..f53b69a3ba 100644--- a/packages/docs/docs/miscellaneous/cloud-gpu-docker.mdx+++ b/packages/docs/docs/miscellaneous/cloud-gpu-docker.mdx@@ -20,9 +20,7 @@ We recommend to first follow these instructions and make changes once you have a## Setup EC2 for Docker with GPU-<Step>1</Step> Follow the instructions for <a href="/docs/miscellaneous/cloud-gpu">- GPUs on EC2-</a>+<Step>1</Step> Follow the instructions for <a href="/docs/miscellaneous/cloud-gpu">GPUs on EC2</a>. You can skip installing Chrome, Node.js and cloning the repo to render a video.<br />@@ -68,9 +66,7 @@ sudo nvidia-ctk runtime configure --runtime=dockersudo systemctl restart docker```-<Step>5</Step> Create two files, <code>Dockerfile</code> and <code>- entrypoint.sh-</code>+<Step>5</Step> Create two files, <code>Dockerfile</code> and <code>entrypoint.sh</code>. You can for example create them using the <code>nano ./file-to-create</code> command.Use <kbd>Ctrl</kbd><kbd>X</kbd> to save and quit. <br />diff --git a/packages/docs/docs/motion-blur/camera-motion-blur.mdx b/packages/docs/docs/motion-blur/camera-motion-blur.mdxindex ef7388fc88..d142b64c72 100644--- a/packages/docs/docs/motion-blur/camera-motion-blur.mdx+++ b/packages/docs/docs/motion-blur/camera-motion-blur.mdx@@ -49,8 +49,7 @@ In movies and TV common values are (FPS/shutter angle):- 60 fps / 180° or 90°<details>-<summary>What is "shutter angle"?-</summary>+<summary>What is "shutter angle"?</summary>Many analog film cameras use rotating discs with partial cut-outs to block or let light through toexpose the analog film. Zero degrees is equal to completely blocking the light, and 360 degrees isthe same as not blocking any light at all.diff --git a/packages/docs/docs/player-into-remotion-project.mdx b/packages/docs/docs/player-into-remotion-project.mdxindex 160734e9ca..9bc9853629 100644--- a/packages/docs/docs/player-into-remotion-project.mdx+++ b/packages/docs/docs/player-into-remotion-project.mdx@@ -19,9 +19,7 @@ If you have a React app that uses the [`<Player>`](/docs/player/player) componen## Instructions<Step>1</Step> Ensure that you don't already have a Studio installed - in the following-templates, the Studio is already installed and can be started using the command <a href="/docs/cli/studio">- <code>npx remotion studio</code>-</a>+templates, the Studio is already installed and can be started using the command <a href="/docs/cli/studio"><code>npx remotion studio</code></a>:<br /><br />diff --git a/packages/docs/docs/player/buffer-state.mdx b/packages/docs/docs/player/buffer-state.mdxindex 8fac6b4785..9bd01158f9 100644--- a/packages/docs/docs/player/buffer-state.mdx+++ b/packages/docs/docs/player/buffer-state.mdx@@ -1,6 +1,6 @@---image: /generated/articles-docs-player-buffer-state.png-title: "The Player buffer state"+title: 'The Player buffer state'sidebar_label: Buffer stateid: buffer-statecrumb: Best practices@@ -26,8 +26,8 @@ By doing so, the Player will briefly pause until your media is loaded.A component can tell the player to switch into a buffer state by first using the [`useBufferState()`](/docs/use-buffer-state) hook and then calling `buffer.delayPlayback()`:```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();@@ -59,8 +59,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();@@ -83,8 +83,8 @@ const MyComp: React.FC = () => {While the following implementation works in production, it fails in React Strict mode, because the `useState()` hook is called twice, which causes the first invocation of the buffer to never be cleared.```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();@@ -112,8 +112,8 @@ const MyComp: React.FC = () => {If you are loading data, you might want to delay the screenshotting of your component during rendering and delay the playback of the video in 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();@@ -159,9 +159,13 @@ By default, Remotion will display the following UI based on the state of the plaWhen in State <InlineStep>1</InlineStep> a Pause button is shown. <br /></p><p>--When in State <InlineStep>2</InlineStep> at first a Pause button, then after <a href="#indicating-buffering-in-the-ui">-a delay</a>, a <a href="/docs/player/buffer-state#indicating-buffering-in-the-ui">customizable spinner</a> is shown.</p>+ When in State <InlineStep>2</InlineStep> at first a Pause button, then after{' '}+ <a href="#indicating-buffering-in-the-ui">a delay</a>, a{' '}+ <a href="/docs/player/buffer-state#indicating-buffering-in-the-ui">+ customizable spinner+ </a>{' '}+ is shown.+</p><p>Otherwise, the Play button is shown.</p>@@ -179,16 +183,16 @@ export const MyVideo = () => <></>;// @filename: index.tsx// ---cut----import { Player, PlayerRef } from "@remotion/player";-import { useEffect, useRef, useState } from "react";-import { MyVideo } from "./remotion/MyVideo";+import {Player, PlayerRef} from '@remotion/player';+import {useEffect, useRef, useState} from 'react';+import {MyVideo} from './remotion/MyVideo';export const App: React.FC = () => {const playerRef = useRef<PlayerRef>(null);const [buffering, setBuffering] = useState(false);useEffect(() => {- const { current } = playerRef;+ const {current} = playerRef;if (!current) {return;}@@ -200,11 +204,11 @@ export const App: React.FC = () => {setBuffering(false);};- current.addEventListener("waiting", onBuffering);- current.addEventListener("resume", onResume);+ current.addEventListener('waiting', onBuffering);+ current.addEventListener('resume', onResume);return () => {- current.removeEventListener("waiting", onBuffering);- current.removeEventListener("resume", onResume);+ current.removeEventListener('waiting', onBuffering);+ current.removeEventListener('resume', onResume);};}, [setBuffering]);@@ -244,9 +248,9 @@ export const MyVideo = () => <></>;// @filename: index.tsx// ---cut----import { Player, PlayerRef } from "@remotion/player";-import { useEffect, useRef, useState } from "react";-import { MyVideo } from "./remotion/MyVideo";+import {Player, PlayerRef} from '@remotion/player';+import {useEffect, useRef, useState} from 'react';+import {MyVideo} from './remotion/MyVideo';export const App: React.FC = () => {return (@@ -265,7 +269,7 @@ export const App: React.FC = () => {In the Studio, you can change the delay in the [config file](/docs/config#setbufferstatedelayinmilliseconds):```ts twoslash title="remotion.config.ts"-import { Config } from "@remotion/cli/config";+import {Config} from '@remotion/cli/config';Config.setBufferStateDelayInMilliseconds(0);```@@ -278,12 +282,12 @@ const MyPauseButton: React.FC = () => null;const MySpinner: React.FC = () => null;const MyVideo: React.FC = () => null;// ---cut----import { Player, RenderPlayPauseButton } from "@remotion/player";-import { useCallback } from "react";+import {Player, RenderPlayPauseButton} from '@remotion/player';+import {useCallback} from 'react';export const App: React.FC = () => {const renderPlayPauseButton: RenderPlayPauseButton = useCallback(- ({ playing, isBuffering }) => {+ ({playing, isBuffering}) => {if (playing && isBuffering) {return <MySpinner />;}@@ -309,24 +313,22 @@ export const App: React.FC = () => {To display a loading UI layered on top of the Player (e.g. a spinner), you can set [`showPosterWhenBuffering`](/docs/player/player#showposterwhenbuffering) to `true` and pass a [`renderPoster()`](/docs/player/player#renderposter) prop:```tsx twoslash title="Rendering a custom spinner on top of the Player"-import { useCallback } from "react";-import { AbsoluteFill } from "remotion";+import {useCallback} from 'react';+import {AbsoluteFill} from 'remotion';const Component: React.FC = () => null;const Spinner: React.FC = () => null;// ---cut----import type { RenderPoster } from "@remotion/player";-import { Player } from "@remotion/player";+import type {RenderPoster} from '@remotion/player';+import {Player} from '@remotion/player';const MyApp: React.FC = () => {- const renderPoster: RenderPoster = useCallback(({ isBuffering }) => {+ const renderPoster: RenderPoster = useCallback(({isBuffering}) => {if (isBuffering) {return (- <AbsoluteFill- style={{ justifyContent: "center", alignItems: "center" }}- >+ <AbsoluteFill style={{justifyContent: 'center', alignItems: 'center'}}><Spinner /></AbsoluteFill>);diff --git a/packages/docs/docs/player/preloading.mdx b/packages/docs/docs/player/preloading.mdxindex d48d1f1d70..92929b0368 100644--- a/packages/docs/docs/player/preloading.mdx+++ b/packages/docs/docs/player/preloading.mdx@@ -1,8 +1,8 @@---image: /generated/articles-docs-player-preloading.png-sidebar_label: "Preloading"-title: "Preloading assets"-crumb: "@remotion/player"+sidebar_label: 'Preloading'+title: 'Preloading assets'+crumb: '@remotion/player'---By default, assets such as videos, audio, or images will only be loaded as they enter the video. When using the [Remotion Player](/docs/terminology/player), you may want to preload those assets beforehand to make them play immediately once they enter the video.@@ -18,11 +18,11 @@ By preloading, a `<link type='preload'>` tag is placed on the page, signaling toFor videos, use [`preloadVideo()`](/docs/preload/preload-video) API, for audio use [`preloadAudio()`](/docs/preload/preload-audio), for images use [`preloadImage()`](/docs/preload/preload-image). Perform the preload outside a component or inside an [`useEffect()`](https://react.dev/reference/react/useEffect).```tsx twoslash-import { preloadAudio, preloadVideo } from "@remotion/preload";+import {preloadAudio, preloadVideo} from '@remotion/preload';-const unpreloadVideo = preloadVideo("https://example.com/video.mp4");+const unpreloadVideo = preloadVideo('https://example.com/video.mp4');const unpreloadAudio = preloadAudio(- "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3",+ 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3',);// Later, you can optionally clean up the preload@@ -38,12 +38,12 @@ By prefetching, the full media is downloaded and turned into a Blob URL using [`If you pass the original URL into either an [`<Audio>`](/docs/audio), [`<Video>`](/docs/video), [`<OffthreadVideo>`](/docs/offthreadvideo) or [`<Img>`](/docs/img) tag and the asset is prefetched, those components will use Blob URL instead.```tsx twoslash-import { prefetch } from "remotion";+import {prefetch} from 'remotion';-const { free, waitUntilDone } = prefetch("https://example.com/video.mp4");+const {free, waitUntilDone} = prefetch('https://example.com/video.mp4');waitUntilDone().then(() => {- console.log("Video has finished loading");+ console.log('Video has finished loading');});// Call free() if you want to un-prefetch and free up the memory:@@ -61,7 +61,8 @@ free();<th></th><th><div>- <code>preloadAudio()</code><br />+ <code>preloadAudio()</code>+ <br /><code>preloadVideo()</code></div></th>@@ -73,87 +74,95 @@ free();</tr><tr><td>Works with</td>+ <td>All audio and video APIs, images and fonts</td><td>- All audio and video APIs, images and fonts </td>- <td>- <a href="/docs/audio"><code>{"<Audio/>"}</code></a>, <a href="/docs/video"><code>{"<Video/>"}</code></a>, <a href="/docs/img"><code>{"<Img/>"}</code></a>, <a href="/docs/offthreadvideo"><code>{"<OffthreadVideo/>"}</code></a>+ <a href="/docs/audio">+ <code>{'<Audio/>'}</code>+ </a>+ ,{' '}+ <a href="/docs/video">+ <code>{'<Video/>'}</code>+ </a>+ ,{' '}+ <a href="/docs/img">+ <code>{'<Img/>'}</code>+ </a>+ ,{' '}+ <a href="/docs/offthreadvideo">+ <code>{'<OffthreadVideo/>'}</code>+ </a></td></tr><tr><td>Mechanism</td><td>- Inserts a <code>{"<link type='preload'>"}</code> tag- </td>- <td>- Fetches the asset and turns it into a URL blob or Base 64 URL+ Inserts a <code>{"<link type='preload'>"}</code> tag</td>+ <td>Fetches the asset and turns it into a URL blob or Base 64 URL</td></tr><tr><td>Readiness</td>- <td style={{color: "green"}}>+ <td style={{color: 'green'}}>Ready to play when asset is partially loaded</td>- <td style={{color: "red"}}>- Asset must be fully fetched- </td>+ <td style={{color: 'red'}}>Asset must be fully fetched</td></tr><tr><td>Reliability</td>- <td style={{color: "red"}}>- No guarantee, just a signal to the browser- </td>- <td style={{color: "green"}}>- Guaranteed to be ready, posssible to track progress of loading+ <td style={{color: 'red'}}>No guarantee, just a signal to the browser</td>+ <td style={{color: 'green'}}>+ Guaranteed to be ready, posssible to track progress of loading</td></tr>- <tr>+ <tr><td>Callback</td>- <td style={{- color: "red"- }}>+ <td+ style={{+ color: 'red',+ }}+ >No way to determine if ready</td>- <td style={{- color: "green"- }}>+ <td+ style={{+ color: 'green',+ }}+ >Ready when promise resolves</td></tr><tr><td>Package</td>- <td>- @remotion/preload- </td>- <td>- remotion- </td>+ <td>@remotion/preload</td>+ <td>remotion</td></tr><tr><td>Handles HTTP redirects</td><td>- Must use <a href="/docs/preload/resolve-redirect"><code>resolveRedirect()</code></a>- </td>- <td>- Handled automatically+ Must use{' '}+ <a href="/docs/preload/resolve-redirect">+ <code>resolveRedirect()</code>+ </a></td>+ <td>Handled automatically</td></tr><tr>- <td><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS">CORS</a></td><td>- Resource must support CORS if <a href="/docs/preload/resolve-redirect"><code>resolveRedirect()</code></a> is used+ <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS">CORS</a></td><td>- Resource must support CORS+ Resource must support CORS if{' '}+ <a href="/docs/preload/resolve-redirect">+ <code>resolveRedirect()</code>+ </a>{' '}+ is used</td>+ <td>Resource must support CORS</td></tr><tr><td>Available from</td>- <td>- v3.0.14- </td>- <td>- v3.2.23- </td>+ <td>v3.0.14</td>+ <td>v3.2.23</td></tr></table>