UNPKG

1.05 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.useUnsafeVideoConfig = void 0;
4const react_1 = require("react");
5const sequencing_1 = require("./sequencing");
6const use_video_1 = require("./use-video");
7const useUnsafeVideoConfig = () => {
8 var _a;
9 const context = (0, react_1.useContext)(sequencing_1.SequenceContext);
10 const ctxDuration = (_a = context === null || context === void 0 ? void 0 : context.durationInFrames) !== null && _a !== void 0 ? _a : null;
11 const video = (0, use_video_1.useVideo)();
12 return (0, react_1.useMemo)(() => {
13 if (!video) {
14 return null;
15 }
16 const { durationInFrames, fps, height, width } = video;
17 return {
18 width,
19 height,
20 fps,
21 durationInFrames: ctxDuration !== null && ctxDuration !== void 0 ? ctxDuration : durationInFrames,
22 };
23 }, [ctxDuration, video]);
24};
25exports.useUnsafeVideoConfig = useUnsafeVideoConfig;
26//# sourceMappingURL=use-unsafe-video-config.js.map
\No newline at end of file