Skip to content

🎥 Make videos programmatically with React

Update use-video-config.ts

Jonny Burger54944225f3bb
diff --git a/packages/core/src/use-video-config.ts b/packages/core/src/use-video-config.ts
index 755a668d33..a74314b820 100644
--- a/packages/core/src/use-video-config.ts
+++ b/packages/core/src/use-video-config.ts
@@ -9,7 +9,7 @@ import {VideoConfig} from './video-config';
export const useVideoConfig = (): VideoConfig => {
const videoConfig = useUnsafeVideoConfig();
- if (window.remotion_isPlayer) {
+ if (typeof window !== 'undefined' && window.remotion_isPlayer) {
throw new Error(
'No video config found. You are probably calling useVideoConfig() from outside the component passed to <Player />. See https://www.remotion.dev/docs/player/examples for how to set up the Player correctly.'
);