@remotion/studio 4.0.374 → 4.0.376
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/dist/Studio.js +3 -3
- package/dist/components/Modals.js +5 -2
- package/dist/components/QuickSwitcher/fuzzy-search.js +0 -1
- package/dist/components/RenderButton.js +1 -1
- package/dist/components/RenderModal/RenderModalAdvanced.js +2 -2
- package/dist/components/RenderModal/{RenderModal.js → ServerRenderModal.js} +5 -62
- package/dist/components/RenderModal/WebRenderModal.d.ts +3 -0
- package/dist/components/RenderModal/WebRenderModal.js +351 -0
- package/dist/components/RenderModal/WebRenderModalAdvanced.d.ts +13 -0
- package/dist/components/RenderModal/WebRenderModalAdvanced.js +75 -0
- package/dist/components/RenderModal/WebRenderModalBasic.d.ts +29 -0
- package/dist/components/RenderModal/WebRenderModalBasic.js +133 -0
- package/dist/components/RenderModal/WebRenderModalPicture.d.ts +14 -0
- package/dist/components/RenderModal/WebRenderModalPicture.js +82 -0
- package/dist/components/RenderModal/layout.js +1 -1
- package/dist/components/RenderModal/render-modals.d.ts +11 -0
- package/dist/components/RenderModal/render-modals.js +63 -0
- package/dist/components/SidebarRenderButton.js +1 -1
- package/dist/components/WebRender/TriggerWebRender.d.ts +1 -1
- package/dist/components/WebRender/TriggerWebRender.js +20 -21
- package/dist/esm/{chunk-1bd2r4wv.js → chunk-fbkf30v3.js} +10733 -2061
- package/dist/esm/internals.mjs +10800 -2116
- package/dist/esm/previewEntry.mjs +10995 -2311
- package/dist/esm/renderEntry.mjs +19 -12
- package/dist/helpers/retry-payload.js +3 -3
- package/dist/renderEntry.js +5 -4
- package/dist/state/modals.d.ts +8 -2
- package/package.json +10 -10
- package/dist/esm/chunk-df4kyjv3.js +0 -42509
- package/dist/esm/chunk-dx9vebsw.js +0 -42509
- /package/dist/components/RenderModal/{RenderModal.d.ts → ServerRenderModal.d.ts} +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebRenderModalAdvanced = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const Checkmark_1 = require("../../icons/Checkmark");
|
|
7
|
+
const Checkbox_1 = require("../Checkbox");
|
|
8
|
+
const layout_1 = require("../layout");
|
|
9
|
+
const ComboBox_1 = require("../NewComposition/ComboBox");
|
|
10
|
+
const layout_2 = require("./layout");
|
|
11
|
+
const NumberSetting_1 = require("./NumberSetting");
|
|
12
|
+
const OptionExplainerBubble_1 = require("./OptionExplainerBubble");
|
|
13
|
+
const tabContainer = {
|
|
14
|
+
flex: 1,
|
|
15
|
+
};
|
|
16
|
+
const WebRenderModalAdvanced = ({ renderMode, delayRenderTimeout, setDelayRenderTimeout, mediaCacheSizeInBytes, setMediaCacheSizeInBytes, hardwareAcceleration, setHardwareAcceleration, }) => {
|
|
17
|
+
const toggleCustomMediaCacheSizeInBytes = (0, react_1.useCallback)(() => {
|
|
18
|
+
setMediaCacheSizeInBytes((previous) => {
|
|
19
|
+
if (previous === null) {
|
|
20
|
+
return 1000 * 1000 * 1000;
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
});
|
|
24
|
+
}, [setMediaCacheSizeInBytes]);
|
|
25
|
+
const changeMediaCacheSizeInBytes = (0, react_1.useCallback)((cb) => {
|
|
26
|
+
setMediaCacheSizeInBytes((prev) => {
|
|
27
|
+
if (prev === null) {
|
|
28
|
+
throw new TypeError('Expected previous value');
|
|
29
|
+
}
|
|
30
|
+
if (typeof cb === 'function') {
|
|
31
|
+
return cb(prev);
|
|
32
|
+
}
|
|
33
|
+
return cb;
|
|
34
|
+
});
|
|
35
|
+
}, [setMediaCacheSizeInBytes]);
|
|
36
|
+
const hardwareAccelerationOptions = (0, react_1.useMemo)(() => {
|
|
37
|
+
return [
|
|
38
|
+
{
|
|
39
|
+
label: 'No Preference',
|
|
40
|
+
onClick: () => setHardwareAcceleration('no-preference'),
|
|
41
|
+
leftItem: hardwareAcceleration === 'no-preference' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
42
|
+
id: 'no-preference',
|
|
43
|
+
keyHint: null,
|
|
44
|
+
quickSwitcherLabel: null,
|
|
45
|
+
subMenu: null,
|
|
46
|
+
type: 'item',
|
|
47
|
+
value: 'no-preference',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: 'Prefer Hardware',
|
|
51
|
+
onClick: () => setHardwareAcceleration('prefer-hardware'),
|
|
52
|
+
leftItem: hardwareAcceleration === 'prefer-hardware' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
53
|
+
id: 'prefer-hardware',
|
|
54
|
+
keyHint: null,
|
|
55
|
+
quickSwitcherLabel: null,
|
|
56
|
+
subMenu: null,
|
|
57
|
+
type: 'item',
|
|
58
|
+
value: 'prefer-hardware',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: 'Prefer Software',
|
|
62
|
+
onClick: () => setHardwareAcceleration('prefer-software'),
|
|
63
|
+
leftItem: hardwareAcceleration === 'prefer-software' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
64
|
+
id: 'prefer-software',
|
|
65
|
+
keyHint: null,
|
|
66
|
+
quickSwitcherLabel: null,
|
|
67
|
+
subMenu: null,
|
|
68
|
+
type: 'item',
|
|
69
|
+
value: 'prefer-software',
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
}, [hardwareAcceleration, setHardwareAcceleration]);
|
|
73
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: tabContainer, children: [(0, jsx_runtime_1.jsx)(NumberSetting_1.NumberSetting, { name: "Delay Render Timeout", formatter: (v) => `${v}ms`, min: 0, max: 1000000000, step: 1000, value: delayRenderTimeout, onValueChanged: setDelayRenderTimeout, hint: "delayRenderTimeoutInMillisecondsOption" }), (0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_2.label, children: ["Custom @remotion/media cache size ", (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(OptionExplainerBubble_1.OptionExplainerBubble, { id: "mediaCacheSizeInBytesOption" })] }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: mediaCacheSizeInBytes !== null, onChange: toggleCustomMediaCacheSizeInBytes, name: "media-cache-size" }) })] }), mediaCacheSizeInBytes === null ? null : ((0, jsx_runtime_1.jsx)(NumberSetting_1.NumberSetting, { name: "@remotion/media cache size", formatter: (w) => `${w} bytes`, min: 0, max: 10000000000, step: 10 * 1024 * 1024, value: mediaCacheSizeInBytes, onValueChanged: changeMediaCacheSizeInBytes })), renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_2.label, children: "Hardware Acceleration" }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: hardwareAccelerationOptions, selectedId: hardwareAcceleration, title: "Hardware Acceleration" }) })] })) : null] }));
|
|
74
|
+
};
|
|
75
|
+
exports.WebRenderModalAdvanced = WebRenderModalAdvanced;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
+
import type { RenderStillImageFormat, WebRendererCodec, WebRendererContainer } from '@remotion/web-renderer';
|
|
3
|
+
import type React from 'react';
|
|
4
|
+
import type { VideoConfig } from 'remotion';
|
|
5
|
+
import type { RenderType } from './WebRenderModal';
|
|
6
|
+
type WebRenderModalBasicProps = {
|
|
7
|
+
readonly renderMode: RenderType;
|
|
8
|
+
readonly resolvedComposition: VideoConfig;
|
|
9
|
+
readonly imageFormat: RenderStillImageFormat;
|
|
10
|
+
readonly setStillFormat: (format: RenderStillImageFormat) => void;
|
|
11
|
+
readonly frame: number;
|
|
12
|
+
readonly onFrameChanged: (e: string) => void;
|
|
13
|
+
readonly onFrameSetDirectly: (newFrame: number) => void;
|
|
14
|
+
readonly container: WebRendererContainer;
|
|
15
|
+
readonly setContainerFormat: (container: WebRendererContainer) => void;
|
|
16
|
+
readonly codec: WebRendererCodec;
|
|
17
|
+
readonly setCodec: (codec: WebRendererCodec) => void;
|
|
18
|
+
readonly startFrame: number | null;
|
|
19
|
+
readonly setStartFrame: React.Dispatch<React.SetStateAction<number | null>>;
|
|
20
|
+
readonly endFrame: number | null;
|
|
21
|
+
readonly setEndFrame: React.Dispatch<React.SetStateAction<number | null>>;
|
|
22
|
+
readonly outName: string;
|
|
23
|
+
readonly onOutNameChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
24
|
+
readonly validationMessage: string | null;
|
|
25
|
+
readonly logLevel: LogLevel;
|
|
26
|
+
readonly setLogLevel: (level: LogLevel) => void;
|
|
27
|
+
};
|
|
28
|
+
export declare const WebRenderModalBasic: React.FC<WebRenderModalBasicProps>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebRenderModalBasic = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const Checkmark_1 = require("../../icons/Checkmark");
|
|
7
|
+
const Checkbox_1 = require("../Checkbox");
|
|
8
|
+
const layout_1 = require("../layout");
|
|
9
|
+
const ComboBox_1 = require("../NewComposition/ComboBox");
|
|
10
|
+
const InputDragger_1 = require("../NewComposition/InputDragger");
|
|
11
|
+
const RemInput_1 = require("../NewComposition/RemInput");
|
|
12
|
+
const SegmentedControl_1 = require("../SegmentedControl");
|
|
13
|
+
const FrameRangeSetting_1 = require("./FrameRangeSetting");
|
|
14
|
+
const layout_2 = require("./layout");
|
|
15
|
+
const OptionExplainerBubble_1 = require("./OptionExplainerBubble");
|
|
16
|
+
const RenderModalOutputName_1 = require("./RenderModalOutputName");
|
|
17
|
+
const tabContainer = {
|
|
18
|
+
flex: 1,
|
|
19
|
+
};
|
|
20
|
+
const WebRenderModalBasic = ({ renderMode, resolvedComposition, imageFormat, setStillFormat, frame, onFrameChanged, onFrameSetDirectly, container, setContainerFormat, codec, setCodec, startFrame, setStartFrame, endFrame, setEndFrame, outName, onOutNameChange, validationMessage, logLevel, setLogLevel, }) => {
|
|
21
|
+
const imageFormatOptions = (0, react_1.useMemo)(() => {
|
|
22
|
+
return [
|
|
23
|
+
{
|
|
24
|
+
label: 'PNG',
|
|
25
|
+
onClick: () => setStillFormat('png'),
|
|
26
|
+
key: 'png',
|
|
27
|
+
selected: imageFormat === 'png',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: 'JPEG',
|
|
31
|
+
onClick: () => setStillFormat('jpeg'),
|
|
32
|
+
key: 'jpeg',
|
|
33
|
+
selected: imageFormat === 'jpeg',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: 'WebP',
|
|
37
|
+
onClick: () => setStillFormat('webp'),
|
|
38
|
+
key: 'webp',
|
|
39
|
+
selected: imageFormat === 'webp',
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
}, [imageFormat, setStillFormat]);
|
|
43
|
+
const containerOptions = (0, react_1.useMemo)(() => {
|
|
44
|
+
return [
|
|
45
|
+
{
|
|
46
|
+
label: 'MP4',
|
|
47
|
+
onClick: () => setContainerFormat('mp4'),
|
|
48
|
+
leftItem: container === 'mp4' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
49
|
+
id: 'mp4',
|
|
50
|
+
keyHint: null,
|
|
51
|
+
quickSwitcherLabel: null,
|
|
52
|
+
subMenu: null,
|
|
53
|
+
type: 'item',
|
|
54
|
+
value: 'mp4',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: 'WebM',
|
|
58
|
+
onClick: () => setContainerFormat('webm'),
|
|
59
|
+
leftItem: container === 'webm' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
60
|
+
id: 'webm',
|
|
61
|
+
keyHint: null,
|
|
62
|
+
quickSwitcherLabel: null,
|
|
63
|
+
subMenu: null,
|
|
64
|
+
type: 'item',
|
|
65
|
+
value: 'webm',
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
}, [container, setContainerFormat]);
|
|
69
|
+
const codecOptions = (0, react_1.useMemo)(() => {
|
|
70
|
+
return [
|
|
71
|
+
{
|
|
72
|
+
label: 'H.264',
|
|
73
|
+
onClick: () => setCodec('h264'),
|
|
74
|
+
leftItem: codec === 'h264' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
75
|
+
id: 'h264',
|
|
76
|
+
keyHint: null,
|
|
77
|
+
quickSwitcherLabel: null,
|
|
78
|
+
subMenu: null,
|
|
79
|
+
type: 'item',
|
|
80
|
+
value: 'h264',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: 'H.265',
|
|
84
|
+
onClick: () => setCodec('h265'),
|
|
85
|
+
leftItem: codec === 'h265' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
86
|
+
id: 'h265',
|
|
87
|
+
keyHint: null,
|
|
88
|
+
quickSwitcherLabel: null,
|
|
89
|
+
subMenu: null,
|
|
90
|
+
type: 'item',
|
|
91
|
+
value: 'h265',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
label: 'VP8',
|
|
95
|
+
onClick: () => setCodec('vp8'),
|
|
96
|
+
leftItem: codec === 'vp8' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
97
|
+
id: 'vp8',
|
|
98
|
+
keyHint: null,
|
|
99
|
+
quickSwitcherLabel: null,
|
|
100
|
+
subMenu: null,
|
|
101
|
+
type: 'item',
|
|
102
|
+
value: 'vp8',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
label: 'VP9',
|
|
106
|
+
onClick: () => setCodec('vp9'),
|
|
107
|
+
leftItem: codec === 'vp9' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
108
|
+
id: 'vp9',
|
|
109
|
+
keyHint: null,
|
|
110
|
+
quickSwitcherLabel: null,
|
|
111
|
+
subMenu: null,
|
|
112
|
+
type: 'item',
|
|
113
|
+
value: 'vp9',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: 'AV1',
|
|
117
|
+
onClick: () => setCodec('av1'),
|
|
118
|
+
leftItem: codec === 'av1' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
119
|
+
id: 'av1',
|
|
120
|
+
keyHint: null,
|
|
121
|
+
quickSwitcherLabel: null,
|
|
122
|
+
subMenu: null,
|
|
123
|
+
type: 'item',
|
|
124
|
+
value: 'av1',
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
}, [codec, setCodec]);
|
|
128
|
+
const onVerboseLoggingChanged = (0, react_1.useCallback)((e) => {
|
|
129
|
+
setLogLevel(e.target.checked ? 'verbose' : 'info');
|
|
130
|
+
}, [setLogLevel]);
|
|
131
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: tabContainer, children: [renderMode === 'still' ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_2.label, children: "Format" }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: imageFormatOptions, needsWrapping: true }) })] }), resolvedComposition.durationInFrames > 1 ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_2.label, children: "Frame" }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: frame, onTextChange: onFrameChanged, placeholder: `0-${resolvedComposition.durationInFrames - 1}`, onValueChange: onFrameSetDirectly, name: "frame", step: 1, min: 0, status: "ok", max: resolvedComposition.durationInFrames - 1, rightAlign: true }) }) })] })) : null] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_2.label, children: "Container" }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: containerOptions, selectedId: container, title: "Container" }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_2.label, children: ["Codec", (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(OptionExplainerBubble_1.OptionExplainerBubble, { id: "videoCodecOption" })] }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: codecOptions, selectedId: codec, title: "Codec" }) })] }), (0, jsx_runtime_1.jsx)(FrameRangeSetting_1.FrameRangeSetting, { durationInFrames: resolvedComposition.durationInFrames, startFrame: startFrame !== null && startFrame !== void 0 ? startFrame : 0, endFrame: endFrame !== null && endFrame !== void 0 ? endFrame : resolvedComposition.durationInFrames - 1, setStartFrame: setStartFrame, setEndFrame: setEndFrame })] })), (0, jsx_runtime_1.jsx)(RenderModalOutputName_1.RenderModalOutputName, { existence: false, inputStyle: layout_2.input, outName: outName, onValueChange: onOutNameChange, validationMessage: validationMessage, label: "Download name" }), (0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_2.label, children: ["Verbose logging ", (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(OptionExplainerBubble_1.OptionExplainerBubble, { id: "logLevelOption" })] }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: logLevel === 'verbose', onChange: onVerboseLoggingChanged, name: "verbose-logging" }) })] })] }));
|
|
132
|
+
};
|
|
133
|
+
exports.WebRenderModalBasic = WebRenderModalBasic;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { WebRendererQuality } from '@remotion/web-renderer';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import type { RenderType } from './WebRenderModal';
|
|
4
|
+
type WebRenderModalPictureProps = {
|
|
5
|
+
readonly renderMode: RenderType;
|
|
6
|
+
readonly videoBitrate: WebRendererQuality;
|
|
7
|
+
readonly setVideoBitrate: (quality: WebRendererQuality) => void;
|
|
8
|
+
readonly keyframeIntervalInSeconds: number;
|
|
9
|
+
readonly setKeyframeIntervalInSeconds: React.Dispatch<React.SetStateAction<number>>;
|
|
10
|
+
readonly transparent: boolean;
|
|
11
|
+
readonly setTransparent: React.Dispatch<React.SetStateAction<boolean>>;
|
|
12
|
+
};
|
|
13
|
+
export declare const WebRenderModalPicture: React.FC<WebRenderModalPictureProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebRenderModalPicture = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const Checkmark_1 = require("../../icons/Checkmark");
|
|
7
|
+
const Checkbox_1 = require("../Checkbox");
|
|
8
|
+
const ComboBox_1 = require("../NewComposition/ComboBox");
|
|
9
|
+
const layout_1 = require("./layout");
|
|
10
|
+
const NumberSetting_1 = require("./NumberSetting");
|
|
11
|
+
const tabContainer = {
|
|
12
|
+
flex: 1,
|
|
13
|
+
};
|
|
14
|
+
const WebRenderModalPicture = ({ renderMode, videoBitrate, setVideoBitrate, keyframeIntervalInSeconds, setKeyframeIntervalInSeconds, transparent, setTransparent, }) => {
|
|
15
|
+
const qualityOptions = (0, react_1.useMemo)(() => {
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
label: 'Very Low',
|
|
19
|
+
onClick: () => setVideoBitrate('very-low'),
|
|
20
|
+
leftItem: videoBitrate === 'very-low' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
21
|
+
id: 'very-low',
|
|
22
|
+
keyHint: null,
|
|
23
|
+
quickSwitcherLabel: null,
|
|
24
|
+
subMenu: null,
|
|
25
|
+
type: 'item',
|
|
26
|
+
value: 'very-low',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: 'Low',
|
|
30
|
+
onClick: () => setVideoBitrate('low'),
|
|
31
|
+
leftItem: videoBitrate === 'low' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
32
|
+
id: 'low',
|
|
33
|
+
keyHint: null,
|
|
34
|
+
quickSwitcherLabel: null,
|
|
35
|
+
subMenu: null,
|
|
36
|
+
type: 'item',
|
|
37
|
+
value: 'low',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: 'Medium',
|
|
41
|
+
onClick: () => setVideoBitrate('medium'),
|
|
42
|
+
leftItem: videoBitrate === 'medium' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
43
|
+
id: 'medium',
|
|
44
|
+
keyHint: null,
|
|
45
|
+
quickSwitcherLabel: null,
|
|
46
|
+
subMenu: null,
|
|
47
|
+
type: 'item',
|
|
48
|
+
value: 'medium',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: 'High',
|
|
52
|
+
onClick: () => setVideoBitrate('high'),
|
|
53
|
+
leftItem: videoBitrate === 'high' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
54
|
+
id: 'high',
|
|
55
|
+
keyHint: null,
|
|
56
|
+
quickSwitcherLabel: null,
|
|
57
|
+
subMenu: null,
|
|
58
|
+
type: 'item',
|
|
59
|
+
value: 'high',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: 'Very High',
|
|
63
|
+
onClick: () => setVideoBitrate('very-high'),
|
|
64
|
+
leftItem: videoBitrate === 'very-high' ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
65
|
+
id: 'very-high',
|
|
66
|
+
keyHint: null,
|
|
67
|
+
quickSwitcherLabel: null,
|
|
68
|
+
subMenu: null,
|
|
69
|
+
type: 'item',
|
|
70
|
+
value: 'very-high',
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
}, [videoBitrate, setVideoBitrate]);
|
|
74
|
+
const onTransparentChanged = (0, react_1.useCallback)((e) => {
|
|
75
|
+
setTransparent(e.target.checked);
|
|
76
|
+
}, [setTransparent]);
|
|
77
|
+
if (renderMode !== 'video') {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: tabContainer, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Quality" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: qualityOptions, selectedId: videoBitrate, title: "Quality" }) })] }), (0, jsx_runtime_1.jsx)(NumberSetting_1.NumberSetting, { name: "Keyframe Interval", formatter: (v) => `${v}s`, min: 1, max: 300, step: 1, value: keyframeIntervalInSeconds, onValueChanged: setKeyframeIntervalInSeconds }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Transparent" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: transparent, onChange: onTransparentChanged, name: "transparent" }) })] })] }));
|
|
81
|
+
};
|
|
82
|
+
exports.WebRenderModalPicture = WebRenderModalPicture;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export declare const outerModalStyle: React.CSSProperties;
|
|
3
|
+
export declare const container: React.CSSProperties;
|
|
4
|
+
export declare const optionsPanel: React.CSSProperties;
|
|
5
|
+
export declare const horizontalLayout: React.CSSProperties;
|
|
6
|
+
export declare const leftSidebar: React.CSSProperties;
|
|
7
|
+
export declare const horizontalTab: React.CSSProperties;
|
|
8
|
+
export declare const iconContainer: React.CSSProperties;
|
|
9
|
+
export declare const icon: React.CSSProperties;
|
|
10
|
+
export declare const buttonStyle: React.CSSProperties;
|
|
11
|
+
export declare const flexer: React.CSSProperties;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.flexer = exports.buttonStyle = exports.icon = exports.iconContainer = exports.horizontalTab = exports.leftSidebar = exports.horizontalLayout = exports.optionsPanel = exports.container = exports.outerModalStyle = void 0;
|
|
4
|
+
const colors_1 = require("../../helpers/colors");
|
|
5
|
+
const ModalContainer_1 = require("../ModalContainer");
|
|
6
|
+
exports.outerModalStyle = {
|
|
7
|
+
width: (0, ModalContainer_1.getMaxModalWidth)(1000),
|
|
8
|
+
height: (0, ModalContainer_1.getMaxModalHeight)(640),
|
|
9
|
+
overflow: 'hidden',
|
|
10
|
+
display: 'flex',
|
|
11
|
+
flexDirection: 'column',
|
|
12
|
+
};
|
|
13
|
+
exports.container = {
|
|
14
|
+
display: 'flex',
|
|
15
|
+
flexDirection: 'row',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
padding: '12px 16px',
|
|
18
|
+
borderBottom: '1px solid black',
|
|
19
|
+
};
|
|
20
|
+
exports.optionsPanel = {
|
|
21
|
+
display: 'flex',
|
|
22
|
+
width: '100%',
|
|
23
|
+
};
|
|
24
|
+
exports.horizontalLayout = {
|
|
25
|
+
display: 'flex',
|
|
26
|
+
flexDirection: 'row',
|
|
27
|
+
overflowY: 'auto',
|
|
28
|
+
flex: 1,
|
|
29
|
+
};
|
|
30
|
+
exports.leftSidebar = {
|
|
31
|
+
padding: 12,
|
|
32
|
+
};
|
|
33
|
+
exports.horizontalTab = {
|
|
34
|
+
width: 250,
|
|
35
|
+
display: 'flex',
|
|
36
|
+
flexDirection: 'row',
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
textAlign: 'left',
|
|
39
|
+
fontSize: 16,
|
|
40
|
+
fontWeight: 'bold',
|
|
41
|
+
paddingLeft: 15,
|
|
42
|
+
paddingTop: 12,
|
|
43
|
+
paddingBottom: 12,
|
|
44
|
+
};
|
|
45
|
+
exports.iconContainer = {
|
|
46
|
+
width: 20,
|
|
47
|
+
height: 20,
|
|
48
|
+
marginRight: 15,
|
|
49
|
+
display: 'inline-flex',
|
|
50
|
+
justifyContent: 'center',
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
};
|
|
53
|
+
exports.icon = {
|
|
54
|
+
color: 'currentcolor',
|
|
55
|
+
height: 20,
|
|
56
|
+
};
|
|
57
|
+
exports.buttonStyle = {
|
|
58
|
+
backgroundColor: colors_1.BLUE,
|
|
59
|
+
color: 'white',
|
|
60
|
+
};
|
|
61
|
+
exports.flexer = {
|
|
62
|
+
flex: 1,
|
|
63
|
+
};
|
|
@@ -32,7 +32,7 @@ const SidebarRenderButton = ({ composition, visible }) => {
|
|
|
32
32
|
}
|
|
33
33
|
e.stopPropagation();
|
|
34
34
|
setSelectedModal({
|
|
35
|
-
type: 'render',
|
|
35
|
+
type: 'server-render',
|
|
36
36
|
compositionId: composition.id,
|
|
37
37
|
initialFrame: 0,
|
|
38
38
|
initialVideoImageFormat: defaults.videoImageFormat,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TriggerWebRender: () => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const TriggerWebRender: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -2,40 +2,39 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TriggerWebRender = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const player_1 = require("@remotion/player");
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
|
+
const modals_1 = require("../../state/modals");
|
|
8
9
|
const Button_1 = require("../Button");
|
|
9
|
-
const imperative_state_1 = require("../Timeline/imperative-state");
|
|
10
10
|
const button = {
|
|
11
11
|
paddingLeft: 7,
|
|
12
12
|
paddingRight: 7,
|
|
13
13
|
paddingTop: 7,
|
|
14
14
|
paddingBottom: 7,
|
|
15
15
|
};
|
|
16
|
+
const label = {
|
|
17
|
+
fontSize: 14,
|
|
18
|
+
};
|
|
16
19
|
const TriggerWebRender = () => {
|
|
17
20
|
const video = remotion_1.Internals.useVideo();
|
|
18
|
-
const
|
|
21
|
+
const getCurrentFrame = player_1.PlayerInternals.useFrameImperative();
|
|
22
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
19
23
|
const onClick = (0, react_1.useCallback)(() => {
|
|
20
|
-
if (!video) {
|
|
21
|
-
|
|
24
|
+
if (!(video === null || video === void 0 ? void 0 : video.id)) {
|
|
25
|
+
return null;
|
|
22
26
|
}
|
|
23
|
-
(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
frame,
|
|
30
|
-
}).then((blob) => {
|
|
31
|
-
const url = URL.createObjectURL(blob);
|
|
32
|
-
const a = document.createElement('a');
|
|
33
|
-
a.href = url;
|
|
34
|
-
a.download = 'composed.png';
|
|
35
|
-
a.click();
|
|
36
|
-
URL.revokeObjectURL(url);
|
|
27
|
+
const frame = getCurrentFrame();
|
|
28
|
+
setSelectedModal({
|
|
29
|
+
type: 'web-render',
|
|
30
|
+
initialFrame: frame,
|
|
31
|
+
compositionId: video.id,
|
|
32
|
+
defaultProps: video.defaultProps,
|
|
37
33
|
});
|
|
38
|
-
}, [video,
|
|
39
|
-
|
|
34
|
+
}, [getCurrentFrame, setSelectedModal, video === null || video === void 0 ? void 0 : video.id, video === null || video === void 0 ? void 0 : video.defaultProps]);
|
|
35
|
+
if (!video) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onClick, buttonContainerStyle: button, disabled: false, children: (0, jsx_runtime_1.jsx)("span", { style: label, children: "Render on web" }) }));
|
|
40
39
|
};
|
|
41
40
|
exports.TriggerWebRender = TriggerWebRender;
|