Skip to content

🎥 Make videos programmatically with React

refactor docs a bit

Jonny Burger0bc9dded3e45
diff --git a/packages/docs/docs/player/api.md b/packages/docs/docs/player/api.md
index 11f51c0fc3..553b2b0b86 100644
--- a/packages/docs/docs/player/api.md
+++ b/packages/docs/docs/player/api.md
@@ -52,7 +52,7 @@ The frame rate of the video. Must be a number.
### `compositionWidth`
-The width you would like the video to have when rendered. Use `style={{width: <width>}}` to define a different natural width for the Player.
+The width you would like the video to have when rendered as an MP4. Use `style={{width: <width>}}` to define a width to be assumed in the browser.
:::note
**Example**:
@@ -62,8 +62,7 @@ To make it smaller, pass a `style` prop to give the player a different width: `{
### `compositionHeight`
-The height of the canvas in pixels.
-The height you would like the video to have when rendered. Use `style={{height: <height>}}` to define a different natural height for the Player.
+The height you would like the video to have when rendered as an MP4. Use `style={{height: <height>}}` to define a height to be assumed in the browser.
### `loop`
@@ -748,3 +747,5 @@ const MyApp: React.FC = () => {
## See also
- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/player/src/Player.tsx)
+- [`<Composition>`](/docs/composition)
+- [`<Thumbnail>`](/docs/player/thumbnail)
diff --git a/packages/docs/docs/player/thumbnail.md b/packages/docs/docs/player/thumbnail.md
index 6fc6dac802..6e99840cac 100644
--- a/packages/docs/docs/player/thumbnail.md
+++ b/packages/docs/docs/player/thumbnail.md
@@ -3,13 +3,12 @@ id: thumbnail
title: "<Thumbnail>"
---
-A component which can be rendered in a regular React App (for example: [Create React App](https://create-react-app.dev/), [Next.JS](https://nextjs.org)) to display a thumbnail from a video.
-This component share React props definition of the [`<Player>`](/player/api) component.
+A component which can be rendered in a regular React App (for example: [Create React App](https://create-react-app.dev/), [Next.JS](https://nextjs.org)) to display a single frame of a video.
```tsx twoslash title="MyApp.tsx"
// @allowUmdGlobalAccess
// @filename: ./remotion/MyVideo.tsx
-export const MyVideo = ({ title }) => <>{ title }</>;
+export const MyVideo = ({ title }) => <>{title}</>;
// @filename: index.tsx
// ---cut---
@@ -18,17 +17,17 @@ import { MyVideo } from "./remotion/MyVideo";
export const App: React.FC = () => {
return (
- <Thumbnail
- inputProps={{
- title: 'Foo'
- }}
- component={MyVideo}
- compositionWidth={600}
- compositionHeight={600}
- frameToDisplay={30}
- durationInFrames={120} f
- ps={30}
- />
+ <Thumbnail
+ inputProps={{
+ title: "Foo",
+ }}
+ component={MyVideo}
+ compositionWidth={600}
+ compositionHeight={600}
+ frameToDisplay={30}
+ durationInFrames={120}
+ fps={30}
+ />
);
};
```
@@ -49,15 +48,20 @@ Thumbnail does not use [`<Composition>`](/docs/composition)'s. Pass your compone
Index of the frame rendered by the composition in the Thumbnail.
-
### `compositionWidth`
-The width you would like the video to have when rendered. Use `style={{width: <width>}}` to define a different natural width for the Thumbnail.
+The width you would like the video to have when rendered as an MP4. Use `style={{width: <width>}}` to define a width to be assumed in the browser.
+
+:::note
+**Example**:
+If you want to render a Full HD video, set `compositionWidth` to `1920` and `compositionHeight` to `1080`. By default, the thumbnail will also assume these dimensions.
+To make it smaller, pass a `style` prop to give the Thumbnail a different width: `{"style={{width: 400}}"}`. See [Player Scaling](/docs/player/scaling) to learn more.
+:::
### `compositionHeight`
The height of the canvas in pixels.
-The height you would like the video to have when rendered. Use `style={{height: <height>}}` to define a different natural height for the Thumbnail.
+The height you would like the video to have when rendered as an MP4. Use `style={{height: <height>}}` to define a height to be assumed in the browser.
### `inputProps`
@@ -75,14 +79,20 @@ A regular `style` prop for a HTMLDivElement. You can pass a different height and
The duration of the video in frames. Must be an integer and greater than 0.
+:::note
+This prop is required for the Thumbnail component because your component may render differently based on what `useVideoConfig()` returns.
+:::
+
### `fps`
The frame rate of the video. Must be a number.
-
-
+:::note
+This prop is required for the Thumbnail component because your component may render differently based on what `useVideoConfig()` returns.
+:::
## See also
+- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/player/src/Thumbnail.tsx)
- [`<Composition>`](/docs/composition)
-- [`<Player>`](/docs/player)
\ No newline at end of file
+- [`<Player>`](/docs/player)