1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.Video = void 0;
|
4 | const jsx_runtime_1 = require("react/jsx-runtime");
|
5 | const react_1 = require("react");
|
6 | const get_environment_1 = require("../get-environment");
|
7 | const sequencing_1 = require("../sequencing");
|
8 | const validate_media_props_1 = require("../validate-media-props");
|
9 | const validate_start_from_props_1 = require("../validate-start-from-props");
|
10 | const VideoForDevelopment_1 = require("./VideoForDevelopment");
|
11 | const VideoForRendering_1 = require("./VideoForRendering");
|
12 | const VideoForwardingFunction = (props, ref) => {
|
13 | const { startFrom, endAt, ...otherProps } = props;
|
14 | if (typeof ref === 'string') {
|
15 | throw new Error('string refs are not supported');
|
16 | }
|
17 | if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
|
18 | (0, validate_start_from_props_1.validateStartFromProps)(startFrom, endAt);
|
19 | const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
20 | const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
21 | return ((0, jsx_runtime_1.jsx)(sequencing_1.Sequence, Object.assign({ layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo }, { children: (0, jsx_runtime_1.jsx)(exports.Video, Object.assign({}, otherProps, { ref: ref }), void 0) }), void 0));
|
22 | }
|
23 | (0, validate_media_props_1.validateMediaProps)(props, 'Video');
|
24 | if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
|
25 | return (0, jsx_runtime_1.jsx)(VideoForRendering_1.VideoForRendering, Object.assign({}, otherProps, { ref: ref }), void 0);
|
26 | }
|
27 | return (0, jsx_runtime_1.jsx)(VideoForDevelopment_1.VideoForDevelopment, Object.assign({}, otherProps, { ref: ref }), void 0);
|
28 | };
|
29 | exports.Video = (0, react_1.forwardRef)(VideoForwardingFunction);
|
30 |
|
\ | No newline at end of file |