Skip to content

🎥 Make videos programmatically with React

explain conditions

Jonny Burger6f97bd542f46
diff --git a/packages/bundler/src/index-html.ts b/packages/bundler/src/index-html.ts
index 6c727fdc50..4a590c7092 100644
--- a/packages/bundler/src/index-html.ts
+++ b/packages/bundler/src/index-html.ts
@@ -67,6 +67,7 @@ export const indexHtml = ({
title: string;
renderDefaults: RenderDefaults | undefined;
}) =>
+ // Must setup remotion_editorName and remotion.remotion_projectName before bundle.js is loaded
`
<!DOCTYPE html>
<html lang="en">
diff --git a/packages/core/src/get-remotion-environment.ts b/packages/core/src/get-remotion-environment.ts
index fd9caedb56..7ac21a3587 100644
--- a/packages/core/src/get-remotion-environment.ts
+++ b/packages/core/src/get-remotion-environment.ts
@@ -10,10 +10,12 @@ export type RemotionEnvironment = {
*/
export const getRemotionEnvironment = (): RemotionEnvironment => {
if (process.env.NODE_ENV === 'production') {
- // Check if inside a Remotion bundle
+ // Check if inside a Remotion bundle.
+ // Must be a variable in index-html.ts and be defined before setupEnvVariables()
if (
typeof window !== 'undefined' &&
- typeof window.remotion_editorName !== 'undefined'
+ typeof window.remotion_editorName !== 'undefined' &&
+ typeof window.remotion_projectName !== 'undefined'
) {
return {
isStudio: false,