Skip to content

🎥 Make videos programmatically with React

update docs

Jonny Burger25d97f304bb3
diff --git a/packages/docs/docs/importing-assets.md b/packages/docs/docs/importing-assets.md
index 30bf0b5152..fabf60ed48 100644
--- a/packages/docs/docs/importing-assets.md
+++ b/packages/docs/docs/importing-assets.md
@@ -200,6 +200,20 @@ Before rendering, the code gets bundled using Webpack, and only bundled assets c
For this reason, assets that are being added to the public folder after [`bundle()`](/docs/bundle) is called will not be accessible during render.
However, if you use the [server-side rendering APIs](/docs/ssr-node), you can add assets to the `public` folder that is inside the bundle after the fact.
+## Use `<Img>`, `<Video>` and `<Audio>`
+
+**Prefer [`<Img />`](/docs/img) or [`<Gif />`](/docs/gif)** over the native `<img>` tag, `<Image>` from Next.js and CSS `background-image`.
+**Prefer [`<OffthreadVideo />`](/docs/offthreadvideo) or [`<Video />`](/docs/video)** over the native `<video>` tag.
+**Prefer [`<Audio />`](/docs/audio)** over the native `<audio>` tag.
+**Prefer [`<IFrame />`](/docs/iframe)** over the native `<iframe>` tag.
+
+<br/>
+
+By using the components from Remotion, you ensure that:
+
+<Step>1</Step> The assets are fully loaded before the the frame is rendered<br/>
+<Step>2</Step> The images and videos are synchronized with Remotion's timeline.
+
## See also
- [staticFile()](/docs/staticfile)
diff --git a/packages/docs/docs/use-img-and-iframe.md b/packages/docs/docs/use-img-and-iframe.md
index 5e9f6463b3..7ddf1295f2 100644
--- a/packages/docs/docs/use-img-and-iframe.md
+++ b/packages/docs/docs/use-img-and-iframe.md
@@ -12,7 +12,7 @@ crumb: "Best practices"
<br/>
-By using the components by Remotion, it will be ensured that:
+By using the components from Remotion, you ensure that:
<Step>1</Step> The assets are fully loaded before the the frame is rendered<br/>
<Step>2</Step> The images and videos are synchronized with Remotion's timeline.
diff --git a/packages/docs/docs/using-audio.md b/packages/docs/docs/using-audio.md
index e72a82347e..c4312751f6 100644
--- a/packages/docs/docs/using-audio.md
+++ b/packages/docs/docs/using-audio.md
@@ -1,6 +1,7 @@
---
image: /generated/articles-docs-using-audio.png
title: Using audio
+sidebar_label: Audio
id: using-audio
crumb: "Techniques"
---
diff --git a/packages/docs/docs/using-fonts.md b/packages/docs/docs/using-fonts.md
index 614a6d6c03..7682b200e4 100644
--- a/packages/docs/docs/using-fonts.md
+++ b/packages/docs/docs/using-fonts.md
@@ -1,6 +1,7 @@
---
image: /generated/articles-docs-using-fonts.png
title: Using fonts
+sidebar_label: Fonts
id: fonts
crumb: "Techniques"
---
@@ -55,7 +56,7 @@ import { continueRender, delayRender, staticFile } from "remotion";
const waitForFont = delayRender();
const font = new FontFace(
`Bangers`,
- `url('${staticFile("bangers.woff2")}') format('woff2')`
+ `url('${staticFile("bangers.woff2")}') format('woff2')`,
);
font
diff --git a/packages/docs/docs/using-randomness.md b/packages/docs/docs/using-randomness.md
index 812cf6b4f8..f437618bbd 100644
--- a/packages/docs/docs/using-randomness.md
+++ b/packages/docs/docs/using-randomness.md
@@ -1,6 +1,7 @@
---
image: /generated/articles-docs-using-randomness.png
id: using-randomness
+sidebar_label: Randomness
title: Using randomness
crumb: "Roll the dice"
---
@@ -17,7 +18,7 @@ const MyComp: React.FC = () => {
x: Math.random(),
y: Math.random(),
};
- })
+ }),
);
// Do something with coordinates
return <></>;
diff --git a/packages/docs/docs/video.md b/packages/docs/docs/video.md
index 2f32e7458c..2007612907 100644
--- a/packages/docs/docs/video.md
+++ b/packages/docs/docs/video.md
@@ -7,7 +7,7 @@ crumb: "API"
This component allows you to include a video file in your Remotion project. It wraps the native [`HTMLVideoElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement).
-Use [`<OffthreadVideo>`](/docs/offthreadvideo) by default instead which is in general faster.
+Prefer [`<OffthreadVideo>`](/docs/offthreadvideo) by default which is faster during rendering.
## API
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 48c62f4e7a..4fb96f136a 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -513,14 +513,13 @@ module.exports = {
"assets",
"layers",
"transitioning",
- "use-img-and-iframe",
"using-audio",
"fonts",
+ "measuring",
"using-randomness",
"audio-visualization",
"noise-visualization",
"video-manipulation",
- "measuring",
],
},
{