Skip to content

🎥 Make videos programmatically with React

docs and rename

Jonny Burgercdfe4567a192
diff --git a/packages/cli/src/config/index.ts b/packages/cli/src/config/index.ts
index 3df8c8587f..4714f9eeca 100644
--- a/packages/cli/src/config/index.ts
+++ b/packages/cli/src/config/index.ts
@@ -141,7 +141,7 @@ declare global {
*/
readonly setMaxTimelineTracks: (maxTracks: number) => void;
/**
- * Enable Keyboard shortcuts in the Remotion Preview.
+ * Enable Keyboard shortcuts in the Remotion Studio.
* @param enabled Boolean whether to enable the keyboard shortcuts
* @default true
*/
diff --git a/packages/cli/src/editor/components/CurrentCompositionSideEffects.tsx b/packages/cli/src/editor/components/CurrentCompositionSideEffects.tsx
index 511c8c4ca7..9f4bd6617c 100644
--- a/packages/cli/src/editor/components/CurrentCompositionSideEffects.tsx
+++ b/packages/cli/src/editor/components/CurrentCompositionSideEffects.tsx
@@ -1,7 +1,7 @@
import type React from 'react';
import {useCallback, useContext, useEffect} from 'react';
import {Internals} from 'remotion';
-import {PreviewServerConnectionCtx} from '../helpers/client-id';
+import {StudioServerConnectionCtx} from '../helpers/client-id';
import {useKeybinding} from '../helpers/use-keybinding';
import {sendErrorNotification} from './Notifications/NotificationCenter';
@@ -10,11 +10,11 @@ export const TitleUpdater: React.FC = () => {
useEffect(() => {
if (!video) {
- document.title = 'Remotion Preview';
+ document.title = 'Remotion Studio';
return;
}
- document.title = `${video.id} / ${window.remotion_projectName} - Remotion Preview`;
+ document.title = `${video.id} / ${window.remotion_projectName} - Remotion Studio`;
}, [video]);
return null;
@@ -23,7 +23,7 @@ export const TitleUpdater: React.FC = () => {
export const CurrentCompositionKeybindings: React.FC = () => {
const keybindings = useKeybinding();
const video = Internals.useVideo();
- const {type} = useContext(PreviewServerConnectionCtx);
+ const {type} = useContext(StudioServerConnectionCtx);
const openRenderModal = useCallback(() => {
if (!video) {
diff --git a/packages/cli/src/editor/components/MenuBuildIndicator.tsx b/packages/cli/src/editor/components/MenuBuildIndicator.tsx
index 38f9632c0f..31313f599d 100644
--- a/packages/cli/src/editor/components/MenuBuildIndicator.tsx
+++ b/packages/cli/src/editor/components/MenuBuildIndicator.tsx
@@ -1,5 +1,5 @@
import React, {useContext, useEffect, useState} from 'react';
-import {PreviewServerConnectionCtx} from '../helpers/client-id';
+import {StudioServerConnectionCtx} from '../helpers/client-id';
import {Spacing} from './layout';
import {OpenEditorButton} from './OpenEditorButton';
import {Spinner} from './Spinner';
@@ -27,7 +27,7 @@ const noSpinner: React.CSSProperties = {
export const MenuBuildIndicator: React.FC = () => {
const [isBuilding, setIsBuilding] = useState(false);
- const ctx = useContext(PreviewServerConnectionCtx);
+ const ctx = useContext(StudioServerConnectionCtx);
const showButton = window.remotion_editorName && ctx.type === 'connected';
useEffect(() => {
diff --git a/packages/cli/src/editor/components/Modals.tsx b/packages/cli/src/editor/components/Modals.tsx
index c5ddd70443..12bc9db96b 100644
--- a/packages/cli/src/editor/components/Modals.tsx
+++ b/packages/cli/src/editor/components/Modals.tsx
@@ -1,5 +1,5 @@
import React, {useContext} from 'react';
-import {PreviewServerConnectionCtx} from '../helpers/client-id';
+import {StudioServerConnectionCtx} from '../helpers/client-id';
import {ModalsContext} from '../state/modals';
import NewComposition from './NewComposition/NewComposition';
import QuickSwitcher from './QuickSwitcher/QuickSwitcher';
@@ -9,7 +9,7 @@ import {UpdateModal} from './UpdateModal/UpdateModal';
export const Modals: React.FC = () => {
const {selectedModal: modalContextType} = useContext(ModalsContext);
- const canRender = useContext(PreviewServerConnectionCtx).type === 'connected';
+ const canRender = useContext(StudioServerConnectionCtx).type === 'connected';
return (
<>
diff --git a/packages/cli/src/editor/components/Notifications/ServerDisconnected.tsx b/packages/cli/src/editor/components/Notifications/ServerDisconnected.tsx
index a16c58c465..c712c8453f 100644
--- a/packages/cli/src/editor/components/Notifications/ServerDisconnected.tsx
+++ b/packages/cli/src/editor/components/Notifications/ServerDisconnected.tsx
@@ -1,5 +1,5 @@
import React, {useContext} from 'react';
-import {PreviewServerConnectionCtx} from '../../helpers/client-id';
+import {StudioServerConnectionCtx} from '../../helpers/client-id';
const container: React.CSSProperties = {
position: 'fixed',
@@ -38,7 +38,7 @@ window.addEventListener('beforeunload', () => {
});
export const ServerDisconnected: React.FC = () => {
- const ctx = useContext(PreviewServerConnectionCtx);
+ const ctx = useContext(StudioServerConnectionCtx);
if (ctx.type !== 'disconnected') {
return null;
diff --git a/packages/cli/src/editor/components/QuickSwitcher/algolia-search.ts b/packages/cli/src/editor/components/QuickSwitcher/algolia-search.ts
index d2720bd19a..ccfdaae882 100644
--- a/packages/cli/src/editor/components/QuickSwitcher/algolia-search.ts
+++ b/packages/cli/src/editor/components/QuickSwitcher/algolia-search.ts
@@ -44,7 +44,7 @@ export const algoliaSearch = async (
url.searchParams.set(
'x-algolia-agen',
- encodeURIComponent('Remotion Preview DocSearch')
+ encodeURIComponent('Remotion Studio DocSearch')
);
url.searchParams.set('x-algolia-api-key', ALGOLIA_API_KEY);
url.searchParams.set('x-algolia-application-id', ALGOLIA_APPLICATION_ID);
diff --git a/packages/cli/src/editor/components/RenderButton.tsx b/packages/cli/src/editor/components/RenderButton.tsx
index 4fc544c8b2..717adb4af0 100644
--- a/packages/cli/src/editor/components/RenderButton.tsx
+++ b/packages/cli/src/editor/components/RenderButton.tsx
@@ -13,7 +13,7 @@ import {Internals, useCurrentFrame} from 'remotion';
import {getDefaultOutLocation} from '../../get-default-out-name';
import {Button} from '../../preview-server/error-overlay/remotion-overlay/Button';
import {getDefaultCodecs} from '../../preview-server/render-queue/get-default-video-contexts';
-import {PreviewServerConnectionCtx} from '../helpers/client-id';
+import {StudioServerConnectionCtx} from '../helpers/client-id';
import {areKeyboardShortcutsDisabled} from '../helpers/use-keybinding';
import {RenderIcon} from '../icons/render';
import {useTimelineInOutFramePosition} from '../state/in-out';
@@ -34,9 +34,9 @@ const label: React.CSSProperties = {
export const RenderButton: React.FC = () => {
const {inFrame, outFrame} = useTimelineInOutFramePosition();
const {setSelectedModal} = useContext(ModalsContext);
- const {type} = useContext(PreviewServerConnectionCtx);
+ const {type} = useContext(StudioServerConnectionCtx);
- const connectionStatus = useContext(PreviewServerConnectionCtx).type;
+ const connectionStatus = useContext(StudioServerConnectionCtx).type;
const shortcut = areKeyboardShortcutsDisabled() ? '' : '(R)';
const tooltip =
type === 'connected'
diff --git a/packages/cli/src/editor/components/RenderModal/DataEditor.tsx b/packages/cli/src/editor/components/RenderModal/DataEditor.tsx
index 3c4c4c670f..ac201ca32b 100644
--- a/packages/cli/src/editor/components/RenderModal/DataEditor.tsx
+++ b/packages/cli/src/editor/components/RenderModal/DataEditor.tsx
@@ -9,7 +9,7 @@ import type {AnyComposition} from 'remotion';
import {getInputProps, Internals} from 'remotion';
import type {z} from 'zod';
import {subscribeToEvent} from '../../../event-source';
-import {PreviewServerConnectionCtx} from '../../helpers/client-id';
+import {StudioServerConnectionCtx} from '../../helpers/client-id';
import {BACKGROUND, BORDER_COLOR, LIGHT_TEXT} from '../../helpers/colors';
import {useZodIfPossible} from '../get-zod-if-possible';
import {Flex, Spacing} from '../layout';
@@ -328,7 +328,7 @@ export const DataEditor: React.FC<{
[unresolvedComposition.defaultProps, unresolvedComposition.id, schema, z]
);
- const connectionStatus = useContext(PreviewServerConnectionCtx).type;
+ const connectionStatus = useContext(StudioServerConnectionCtx).type;
const warnings = useMemo(() => {
return getRenderModalWarnings({
diff --git a/packages/cli/src/editor/components/RenderQueue/index.tsx b/packages/cli/src/editor/components/RenderQueue/index.tsx
index 94fa27b1d5..f2d22e0e11 100644
--- a/packages/cli/src/editor/components/RenderQueue/index.tsx
+++ b/packages/cli/src/editor/components/RenderQueue/index.tsx
@@ -1,5 +1,5 @@
import React, {useContext} from 'react';
-import {PreviewServerConnectionCtx} from '../../helpers/client-id';
+import {StudioServerConnectionCtx} from '../../helpers/client-id';
import {BACKGROUND, BORDER_COLOR, LIGHT_TEXT} from '../../helpers/colors';
import {Spacing} from '../layout';
import {VERTICAL_SCROLLBAR_CLASSNAME} from '../Menu/is-menu-item';
@@ -35,7 +35,7 @@ const renderQueue: React.CSSProperties = {
};
export const RenderQueue: React.FC = () => {
- const connectionStatus = useContext(PreviewServerConnectionCtx).type;
+ const connectionStatus = useContext(StudioServerConnectionCtx).type;
const {jobs} = useContext(RenderQueueContext);
const jobCount = jobs.length;
diff --git a/packages/cli/src/editor/components/SidebarRenderButton.tsx b/packages/cli/src/editor/components/SidebarRenderButton.tsx
index 7777e6084a..78dfd00ef3 100644
--- a/packages/cli/src/editor/components/SidebarRenderButton.tsx
+++ b/packages/cli/src/editor/components/SidebarRenderButton.tsx
@@ -13,7 +13,7 @@ import type {AnyCompMetadata} from 'remotion';
import {Internals} from 'remotion';
import {getDefaultOutLocation} from '../../get-default-out-name';
import {getDefaultCodecs} from '../../preview-server/render-queue/get-default-video-contexts';
-import {PreviewServerConnectionCtx} from '../helpers/client-id';
+import {StudioServerConnectionCtx} from '../helpers/client-id';
import {ThinRenderIcon} from '../icons/render';
import {ModalsContext} from '../state/modals';
import type {RenderInlineAction} from './InlineAction';
@@ -33,7 +33,7 @@ export const SidebarRenderButton: React.FC<{
};
}, []);
- const connectionStatus = useContext(PreviewServerConnectionCtx).type;
+ const connectionStatus = useContext(StudioServerConnectionCtx).type;
const {props} = useContext(Internals.EditorPropsContext);
const isVideo = composition.durationInFrames > 1;
diff --git a/packages/cli/src/editor/helpers/client-id.tsx b/packages/cli/src/editor/helpers/client-id.tsx
index a7ab214f6a..5710e88be6 100644
--- a/packages/cli/src/editor/helpers/client-id.tsx
+++ b/packages/cli/src/editor/helpers/client-id.tsx
@@ -12,7 +12,7 @@ type PreviewServerState =
type: 'disconnected';
};
-export const PreviewServerConnectionCtx =
+export const StudioServerConnectionCtx =
React.createContext<PreviewServerState>({
type: 'init',
});
@@ -41,8 +41,8 @@ export const PreviewServerConnection: React.FC<{
);
return (
- <PreviewServerConnectionCtx.Provider value={state}>
+ <StudioServerConnectionCtx.Provider value={state}>
{children}
- </PreviewServerConnectionCtx.Provider>
+ </StudioServerConnectionCtx.Provider>
);
};
diff --git a/packages/cli/src/editor/helpers/use-file-existence.ts b/packages/cli/src/editor/helpers/use-file-existence.ts
index 74e41fe789..79a98d0640 100644
--- a/packages/cli/src/editor/helpers/use-file-existence.ts
+++ b/packages/cli/src/editor/helpers/use-file-existence.ts
@@ -5,12 +5,12 @@ import {
subscribeToFileExistenceWatcher,
unsubscribeFromFileExistenceWatcher,
} from '../components/RenderQueue/actions';
-import {PreviewServerConnectionCtx} from './client-id';
+import {StudioServerConnectionCtx} from './client-id';
export const useFileExistence = (outName: string) => {
const [exists, setExists] = useState(false);
- const state = useContext(PreviewServerConnectionCtx);
+ const state = useContext(StudioServerConnectionCtx);
const clientId = state.type === 'connected' ? state.clientId : undefined;
const currentOutName = useRef('');
diff --git a/packages/cli/src/editor/helpers/use-menu-structure.tsx b/packages/cli/src/editor/helpers/use-menu-structure.tsx
index 2c2dd744be..e9f3e6023d 100644
--- a/packages/cli/src/editor/helpers/use-menu-structure.tsx
+++ b/packages/cli/src/editor/helpers/use-menu-structure.tsx
@@ -18,7 +18,7 @@ import {PreviewSizeContext} from '../state/preview-size';
import type {SidebarCollapsedState} from '../state/sidebar';
import {SidebarContext} from '../state/sidebar';
import {timelineRef} from '../state/timeline-ref';
-import {PreviewServerConnectionCtx} from './client-id';
+import {StudioServerConnectionCtx} from './client-id';
import {openInEditor} from './open-in-editor';
import {pickColor} from './pick-color';
import {areKeyboardShortcutsDisabled} from './use-keybinding';
@@ -41,7 +41,7 @@ export const useMenuStructure = (closeMenu: () => void) => {
EditorZoomGesturesContext
);
const {size, setSize} = useContext(PreviewSizeContext);
- const {type} = useContext(PreviewServerConnectionCtx);
+ const {type} = useContext(StudioServerConnectionCtx);
const {
setSidebarCollapsedState,
diff --git a/packages/cli/src/preview-server/routes.ts b/packages/cli/src/preview-server/routes.ts
index aa06f52979..a108023061 100644
--- a/packages/cli/src/preview-server/routes.ts
+++ b/packages/cli/src/preview-server/routes.ts
@@ -111,7 +111,7 @@ const handleFallback = async ({
getNumberOfSharedAudioTags(),
publicFiles: getFiles(),
includeFavicon: true,
- title: 'Remotion Preview',
+ title: 'Remotion Studio',
renderDefaults: {
jpegQuality: defaultJpegQuality ?? 80,
scale: defaultScale ?? 1,
diff --git a/packages/cli/src/print-help.ts b/packages/cli/src/print-help.ts
index a15b9d900e..b6c8234422 100644
--- a/packages/cli/src/print-help.ts
+++ b/packages/cli/src/print-help.ts
@@ -19,7 +19,7 @@ export const printHelp = () => {
Log.info();
Log.info('Available commands:');
Log.info('');
- Log.info('remotion preview <entry-point.ts>');
+ Log.info('remotion studio <entry-point.ts>');
Log.info(chalk.gray('Start the preview server.'));
printFlags([['--props', 'Pass input props as filename or as JSON']]);
Log.info();
diff --git a/packages/core/src/get-static-files.ts b/packages/core/src/get-static-files.ts
index 84018a6769..33c2eae446 100644
--- a/packages/core/src/get-static-files.ts
+++ b/packages/core/src/get-static-files.ts
@@ -19,7 +19,7 @@ const warnPlayerOnce = () => {
warnedPlayer = true;
console.warn(
- 'Called getStaticFiles() while using the Remotion Player. The API is only available while using the Remotion Preview. An empty array was returned.'
+ 'Called getStaticFiles() while using the Remotion Player. The API is only available while using the Remotion Studio. An empty array was returned.'
);
};
diff --git a/packages/create-video/src/test/patch-package-json.test.ts b/packages/create-video/src/test/patch-package-json.test.ts
index c9c03c4b89..de7426af71 100644
--- a/packages/create-video/src/test/patch-package-json.test.ts
+++ b/packages/create-video/src/test/patch-package-json.test.ts
@@ -13,7 +13,7 @@ for (const packageManager of packageManagers) {
version: '1.0.0',
description: 'My Remotion video',
scripts: {
- start: 'remotion preview',
+ start: 'remotion studio',
},
dependencies: {
'@remotion/cli': 'stale-remotion-version',
diff --git a/packages/docs/blog/2021-07-09-remotion-2-2.md b/packages/docs/blog/2021-07-09-remotion-2-2.md
index ee82c68b0b..4b51a99567 100644
--- a/packages/docs/blog/2021-07-09-remotion-2-2.md
+++ b/packages/docs/blog/2021-07-09-remotion-2-2.md
@@ -113,7 +113,7 @@ If a Webfont gets loaded via Google Fonts, it would be loaded using `font-displa
## Specify a custom `--port`
-By default the Remotion preview starts a server on port 3000. Should you want to have it start on a different port for any reason, you can now pass a CLI flag.
+By default the Remotion Preview starts a server on port 3000. Should you want to have it start on a different port for any reason, you can now pass a CLI flag.
## More helpful error handling
diff --git a/packages/docs/components/TableOfContents/cli.tsx b/packages/docs/components/TableOfContents/cli.tsx
index 5d37ebcc4f..ea06d4faf9 100644
--- a/packages/docs/components/TableOfContents/cli.tsx
+++ b/packages/docs/components/TableOfContents/cli.tsx
@@ -6,9 +6,9 @@ export const TableOfContents: React.FC = () => {
return (
<div>
<Grid>
- <TOCItem link="/docs/cli/preview">
- <strong>preview</strong>
- <div>Start the Remotion Preview Server</div>
+ <TOCItem link="/docs/cli/studio">
+ <strong>studio</strong>
+ <div>Start the Remotion Studio</div>
</TOCItem>
<TOCItem link="/docs/cli/render">
<strong>render</strong>
diff --git a/packages/docs/docs/cli/preview.md b/packages/docs/docs/cli/studio.md
similarity index 92%
rename from packages/docs/docs/cli/preview.md
rename to packages/docs/docs/cli/studio.md
index aeb5803c7b..c4e7138067 100644
--- a/packages/docs/docs/cli/preview.md
+++ b/packages/docs/docs/cli/studio.md
@@ -1,14 +1,16 @@
---
-image: /generated/articles-docs-cli-preview.png
-title: npx remotion preview
-sidebar_label: preview
+image: /generated/articles-docs-cli-studio.png
+title: npx remotion studio
+sidebar_label: studio
crumb: CLI Reference
---
-Start the server which allows you to preview the Remotion video. The only argument to pass is the entry file:
+_Alias: npx remotion preview_
+
+Start the Remotion Studio. The only argument to pass is the entry file:
```bash
-npx remotion preview <entry-file>
+npx remotion studio <entry-file>
```
If `entry-file` is not passed, Remotion will try to detect the entry file with the following priority order:
diff --git a/packages/docs/docs/terminology.md b/packages/docs/docs/terminology.md
index 92605ea1ae..31b90037ef 100644
--- a/packages/docs/docs/terminology.md
+++ b/packages/docs/docs/terminology.md
@@ -57,9 +57,13 @@ The entry point is the file where the Remotion CLI and Node.JS APIs will look fo
In the [Remotion Player](#remotion-player), there is no concept of an entry point. You directly pass a React component and metadata to the [`<Player>`](/docs/player/player).
+## Remotion Studio
+
+The Remotion Studio is the editor that opens that when you run [`npx remotion studio`](/docs/cli/studio) or `npx remotion preview`. It allows fast editing and playback of [compositions](#composition). It is included in the `@remotion/cli` package. It is not the same as the [Remotion Player](#remotion-player).
+
## Remotion Preview
-The Remotion Preview is the editor that opens that when you run `npx remotion preview ` followed by the [entry point](#entry-point). It allows fast editing and playback of [compositions](#composition). It is included in the `@remotion/cli` package. It is not the same as the [Remotion Player](#remotion-player).
+The former name of the [Remotion Studio](#remotion-studio), renamed in v4.0. Since the Preview gained more capabilities than just previewing, the name was not fitting anymore.
## Remotion Player
diff --git a/packages/docs/package.json b/packages/docs/package.json
index 664fff3312..bae4902549 100644
--- a/packages/docs/package.json
+++ b/packages/docs/package.json
@@ -15,7 +15,7 @@
"clear": "docusaurus clear",
"lint": "eslint components && eslint src",
"test": "vitest --run",
- "remotion": "remotion preview src/remotion/entry.ts"
+ "remotion": "remotion studio src/remotion/entry.ts"
},
"dependencies": {
"@aws-sdk/s3-request-presigner": "3.215.0",
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 0c5e846576..05d53ded14 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -10,7 +10,7 @@ module.exports = {
},
collapsed: true,
items: [
- "cli/preview",
+ "cli/studio",
"cli/render",
"cli/still",
"cli/compositions",
diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.ts
index e96a63c4fb..4b619d0231 100644
--- a/packages/docs/src/data/articles.ts
+++ b/packages/docs/src/data/articles.ts
@@ -174,13 +174,6 @@ export const articles = [
compId: "articles-docs-cli-install",
crumb: "CLI Reference",
},
- {
- id: "cli/preview",
- title: "npx remotion preview",
- relativePath: "docs/cli/preview.md",
- compId: "articles-docs-cli-preview",
- crumb: "CLI Reference",
- },
{
id: "cli/render",
title: "npx remotion render",
@@ -195,6 +188,13 @@ export const articles = [
compId: "articles-docs-cli-still",
crumb: "CLI Reference",
},
+ {
+ id: "cli/studio",
+ title: "npx remotion studio",
+ relativePath: "docs/cli/studio.md",
+ compId: "articles-docs-cli-studio",
+ crumb: "CLI Reference",
+ },
{
id: "cli/upgrade",
title: "npx remotion upgrade",
diff --git a/packages/docs/static/generated/articles-docs-cli-preview.png b/packages/docs/static/generated/articles-docs-cli-preview.png
deleted file mode 100644
index d8953c5a22..0000000000
Binary files a/packages/docs/static/generated/articles-docs-cli-preview.png and /dev/null differ
diff --git a/packages/docs/static/generated/articles-docs-cli-studio.png b/packages/docs/static/generated/articles-docs-cli-studio.png
new file mode 100644
index 0000000000..6a12acdf54
Binary files /dev/null and b/packages/docs/static/generated/articles-docs-cli-studio.png differ
diff --git a/vercel.json b/vercel.json
index 47e1aed030..186e9418fc 100644
--- a/vercel.json
+++ b/vercel.json
@@ -145,6 +145,11 @@
"destination": "/docs/overlay",
"permanent": false
},
+ {
+ "source": "/docs/cli/preview",
+ "destination": "/docs/cli/studio",
+ "permanent": false
+ },
{
"source": "/links",
"destination": "https://linktr.ee/remotion",