Skip to content

🎥 Make videos programmatically with React

feat(player): implement Thumbnail component for player

Antoine Caron418a53bd17e9
diff --git a/packages/docs/docs/player/thumbnail.md b/packages/docs/docs/player/thumbnail.md
new file mode 100644
index 0000000000..d8e714a2e8
--- /dev/null
+++ b/packages/docs/docs/player/thumbnail.md
@@ -0,0 +1,38 @@
+---
+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.
+
+```tsx twoslash title="MyApp.tsx"
+// @allowUmdGlobalAccess
+// @filename: ./remotion/MyVideo.tsx
+export const MyVideo = () => <></>;
+
+// @filename: index.tsx
+// ---cut---
+import { Thumbnail } from "@remotion/player";
+import { MyVideo } from "./remotion/MyVideo";
+
+export const App: React.FC = () => {
+ return (
+ <Thumbnail
+ component={MyVideo}
+ durationInFrames={120}
+ compositionWidth={1920}
+ compositionHeight={1080}
+ fps={30}
+ />
+ );
+};
+```
+
+
+
+
+## See also
+
+- [`<Composition>`](/docs/composition)
+- [`<Player>`](/docs/player)
\ No newline at end of file
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 690512a616..e565f4cab9 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -114,7 +114,7 @@ module.exports = {
id: "player/installation",
},
label: "@remotion/player",
- items: ["player/api"],
+ items: ["player/api", "player/thumbnail"],
},
{
diff --git a/packages/player/src/Thumbnail.tsx b/packages/player/src/Thumbnail.tsx
new file mode 100644
index 0000000000..e69de29bb2