Skip to content

🎥 Make videos programmatically with React

start

Jonny Burger6c0f3dc0a79d
diff --git a/packages/docs/components/LandingPage/GetStartedStrip.tsx b/packages/docs/components/LandingPage/GetStartedStrip.tsx
index 008d9c40a8..6024d54014 100644
--- a/packages/docs/components/LandingPage/GetStartedStrip.tsx
+++ b/packages/docs/components/LandingPage/GetStartedStrip.tsx
@@ -10,7 +10,7 @@ export const GetStarted: React.FC = () => {
<div className={styles.myrow}>
<div style={{ position: "relative" }}>
{clicked ? (
- <div className={styles.copied} key={clicked}>
+ <div key={clicked} className={styles.copied}>
Copied!
</div>
) : null}
@@ -26,20 +26,20 @@ export const GetStarted: React.FC = () => {
$ npm init video
</div>
</div>
- <div style={{ width: 10 }}></div>
+ <div style={{ width: 10 }} />
<a className={styles.a} href="/docs">
<BlueButton size="sm" loading={false} fullWidth={false}>
Docs
</BlueButton>
</a>
- <div style={{ width: 10 }}></div>
+ <div style={{ width: 10 }} />
<a className={styles.a} href="https://github.com/remotion-dev/remotion">
<BlueButton size="sm" loading={false} fullWidth={false}>
- <GithubButton></GithubButton>
+ <GithubButton />
</BlueButton>
</a>
</div>
- <div style={{ height: 10 }}></div>
+ <div style={{ height: 10 }} />
</>
);
};
diff --git a/packages/docs/components/LandingPage/WriteInReact.tsx b/packages/docs/components/LandingPage/WriteInReact.tsx
index 606efde69e..afe6ad0388 100644
--- a/packages/docs/components/LandingPage/WriteInReact.tsx
+++ b/packages/docs/components/LandingPage/WriteInReact.tsx
@@ -15,7 +15,7 @@ export const WriteInReact: React.FC = () => {
video production using server-side rendering and parametrization.
</p>
- <GetStarted></GetStarted>
+ <GetStarted />
</div>
<div className={styles.writeright}>
<PlayerPreview />
diff --git a/packages/docs/components/Player/LandingHeader.tsx b/packages/docs/components/Player/LandingHeader.tsx
new file mode 100644
index 0000000000..e9869790ba
--- /dev/null
+++ b/packages/docs/components/Player/LandingHeader.tsx
@@ -0,0 +1,39 @@
+import React from "react";
+import { BlueButton } from "../layout/Button";
+import styles from "./landing.module.css";
+import useThemeContext from "@theme/hooks/useThemeContext";
+
+export const LandingHeader: React.FC = () => {
+ const { isDarkTheme } = useThemeContext();
+
+ return (
+ <div className={styles.container}>
+ <h1 className={styles.title}>
+ Dynamic embedded
+ <br />
+ videos in React.
+ </h1>
+ <video
+ src={isDarkTheme ? "/img/player-dark.mp4" : "/img/player-light.mp4"}
+ playsInline
+ muted
+ autoPlay
+ loop
+ />
+ <br />
+ <br />
+ <p className={styles.p}>
+ With the Remotion Player, you can embed videos that are written in
+ React, and change them at runtime. Connect it to server-side rendering
+ to turn them into real MP4 videos.
+ </p>
+ <a className={styles.a} href="/docs">
+ <BlueButton size="sm" loading={false} fullWidth={false}>
+ Get started
+ </BlueButton>
+ </a>
+ <br />
+ <br />
+ </div>
+ );
+};
diff --git a/packages/docs/components/Player/landing.module.css b/packages/docs/components/Player/landing.module.css
new file mode 100644
index 0000000000..9cf86a7cfa
--- /dev/null
+++ b/packages/docs/components/Player/landing.module.css
@@ -0,0 +1,32 @@
+.container {
+ display: flex;
+ align-items: center;
+ flex-direction: column;
+}
+
+.title {
+ font-size: 3.5em;
+ text-align: center;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
+ Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
+ margin-top: 5vh;
+ font-weight: 700;
+ line-height: 1.2;
+ -webkit-text-fill-color: transparent;
+ background: linear-gradient(
+ to right,
+ var(--text-color),
+ var(--light-text-color)
+ );
+ -webkit-background-clip: text;
+ max-width: 600px;
+}
+
+.p {
+ text-align: center;
+ max-width: 500px;
+}
+
+.a:hover {
+ text-decoration: none;
+}
diff --git a/packages/docs/src/pages/player/index.tsx b/packages/docs/src/pages/player/index.tsx
new file mode 100644
index 0000000000..5ad5ba2f4d
--- /dev/null
+++ b/packages/docs/src/pages/player/index.tsx
@@ -0,0 +1,21 @@
+import React from "react";
+import Layout from "@theme/Layout";
+import { LandingHeader } from "../../../components/Player/LandingHeader";
+
+const container: React.CSSProperties = {
+ maxWidth: 1000,
+ margin: "auto",
+};
+
+export default () => {
+ return (
+ <Layout
+ title="@remotion/player"
+ description="Embed videos that are written in React, and change them at runtime. Connect it to server-side rendering to turn them into real MP4 videos."
+ >
+ <div style={container}>
+ <LandingHeader />
+ </div>
+ </Layout>
+ );
+};
diff --git a/packages/docs/static/img/player-dark.mp4 b/packages/docs/static/img/player-dark.mp4
new file mode 100644
index 0000000000..7f7f40b9d2
Binary files /dev/null and b/packages/docs/static/img/player-dark.mp4 differ
diff --git a/packages/docs/static/img/player-light.mp4 b/packages/docs/static/img/player-light.mp4
new file mode 100644
index 0000000000..6d826df2a2
Binary files /dev/null and b/packages/docs/static/img/player-light.mp4 differ