🎥 Make videos programmatically with React
features
Jonny Burger274fcc46e98f
diff --git a/packages/docs/components/LandingPage/if-you-know-react.tsx b/packages/docs/components/LandingPage/if-you-know-react.tsxindex 760b05c3be..c4e487955f 100644--- a/packages/docs/components/LandingPage/if-you-know-react.tsx+++ b/packages/docs/components/LandingPage/if-you-know-react.tsx@@ -7,8 +7,8 @@ import styles from "./ifyouknowreact.module.css";export const IfYouKnowReact: React.FC = () => {return (<div className={styles.ifyouknowrow}>- <CodeExample></CodeExample>- <div style={{ width: 40 }}></div>+ <CodeExample />+ <div style={{ width: 40 }} /><div><h2 className={styles.ifyouknowtitle}>If you know <span className={styles.rea}>React</span> <br />@@ -19,8 +19,8 @@ export const IfYouKnowReact: React.FC = () => {of React stay the same. <br /></p>Learn the fundamentals in just a few minutes.- <Spacer></Spacer>- <Spacer></Spacer>+ <Spacer />+ <Spacer /><a className={styles.aknow} href="/docs/the-fundamentals"><BlueButton size="sm" fullWidth={false} loading={false}>Learn Remotiondiff --git a/packages/docs/components/Player/PoweredByRemotion.tsx b/packages/docs/components/Player/PoweredByRemotion.tsxindex 9dc19548e7..50e276efb3 100644--- a/packages/docs/components/Player/PoweredByRemotion.tsx+++ b/packages/docs/components/Player/PoweredByRemotion.tsx@@ -1,5 +1,18 @@import React from "react";+const btn: React.CSSProperties = {+ backgroundColor: "white",+ padding: "10px 16px",+ appearance: "none",+ color: "#0B84F3",+ border: "none",+ fontFamily: "inherit",+ fontWeight: "bold",+ borderRadius: 8,+ cursor: "pointer",+ fontSize: 16,+};+export const PoweredByRemotion: React.FC = () => {return (<div style={{ background: `#0B84F3` }}>@@ -12,18 +25,30 @@ export const PoweredByRemotion: React.FC = () => {paddingTop: 30,paddingBottom: 30,color: `#fff`,- textAlign: "center",+ display: "flex",+ flexDirection: "row",+ alignItems: "center",}}>- <p style={{ marginBottom: 8 }}>- <strong>Powered by Remotion</strong>- </p>- <p style={{ marginBottom: 0 }}>- Remotion is the premier framework for writing videos in React.- <br />- Use our Timeline UI and Fast Refresh to get every frame perfect,- before you embed it in a website.- </p>+ <div>+ <p style={{ marginBottom: 8 }}>+ <strong>Powered by Remotion</strong>+ </p>+ <p style={{ marginBottom: 0 }}>+ Remotion is the premier framework for writing videos in React.+ <br />+ Use the timeline editor with Fast Refresh to get every frame+ perfect, before you embed it in a website.+ </p>+ </div>+ <div style={{ flex: 1 }} />+ <div>+ <a href="/">+ <button style={btn} type="button">+ Learn more+ </button>+ </a>+ </div></div></div>);diff --git a/packages/docs/components/Player/features.module.css b/packages/docs/components/Player/features.module.cssnew file mode 100644index 0000000000..d18e21ab54--- /dev/null+++ b/packages/docs/components/Player/features.module.css@@ -0,0 +1,18 @@+.title {+ font-size: 2.5em;+ font-weight: 700;+ font-family: --apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,+ Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;+ line-height: 1.1;+}++.keyword {+ background: linear-gradient(to right, rgb(66, 144, 245), rgb(66, 233, 245));+ -webkit-text-fill-color: transparent;+ -webkit-background-clip: text;+}++.container {+ margin-top: 80px;+ margin-bottom: 80px;+}diff --git a/packages/docs/components/Player/features.tsx b/packages/docs/components/Player/features.tsxnew file mode 100644index 0000000000..1b327f4461--- /dev/null+++ b/packages/docs/components/Player/features.tsx@@ -0,0 +1,62 @@+import React from "react";+import styles from "./features.module.css";++const row: React.CSSProperties = {+ display: "flex",+ flexDirection: "row",+ paddingTop: 40,+ paddingBottom: 40,+};++const half: React.CSSProperties = {+ flex: 1,+};++export const PlayerFeatures: React.FC = () => {+ return (+ <div className={styles.container}>+ <div style={row}>+ <div style={half}>+ <h2 className={styles.title}>+ <span className={styles.keyword}>Reactive</span> to data+ </h2>+ <p>+ Connect the video to an API or a form - the video will update+ immediately once the data changes - simply update a React prop!+ </p>+ </div>+ <div style={{ width: 20 }} />+ <div style={half} />+ </div>+ <div style={row}>+ <div style={half}>+ <h2 className={styles.title}>+ Extremely <span className={styles.keyword}>customizable</span>+ </h2>+ <p>+ The Remotion Player is inspired by the browsers native{" "}+ <code><video></code> tag. Get started by adding the{" "}+ <code>controls</code> prop, or build your own UI using our flexible+ APIs.{" "}+ </p>+ </div>+ <div style={{ width: 20 }} />+ <div style={half} />+ </div>+ <div style={row}>+ <div style={half}>+ <h2 className={styles.title}>+ Turn it into <span className={styles.keyword}>real videos</span>+ </h2>+ <p>+ Connect to the Remotion server-side rendering APIs to turn the+ preview into real videos. We have support for audio and various+ codecs, and allow rendering in Node.JS or serverless (coming soon).+ </p>+ </div>+ <div style={{ width: 20 }} />+ <div style={half} />+ </div>+ </div>+ );+};diff --git a/packages/docs/docs/the-fundamentals.md b/packages/docs/docs/the-fundamentals.mdindex d0b22edf16..0775c615a4 100644--- a/packages/docs/docs/the-fundamentals.md+++ b/packages/docs/docs/the-fundamentals.md@@ -34,7 +34,7 @@ A video has 4 properties:- `durationInFrames`: The number of frames which the video is long.- `fps`: The amount of frames per second. The duration in frames divided by FPS results in the duration in seconds.-These properties are variable and you can reuse a component multiple times with different properties. This is why you better not hard-code these properties, but instead derive them from the `useVideoConfig` hook:+These properties are variable and you can reuse a component multiple times with different properties. This is why you better not hard-code these properties, but instead derive them from the [`useVideoConfig()`](/docs/use-video-config) hook:```tsx twoslashimport { useVideoConfig } from "remotion";@@ -79,4 +79,4 @@ export const RemotionVideo: React.FC = () => {Remember that if you like, you can register multiple compositions that rely on the same component. For example, if you like to make a square video for social media feeds, and a portrait video for Stories, you can reuse the component and try to make it 'responsive'.-Besides the `<Composition />` component, you can also render a [`<Still />`](/docs/still) component and define a still image rather than a video.+Besides the [`<Composition />`](/docs/composition) component, you can also use a [`<Still />`](/docs/still) component and define a still image rather than a video.diff --git a/packages/docs/src/css/custom.css b/packages/docs/src/css/custom.cssindex 62a313a8c6..0a79c2c3fc 100644--- a/packages/docs/src/css/custom.css+++ b/packages/docs/src/css/custom.css@@ -63,3 +63,15 @@pre.shiki > .code-title {color: var(--ifm-color-emphasis-900) !important;}++code {+ background-color: transparent;+ border-width: 0;+ color: #0b84f3;+ padding: 0;+}++.markdown a {+ text-underline-position: under;+ text-decoration: underline;+}diff --git a/packages/docs/src/pages/player/index.tsx b/packages/docs/src/pages/player/index.tsxindex 8e42a0e422..62f47fc1b6 100644--- a/packages/docs/src/pages/player/index.tsx+++ b/packages/docs/src/pages/player/index.tsx@@ -1,6 +1,7 @@import React from "react";import Layout from "@theme/Layout";import { LandingHeader } from "../../../components/Player/LandingHeader";+import { PlayerFeatures } from "../../../components/Player/features";import { PoweredByRemotion } from "../../../components/Player/PoweredByRemotion";const container: React.CSSProperties = {@@ -20,6 +21,9 @@ export default () => {<LandingHeader /></div><PoweredByRemotion />+ <div style={container}>+ <PlayerFeatures />+ </div></Layout>);};