Skip to content

🎥 Make videos programmatically with React

Update renderEntry.tsx

Jonny Burger49c17e874b11
diff --git a/packages/bundler/src/renderEntry.tsx b/packages/bundler/src/renderEntry.tsx
index ad33b7853e..c1dd4a7ac1 100644
--- a/packages/bundler/src/renderEntry.tsx
+++ b/packages/bundler/src/renderEntry.tsx
@@ -39,6 +39,10 @@ const getCanSerializeDefaultProps = (object: unknown) => {
}
};
+const isInHeadlessBrowser = () => {
+ return typeof window.remotion_puppeteerTimeout !== 'undefined';
+};
+
const GetVideo: React.FC<{state: BundleState}> = ({state}) => {
const video = Internals.useVideo();
const compositions = useContext(Internals.CompositionManager);
@@ -194,6 +198,10 @@ const renderContent = (Root: React.FC) => {
}
if (bundleMode.type === 'index') {
+ if (isInHeadlessBrowser()) {
+ return;
+ }
+
renderToDOM(<div>Loading Remotion Studio...</div>);
import('@remotion/studio')
.then(({Studio}) => {