@remotion/bundler 4.0.113 → 4.0.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/dist/bundle-mode.d.ts +0 -3
- package/dist/bundle-mode.js +0 -14
- package/dist/homepage/homepage.d.ts +0 -2
- package/dist/homepage/homepage.js +0 -108
- package/dist/renderEntry.d.ts +0 -2
- package/dist/renderEntry.js +0 -274
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/bundler",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.115",
|
|
4
4
|
"description": "Bundler for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"style-loader": "2.0.0",
|
|
26
26
|
"source-map": "0.7.3",
|
|
27
27
|
"webpack": "5.83.1",
|
|
28
|
-
"remotion": "4.0.
|
|
29
|
-
"@remotion/studio
|
|
30
|
-
"@remotion/studio": "4.0.
|
|
28
|
+
"remotion": "4.0.115",
|
|
29
|
+
"@remotion/studio": "4.0.115",
|
|
30
|
+
"@remotion/studio-shared": "4.0.115"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": ">=16.8.0",
|
package/dist/bundle-mode.d.ts
DELETED
package/dist/bundle-mode.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBundleMode = exports.setBundleMode = void 0;
|
|
4
|
-
let bundleMode = {
|
|
5
|
-
type: 'index',
|
|
6
|
-
};
|
|
7
|
-
const setBundleMode = (state) => {
|
|
8
|
-
bundleMode = state;
|
|
9
|
-
};
|
|
10
|
-
exports.setBundleMode = setBundleMode;
|
|
11
|
-
const getBundleMode = () => {
|
|
12
|
-
return bundleMode;
|
|
13
|
-
};
|
|
14
|
-
exports.getBundleMode = getBundleMode;
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Homepage = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const bundle_mode_1 = require("../bundle-mode");
|
|
7
|
-
const renderEntry_1 = require("../renderEntry");
|
|
8
|
-
const container = {
|
|
9
|
-
width: 800,
|
|
10
|
-
margin: 'auto',
|
|
11
|
-
paddingLeft: 20,
|
|
12
|
-
paddingRight: 20,
|
|
13
|
-
fontFamily: 'sans-serif',
|
|
14
|
-
lineHeight: 1.5,
|
|
15
|
-
};
|
|
16
|
-
const pre = {
|
|
17
|
-
display: 'block',
|
|
18
|
-
backgroundColor: '#f7f7f7',
|
|
19
|
-
whiteSpace: 'nowrap',
|
|
20
|
-
padding: 16,
|
|
21
|
-
fontFamily: 'monospace',
|
|
22
|
-
borderRadius: 5,
|
|
23
|
-
fontSize: 15,
|
|
24
|
-
overflowX: 'auto',
|
|
25
|
-
};
|
|
26
|
-
const AvailableCompositions = () => {
|
|
27
|
-
const [state, setComps] = (0, react_1.useState)({
|
|
28
|
-
type: 'not-initialized',
|
|
29
|
-
});
|
|
30
|
-
(0, react_1.useEffect)(() => {
|
|
31
|
-
if ((0, bundle_mode_1.getBundleMode)().type !== 'evaluation') {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
let timeout = null;
|
|
35
|
-
const check = () => {
|
|
36
|
-
if (window.remotion_renderReady === true) {
|
|
37
|
-
setComps({ type: 'loading' });
|
|
38
|
-
setTimeout(() => {
|
|
39
|
-
try {
|
|
40
|
-
const newComps = window.remotion_getCompositionNames();
|
|
41
|
-
setComps({ type: 'loaded', comps: newComps });
|
|
42
|
-
}
|
|
43
|
-
catch (err) {
|
|
44
|
-
setComps({ type: 'error', error: err });
|
|
45
|
-
}
|
|
46
|
-
}, 250);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
timeout = setTimeout(check, 250);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
check();
|
|
53
|
-
return () => {
|
|
54
|
-
if (!timeout) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
clearTimeout(timeout);
|
|
58
|
-
};
|
|
59
|
-
}, []);
|
|
60
|
-
const showComps = (0, react_1.useCallback)(() => {
|
|
61
|
-
(0, renderEntry_1.setBundleModeAndUpdate)({ type: 'evaluation' });
|
|
62
|
-
}, []);
|
|
63
|
-
if ((0, bundle_mode_1.getBundleMode)().type !== 'evaluation') {
|
|
64
|
-
return ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: showComps, children: "Click here to see a list of available compositions." }));
|
|
65
|
-
}
|
|
66
|
-
if (state.type === 'loading') {
|
|
67
|
-
return (0, jsx_runtime_1.jsx)("div", { children: state === null ? (0, jsx_runtime_1.jsx)("p", { children: "Loading compositions..." }) : null });
|
|
68
|
-
}
|
|
69
|
-
if (state.type === 'error') {
|
|
70
|
-
return (0, jsx_runtime_1.jsxs)("div", { children: ["Error loading compositions: ", state.error.stack] });
|
|
71
|
-
}
|
|
72
|
-
if (state.type === 'not-initialized') {
|
|
73
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Not initialized" });
|
|
74
|
-
}
|
|
75
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("ul", { children: state === null
|
|
76
|
-
? []
|
|
77
|
-
: state.comps.map((c) => {
|
|
78
|
-
return (0, jsx_runtime_1.jsx)("li", { children: c }, c);
|
|
79
|
-
}) }) }));
|
|
80
|
-
};
|
|
81
|
-
const TestCORS = () => {
|
|
82
|
-
const [serveUrl, setServeUrl] = (0, react_1.useState)('');
|
|
83
|
-
const [result, setResult] = (0, react_1.useState)('');
|
|
84
|
-
const handleServeUrl = (0, react_1.useCallback)((e) => {
|
|
85
|
-
setServeUrl(e.target.value);
|
|
86
|
-
}, []);
|
|
87
|
-
const isCORSWorking = (0, react_1.useCallback)(async (e) => {
|
|
88
|
-
e.preventDefault();
|
|
89
|
-
try {
|
|
90
|
-
const response = await fetch(serveUrl, { mode: 'cors' });
|
|
91
|
-
if (response.ok) {
|
|
92
|
-
setResult(`CORS is enabled on this URL: ${serveUrl}`);
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
setResult('URL does not support CORS - See DevTools console for more details');
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
catch (error) {
|
|
99
|
-
setResult('URL does not support CORS - See DevTools console for more details');
|
|
100
|
-
}
|
|
101
|
-
}, [serveUrl]);
|
|
102
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("p", { children: ["Quickly test if a URL is supported being loaded on origin", ' ', (0, jsx_runtime_1.jsx)("code", { children: window.location.origin }), ". Enter the URL of an asset below."] }), result ? (0, jsx_runtime_1.jsx)("p", { className: "result", children: result }) : null, (0, jsx_runtime_1.jsxs)("form", { onSubmit: isCORSWorking, children: [(0, jsx_runtime_1.jsx)("label", { htmlFor: "serveurl", children: (0, jsx_runtime_1.jsx)("input", { placeholder: "Enter URL", type: "text", name: "serveurl", value: serveUrl, onChange: handleServeUrl }) }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("button", { type: "submit", children: "Test CORS" })] })] }));
|
|
103
|
-
};
|
|
104
|
-
const Homepage = () => {
|
|
105
|
-
const url = window.location.origin + window.location.pathname;
|
|
106
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("h1", { children: "Remotion Bundle" }), "This is a website which contains a bundled Remotion video. You can render videos based on this URL.", (0, jsx_runtime_1.jsx)("h2", { children: "Available compositions" }), (0, jsx_runtime_1.jsx)(AvailableCompositions, {}), (0, jsx_runtime_1.jsx)("h2", { children: "How to render" }), "Locally: ", (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsxs)("div", { style: pre, children: ["npx remotion render ", url, " ", '<comp-name> <output-location>'] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), "With Remotion Lambda: ", (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsxs)("div", { style: pre, children: ["npx remotion lambda render ", url, " ", '<comp-name>'] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsxs)("p", { children: ["You can also render still images, and use the Node.JS APIs", ' ', (0, jsx_runtime_1.jsx)("code", { children: "getCompositions()" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "renderMedia()" }), ",", ' ', (0, jsx_runtime_1.jsx)("code", { children: "renderMediaOnLambda()" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "renderStill()" }), " and", ' ', (0, jsx_runtime_1.jsx)("code", { children: "renderStillOnLambda()" }), " with this URL."] }), (0, jsx_runtime_1.jsxs)("p", { children: ["Visit", ' ', (0, jsx_runtime_1.jsx)("a", { href: "https://remotion.dev/docs", target: "_blank", children: "remotion.dev/docs" }), ' ', "to read the documentation."] }), (0, jsx_runtime_1.jsx)("h2", { children: "CORS testing tool" }), (0, jsx_runtime_1.jsx)(TestCORS, {}), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {})] }));
|
|
107
|
-
};
|
|
108
|
-
exports.Homepage = Homepage;
|
package/dist/renderEntry.d.ts
DELETED
package/dist/renderEntry.js
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.setBundleModeAndUpdate = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
// In React 18, you should use createRoot() from "react-dom/client".
|
|
10
|
-
// In React 18, you should use render from "react-dom".
|
|
11
|
-
// We support both, but Webpack chooses both of them and normalizes them to "react-dom/client",
|
|
12
|
-
// hence why we import the right thing all the time but need to differentiate here
|
|
13
|
-
const client_1 = __importDefault(require("react-dom/client"));
|
|
14
|
-
const remotion_1 = require("remotion");
|
|
15
|
-
const no_react_1 = require("remotion/no-react");
|
|
16
|
-
const bundle_mode_1 = require("./bundle-mode");
|
|
17
|
-
const homepage_1 = require("./homepage/homepage");
|
|
18
|
-
remotion_1.Internals.CSSUtils.injectCSS(remotion_1.Internals.CSSUtils.makeDefaultCSS(null, '#fff'));
|
|
19
|
-
const getCanSerializeDefaultProps = (object) => {
|
|
20
|
-
try {
|
|
21
|
-
const str = JSON.stringify(object);
|
|
22
|
-
// 256MB is the theoretical limit, making it throw if over 90% of that is reached.
|
|
23
|
-
return str.length < 256 * 1024 * 1024 * 0.9;
|
|
24
|
-
}
|
|
25
|
-
catch (err) {
|
|
26
|
-
if (err.message.includes('Invalid string length')) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
throw err;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
const GetVideo = ({ state }) => {
|
|
33
|
-
const video = remotion_1.Internals.useVideo();
|
|
34
|
-
const compositions = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
35
|
-
const portalContainer = (0, react_1.useRef)(null);
|
|
36
|
-
const [handle] = (0, react_1.useState)(() => (0, remotion_1.delayRender)('Wait for Composition' + JSON.stringify(state)));
|
|
37
|
-
(0, react_1.useEffect)(() => {
|
|
38
|
-
return () => (0, remotion_1.continueRender)(handle);
|
|
39
|
-
}, [handle]);
|
|
40
|
-
(0, react_1.useEffect)(() => {
|
|
41
|
-
if (state.type !== 'composition') {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
if (!video && compositions.compositions.length > 0) {
|
|
45
|
-
const foundComposition = compositions.compositions.find((c) => c.id === state.compositionName);
|
|
46
|
-
if (!foundComposition) {
|
|
47
|
-
throw new Error(`Found no composition with the name ${state.compositionName}. The following compositions were found instead: ${compositions.compositions
|
|
48
|
-
.map((c) => c.id)
|
|
49
|
-
.join(', ')}. All compositions must have their ID calculated deterministically and must be mounted at the same time.`);
|
|
50
|
-
}
|
|
51
|
-
if (foundComposition) {
|
|
52
|
-
compositions.setCanvasContent({
|
|
53
|
-
type: 'composition',
|
|
54
|
-
compositionId: foundComposition.id,
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
compositions.setCanvasContent(null);
|
|
59
|
-
}
|
|
60
|
-
compositions.setCurrentCompositionMetadata({
|
|
61
|
-
props: no_react_1.NoReactInternals.deserializeJSONWithCustomFields(state.serializedResolvedPropsWithSchema),
|
|
62
|
-
durationInFrames: state.compositionDurationInFrames,
|
|
63
|
-
fps: state.compositionFps,
|
|
64
|
-
height: state.compositionHeight,
|
|
65
|
-
width: state.compositionWidth,
|
|
66
|
-
defaultCodec: state.compositionDefaultCodec,
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}, [compositions, compositions.compositions, state, video]);
|
|
70
|
-
(0, react_1.useEffect)(() => {
|
|
71
|
-
if (state.type === 'evaluation') {
|
|
72
|
-
(0, remotion_1.continueRender)(handle);
|
|
73
|
-
}
|
|
74
|
-
else if (video) {
|
|
75
|
-
(0, remotion_1.continueRender)(handle);
|
|
76
|
-
}
|
|
77
|
-
}, [handle, state.type, video]);
|
|
78
|
-
(0, react_1.useEffect)(() => {
|
|
79
|
-
if (!video) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const { current } = portalContainer;
|
|
83
|
-
if (!current) {
|
|
84
|
-
throw new Error('portal did not render');
|
|
85
|
-
}
|
|
86
|
-
current.appendChild(remotion_1.Internals.portalNode());
|
|
87
|
-
return () => {
|
|
88
|
-
current.removeChild(remotion_1.Internals.portalNode());
|
|
89
|
-
};
|
|
90
|
-
}, [video]);
|
|
91
|
-
if (!video) {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
return ((0, jsx_runtime_1.jsx)("div", { ref: portalContainer, id: "remotion-canvas", style: {
|
|
95
|
-
width: video.width,
|
|
96
|
-
height: video.height,
|
|
97
|
-
display: 'flex',
|
|
98
|
-
backgroundColor: 'transparent',
|
|
99
|
-
} }));
|
|
100
|
-
};
|
|
101
|
-
const videoContainer = document.getElementById('video-container');
|
|
102
|
-
const explainerContainer = document.getElementById('explainer-container');
|
|
103
|
-
let cleanupVideoContainer = () => {
|
|
104
|
-
videoContainer.innerHTML = '';
|
|
105
|
-
};
|
|
106
|
-
let cleanupExplainerContainer = () => {
|
|
107
|
-
explainerContainer.innerHTML = '';
|
|
108
|
-
};
|
|
109
|
-
const waitForRootHandle = (0, remotion_1.delayRender)('Loading root component - See https://remotion.dev/docs/troubleshooting/loading-root-component if you experience a timeout');
|
|
110
|
-
const WaitForRoot = () => {
|
|
111
|
-
const [Root, setRoot] = (0, react_1.useState)(() => remotion_1.Internals.getRoot());
|
|
112
|
-
(0, react_1.useEffect)(() => {
|
|
113
|
-
if (Root) {
|
|
114
|
-
(0, remotion_1.continueRender)(waitForRootHandle);
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
const cleanup = remotion_1.Internals.waitForRoot((NewRoot) => {
|
|
118
|
-
setRoot(() => NewRoot);
|
|
119
|
-
});
|
|
120
|
-
return () => cleanup();
|
|
121
|
-
}, [Root]);
|
|
122
|
-
if (Root === null) {
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
return (0, jsx_runtime_1.jsx)(Root, {});
|
|
126
|
-
};
|
|
127
|
-
const renderContent = () => {
|
|
128
|
-
const bundleMode = (0, bundle_mode_1.getBundleMode)();
|
|
129
|
-
if (bundleMode.type === 'composition' || bundleMode.type === 'evaluation') {
|
|
130
|
-
const markup = ((0, jsx_runtime_1.jsxs)(remotion_1.Internals.RemotionRoot, { numberOfAudioTags: 0, children: [(0, jsx_runtime_1.jsx)(WaitForRoot, {}), (0, jsx_runtime_1.jsx)(GetVideo, { state: bundleMode })] }));
|
|
131
|
-
if (client_1.default.createRoot) {
|
|
132
|
-
const root = client_1.default.createRoot(videoContainer);
|
|
133
|
-
root.render(markup);
|
|
134
|
-
cleanupVideoContainer = () => {
|
|
135
|
-
root.unmount();
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
client_1.default.render(markup, videoContainer);
|
|
140
|
-
cleanupVideoContainer = () => {
|
|
141
|
-
client_1.default.unmountComponentAtNode(videoContainer);
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
cleanupVideoContainer();
|
|
147
|
-
cleanupVideoContainer = () => {
|
|
148
|
-
videoContainer.innerHTML = '';
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
if (bundleMode.type === 'index' || bundleMode.type === 'evaluation') {
|
|
152
|
-
if (client_1.default.createRoot) {
|
|
153
|
-
const root = client_1.default.createRoot(explainerContainer);
|
|
154
|
-
root.render((0, jsx_runtime_1.jsx)(homepage_1.Homepage, {}));
|
|
155
|
-
cleanupExplainerContainer = () => {
|
|
156
|
-
root.unmount();
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
const root = client_1.default;
|
|
161
|
-
root.render((0, jsx_runtime_1.jsx)(homepage_1.Homepage, {}), explainerContainer);
|
|
162
|
-
cleanupExplainerContainer = () => {
|
|
163
|
-
root.unmountComponentAtNode(explainerContainer);
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
cleanupExplainerContainer();
|
|
169
|
-
cleanupExplainerContainer = () => {
|
|
170
|
-
explainerContainer.innerHTML = '';
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
renderContent();
|
|
175
|
-
const setBundleModeAndUpdate = (state) => {
|
|
176
|
-
(0, bundle_mode_1.setBundleMode)(state);
|
|
177
|
-
renderContent();
|
|
178
|
-
};
|
|
179
|
-
exports.setBundleModeAndUpdate = setBundleModeAndUpdate;
|
|
180
|
-
if (typeof window !== 'undefined') {
|
|
181
|
-
const getUnevaluatedComps = () => {
|
|
182
|
-
if (!remotion_1.Internals.getRoot()) {
|
|
183
|
-
throw new Error('registerRoot() was never called. 1. Make sure you specified the correct entrypoint for your bundle. 2. If your registerRoot() call is deferred, use the delayRender/continueRender pattern to tell Remotion to wait.');
|
|
184
|
-
}
|
|
185
|
-
if (!remotion_1.Internals.compositionsRef.current) {
|
|
186
|
-
throw new Error('Unexpectedly did not have a CompositionManager');
|
|
187
|
-
}
|
|
188
|
-
const compositions = remotion_1.Internals.compositionsRef.current.getCompositions();
|
|
189
|
-
const canSerializeDefaultProps = getCanSerializeDefaultProps(compositions);
|
|
190
|
-
if (!canSerializeDefaultProps) {
|
|
191
|
-
console.warn('defaultProps are too big to serialize - trying to find the problematic composition...');
|
|
192
|
-
for (const comp of compositions) {
|
|
193
|
-
if (!getCanSerializeDefaultProps(comp)) {
|
|
194
|
-
throw new Error(`defaultProps too big - could not serialize - the defaultProps of composition with ID ${comp.id} - the object that was passed to defaultProps was too big. Learn how to mitigate this error by visiting https://remotion.dev/docs/troubleshooting/serialize-defaultprops`);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
console.warn('Could not single out a problematic composition - The composition list as a whole is too big to serialize.');
|
|
198
|
-
throw new Error('defaultProps too big - Could not serialize - an object that was passed to defaultProps was too big. Learn how to mitigate this error by visiting https://remotion.dev/docs/troubleshooting/serialize-defaultprops');
|
|
199
|
-
}
|
|
200
|
-
return compositions;
|
|
201
|
-
};
|
|
202
|
-
window.getStaticCompositions = () => {
|
|
203
|
-
var _a;
|
|
204
|
-
const compositions = getUnevaluatedComps();
|
|
205
|
-
const inputProps = typeof window === 'undefined' || (0, remotion_1.getRemotionEnvironment)().isPlayer
|
|
206
|
-
? {}
|
|
207
|
-
: (_a = (0, remotion_1.getInputProps)()) !== null && _a !== void 0 ? _a : {};
|
|
208
|
-
return Promise.all(compositions.map(async (c) => {
|
|
209
|
-
const handle = (0, remotion_1.delayRender)(`Running calculateMetadata() for composition ${c.id}. If you didn't want to evaluate this composition, use "selectComposition()" instead of "getCompositions()"`);
|
|
210
|
-
const comp = remotion_1.Internals.resolveVideoConfig({
|
|
211
|
-
composition: c,
|
|
212
|
-
editorProps: {},
|
|
213
|
-
signal: new AbortController().signal,
|
|
214
|
-
inputProps,
|
|
215
|
-
});
|
|
216
|
-
const resolved = await Promise.resolve(comp);
|
|
217
|
-
(0, remotion_1.continueRender)(handle);
|
|
218
|
-
const { props, defaultProps, ...data } = resolved;
|
|
219
|
-
return {
|
|
220
|
-
...data,
|
|
221
|
-
serializedResolvedPropsWithCustomSchema: no_react_1.NoReactInternals.serializeJSONWithDate({
|
|
222
|
-
data: props,
|
|
223
|
-
indent: undefined,
|
|
224
|
-
staticBase: null,
|
|
225
|
-
}).serializedString,
|
|
226
|
-
serializedDefaultPropsWithCustomSchema: no_react_1.NoReactInternals.serializeJSONWithDate({
|
|
227
|
-
data: defaultProps,
|
|
228
|
-
indent: undefined,
|
|
229
|
-
staticBase: null,
|
|
230
|
-
}).serializedString,
|
|
231
|
-
};
|
|
232
|
-
}));
|
|
233
|
-
};
|
|
234
|
-
window.remotion_getCompositionNames = () => {
|
|
235
|
-
return getUnevaluatedComps().map((c) => c.id);
|
|
236
|
-
};
|
|
237
|
-
window.remotion_calculateComposition = async (compId) => {
|
|
238
|
-
var _a;
|
|
239
|
-
const compositions = getUnevaluatedComps();
|
|
240
|
-
const selectedComp = compositions.find((c) => c.id === compId);
|
|
241
|
-
if (!selectedComp) {
|
|
242
|
-
throw new Error(`Could not find composition with ID ${compId}`);
|
|
243
|
-
}
|
|
244
|
-
const abortController = new AbortController();
|
|
245
|
-
const handle = (0, remotion_1.delayRender)(`Running the calculateMetadata() function for composition ${compId}`);
|
|
246
|
-
const inputProps = typeof window === 'undefined' || (0, remotion_1.getRemotionEnvironment)().isPlayer
|
|
247
|
-
? {}
|
|
248
|
-
: (_a = (0, remotion_1.getInputProps)()) !== null && _a !== void 0 ? _a : {};
|
|
249
|
-
const prom = await Promise.resolve(remotion_1.Internals.resolveVideoConfig({
|
|
250
|
-
composition: selectedComp,
|
|
251
|
-
editorProps: {},
|
|
252
|
-
signal: abortController.signal,
|
|
253
|
-
inputProps,
|
|
254
|
-
}));
|
|
255
|
-
(0, remotion_1.continueRender)(handle);
|
|
256
|
-
const { props, defaultProps, ...data } = prom;
|
|
257
|
-
return {
|
|
258
|
-
...data,
|
|
259
|
-
serializedResolvedPropsWithCustomSchema: no_react_1.NoReactInternals.serializeJSONWithDate({
|
|
260
|
-
data: props,
|
|
261
|
-
indent: undefined,
|
|
262
|
-
staticBase: null,
|
|
263
|
-
}).serializedString,
|
|
264
|
-
serializedDefaultPropsWithCustomSchema: no_react_1.NoReactInternals.serializeJSONWithDate({
|
|
265
|
-
data: defaultProps,
|
|
266
|
-
indent: undefined,
|
|
267
|
-
staticBase: null,
|
|
268
|
-
}).serializedString,
|
|
269
|
-
};
|
|
270
|
-
};
|
|
271
|
-
window.siteVersion = '10';
|
|
272
|
-
window.remotion_version = remotion_1.VERSION;
|
|
273
|
-
window.remotion_setBundleMode = exports.setBundleModeAndUpdate;
|
|
274
|
-
}
|