Skip to content

🎥 Make videos programmatically with React

Update video-tags.mdx

Jonny Burger4a4e44d1a209
diff --git a/packages/docs/docs/video-tags.mdx b/packages/docs/docs/video-tags.mdx
index 577f10a1b1..5aab9eba11 100644
--- a/packages/docs/docs/video-tags.mdx
+++ b/packages/docs/docs/video-tags.mdx
@@ -35,24 +35,20 @@ This page offers a comparison to help you decide which tag to use.
Use the [`useRemotionEnvironment()`](/docs/use-remotion-environment) hook to render a different component in preview and rendering.
```tsx twoslash title="OffthreadVideo during preview, @remotion/media during rendering"
-import {
- useRemotionEnvironment,
- OffthreadVideo,
- RemotionOffthreadVideoProps,
-} from 'remotion';
+import {useRemotionEnvironment, OffthreadVideo, RemotionOffthreadVideoProps} from 'remotion';
import {Video, VideoProps} from '@remotion/media';
const OffthreadWhileRenderingRefForwardingFunction: React.FC<{
- offthreadVideoProps: RemotionOffthreadVideoProps;
- videoProps: VideoProps;
+ offthreadVideoProps: RemotionOffthreadVideoProps;
+ videoProps: VideoProps;
}> = ({offthreadVideoProps, videoProps}) => {
- const env = useRemotionEnvironment();
+ const env = useRemotionEnvironment();
- if (!env.isRendering) {
- return <OffthreadVideo {...offthreadVideoProps} />;
- }
+ if (!env.isRendering) {
+ return <OffthreadVideo {...offthreadVideoProps} />;
+ }
- return <Video {...videoProps} />;
+ return <Video {...videoProps} />;
};
```
@@ -63,15 +59,15 @@ import {useRemotionEnvironment, Html5Audio, RemotionAudioProps} from 'remotion';
import {Audio, AudioProps} from '@remotion/media';
const Html5AudioWhilePreviewingComponent: React.FC<{
- html5AudioProps: RemotionAudioProps;
- audioProps: AudioProps;
+ html5AudioProps: RemotionAudioProps;
+ audioProps: AudioProps;
}> = ({html5AudioProps, audioProps}) => {
- const env = useRemotionEnvironment();
+ const env = useRemotionEnvironment();
- if (!env.isRendering) {
- return <Html5Audio {...html5AudioProps} />;
- }
+ if (!env.isRendering) {
+ return <Html5Audio {...html5AudioProps} />;
+ }
- return <Audio {...audioProps} />;
+ return <Audio {...audioProps} />;
};
```