-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4544 from remotion-dev/remotion.dev/convert
- Loading branch information
Showing
9 changed files
with
79 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ node_modules | |
/.cache | ||
build | ||
.env | ||
spa-dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, {useState} from 'react'; | ||
import {SAMPLE_FILE, TEST_FAST} from '~/lib/config'; | ||
import {Source} from '~/lib/convert-state'; | ||
import {FileAvailable} from './FileAvailable'; | ||
import {PickFile} from './PickFile'; | ||
|
||
export const Main: React.FC = () => { | ||
const [src, setSrc] = useState<Source | null>( | ||
TEST_FAST ? {type: 'url', url: SAMPLE_FILE} : null, | ||
); | ||
|
||
return ( | ||
<div className="font-sans min-h-screen bg-slate-50"> | ||
{src ? ( | ||
<FileAvailable | ||
key={src.type === 'url' ? src.url : src.file.name} | ||
src={src} | ||
setSrc={setSrc} | ||
/> | ||
) : ( | ||
<PickFile setSrc={setSrc} /> | ||
)} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,15 @@ | ||
import type {MetaFunction} from '@remix-run/node'; | ||
import {useState} from 'react'; | ||
import {FileAvailable} from '~/components/FileAvailable'; | ||
import {PickFile} from '~/components/PickFile'; | ||
import {SAMPLE_FILE, TEST_FAST} from '~/lib/config'; | ||
import {Source} from '~/lib/convert-state'; | ||
import {Main} from '~/components/Main'; | ||
|
||
export const meta: MetaFunction = () => { | ||
return [ | ||
{title: 'Remotion Convert'}, | ||
{name: 'description', content: 'Fast video conersion in the browser.'}, | ||
{name: 'description', content: 'Fast video conversion in the browser.'}, | ||
]; | ||
}; | ||
|
||
const Index = () => { | ||
const [src, setSrc] = useState<Source | null>( | ||
TEST_FAST ? {type: 'url', url: SAMPLE_FILE} : null, | ||
); | ||
|
||
return ( | ||
<div className="font-sans min-h-screen bg-slate-50"> | ||
{src ? ( | ||
<FileAvailable | ||
key={src.type === 'url' ? src.url : src.file.name} | ||
src={src} | ||
setSrc={setSrc} | ||
/> | ||
) : ( | ||
<PickFile setSrc={setSrc} /> | ||
)} | ||
</div> | ||
); | ||
return <Main />; | ||
}; | ||
|
||
export default Index; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type {MetaFunction} from '@remix-run/node'; | ||
import {Main} from '~/components/Main'; | ||
|
||
export const meta: MetaFunction = () => { | ||
return [ | ||
{title: 'Remotion Convert'}, | ||
{name: 'description', content: 'Fast video conversion in the browser.'}, | ||
]; | ||
}; | ||
|
||
const Index = () => { | ||
return <Main />; | ||
}; | ||
|
||
export default Index; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {vitePlugin as remix} from '@remix-run/dev'; | ||
import {installGlobals} from '@remix-run/node'; | ||
import path from 'path'; | ||
import {defineConfig} from 'vite'; | ||
import tsconfigPaths from 'vite-tsconfig-paths'; | ||
|
||
installGlobals(); | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
remix({ssr: false, buildDirectory: path.resolve(__dirname, 'spa-dist')}), | ||
tsconfigPaths(), | ||
], | ||
base: '/convert/', | ||
resolve: { | ||
alias: { | ||
'@': path.resolve(__dirname, './app'), | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {$} from 'bun'; | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
|
||
await $`bunx turbo "@remotion/convert#build-spa"`; | ||
|
||
const dir = path.join(__dirname, '../convert/spa-dist/client'); | ||
|
||
fs.cpSync(dir, path.join(__dirname, './build/convert'), {recursive: true}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters