UNPKG

1.2 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.useVideoConfig = void 0;
4const use_unsafe_video_config_1 = require("./use-unsafe-video-config");
5/**
6 * Get some info about the context of the video that you are making.
7 * Returns an object containing `fps`, `width`, `height` and `durationInFrames`, all of type `number`.
8 * @link https://www.remotion.dev/docs/use-video-config
9 */
10const useVideoConfig = () => {
11 const videoConfig = (0, use_unsafe_video_config_1.useUnsafeVideoConfig)();
12 if (!videoConfig) {
13 if (typeof window !== 'undefined' && window.remotion_isPlayer) {
14 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.');
15 }
16 throw new Error('No video config found. You are probably calling useVideoConfig() from a component which has not been registered as a <Composition />. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions for more information.');
17 }
18 return videoConfig;
19};
20exports.useVideoConfig = useVideoConfig;