Skip to content

🎥 Make videos programmatically with React

Rename project dir to project name

Vlad M615fc5c99e8e
diff --git a/packages/template-ai-video/src/Root.tsx b/packages/template-ai-video/src/Root.tsx
index d687570f9d..4c69f81ca3 100644
--- a/packages/template-ai-video/src/Root.tsx
+++ b/packages/template-ai-video/src/Root.tsx
@@ -10,21 +10,21 @@ import { FPS, WindowHeight, WindowWidth } from "./lib/constants";
import { getTimelinePath, loadTimelineFromFile } from "./lib/utils";
interface InputProps extends Record<string, unknown> {
- projectDir?: string;
+ projectName?: string;
}
export const RemotionRoot: React.FC = () => {
const inputProps = getInputProps<InputProps>();
const [frameLength, setFrameLength] = useState(1);
- const projectDir = inputProps.projectDir ?? "history_of_venus";
+ const resolvedProjectName = inputProps.projectName ?? "history_of_venus";
useEffect(() => {
const handle = delayRender("Calculating FPS duration...");
const fetchConfig = async () => {
const { lengthFrames } = await loadTimelineFromFile(
- getTimelinePath(projectDir),
+ getTimelinePath(resolvedProjectName),
);
setFrameLength(lengthFrames);
continueRender(handle);
@@ -49,7 +49,7 @@ export const RemotionRoot: React.FC = () => {
// @ts-expect-error zod version mismatch
schema={aiVideoSchema}
defaultProps={{
- projectName: projectDir,
+ projectName: resolvedProjectName,
}}
/>
</>