-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreference.js
More file actions
51 lines (41 loc) · 1.83 KB
/
reference.js
File metadata and controls
51 lines (41 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Set bundle to evaluation mode
// Reference: https://github.com/remotion-dev/remotion/blob/main/packages/renderer/src/get-compositions.ts#L104C4-L106C7
window.remotion_setBundleMode({ type: 'evaluation' });
// Get a list of compositions,
// Reference: https://github.com/remotion-dev/remotion/blob/main/packages/renderer/src/get-compositions.ts#L114C3-L117C15
window.getStaticCompositions();
// Result of window.getStaticCompositions();
[
{
"width": 1920,
"height": 1080,
"fps": 30,
"durationInFrames": 150,
"id": "HelloWorld",
"serializedResolvedPropsWithCustomSchema": "{\"titleText\":\"Welcome to Remotion\",\"titleColor\":\"#000000\",\"logoColor1\":\"#91EAE4\",\"logoColor2\":\"#86A8E7\"}",
"serializedDefaultPropsWithCustomSchema": "{\"titleText\":\"Welcome to Remotion\",\"titleColor\":\"#000000\",\"logoColor1\":\"#91EAE4\",\"logoColor2\":\"#86A8E7\"}"
},
{
"width": 1920,
"height": 1080,
"fps": 30,
"durationInFrames": 150,
"id": "OnlyLogo",
"serializedResolvedPropsWithCustomSchema": "{\"logoColor1\":\"#91dAE2\",\"logoColor2\":\"#86A8E7\"}",
"serializedDefaultPropsWithCustomSchema": "{\"logoColor1\":\"#91dAE2\",\"logoColor2\":\"#86A8E7\"}"
}
]
// Set bundle to composition mode — props need to be correctly provided.
// Reference: https://github.com/remotion-dev/remotion/blob/main/packages/renderer/src/render-frames.ts#L283C5-L291C8
window.remotion_setBundleMode({
type: 'composition',
compositionName: id,
serializedResolvedPropsWithSchema: props,
compositionDurationInFrames: durationInFrames,
compositionFps: fps,
compositionHeight: height,
compositionWidth: width,
});
// In composition mode, "seek" to frame (f: frame number, c: composition name)
// Reference: https://github.com/remotion-dev/remotion/blob/main/packages/renderer/src/seek-to-frame.ts#L159C3-L162C30
window.remotion_setFrame(f, c);