Skip to content

🎥 Make videos programmatically with React

player table of contents

Jonny Burger12384a4df9a5
diff --git a/packages/docs/components/TableOfContents/api.tsx b/packages/docs/components/TableOfContents/api.tsx
index 840add9d9f..912025264d 100644
--- a/packages/docs/components/TableOfContents/api.tsx
+++ b/packages/docs/components/TableOfContents/api.tsx
@@ -6,6 +6,7 @@ import {TableOfContents as FontsTableOfContents} from '../../docs/fonts-api/Tabl
import {TableOfContents as InstallWhisperCppTableOfContents} from '../../docs/install-whisper-cpp/install-whisper-cpp';
import {TableOfContents as MediaParserTableOfContents} from '../../docs/media-parser/TableOfContents';
import {TableOfContents as OpenAiWhisperTableOfContents} from '../../docs/openai-whisper/TableOfContents';
+import {PlayerTableOfContents} from '../../docs/player/TableOfContents';
import {TableOfContents as SkiaTableOfContents} from '../../docs/skia/TableOfContents';
import {TableOfContents as StudioTableOfContents} from '../../docs/studio/TableOfContents';
import {TableOfContents as TailwindTableOfContents} from '../../docs/tailwind/TableOfContents';
@@ -22,7 +23,6 @@ import {TableOfContents as MediaUtilsTableOfContents} from '../TableOfContents/m
import {TableOfContents as MotionBlurTableOfContents} from '../TableOfContents/motion-blur';
import {TableOfContents as NoiseTableOfContents} from '../TableOfContents/noise';
import {TableOfContents as PathsTableOfContents} from '../TableOfContents/paths';
-import {TableOfContents as PlayerTableOfContents} from '../TableOfContents/player';
import {TableOfContents as PreloadTableOfContents} from '../TableOfContents/preload';
import {TableOfContents as RemotionTableOfContents} from '../TableOfContents/remotion';
import {TableOfContents as RendererTableOfContents} from '../TableOfContents/renderer';
diff --git a/packages/docs/components/TableOfContents/player.tsx b/packages/docs/components/TableOfContents/player.tsx
deleted file mode 100644
index ea21479d83..0000000000
--- a/packages/docs/components/TableOfContents/player.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-import React from "react";
-import { Grid } from "./Grid";
-import { TOCItem } from "./TOCItem";
-
-export const TableOfContents: React.FC = () => {
- return (
- <div>
- <Grid>
- <TOCItem link="/docs/player/player">
- <strong>{"<Player>"}</strong>
- <div>Embed a Remotion composition in a web app</div>
- </TOCItem>
- <TOCItem link="/docs/player/thumbnail">
- <strong>{"<Thumbnail>"}</strong>
- <div>Embed a still in a web app</div>
- </TOCItem>
- </Grid>
- </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/troubleshooting/player-flicker">
- <strong>Avoiding flickers</strong>
- <div>Troubleshooting for flickers due to unloaded assets</div>
- </TOCItem>
- <TOCItem link="/docs/player/premounting">
- <strong>Premounting</strong>
- <div>Mount components earlier to allow them to load</div>
- </TOCItem>
- </Grid>
- </div>
- );
-};
diff --git a/packages/docs/docs/player/TableOfContents.tsx b/packages/docs/docs/player/TableOfContents.tsx
new file mode 100644
index 0000000000..6f2414d862
--- /dev/null
+++ b/packages/docs/docs/player/TableOfContents.tsx
@@ -0,0 +1,69 @@
+import React from 'react';
+import {Grid} from '../../components/TableOfContents/Grid';
+import {TOCItem} from '../../components/TableOfContents/TOCItem';
+
+export const PlayerTableOfContents: React.FC = () => {
+ return (
+ <div>
+ <Grid>
+ <TOCItem link="/docs/player/player">
+ <strong>{'<Player>'}</strong>
+ <div>Embed a Remotion composition in a web app</div>
+ </TOCItem>
+ <TOCItem link="/docs/player/thumbnail">
+ <strong>{'<Thumbnail>'}</strong>
+ <div>Embed a still in a web app</div>
+ </TOCItem>
+ </Grid>
+ </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/troubleshooting/player-flicker">
+ <strong>Avoiding flickers</strong>
+ <div>Troubleshooting for flickers due to unloaded assets</div>
+ </TOCItem>
+ <TOCItem link="/docs/player/premounting">
+ <strong>Premounting</strong>
+ <div>Mount components earlier to allow them to load</div>
+ </TOCItem>
+ </Grid>
+ </div>
+ );
+};
diff --git a/packages/docs/docs/player/index.mdx b/packages/docs/docs/player/index.mdx
index bf5c6e3ca5..3ff7c7f22c 100644
--- a/packages/docs/docs/player/index.mdx
+++ b/packages/docs/docs/player/index.mdx
@@ -1,13 +1,10 @@
---
image: /generated/articles-docs-player-index.png
-title: "@remotion/player"
+title: '@remotion/player'
---
-import { PlayerExampleWithControls } from "../../components/PlayerExampleWithControls";
-import {
- TableOfContents,
- PlayerGuide,
-} from "../../components/TableOfContents/player";
+import {PlayerExampleWithControls} from '../../components/PlayerExampleWithControls';
+import {PlayerTableOfContents, PlayerGuide} from './TableOfContents';
Using the Remotion Player you can embed Remotion videos in any React app and customize the video content at runtime.
@@ -22,7 +19,7 @@ The following templates include the Player and Lambda rendering and are a good s
## API
-<TableOfContents />
+<PlayerTableOfContents />
## Guide
diff --git a/packages/docs/docs/player/installation.mdx b/packages/docs/docs/player/installation.mdx
index cf48309c35..29778aae4d 100644
--- a/packages/docs/docs/player/installation.mdx
+++ b/packages/docs/docs/player/installation.mdx
@@ -3,18 +3,18 @@ image: /generated/articles-docs-player-installation.png
id: installation
title: Installation
slug: /player/installation
-crumb: "@remotion/player"
+crumb: '@remotion/player'
---
-import {TableOfContents, PlayerGuide} from '../../components/TableOfContents/player';
+import {PlayerTableOfContents, PlayerGuide} from './TableOfContents';
To install the Player, run the following command in a React project:
-<Installation pkg="@remotion/player"/>
+<Installation pkg="@remotion/player" />
## Components
-<TableOfContents />
+<PlayerTableOfContents />
## Guide