@remotion/studio 4.0.396 → 4.0.398
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/components/Checkbox.d.ts +1 -0
- package/dist/components/Checkbox.js +14 -2
- package/dist/components/Modals.js +1 -1
- package/dist/components/PreviewToolbar.js +2 -3
- package/dist/components/RenderButton.d.ts +4 -1
- package/dist/components/RenderButton.js +253 -5
- package/dist/components/RenderModal/WebRenderModal.js +17 -3
- package/dist/components/RenderModal/WebRenderModalAudio.d.ts +5 -0
- package/dist/components/RenderModal/WebRenderModalAudio.js +14 -0
- package/dist/components/RenderModal/WebRenderModalBasic.d.ts +5 -5
- package/dist/components/RenderModal/WebRenderModalLicense.d.ts +9 -0
- package/dist/components/RenderModal/WebRenderModalLicense.js +130 -0
- package/dist/components/RenderModal/WebRendererExperimentalBadge.d.ts +1 -0
- package/dist/components/RenderModal/WebRendererExperimentalBadge.js +33 -0
- package/dist/esm/{chunk-khjn7st6.js → chunk-qrhc345b.js} +2493 -1810
- package/dist/esm/internals.mjs +2493 -1810
- package/dist/esm/previewEntry.mjs +2524 -1841
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/inject-css.js +0 -1
- package/dist/helpers/should-show-render-button.d.ts +1 -0
- package/dist/helpers/should-show-render-button.js +11 -0
- package/dist/helpers/use-menu-structure.js +19 -1
- package/dist/icons/certificate.d.ts +1 -0
- package/dist/icons/certificate.js +6 -0
- package/dist/icons/render.d.ts +0 -3
- package/dist/icons/render.js +1 -5
- package/dist/state/modals.d.ts +1 -0
- package/package.json +9 -9
- package/dist/components/WebRender/TriggerWebRender.d.ts +0 -1
- package/dist/components/WebRender/TriggerWebRender.js +0 -56
|
@@ -11,6 +11,12 @@ const background = {
|
|
|
11
11
|
width: size,
|
|
12
12
|
position: 'relative',
|
|
13
13
|
};
|
|
14
|
+
const bullet = {
|
|
15
|
+
width: 10,
|
|
16
|
+
height: 10,
|
|
17
|
+
backgroundColor: colors_1.LIGHT_TEXT,
|
|
18
|
+
borderRadius: '50%',
|
|
19
|
+
};
|
|
14
20
|
const box = {
|
|
15
21
|
display: 'flex',
|
|
16
22
|
justifyContent: 'center',
|
|
@@ -23,7 +29,8 @@ const box = {
|
|
|
23
29
|
pointerEvents: 'none',
|
|
24
30
|
color: 'white',
|
|
25
31
|
};
|
|
26
|
-
const Checkbox = ({ checked, onChange, disabled, name }) => {
|
|
32
|
+
const Checkbox = ({ checked, onChange, disabled, name, rounded }) => {
|
|
33
|
+
const ref = (0, react_1.useRef)(null);
|
|
27
34
|
const input = (0, react_1.useMemo)(() => {
|
|
28
35
|
return {
|
|
29
36
|
appearance: 'none',
|
|
@@ -37,6 +44,11 @@ const Checkbox = ({ checked, onChange, disabled, name }) => {
|
|
|
37
44
|
margin: 0,
|
|
38
45
|
};
|
|
39
46
|
}, [disabled]);
|
|
40
|
-
|
|
47
|
+
(0, react_1.useEffect)(() => {
|
|
48
|
+
if (ref.current) {
|
|
49
|
+
ref.current.style.setProperty('border-radius', rounded ? '50%' : '0%', 'important');
|
|
50
|
+
}
|
|
51
|
+
}, [rounded]);
|
|
52
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: background, children: [(0, jsx_runtime_1.jsx)("input", { ref: ref, style: input, type: 'checkbox', checked: checked, onChange: onChange, disabled: disabled, name: name }), (0, jsx_runtime_1.jsx)("div", { style: box, children: checked ? rounded ? (0, jsx_runtime_1.jsx)("div", { style: bullet }) : (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null })] }));
|
|
41
53
|
};
|
|
42
54
|
exports.Checkbox = Checkbox;
|
|
@@ -23,7 +23,7 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
23
23
|
const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
24
24
|
const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
|
|
25
25
|
'connected';
|
|
26
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'duplicate-comp' && ((0, jsx_runtime_1.jsx)(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && ((0, jsx_runtime_1.jsx)(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && ((0, jsx_runtime_1.jsx)(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'input-props-override' && ((0, jsx_runtime_1.jsx)(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'web-render' && ((0, jsx_runtime_1.jsx)(WebRenderModal_1.WebRenderModalWithLoader, { type: "web-render", initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, initialLogLevel: modalContextType.initialLogLevel })), modalContextType &&
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'duplicate-comp' && ((0, jsx_runtime_1.jsx)(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && ((0, jsx_runtime_1.jsx)(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && ((0, jsx_runtime_1.jsx)(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'input-props-override' && ((0, jsx_runtime_1.jsx)(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'web-render' && ((0, jsx_runtime_1.jsx)(WebRenderModal_1.WebRenderModalWithLoader, { type: "web-render", initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, initialLogLevel: modalContextType.initialLogLevel, initialLicenseKey: modalContextType.initialLicenseKey })), modalContextType &&
|
|
27
27
|
canRender &&
|
|
28
28
|
modalContextType.type === 'server-render' && ((0, jsx_runtime_1.jsx)(ServerRenderModal_1.RenderModalWithLoader, { initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })), modalContextType &&
|
|
29
29
|
canRender &&
|
|
@@ -8,7 +8,7 @@ const check_fullscreen_support_1 = require("../helpers/check-fullscreen-support"
|
|
|
8
8
|
const colors_1 = require("../helpers/colors");
|
|
9
9
|
const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
|
|
10
10
|
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
11
|
-
const
|
|
11
|
+
const should_show_render_button_1 = require("../helpers/should-show-render-button");
|
|
12
12
|
const timeline_layout_1 = require("../helpers/timeline-layout");
|
|
13
13
|
const loop_1 = require("../state/loop");
|
|
14
14
|
const CheckboardToggle_1 = require("./CheckboardToggle");
|
|
@@ -24,7 +24,6 @@ const RenderButton_1 = require("./RenderButton");
|
|
|
24
24
|
const SizeSelector_1 = require("./SizeSelector");
|
|
25
25
|
const TimelineZoomControls_1 = require("./Timeline/TimelineZoomControls");
|
|
26
26
|
const TimelineInOutToggle_1 = require("./TimelineInOutToggle");
|
|
27
|
-
const TriggerWebRender_1 = require("./WebRender/TriggerWebRender");
|
|
28
27
|
const layout_1 = require("./layout");
|
|
29
28
|
const container = {
|
|
30
29
|
display: 'flex',
|
|
@@ -134,6 +133,6 @@ const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
|
134
133
|
};
|
|
135
134
|
}
|
|
136
135
|
});
|
|
137
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ref: previewToolbarRef, style: isMobileLayout ? mobileContainer : container, className: "css-reset", children: [(0, jsx_runtime_1.jsx)("div", { ref: leftScrollIndicatorRef, style: scrollIndicatorLeft }), isMobileLayout ? null : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)("div", { style: padding }), (0, jsx_runtime_1.jsx)(TimelineZoomControls_1.TimelineZoomControls, {})] }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(SizeSelector_1.SizeSelector, {}), isStill || isVideoComposition ? ((0, jsx_runtime_1.jsx)(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate })) : null] })), isVideoComposition ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(PlayPause_1.PlayPause, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, loop: loop, playbackRate: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }), (0, jsx_runtime_1.jsx)(MuteToggle_1.MuteToggle, { muted: mediaMuted, setMuted: setMediaMuted }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(TimelineInOutToggle_1.TimelineInOutPointToggle, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 })] })) : null, (0, jsx_runtime_1.jsx)(CheckboardToggle_1.CheckboardToggle, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), isFullscreenSupported && (0, jsx_runtime_1.jsx)(FullscreenToggle_1.FullScreenToggle, {}), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), isMobileLayout && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(SizeSelector_1.SizeSelector, {}), isStill || isVideoComposition ? ((0, jsx_runtime_1.jsx)(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate })) : null] })), (0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, {}), !isMobileLayout && (0, jsx_runtime_1.jsx)(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }),
|
|
136
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: previewToolbarRef, style: isMobileLayout ? mobileContainer : container, className: "css-reset", children: [(0, jsx_runtime_1.jsx)("div", { ref: leftScrollIndicatorRef, style: scrollIndicatorLeft }), isMobileLayout ? null : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)("div", { style: padding }), (0, jsx_runtime_1.jsx)(TimelineZoomControls_1.TimelineZoomControls, {})] }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(SizeSelector_1.SizeSelector, {}), isStill || isVideoComposition ? ((0, jsx_runtime_1.jsx)(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate })) : null] })), isVideoComposition ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(PlayPause_1.PlayPause, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, loop: loop, playbackRate: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }), (0, jsx_runtime_1.jsx)(MuteToggle_1.MuteToggle, { muted: mediaMuted, setMuted: setMediaMuted }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(TimelineInOutToggle_1.TimelineInOutPointToggle, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 })] })) : null, (0, jsx_runtime_1.jsx)(CheckboardToggle_1.CheckboardToggle, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), isFullscreenSupported && (0, jsx_runtime_1.jsx)(FullscreenToggle_1.FullScreenToggle, {}), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), isMobileLayout && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(SizeSelector_1.SizeSelector, {}), isStill || isVideoComposition ? ((0, jsx_runtime_1.jsx)(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate })) : null] })), (0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, {}), !isMobileLayout && (0, jsx_runtime_1.jsx)(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, should_show_render_button_1.shouldShowRenderButton)(readOnlyStudio) ? ((0, jsx_runtime_1.jsx)(RenderButton_1.RenderButton, { readOnlyStudio: readOnlyStudio })) : null, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1.5 })] }), (0, jsx_runtime_1.jsx)(PlaybackKeyboardShortcutsManager_1.PlaybackKeyboardShortcutsManager, { setPlaybackRate: setPlaybackRate }), (0, jsx_runtime_1.jsx)(PlaybackRatePersistor_1.PlaybackRatePersistor, {}), (0, jsx_runtime_1.jsx)("div", { ref: rightScrollIndicatorRef, style: scrollIndicatorRight })] }));
|
|
138
137
|
};
|
|
139
138
|
exports.PreviewToolbar = PreviewToolbar;
|
|
@@ -1,29 +1,107 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.RenderButton = void 0;
|
|
4
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
8
|
const player_1 = require("@remotion/player");
|
|
6
9
|
const react_1 = require("react");
|
|
10
|
+
const react_dom_1 = __importDefault(require("react-dom"));
|
|
7
11
|
const remotion_1 = require("remotion");
|
|
8
12
|
const client_id_1 = require("../helpers/client-id");
|
|
13
|
+
const colors_1 = require("../helpers/colors");
|
|
14
|
+
const show_browser_rendering_1 = require("../helpers/show-browser-rendering");
|
|
9
15
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
16
|
+
const caret_1 = require("../icons/caret");
|
|
10
17
|
const render_1 = require("../icons/render");
|
|
11
18
|
const in_out_1 = require("../state/in-out");
|
|
12
19
|
const modals_1 = require("../state/modals");
|
|
13
|
-
const
|
|
20
|
+
const z_index_1 = require("../state/z-index");
|
|
21
|
+
const is_menu_item_1 = require("./Menu/is-menu-item");
|
|
22
|
+
const portals_1 = require("./Menu/portals");
|
|
23
|
+
const styles_1 = require("./Menu/styles");
|
|
24
|
+
const MenuContent_1 = require("./NewComposition/MenuContent");
|
|
14
25
|
const layout_1 = require("./layout");
|
|
15
|
-
const
|
|
26
|
+
const splitButtonContainer = {
|
|
27
|
+
display: 'inline-flex',
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
alignItems: 'stretch',
|
|
30
|
+
borderRadius: 4,
|
|
31
|
+
border: `1px solid ${colors_1.INPUT_BORDER_COLOR_UNHOVERED}`,
|
|
32
|
+
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
33
|
+
overflow: 'hidden',
|
|
34
|
+
};
|
|
35
|
+
const mainButtonStyle = {
|
|
16
36
|
paddingLeft: 7,
|
|
17
37
|
paddingRight: 7,
|
|
18
38
|
paddingTop: 7,
|
|
19
39
|
paddingBottom: 7,
|
|
40
|
+
background: 'transparent',
|
|
41
|
+
border: 'none',
|
|
42
|
+
color: 'white',
|
|
43
|
+
cursor: 'pointer',
|
|
44
|
+
display: 'flex',
|
|
45
|
+
alignItems: 'center',
|
|
46
|
+
fontSize: 14,
|
|
47
|
+
fontFamily: 'inherit',
|
|
48
|
+
};
|
|
49
|
+
const dividerStyle = {
|
|
50
|
+
width: 1,
|
|
51
|
+
backgroundColor: colors_1.INPUT_BORDER_COLOR_UNHOVERED,
|
|
52
|
+
alignSelf: 'stretch',
|
|
53
|
+
};
|
|
54
|
+
const dropdownTriggerStyle = {
|
|
55
|
+
paddingLeft: 6,
|
|
56
|
+
paddingRight: 6,
|
|
57
|
+
paddingTop: 7,
|
|
58
|
+
paddingBottom: 7,
|
|
59
|
+
background: 'transparent',
|
|
60
|
+
border: 'none',
|
|
61
|
+
color: 'white',
|
|
62
|
+
cursor: 'pointer',
|
|
63
|
+
display: 'flex',
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
};
|
|
66
|
+
const mainButtonContent = {
|
|
67
|
+
paddingLeft: 4,
|
|
68
|
+
paddingRight: 6,
|
|
20
69
|
};
|
|
21
70
|
const label = {
|
|
22
71
|
fontSize: 14,
|
|
23
72
|
};
|
|
24
|
-
const
|
|
73
|
+
const RENDER_TYPE_STORAGE_KEY = 'remotion.renderType';
|
|
74
|
+
const getInitialRenderType = (readOnlyStudio) => {
|
|
75
|
+
if (!show_browser_rendering_1.SHOW_BROWSER_RENDERING) {
|
|
76
|
+
return 'server-render';
|
|
77
|
+
}
|
|
78
|
+
if (readOnlyStudio) {
|
|
79
|
+
return 'client-render';
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
const stored = localStorage.getItem(RENDER_TYPE_STORAGE_KEY);
|
|
83
|
+
if (stored === 'server-render' || stored === 'client-render') {
|
|
84
|
+
return stored;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (_a) {
|
|
88
|
+
// localStorage might not be available
|
|
89
|
+
}
|
|
90
|
+
return 'server-render';
|
|
91
|
+
};
|
|
92
|
+
const RenderButton = ({ readOnlyStudio, }) => {
|
|
25
93
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
26
94
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
95
|
+
const [renderType, setRenderType] = (0, react_1.useState)(() => getInitialRenderType(readOnlyStudio));
|
|
96
|
+
const [dropdownOpened, setDropdownOpened] = (0, react_1.useState)(false);
|
|
97
|
+
const dropdownRef = (0, react_1.useRef)(null);
|
|
98
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
99
|
+
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
100
|
+
const size = player_1.PlayerInternals.useElementSize(dropdownRef, {
|
|
101
|
+
triggerOnWindowResize: true,
|
|
102
|
+
shouldApplyCssTransforms: true,
|
|
103
|
+
});
|
|
104
|
+
const refresh = size === null || size === void 0 ? void 0 : size.refresh;
|
|
27
105
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
28
106
|
.previewServerState.type;
|
|
29
107
|
const shortcut = (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? '' : '(R)';
|
|
@@ -41,7 +119,7 @@ const RenderButton = () => {
|
|
|
41
119
|
const video = remotion_1.Internals.useVideo();
|
|
42
120
|
const getCurrentFrame = player_1.PlayerInternals.useFrameImperative();
|
|
43
121
|
const { props } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
|
|
44
|
-
const
|
|
122
|
+
const openServerRenderModal = (0, react_1.useCallback)(() => {
|
|
45
123
|
var _a, _b, _c;
|
|
46
124
|
if (!video) {
|
|
47
125
|
return null;
|
|
@@ -101,9 +179,179 @@ const RenderButton = () => {
|
|
|
101
179
|
renderDefaults: defaults,
|
|
102
180
|
});
|
|
103
181
|
}, [video, setSelectedModal, getCurrentFrame, props, inFrame, outFrame]);
|
|
182
|
+
const openClientRenderModal = (0, react_1.useCallback)(() => {
|
|
183
|
+
var _a;
|
|
184
|
+
if (!video) {
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
const defaults = window.remotion_renderDefaults;
|
|
188
|
+
if (!defaults) {
|
|
189
|
+
throw new TypeError('Expected defaults');
|
|
190
|
+
}
|
|
191
|
+
setSelectedModal({
|
|
192
|
+
type: 'web-render',
|
|
193
|
+
compositionId: video.id,
|
|
194
|
+
initialFrame: getCurrentFrame(),
|
|
195
|
+
defaultProps: (_a = props[video.id]) !== null && _a !== void 0 ? _a : video.defaultProps,
|
|
196
|
+
inFrameMark: inFrame,
|
|
197
|
+
outFrameMark: outFrame,
|
|
198
|
+
initialLogLevel: defaults.logLevel,
|
|
199
|
+
initialLicenseKey: defaults.publicLicenseKey,
|
|
200
|
+
});
|
|
201
|
+
}, [video, setSelectedModal, getCurrentFrame, props, inFrame, outFrame]);
|
|
202
|
+
const onClick = (0, react_1.useCallback)(() => {
|
|
203
|
+
if (!show_browser_rendering_1.SHOW_BROWSER_RENDERING || renderType === 'server-render') {
|
|
204
|
+
openServerRenderModal();
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
openClientRenderModal();
|
|
208
|
+
}
|
|
209
|
+
}, [renderType, openServerRenderModal, openClientRenderModal]);
|
|
210
|
+
const onHideDropdown = (0, react_1.useCallback)(() => {
|
|
211
|
+
setDropdownOpened(false);
|
|
212
|
+
}, []);
|
|
213
|
+
const handleRenderTypeChange = (0, react_1.useCallback)((newType) => {
|
|
214
|
+
setRenderType(newType);
|
|
215
|
+
try {
|
|
216
|
+
localStorage.setItem(RENDER_TYPE_STORAGE_KEY, newType);
|
|
217
|
+
}
|
|
218
|
+
catch (_a) {
|
|
219
|
+
// localStorage might not be available
|
|
220
|
+
}
|
|
221
|
+
setDropdownOpened(false);
|
|
222
|
+
if (newType === 'server-render') {
|
|
223
|
+
openServerRenderModal();
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
openClientRenderModal();
|
|
227
|
+
}
|
|
228
|
+
}, [openServerRenderModal, openClientRenderModal]);
|
|
229
|
+
const dropdownValues = (0, react_1.useMemo)(() => {
|
|
230
|
+
return [
|
|
231
|
+
{
|
|
232
|
+
type: 'item',
|
|
233
|
+
id: 'server-render',
|
|
234
|
+
label: 'Server-side render',
|
|
235
|
+
value: 'server-render',
|
|
236
|
+
onClick: () => handleRenderTypeChange('server-render'),
|
|
237
|
+
keyHint: null,
|
|
238
|
+
leftItem: null,
|
|
239
|
+
subMenu: null,
|
|
240
|
+
quickSwitcherLabel: null,
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
type: 'item',
|
|
244
|
+
id: 'client-render',
|
|
245
|
+
label: 'Client-side render',
|
|
246
|
+
value: 'client-render',
|
|
247
|
+
onClick: () => handleRenderTypeChange('client-render'),
|
|
248
|
+
keyHint: null,
|
|
249
|
+
leftItem: null,
|
|
250
|
+
subMenu: null,
|
|
251
|
+
quickSwitcherLabel: null,
|
|
252
|
+
},
|
|
253
|
+
];
|
|
254
|
+
}, [handleRenderTypeChange]);
|
|
255
|
+
(0, react_1.useEffect)(() => {
|
|
256
|
+
const { current } = dropdownRef;
|
|
257
|
+
if (!current) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const onPointerDown = () => {
|
|
261
|
+
return setDropdownOpened((o) => {
|
|
262
|
+
if (!o) {
|
|
263
|
+
refresh === null || refresh === void 0 ? void 0 : refresh();
|
|
264
|
+
}
|
|
265
|
+
return !o;
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
const onClickDropdown = (e) => {
|
|
269
|
+
e.stopPropagation();
|
|
270
|
+
const isKeyboardInitiated = e.detail === 0;
|
|
271
|
+
if (!isKeyboardInitiated) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
return setDropdownOpened((o) => {
|
|
275
|
+
if (!o) {
|
|
276
|
+
refresh === null || refresh === void 0 ? void 0 : refresh();
|
|
277
|
+
window.addEventListener('pointerup', (evt) => {
|
|
278
|
+
if (!(0, is_menu_item_1.isMenuItem)(evt.target)) {
|
|
279
|
+
setDropdownOpened(false);
|
|
280
|
+
}
|
|
281
|
+
}, {
|
|
282
|
+
once: true,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
return !o;
|
|
286
|
+
});
|
|
287
|
+
};
|
|
288
|
+
current.addEventListener('pointerdown', onPointerDown);
|
|
289
|
+
current.addEventListener('click', onClickDropdown);
|
|
290
|
+
return () => {
|
|
291
|
+
current.removeEventListener('pointerdown', onPointerDown);
|
|
292
|
+
current.removeEventListener('click', onClickDropdown);
|
|
293
|
+
};
|
|
294
|
+
}, [refresh]);
|
|
295
|
+
const spaceToBottom = (0, react_1.useMemo)(() => {
|
|
296
|
+
const margin = 10;
|
|
297
|
+
if (size && dropdownOpened) {
|
|
298
|
+
return size.windowSize.height - (size.top + size.height) - margin;
|
|
299
|
+
}
|
|
300
|
+
return 0;
|
|
301
|
+
}, [dropdownOpened, size]);
|
|
302
|
+
const spaceToTop = (0, react_1.useMemo)(() => {
|
|
303
|
+
const margin = 10;
|
|
304
|
+
if (size && dropdownOpened) {
|
|
305
|
+
return size.top - margin;
|
|
306
|
+
}
|
|
307
|
+
return 0;
|
|
308
|
+
}, [dropdownOpened, size]);
|
|
309
|
+
const derivedMaxHeight = (0, react_1.useMemo)(() => {
|
|
310
|
+
return spaceToTop > spaceToBottom ? spaceToTop : spaceToBottom;
|
|
311
|
+
}, [spaceToBottom, spaceToTop]);
|
|
312
|
+
const portalStyle = (0, react_1.useMemo)(() => {
|
|
313
|
+
if (!dropdownOpened || !size) {
|
|
314
|
+
return null;
|
|
315
|
+
}
|
|
316
|
+
const verticalLayout = spaceToTop > spaceToBottom ? 'bottom' : 'top';
|
|
317
|
+
return {
|
|
318
|
+
...(verticalLayout === 'top'
|
|
319
|
+
? {
|
|
320
|
+
...styles_1.menuContainerTowardsBottom,
|
|
321
|
+
top: size.top + size.height,
|
|
322
|
+
}
|
|
323
|
+
: {
|
|
324
|
+
...styles_1.menuContainerTowardsTop,
|
|
325
|
+
bottom: size.windowSize.height - size.top,
|
|
326
|
+
}),
|
|
327
|
+
right: size.windowSize.width - size.left - size.width,
|
|
328
|
+
};
|
|
329
|
+
}, [dropdownOpened, size, spaceToBottom, spaceToTop]);
|
|
330
|
+
const containerStyle = (0, react_1.useMemo)(() => {
|
|
331
|
+
return {
|
|
332
|
+
...splitButtonContainer,
|
|
333
|
+
borderColor: colors_1.INPUT_BORDER_COLOR_UNHOVERED,
|
|
334
|
+
opacity: connectionStatus !== 'connected' ? 0.7 : 1,
|
|
335
|
+
cursor: connectionStatus !== 'connected' ? 'inherit' : 'pointer',
|
|
336
|
+
};
|
|
337
|
+
}, [connectionStatus]);
|
|
338
|
+
const renderLabel = renderType === 'server-render' ? 'Render' : 'Render on web';
|
|
339
|
+
const shouldShowDropdown = (0, react_1.useMemo)(() => {
|
|
340
|
+
// Server render is not available
|
|
341
|
+
if (readOnlyStudio) {
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
// client render is not available
|
|
345
|
+
if (!show_browser_rendering_1.SHOW_BROWSER_RENDERING) {
|
|
346
|
+
return false;
|
|
347
|
+
}
|
|
348
|
+
return true;
|
|
349
|
+
}, [readOnlyStudio]);
|
|
104
350
|
if (!video) {
|
|
105
351
|
return null;
|
|
106
352
|
}
|
|
107
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
353
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { style: { display: 'none' }, id: "render-modal-button-server", disabled: connectionStatus !== 'connected' && renderType === 'server-render', onClick: openServerRenderModal, type: "button" }), ' ', (0, jsx_runtime_1.jsx)("button", { style: { display: 'none' }, id: "render-modal-button-client", disabled: connectionStatus !== 'connected' && renderType === 'server-render', onClick: openClientRenderModal, type: "button" }), (0, jsx_runtime_1.jsxs)("div", { ref: containerRef, style: containerStyle, title: tooltip, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", style: mainButtonStyle, onClick: onClick, id: "render-modal-button", disabled: connectionStatus !== 'connected' && renderType === 'server-render', children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", style: mainButtonContent, children: [(0, jsx_runtime_1.jsx)(render_1.ThinRenderIcon, { fill: "currentcolor", svgProps: iconStyle }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("span", { style: label, children: renderLabel })] }) }), shouldShowDropdown ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: dividerStyle }), (0, jsx_runtime_1.jsx)("button", { ref: dropdownRef, type: "button", style: dropdownTriggerStyle, disabled: connectionStatus !== 'connected', className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, children: (0, jsx_runtime_1.jsx)(caret_1.CaretDown, {}) })] })) : null] }), portalStyle
|
|
354
|
+
? react_dom_1.default.createPortal((0, jsx_runtime_1.jsx)("div", { style: styles_1.fullScreenOverlay, children: (0, jsx_runtime_1.jsx)("div", { style: styles_1.outerPortal, className: "css-reset", children: (0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onOutsideClick: onHideDropdown, onEscape: onHideDropdown, children: (0, jsx_runtime_1.jsx)("div", { style: portalStyle, children: (0, jsx_runtime_1.jsx)(MenuContent_1.MenuContent, { onNextMenu: () => { }, onPreviousMenu: () => { }, values: dropdownValues, onHide: onHideDropdown, leaveLeftSpace: false, preselectIndex: dropdownValues.findIndex((v) => v.id === renderType), topItemCanBeUnselected: false, fixedHeight: derivedMaxHeight }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
355
|
+
: null] }));
|
|
108
356
|
};
|
|
109
357
|
exports.RenderButton = RenderButton;
|
|
@@ -6,9 +6,12 @@ const studio_shared_1 = require("@remotion/studio-shared");
|
|
|
6
6
|
const web_renderer_1 = require("@remotion/web-renderer");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const ShortcutHint_1 = require("../../error-overlay/remotion-overlay/ShortcutHint");
|
|
9
|
+
const audio_1 = require("../../icons/audio");
|
|
10
|
+
const certificate_1 = require("../../icons/certificate");
|
|
9
11
|
const data_1 = require("../../icons/data");
|
|
10
12
|
const file_1 = require("../../icons/file");
|
|
11
13
|
const frame_1 = require("../../icons/frame");
|
|
14
|
+
const gear_1 = require("../../icons/gear");
|
|
12
15
|
const Button_1 = require("../Button");
|
|
13
16
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
14
17
|
const ModalHeader_1 = require("../ModalHeader");
|
|
@@ -19,8 +22,11 @@ const DataEditor_1 = require("./DataEditor");
|
|
|
19
22
|
const get_string_before_suffix_1 = require("./get-string-before-suffix");
|
|
20
23
|
const render_modals_1 = require("./render-modals");
|
|
21
24
|
const ResolveCompositionBeforeModal_1 = require("./ResolveCompositionBeforeModal");
|
|
25
|
+
const WebRendererExperimentalBadge_1 = require("./WebRendererExperimentalBadge");
|
|
22
26
|
const WebRenderModalAdvanced_1 = require("./WebRenderModalAdvanced");
|
|
27
|
+
const WebRenderModalAudio_1 = require("./WebRenderModalAudio");
|
|
23
28
|
const WebRenderModalBasic_1 = require("./WebRenderModalBasic");
|
|
29
|
+
const WebRenderModalLicense_1 = require("./WebRenderModalLicense");
|
|
24
30
|
const WebRenderModalPicture_1 = require("./WebRenderModalPicture");
|
|
25
31
|
const invalidCharacters = ['?', '*', '+', ':', '%'];
|
|
26
32
|
const isValidStillExtension = (extension, stillImageFormat) => {
|
|
@@ -70,7 +76,7 @@ const validateOutnameForStill = ({ outName, stillImageFormat, }) => {
|
|
|
70
76
|
// TODO: Shortcut: Shift + R
|
|
71
77
|
// TODO: Apply defaultCodec
|
|
72
78
|
// TODO: Apply defaultOutName
|
|
73
|
-
const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark, initialLogLevel, }) => {
|
|
79
|
+
const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark, initialLogLevel, initialLicenseKey, }) => {
|
|
74
80
|
const context = (0, react_1.useContext)(ResolveCompositionBeforeModal_1.ResolvedCompositionContext);
|
|
75
81
|
if (!context) {
|
|
76
82
|
throw new Error('Should not be able to render without resolving comp first');
|
|
@@ -100,6 +106,8 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
100
106
|
const [endFrame, setEndFrame] = (0, react_1.useState)(() => outFrameMark !== null && outFrameMark !== void 0 ? outFrameMark : null);
|
|
101
107
|
const [renderProgress, setRenderProgress] = (0, react_1.useState)(null);
|
|
102
108
|
const [transparent, setTransparent] = (0, react_1.useState)(false);
|
|
109
|
+
const [muted, setMuted] = (0, react_1.useState)(false);
|
|
110
|
+
const [licenseKey, setLicenseKey] = (0, react_1.useState)(initialLicenseKey);
|
|
103
111
|
const finalEndFrame = (0, react_1.useMemo)(() => {
|
|
104
112
|
if (endFrame === null) {
|
|
105
113
|
return resolvedComposition.durationInFrames - 1;
|
|
@@ -261,6 +269,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
261
269
|
delayRenderTimeoutInMilliseconds: delayRenderTimeout,
|
|
262
270
|
mediaCacheSizeInBytes,
|
|
263
271
|
logLevel,
|
|
272
|
+
licenseKey: licenseKey !== null && licenseKey !== void 0 ? licenseKey : undefined,
|
|
264
273
|
});
|
|
265
274
|
const url = URL.createObjectURL(blob);
|
|
266
275
|
const a = document.createElement('a');
|
|
@@ -288,6 +297,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
288
297
|
resolvedComposition.defaultProps,
|
|
289
298
|
unresolvedComposition.calculateMetadata,
|
|
290
299
|
resolvedComposition.id,
|
|
300
|
+
licenseKey,
|
|
291
301
|
]);
|
|
292
302
|
const onRenderVideo = (0, react_1.useCallback)(async () => {
|
|
293
303
|
setRenderProgress({ renderedFrames: 0, encodedFrames: 0 });
|
|
@@ -306,7 +316,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
306
316
|
delayRenderTimeoutInMilliseconds: delayRenderTimeout,
|
|
307
317
|
mediaCacheSizeInBytes,
|
|
308
318
|
logLevel,
|
|
309
|
-
codec,
|
|
319
|
+
videoCodec: codec,
|
|
310
320
|
container,
|
|
311
321
|
videoBitrate,
|
|
312
322
|
hardwareAcceleration,
|
|
@@ -316,7 +326,9 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
316
326
|
setRenderProgress(progress);
|
|
317
327
|
},
|
|
318
328
|
transparent,
|
|
329
|
+
muted,
|
|
319
330
|
outputTarget: 'web-fs',
|
|
331
|
+
licenseKey: licenseKey !== null && licenseKey !== void 0 ? licenseKey : undefined,
|
|
320
332
|
});
|
|
321
333
|
setRenderProgress(null);
|
|
322
334
|
const blob = await getBlob();
|
|
@@ -348,9 +360,11 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
348
360
|
resolvedComposition.fps,
|
|
349
361
|
outName,
|
|
350
362
|
transparent,
|
|
363
|
+
muted,
|
|
351
364
|
resolvedComposition.defaultProps,
|
|
352
365
|
resolvedComposition.id,
|
|
353
366
|
unresolvedComposition.calculateMetadata,
|
|
367
|
+
licenseKey,
|
|
354
368
|
]);
|
|
355
369
|
const onRender = (0, react_1.useCallback)(async () => {
|
|
356
370
|
if (renderMode === 'still') {
|
|
@@ -362,7 +376,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
362
376
|
}, [renderMode, onRenderStill, onRenderVideo]);
|
|
363
377
|
return ((0, jsx_runtime_1.jsxs)("div", { style: render_modals_1.outerModalStyle, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.ModalHeader, { title: `Render ${resolvedComposition.id}` }), (0, jsx_runtime_1.jsxs)("div", { style: render_modals_1.container, children: [(0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: renderTabOptions, needsWrapping: false }), (0, jsx_runtime_1.jsx)("div", { style: render_modals_1.flexer }), (0, jsx_runtime_1.jsxs)(Button_1.Button, { autoFocus: true, onClick: onRender, style: render_modals_1.buttonStyle, disabled: !outnameValidation.valid, children: [renderProgress
|
|
364
378
|
? `Rendering... ${renderProgress.renderedFrames}/${finalEndFrame}`
|
|
365
|
-
: `Render ${renderMode}`, (0, jsx_runtime_1.jsx)(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: render_modals_1.horizontalLayout, children: [(0, jsx_runtime_1.jsxs)("div", { style: render_modals_1.leftSidebar, children: [(0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'general', onClick: () => setTab('general'), children: [(0, jsx_runtime_1.jsx)("div", { style: render_modals_1.iconContainer, children: (0, jsx_runtime_1.jsx)(file_1.FileIcon, { style: render_modals_1.icon }) }), "General"] }), (0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'data', onClick: () => setTab('data'), children: [(0, jsx_runtime_1.jsx)("div", { style: render_modals_1.iconContainer, children: (0, jsx_runtime_1.jsx)(data_1.DataIcon, { style: render_modals_1.icon }) }), "Input Props"] }), renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'picture', onClick: () => setTab('picture'), children: [(0, jsx_runtime_1.jsx)("div", { style: render_modals_1.iconContainer, children: (0, jsx_runtime_1.jsx)(frame_1.PicIcon, { style: render_modals_1.icon }) }), "Picture"] })) : null, (0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), children: [(0, jsx_runtime_1.jsx)("div", { style: render_modals_1.iconContainer, children: (0, jsx_runtime_1.jsx)(
|
|
379
|
+
: `Render ${renderMode}`, (0, jsx_runtime_1.jsx)(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })] })] }), (0, jsx_runtime_1.jsx)("div", { style: render_modals_1.container, children: (0, jsx_runtime_1.jsx)(WebRendererExperimentalBadge_1.WebRendererExperimentalBadge, {}) }), (0, jsx_runtime_1.jsxs)("div", { style: render_modals_1.horizontalLayout, children: [(0, jsx_runtime_1.jsxs)("div", { style: render_modals_1.leftSidebar, children: [(0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'general', onClick: () => setTab('general'), children: [(0, jsx_runtime_1.jsx)("div", { style: render_modals_1.iconContainer, children: (0, jsx_runtime_1.jsx)(file_1.FileIcon, { style: render_modals_1.icon }) }), "General"] }), (0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'data', onClick: () => setTab('data'), children: [(0, jsx_runtime_1.jsx)("div", { style: render_modals_1.iconContainer, children: (0, jsx_runtime_1.jsx)(data_1.DataIcon, { style: render_modals_1.icon }) }), "Input Props"] }), renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'picture', onClick: () => setTab('picture'), children: [(0, jsx_runtime_1.jsx)("div", { style: render_modals_1.iconContainer, children: (0, jsx_runtime_1.jsx)(frame_1.PicIcon, { style: render_modals_1.icon }) }), "Picture"] })) : null, renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'audio', onClick: () => setTab('audio'), children: [(0, jsx_runtime_1.jsx)("div", { style: render_modals_1.iconContainer, children: (0, jsx_runtime_1.jsx)(audio_1.AudioIcon, { style: render_modals_1.icon }) }), "Audio"] })) : null, (0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), children: [(0, jsx_runtime_1.jsx)("div", { style: render_modals_1.iconContainer, children: (0, jsx_runtime_1.jsx)(gear_1.GearIcon, { style: render_modals_1.icon }) }), "Other"] }), (0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'license', onClick: () => setTab('license'), children: [(0, jsx_runtime_1.jsx)("div", { style: render_modals_1.iconContainer, children: (0, jsx_runtime_1.jsx)(certificate_1.CertificateIcon, { style: render_modals_1.icon }) }), "License"] })] }), (0, jsx_runtime_1.jsx)("div", { style: render_modals_1.optionsPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? ((0, jsx_runtime_1.jsx)(WebRenderModalBasic_1.WebRenderModalBasic, { renderMode: renderMode, resolvedComposition: resolvedComposition, imageFormat: imageFormat, setStillFormat: setStillFormat, frame: frame, onFrameChanged: onFrameChanged, onFrameSetDirectly: onFrameSetDirectly, container: container, setContainerFormat: setContainerFormat, codec: codec, setCodec: setCodec, startFrame: finalStartFrame, setStartFrame: setStartFrame, endFrame: finalEndFrame, setEndFrame: setEndFrame, outName: outName, onOutNameChange: onOutNameChange, validationMessage: outnameValidation.valid ? null : outnameValidation.error.message, logLevel: logLevel, setLogLevel: setLogLevel })) : tab === 'data' ? ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { defaultProps: inputProps, setDefaultProps: setInputProps, unresolvedComposition: unresolvedComposition, mayShowSaveButton: false, propsEditType: "input-props", saving: saving, setSaving: setSaving, readOnlyStudio: false })) : tab === 'picture' ? ((0, jsx_runtime_1.jsx)(WebRenderModalPicture_1.WebRenderModalPicture, { renderMode: renderMode, videoBitrate: videoBitrate, setVideoBitrate: setVideoBitrate, keyframeIntervalInSeconds: keyframeIntervalInSeconds, setKeyframeIntervalInSeconds: setKeyframeIntervalInSeconds, transparent: transparent, setTransparent: setTransparent })) : tab === 'audio' ? ((0, jsx_runtime_1.jsx)(WebRenderModalAudio_1.WebRenderModalAudio, { muted: muted, setMuted: setMuted })) : tab === 'advanced' ? ((0, jsx_runtime_1.jsx)(WebRenderModalAdvanced_1.WebRenderModalAdvanced, { renderMode: renderMode, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, mediaCacheSizeInBytes: mediaCacheSizeInBytes, setMediaCacheSizeInBytes: setMediaCacheSizeInBytes, hardwareAcceleration: hardwareAcceleration, setHardwareAcceleration: setHardwareAcceleration })) : ((0, jsx_runtime_1.jsx)(WebRenderModalLicense_1.WebRenderModalLicense, { licenseKey: licenseKey, setLicenseKey: setLicenseKey, initialPublicLicenseKey: initialLicenseKey })) })] })] }));
|
|
366
380
|
};
|
|
367
381
|
const WebRenderModalWithLoader = (props) => {
|
|
368
382
|
return ((0, jsx_runtime_1.jsx)(DismissableModal_1.DismissableModal, { children: (0, jsx_runtime_1.jsx)(ResolveCompositionBeforeModal_1.ResolveCompositionBeforeModal, { compositionId: props.compositionId, children: (0, jsx_runtime_1.jsx)(WebRenderModal, { ...props }) }) }));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebRenderModalAudio = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
6
|
+
const MutedSetting_1 = require("./MutedSetting");
|
|
7
|
+
const container = {
|
|
8
|
+
flex: 1,
|
|
9
|
+
overflowY: 'auto',
|
|
10
|
+
};
|
|
11
|
+
const WebRenderModalAudio = ({ muted, setMuted }) => {
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: container, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: (0, jsx_runtime_1.jsx)(MutedSetting_1.MutedSetting, { enforceAudioTrack: false, muted: muted, setMuted: setMuted }) }));
|
|
13
|
+
};
|
|
14
|
+
exports.WebRenderModalAudio = WebRenderModalAudio;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RenderStillOnWebImageFormat, WebRendererContainer, WebRendererVideoCodec } from '@remotion/web-renderer';
|
|
3
3
|
import type React from 'react';
|
|
4
4
|
import type { VideoConfig } from 'remotion';
|
|
5
5
|
import type { RenderType } from './WebRenderModal';
|
|
6
6
|
type WebRenderModalBasicProps = {
|
|
7
7
|
readonly renderMode: RenderType;
|
|
8
8
|
readonly resolvedComposition: VideoConfig;
|
|
9
|
-
readonly imageFormat:
|
|
10
|
-
readonly setStillFormat: (format:
|
|
9
|
+
readonly imageFormat: RenderStillOnWebImageFormat;
|
|
10
|
+
readonly setStillFormat: (format: RenderStillOnWebImageFormat) => void;
|
|
11
11
|
readonly frame: number;
|
|
12
12
|
readonly onFrameChanged: (e: string) => void;
|
|
13
13
|
readonly onFrameSetDirectly: (newFrame: number) => void;
|
|
14
14
|
readonly container: WebRendererContainer;
|
|
15
15
|
readonly setContainerFormat: (container: WebRendererContainer) => void;
|
|
16
|
-
readonly codec:
|
|
17
|
-
readonly setCodec: (codec:
|
|
16
|
+
readonly codec: WebRendererVideoCodec;
|
|
17
|
+
readonly setCodec: (codec: WebRendererVideoCodec) => void;
|
|
18
18
|
readonly startFrame: number | null;
|
|
19
19
|
readonly setStartFrame: React.Dispatch<React.SetStateAction<number | null>>;
|
|
20
20
|
readonly endFrame: number | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type WebRenderModalLicenseProps = {
|
|
3
|
+
readonly licenseKey: string | null;
|
|
4
|
+
readonly setLicenseKey: React.Dispatch<React.SetStateAction<string | null>>;
|
|
5
|
+
readonly initialPublicLicenseKey: string | null;
|
|
6
|
+
};
|
|
7
|
+
export declare const row: React.CSSProperties;
|
|
8
|
+
export declare const WebRenderModalLicense: React.FC<WebRenderModalLicenseProps>;
|
|
9
|
+
export {};
|