1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.useUnsafeVideoConfig = void 0;
|
4 | const react_1 = require("react");
|
5 | const sequencing_1 = require("./sequencing");
|
6 | const use_video_1 = require("./use-video");
|
7 | const 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 { id, durationInFrames, fps, height, width, defaultProps } = video;
|
17 | return {
|
18 | id,
|
19 | width,
|
20 | height,
|
21 | fps,
|
22 | durationInFrames: ctxDuration !== null && ctxDuration !== void 0 ? ctxDuration : durationInFrames,
|
23 | defaultProps,
|
24 | };
|
25 | }, [ctxDuration, video]);
|
26 | };
|
27 | exports.useUnsafeVideoConfig = useUnsafeVideoConfig;
|