🎥 Make videos programmatically with React
`@remotion/promo-pages`: Disable prompt showcase submissions (#8687)
Jonny Burger66488a7c1a1b
diff --git a/packages/docs/src/pages/prompts/submit.tsx b/packages/docs/src/pages/prompts/submit.tsxindex 1521f70eb0..f00d5e066a 100644--- a/packages/docs/src/pages/prompts/submit.tsx+++ b/packages/docs/src/pages/prompts/submit.tsx@@ -13,7 +13,7 @@ export default () => {<Head>{Seo.renderTitle('Share your video | Remotion')}{Seo.renderDescription(- 'Share a video you made with Remotion to be featured in the Prompt Showcase.',+ 'Submissions are currently disabled while we work on something better!',)}{Seo.renderImage('/generated/articles-prompts-submit.png',diff --git a/packages/promo-pages/src/components/homepage/GetStartedStrip.tsx b/packages/promo-pages/src/components/homepage/GetStartedStrip.tsxindex 3ab7827fc4..6c653969df 100644--- a/packages/promo-pages/src/components/homepage/GetStartedStrip.tsx+++ b/packages/promo-pages/src/components/homepage/GetStartedStrip.tsx@@ -59,25 +59,6 @@ export const GetStarted: React.FC = () => {><GithubButton /></Button>- </div>{' '}- <div className="w-2 h-2" />- <div className="w-full lg:w-auto">- <Button href="/prompts" className="w-full">- <svg- width="20"- height="20"- viewBox="0 0 149 149"- fill="none"- xmlns="http://www.w3.org/2000/svg"- style={{marginRight: 8}}- >- <path- d="M29.05 98.54L58.19 82.19L58.68 80.77L58.19 79.98H56.77L51.9 79.68L35.25 79.23L20.81 78.63L6.82 77.88L3.3 77.13L0 72.78L0.340004 70.61L3.3 68.62L7.54 68.99L16.91 69.63L30.97 70.6L41.17 71.2L56.28 72.77H58.68L59.02 71.8L58.2 71.2L57.56 70.6L43.01 60.74L27.26 50.32L19.01 44.32L14.55 41.28L12.3 38.43L11.33 32.21L15.38 27.75L20.82 28.12L22.21 28.49L27.72 32.73L39.49 41.84L54.86 53.16L57.11 55.03L58.01 54.39L58.12 53.94L57.11 52.25L48.75 37.14L39.83 21.77L35.86 15.4L34.81 11.58C34.44 10.01 34.17 8.69 34.17 7.08L38.78 0.820007L41.33 0L47.48 0.820007L50.07 3.07001L53.89 11.81L60.08 25.57L69.68 44.28L72.49 49.83L73.99 54.97L74.55 56.54H75.52V55.64L76.31 45.1L77.77 32.16L79.19 15.51L79.68 10.82L82 5.2L86.61 2.16L90.21 3.88L93.17 8.12L92.76 10.86L91 22.3L87.55 40.22L85.3 52.22H86.61L88.11 50.72L94.18 42.66L104.38 29.91L108.88 24.85L114.13 19.26L117.5 16.6H123.87L128.56 23.57L126.46 30.77L119.9 39.09L114.46 46.14L106.66 56.64L101.79 65.04L102.24 65.71L103.4 65.6L121.02 61.85L130.54 60.13L141.9 58.18L147.04 60.58L147.6 63.02L145.58 68.01L133.43 71.01L119.18 73.86L97.96 78.88L97.7 79.07L98 79.44L107.56 80.34L111.65 80.56H121.66L140.3 81.95L145.17 85.17L148.09 89.11L147.6 92.11L140.1 95.93L129.98 93.53L106.36 87.91L98.26 85.89H97.14V86.56L103.89 93.16L116.26 104.33L131.75 118.73L132.54 122.29L130.55 125.1L128.45 124.8L114.84 114.56L109.59 109.95L97.7 99.94H96.91V100.99L99.65 105L114.12 126.75L114.87 133.42L113.82 135.59L110.07 136.9L105.95 136.15L97.48 124.26L88.74 110.87L81.69 98.87L80.83 99.36L76.67 144.17L74.72 146.46L70.22 148.18L66.47 145.33L64.48 140.72L66.47 131.61L68.87 119.72L70.82 110.27L72.58 98.53L73.63 94.63L73.56 94.37L72.7 94.48L63.85 106.63L50.39 124.82L39.74 136.22L37.19 137.23L32.77 134.94L33.18 130.85L35.65 127.21L50.39 108.46L59.28 96.84L65.02 90.13L64.98 89.16H64.64L25.49 114.58L18.52 115.48L15.52 112.67L15.89 108.06L17.31 106.56L29.08 98.46L29.04 98.5L29.05 98.54Z"- fill="#D97757"- />- </svg>- Prompt a video- </Button></div></div>);diff --git a/packages/promo-pages/src/components/prompts/PromptsGallery.tsx b/packages/promo-pages/src/components/prompts/PromptsGallery.tsxindex 9fcaa268f7..bd878a62d0 100644--- a/packages/promo-pages/src/components/prompts/PromptsGallery.tsx+++ b/packages/promo-pages/src/components/prompts/PromptsGallery.tsx@@ -191,8 +191,7 @@ export const PromptsGalleryPage: React.FC<{>Remotion Skills</a>{' '}- and a coding agent like Claude Code, Codex, or OpenCode. Want to- make your own?+ and coding agents like Claude Code, Codex, or OpenCode.</p></div><div className="flex items-center gap-2">@@ -215,12 +214,6 @@ export const PromptsGalleryPage: React.FC<{</svg><div className="text-sm">Create your own video</div></Button>- <Button- href="/prompts/submit"- className="font-brand rounded-full text-sm"- >- Share your video- </Button></div><div className="h-12" />diff --git a/packages/promo-pages/src/components/prompts/PromptsSubmit.tsx b/packages/promo-pages/src/components/prompts/PromptsSubmit.tsxindex de3bfa41e7..5214cac191 100644--- a/packages/promo-pages/src/components/prompts/PromptsSubmit.tsx+++ b/packages/promo-pages/src/components/prompts/PromptsSubmit.tsx@@ -1,246 +1,9 @@-import {- Button,- Input,- Tabs,- TabsContent,- TabsList,- TabsTrigger,- Textarea,-} from '@remotion/design';-import React, {useCallback, useEffect, useRef, useState} from 'react';-import {REMOTION_PRO_ORIGIN} from './config';-import {MuxPlayer} from './MuxPlayer';+import {Button} from '@remotion/design';+import React from 'react';import {NewBackButton} from './NewBackButton';import {Page} from './Page';-type UsernameType = 'github' | 'x';--type UploadState =- | {type: 'idle'}- | {type: 'uploading'; progress: number}- | {type: 'processing'}- | {type: 'ready'; muxAssetId: string; muxPlaybackId: string}- | {type: 'error'; message: string};--type SubmitStatus =- | {type: 'idle'}- | {type: 'submitting'}- | {type: 'done'; slug: string}- | {type: 'error'; err: Error};-export const PromptsSubmitPage: React.FC = () => {- const [title, setTitle] = useState('');- const [prompt, setPrompt] = useState('');- const [toolUsed, setToolUsed] = useState('');- const [modelUsed, setModelUsed] = useState('');- const [usernameType, setUsernameType] = useState<UsernameType>('github');- const [username, setUsername] = useState('');- const [uploadState, setUploadState] = useState<UploadState>({type: 'idle'});- const [submitStatus, setSubmitStatus] = useState<SubmitStatus>({- type: 'idle',- });- const [isDragging, setIsDragging] = useState(false);- const pollRef = useRef<ReturnType<typeof setInterval> | null>(null);-- useEffect(() => {- return () => {- if (pollRef.current) clearInterval(pollRef.current);- };- }, []);-- const fileInputRef = useRef<HTMLInputElement | null>(null);-- const startUpload = useCallback(async (file: File) => {- setUploadState({type: 'uploading', progress: 0});-- try {- const res = await fetch(`${REMOTION_PRO_ORIGIN}/api/prompts/upload`, {- method: 'POST',- headers: {'content-type': 'application/json'},- });- const {id, url} = await res.json();-- const {createUpload} = await import('@mux/upchunk');- const upload = createUpload({endpoint: url, file});-- upload.on('progress', (p: {detail: number}) => {- setUploadState({type: 'uploading', progress: p.detail});- });-- upload.on('success', () => {- setUploadState({type: 'processing'});-- pollRef.current = setInterval(async () => {- try {- const statusRes = await fetch(- `${REMOTION_PRO_ORIGIN}/api/prompts/upload/${id}`,- );- if (!statusRes.ok) {- throw new Error(- `Failed to fetch upload status: ${statusRes.status}`,- );- }-- const data = await statusRes.json();-- if (- data.status === 'asset_created' &&- data.playback_id &&- data.asset_status === 'ready'- ) {- if (pollRef.current) clearInterval(pollRef.current);- setUploadState({- type: 'ready',- muxAssetId: data.asset_id,- muxPlaybackId: data.playback_id,- });- }- } catch (error) {- // eslint-disable-next-line no-console- console.error('Error while polling upload status', error);- }- }, 2000);- });-- upload.on('error', (err: {detail: {message: string}}) => {- setUploadState({- type: 'error',- message: err.detail.message,- });- });- } catch (err) {- setUploadState({- type: 'error',- message: err instanceof Error ? err.message : 'Upload failed',- });- }- }, []);-- const onFileSelect = useCallback(- (e: React.ChangeEvent<HTMLInputElement>) => {- const file = e.target.files?.[0];- if (!file) return;- startUpload(file);- },- [startUpload],- );-- const onDrop: React.DragEventHandler = useCallback(- (e) => {- e.preventDefault();- setIsDragging(false);- if (uploadState.type !== 'idle') return;- const file = e.dataTransfer?.files?.[0];- if (!file) return;- if (!file.type.startsWith('video/')) return;- startUpload(file);- },- [startUpload, uploadState.type],- );-- const onDragOver: React.DragEventHandler = useCallback((e) => {- e.preventDefault();- }, []);-- const onDragEnter: React.DragEventHandler = useCallback(() => {- if (uploadState.type === 'idle') {- setIsDragging(true);- }- }, [uploadState.type]);-- const onDragLeave: React.DragEventHandler = useCallback((e) => {- if (e.currentTarget === e.target) {- setIsDragging(false);- }- }, []);-- const submitPossible =- title.length > 0 &&- title.length <= 80 &&- prompt.length > 0 &&- usernameType &&- username.length > 0 &&- uploadState.type === 'ready' &&- (submitStatus.type === 'idle' || submitStatus.type === 'error');-- const submit = useCallback(async () => {- if (!submitPossible || uploadState.type !== 'ready') return;-- setSubmitStatus({type: 'submitting'});-- try {- const res = await fetch(`${REMOTION_PRO_ORIGIN}/api/prompts/submit`, {- method: 'POST',- headers: {'content-type': 'application/json'},- body: JSON.stringify({- muxAssetId: uploadState.muxAssetId,- muxPlaybackId: uploadState.muxPlaybackId,- title,- prompt,- toolUsed: toolUsed || undefined,- modelUsed: modelUsed || undefined,- githubUsername: usernameType === 'github' ? username : undefined,- xUsername: usernameType === 'x' ? username : undefined,- }),- });-- if (!res.ok) {- const submissionData = await res.json();- throw new Error(submissionData.error || 'Submission failed');- }-- const data = await res.json();- setSubmitStatus({type: 'done', slug: data.slug});- } catch (err) {- setSubmitStatus({type: 'error', err: err as Error});- }- }, [- submitPossible,- uploadState,- title,- prompt,- usernameType,- username,- toolUsed,- modelUsed,- ]);-- if (submitStatus.type === 'done') {- return (- <Page className="flex-col">- <div className="m-auto max-w-[800px] w-full">- <div className="mx-4 px-8 py-8 mt-12 pt-8">- <h1 className="text-3xl font-brand font-black">- Submission received!- </h1>- <div className="mt-4 text-muted-foreground font-brand">- Thanks for submitting your prompt! Your prompt submission is- pending review.- <br /> Once approved, it will appear on the{' '}- <a href="/prompts" className="underline">- prompts showcase- </a>- .- </div>- <div className="mt-4 text-muted-foreground font-brand">- Note that this showcase is curated - we may reject submissions if- they are repetitive or not up to our quality standards. In that- case, we will not give notification or reason.- </div>- <Button- onClick={() => {- window.location.href = '/prompts';- }}- className="font-brand rounded-full mt-4"- >- Back to gallery- </Button>- </div>- </div>- </Page>- );- }-return (<Page className="flex-col"><div className="m-auto max-w-[800px] w-full">@@ -248,193 +11,12 @@ export const PromptsSubmitPage: React.FC = () => {<NewBackButton text="Back to gallery" link="/prompts" /><h1 className="text-3xl font-brand font-black">Share your video</h1><p className="text-muted-foreground text-sm font-brand">- Share a video you made with Remotion to be featured in the{' '}- <a- href="/prompts"- className="underline hover:text-text underline-offset-4"- >- Prompt Showcase.- </a>- </p>- <p className="text-muted-foreground text-sm font-brand">- Note that this showcase is curated - we may reject submissions if- they are repetitive or not up to our quality standards. In that- case, we will not give notification or reason.- </p>- <h2 className="font-brand mt-5 font-bold">Title *</h2>- <p className="text-muted-foreground text-sm mb-0 font-brand">- A short title for your prompt (max 80 characters).+ Submissions are currently disabled while we work on something+ better!</p>- <Input- name="title"- placeholder="Newspaper highlighting animation"- className="font-brand mt-3"- value={title}- maxLength={80}- onChange={(e) => setTitle(e.target.value)}- />- <p className="text-muted-foreground text-xs mt-1 mb-0 font-brand">- {title.length}/80- </p>- <h2 className="font-brand mt-5 font-bold">Video *</h2>- <p className="text-muted-foreground text-sm mb-0 font-brand">- Upload a video showing the result of your prompt.- </p>- <input- ref={fileInputRef}- type="file"- accept="video/*"- onChange={onFileSelect}- className="hidden"- />- <div- onDrop={onDrop}- onDragOver={onDragOver}- onDragEnter={onDragEnter}- onDragLeave={onDragLeave}- className={`flex flex-col items-center py-12 mt-3 rounded-lg border-2 border-dashed transition-colors ${- isDragging- ? 'border-brand bg-brand/10'- : 'border-muted-foreground/25'- }`}- >- {uploadState.type === 'idle' &&- (isDragging ? (- <div className="font-brand text-sm text-brand font-medium">- Drop your video here- </div>- ) : (- <>- <Button- className="font-brand rounded-full"- onClick={() => fileInputRef.current?.click()}- >- Choose video file- </Button>- <div className="font-brand text-sm mt-3 text-muted-foreground">- or drag and drop a video file here- </div>- </>- ))}- {uploadState.type === 'uploading' && (- <div className="text-muted-foreground font-brand font-medium text-sm">- Uploading {Math.round(uploadState.progress)}%- </div>- )}- {uploadState.type === 'processing' && (- <div className="text-muted-foreground font-brand font-medium text-sm">- Processing video...- </div>- )}- {uploadState.type === 'ready' && (- <div className="w-full flex flex-col items-center px-4 gap-4">- <MuxPlayer- playbackId={uploadState.muxPlaybackId}- title={title || 'Preview'}- />- <button- type="button"- className="font-brand text-sm text-muted-foreground hover:text-foreground transition-colors"- onClick={() => setUploadState({type: 'idle'})}- >- Remove video- </button>- </div>- )}- {uploadState.type === 'error' && (- <div className="text-red-500 font-brand font-medium text-sm">- {uploadState.message}- </div>- )}- </div>-- <h2 className="font-brand mt-5 font-bold">Prompt(s) *</h2>- <p className="text-muted-foreground text-sm mb-0 font-brand">- The prompts you used to generate this video. Separate multiple- prompts with an empty line.- </p>- <Textarea- name="prompt"- className="font-brand mt-3"- placeholder="Enter your full prompt here"- value={prompt}- onChange={(e) => setPrompt(e.target.value)}- />-- <h2 className="font-brand mt-5 font-bold">Tool used</h2>- <p className="text-muted-foreground text-sm mb-0 font-brand">- Which tool did you use to generate this video? (e.g. Claude Code,- Cursor, Codex)- </p>- <Input- name="toolUsed"- placeholder="Claude Code"- className="font-brand mt-3"- value={toolUsed}- onChange={(e) => setToolUsed(e.target.value)}- />-- <h2 className="font-brand mt-5 font-bold">Model used</h2>- <p className="text-muted-foreground text-sm mb-0 font-brand">- Which AI model did you use? (e.g. Opus 4.7, GPT-5.5)- </p>- <Input- name="modelUsed"- placeholder="Opus 4.7"- className="font-brand mt-3"- value={modelUsed}- onChange={(e) => setModelUsed(e.target.value)}- />-- <h2 className="font-brand mt-5 font-bold">- How should we credit you? *- </h2>- <Tabs- defaultValue="github"- className="mt-3"- onValueChange={(value: string) => {- setUsernameType(value as UsernameType);- setUsername('');- }}- >- <TabsList>- <TabsTrigger value="github">GitHub</TabsTrigger>- <TabsTrigger value="x">X (Twitter)</TabsTrigger>- </TabsList>- <TabsContent value="github">- <Input- name="username"- className="font-brand"- placeholder="Your GitHub username"- value={usernameType === 'github' ? username : ''}- onChange={(e) => setUsername(e.target.value)}- />- </TabsContent>- <TabsContent value="x">- <Input- name="username"- className="font-brand"- placeholder="Your X username (without @)"- value={usernameType === 'x' ? username : ''}- onChange={(e) => setUsername(e.target.value)}- />- </TabsContent>- </Tabs>-- <div className="h-8" />- <Button- onClick={submit}- disabled={!submitPossible}- type="submit"- className="font-brand rounded-full w-full bg-brand text-white"- >- Submit+ <Button href="/prompts" className="font-brand rounded-full mt-4">+ Back to gallery</Button>- {submitStatus.type === 'error' && (- <p className="text-red-500 mt-4 text-sm font-brand">- An error occurred: {submitStatus.err.message}- </p>- )}</div></div></Page>