Skip to content

🎥 Make videos programmatically with React

player docs refactor

Jonny Burger5d6e4bcb9cfa
diff --git a/packages/docs/components/TableOfContents/player.tsx b/packages/docs/components/TableOfContents/player.tsx
index edd589c692..e4f734aec8 100644
--- a/packages/docs/components/TableOfContents/player.tsx
+++ b/packages/docs/components/TableOfContents/player.tsx
@@ -18,3 +18,48 @@ export const TableOfContents: React.FC = () => {
</div>
);
};
+
+export const PlayerGuide: React.FC = () => {
+ return (
+ <div>
+ <Grid>
+ <TOCItem link="/docs/player/installation">
+ <strong>Installation</strong>
+ <div>Install the Player into your project</div>
+ </TOCItem>
+ <TOCItem link="/docs/player/examples">
+ <strong>Examples</strong>
+ <div>Code samples for various scenarios</div>
+ </TOCItem>
+ <TOCItem link="/docs/player/scaling">
+ <strong>Sizing</strong>
+ <div>Setting the size of the Player</div>
+ </TOCItem>
+ <TOCItem link="/docs/player/autoplay">
+ <strong>Autoplay</strong>
+ <div>Dealing with browser autoplay policies</div>
+ </TOCItem>
+ <TOCItem link="/docs/player/current-time">
+ <strong>Display time</strong>
+ <div>Write a custom component for displaying the current time</div>
+ </TOCItem>
+ <TOCItem link="/docs/player/preloading">
+ <strong>Preloading assets</strong>
+ <div>Make assets ready to play when they appear in the video</div>
+ </TOCItem>
+ <TOCItem link="/docs/player/best-practices">
+ <strong>Best practices</strong>
+ <div>Checklist of correct implementation</div>
+ </TOCItem>
+ <TOCItem link="/docs/player/buffer-state">
+ <strong>Buffer state</strong>
+ <div>Pause the Player while assets are loading</div>
+ </TOCItem>
+ <TOCItem link="/docs/player/player-flicker">
+ <strong>Avoiding flickers</strong>
+ <div>Troubleshooting for flickers due to unloaded assets</div>
+ </TOCItem>
+ </Grid>
+ </div>
+ );
+};
diff --git a/packages/docs/docs/delay-render.md b/packages/docs/docs/delay-render.md
index e49222f831..17ef326653 100644
--- a/packages/docs/docs/delay-render.md
+++ b/packages/docs/docs/delay-render.md
@@ -147,7 +147,7 @@ export const MyComp: React.FC = () => {
## Difference to `useBufferState().delayPlayback()`
-[`useBufferState()`](/docs/use-buffer-state) is a different API that comes into play during playback in the [Studio](/docs/terminology/studio) and in the [Player](/docs/terminology/player).
+[`useBufferState()`](/docs/use-buffer-state) is a different API that allows pausing playback in the [Studio](/docs/terminology/studio) and in the [Player](/docs/terminology/player).
If you are loading data, you might want to both delay the screenshotting of your component during rendering and start a buffering state during Preview, in which case you need to use both APIs together.
diff --git a/packages/docs/docs/player/index.md b/packages/docs/docs/player/index.md
index 31f0757551..61a5431e4b 100644
--- a/packages/docs/docs/player/index.md
+++ b/packages/docs/docs/player/index.md
@@ -4,7 +4,7 @@ title: "@remotion/player"
---
import { PlayerExampleWithControls } from "../../components/PlayerExampleWithControls.tsx";
-import {TableOfContents} from '../../components/TableOfContents/player';
+import {TableOfContents, PlayerGuide} from '../../components/TableOfContents/player';
Using the Remotion Player you can embed Remotion videos in any React app and customize the video content at runtime.
@@ -16,15 +16,19 @@ The following templates include the Player and Lambda rendering and are a good s
- [Next.js (Pages dir)](/templates/next-pages-dir)
- [Remix](/templates/remix)
+## API
+
+<TableOfContents />
+
+## Guide
+
+<PlayerGuide />
+
## Demo
Play the video, then tweak the parameters below the video.
<PlayerExampleWithControls />
-## Components
-
-<TableOfContents />
-
## See also
- [Installation](/docs/player/installation)
diff --git a/packages/docs/docs/player/installation.md b/packages/docs/docs/player/installation.md
index 5f4715e4cf..220daffda4 100644
--- a/packages/docs/docs/player/installation.md
+++ b/packages/docs/docs/player/installation.md
@@ -6,7 +6,7 @@ slug: /player/installation
crumb: "@remotion/player"
---
-import {TableOfContents} from '../../components/TableOfContents/player';
+import {TableOfContents, PlayerGuide} from '../../components/TableOfContents/player';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
@@ -52,8 +52,10 @@ Also update **all the other Remotion packages** to have the same version: `remot
Make sure no package version number has a `^` character in front of it as it can lead to a version conflict.
:::
-Read the [examples](/docs/player/examples) and [API reference](/docs/player/player) next.
-
## Components
<TableOfContents />
+
+## Guide
+
+<PlayerGuide />
diff --git a/packages/docs/docs/player/scaling.md b/packages/docs/docs/player/scaling.md
index 8fe5cb789b..b7725a3008 100644
--- a/packages/docs/docs/player/scaling.md
+++ b/packages/docs/docs/player/scaling.md
@@ -1,7 +1,7 @@
---
image: /generated/articles-docs-player-scaling.png
id: scaling
-title: "Scaling"
+title: "Sizing"
crumb: "@remotion/player"
---