@remotion/cli 4.0.44 → 4.0.46
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/config/index.d.ts +1 -1
- package/dist/config/log.d.ts +1 -1
- package/dist/editor/components/Canvas.js +10 -28
- package/dist/editor/components/CanvasOrLoading.js +1 -1
- package/dist/editor/components/CheckboardToggle.js +0 -5
- package/dist/editor/components/CompositionSelectorItem.js +1 -7
- package/dist/editor/components/CurrentComposition.d.ts +0 -1
- package/dist/editor/components/CurrentCompositionSideEffects.js +4 -0
- package/dist/editor/components/EditorContent.js +3 -1
- package/dist/editor/components/FilePreview.d.ts +2 -1
- package/dist/editor/components/FilePreview.js +10 -3
- package/dist/editor/components/InitialCompositionLoader.js +9 -2
- package/dist/editor/components/LoopToggle.js +0 -7
- package/dist/editor/components/MuteToggle.js +0 -7
- package/dist/editor/components/NewComposition/RemInput.d.ts +2 -2
- package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
- package/dist/editor/components/PlayPause.js +0 -4
- package/dist/editor/components/Preview.d.ts +3 -2
- package/dist/editor/components/Preview.js +13 -72
- package/dist/editor/components/PreviewToolbar.js +4 -1
- package/dist/editor/components/RenderPreview.d.ts +2 -0
- package/dist/editor/components/RenderPreview.js +4 -3
- package/dist/editor/components/RenderQueue/RenderQueueCopyToClipboard.js +3 -2
- package/dist/editor/components/RenderQueue/RenderQueueItem.d.ts +1 -0
- package/dist/editor/components/RenderQueue/RenderQueueItem.js +55 -2
- package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.js +2 -1
- package/dist/editor/components/RenderQueue/RenderQueueItemStatus.js +35 -4
- package/dist/editor/components/RenderQueue/RenderQueueOpenInFolder.js +3 -2
- package/dist/editor/components/RenderQueue/RenderQueueOutputName.js +3 -11
- package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.js +2 -1
- package/dist/editor/components/RenderQueue/RenderQueueRepeat.js +2 -1
- package/dist/editor/components/RenderQueue/index.js +16 -1
- package/dist/editor/components/SizeSelector.js +15 -6
- package/dist/editor/components/StaticFilePreview.d.ts +2 -0
- package/dist/editor/components/StaticFilePreview.js +2 -10
- package/dist/editor/components/TimelineInOutToggle.js +0 -6
- package/dist/editor/components/UpdateCheck.d.ts +0 -1
- package/dist/editor/components/ZoomPersistor.js +9 -3
- package/dist/editor/components/layout.d.ts +2 -1
- package/dist/editor/components/layout.js +2 -2
- package/dist/editor/helpers/colors.d.ts +1 -1
- package/dist/editor/helpers/get-asset-metadata.d.ts +11 -0
- package/dist/editor/helpers/get-asset-metadata.js +64 -0
- package/dist/editor/helpers/is-current-selected-still.d.ts +1 -0
- package/dist/editor/helpers/is-current-selected-still.js +14 -1
- package/dist/editor/helpers/render-modal-sections.d.ts +0 -1
- package/dist/get-cli-options.d.ts +2 -2
- package/dist/index.d.ts +10 -10
- package/dist/log.d.ts +4 -4
- package/dist/preview-server/routes.d.ts +5 -4
- package/dist/preview-server/routes.js +52 -8
- package/dist/preview-server/serve-static.d.ts +6 -1
- package/dist/preview-server/serve-static.js +1 -4
- package/dist/preview-server/start-server.d.ts +4 -2
- package/dist/preview-server/start-server.js +4 -2
- package/dist/studio.js +9 -4
- package/package.json +9 -9
package/dist/config/index.d.ts
CHANGED
|
@@ -295,7 +295,7 @@ export declare const ConfigInternals: {
|
|
|
295
295
|
getOutputCodecOrUndefined: () => CodecOrUndefined;
|
|
296
296
|
getBrowser: () => null;
|
|
297
297
|
getPixelFormat: () => "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
298
|
-
getProResProfile: () => "4444-xq" | "4444" | "hq" | "standard" | "
|
|
298
|
+
getProResProfile: () => "light" | "4444-xq" | "4444" | "hq" | "standard" | "proxy" | undefined;
|
|
299
299
|
getPresetProfile: () => "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | undefined;
|
|
300
300
|
getShouldOverwrite: ({ defaultValue, }: {
|
|
301
301
|
defaultValue: boolean;
|
package/dist/config/log.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getLogLevel: () => "
|
|
1
|
+
export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn", setLogLevel: (newLogLevel: "error" | "verbose" | "info" | "warn") => void;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Canvas = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const media_utils_1 = require("@remotion/media-utils");
|
|
6
5
|
const player_1 = require("@remotion/player");
|
|
7
6
|
const react_1 = require("react");
|
|
8
7
|
const remotion_1 = require("remotion");
|
|
9
8
|
const smooth_zoom_1 = require("../../smooth-zoom");
|
|
10
9
|
const colors_1 = require("../helpers/colors");
|
|
10
|
+
const get_asset_metadata_1 = require("../helpers/get-asset-metadata");
|
|
11
11
|
const get_effective_translation_1 = require("../helpers/get-effective-translation");
|
|
12
12
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
13
13
|
const canvas_ref_1 = require("../state/canvas-ref");
|
|
@@ -36,8 +36,10 @@ const Canvas = ({ canvasContent }) => {
|
|
|
36
36
|
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
37
37
|
const [assetResolution, setAssetResolution] = (0, react_1.useState)(null);
|
|
38
38
|
const contentDimensions = (0, react_1.useMemo)(() => {
|
|
39
|
-
if (canvasContent.type === 'asset')
|
|
40
|
-
|
|
39
|
+
if ((canvasContent.type === 'asset' || canvasContent.type === 'output') &&
|
|
40
|
+
assetResolution &&
|
|
41
|
+
assetResolution.type === 'found') {
|
|
42
|
+
return assetResolution.dimensions;
|
|
41
43
|
}
|
|
42
44
|
if (config) {
|
|
43
45
|
return { width: config.width, height: config.height };
|
|
@@ -231,36 +233,16 @@ const Canvas = ({ canvasContent }) => {
|
|
|
231
233
|
};
|
|
232
234
|
}, [keybindings, onReset, onZoomIn, onZoomOut]);
|
|
233
235
|
const fetchMetadata = (0, react_1.useCallback)(async () => {
|
|
234
|
-
if (canvasContent.type !== 'asset') {
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
236
|
setAssetResolution(null);
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
if (fileType === 'video') {
|
|
241
|
-
try {
|
|
242
|
-
await (0, media_utils_1.getVideoMetadata)(assetSrc).then((data) => {
|
|
243
|
-
setAssetResolution({ width: data.width, height: data.height });
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
catch (_a) {
|
|
247
|
-
setAssetResolution('none');
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
else if (fileType === 'image') {
|
|
251
|
-
const img = new Image();
|
|
252
|
-
img.onload = () => {
|
|
253
|
-
setAssetResolution({ width: img.width, height: img.height });
|
|
254
|
-
};
|
|
255
|
-
img.src = assetSrc;
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
258
|
-
setAssetResolution('none');
|
|
237
|
+
if (canvasContent.type === 'composition') {
|
|
238
|
+
return;
|
|
259
239
|
}
|
|
240
|
+
const metadata = await (0, get_asset_metadata_1.getAssetMetadata)(canvasContent);
|
|
241
|
+
setAssetResolution(metadata);
|
|
260
242
|
}, [canvasContent]);
|
|
261
243
|
(0, react_1.useEffect)(() => {
|
|
262
244
|
fetchMetadata();
|
|
263
245
|
}, [fetchMetadata]);
|
|
264
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ref: canvas_ref_1.canvasRef, style: container, children: [size ? ((0, jsx_runtime_1.jsx)(Preview_1.VideoPreview, { canvasContent: canvasContent, contentDimensions: contentDimensions, canvasSize: size })) : null, isFit ? null : ((0, jsx_runtime_1.jsx)("div", { style: resetZoom, className: "css-reset", children: (0, jsx_runtime_1.jsx)(ResetZoomButton_1.ResetZoomButton, { onClick: onReset }) }))] }));
|
|
246
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: canvas_ref_1.canvasRef, style: container, children: [size ? ((0, jsx_runtime_1.jsx)(Preview_1.VideoPreview, { canvasContent: canvasContent, contentDimensions: contentDimensions, canvasSize: size, assetMetadata: assetResolution })) : null, isFit ? null : ((0, jsx_runtime_1.jsx)("div", { style: resetZoom, className: "css-reset", children: (0, jsx_runtime_1.jsx)(ResetZoomButton_1.ResetZoomButton, { onClick: onReset }) }))] }));
|
|
265
247
|
};
|
|
266
248
|
exports.Canvas = Canvas;
|
|
@@ -61,7 +61,7 @@ const CanvasOrLoading = () => {
|
|
|
61
61
|
return null;
|
|
62
62
|
}
|
|
63
63
|
const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ZoomPersistor_1.ZoomPersistor, {}), (0, jsx_runtime_1.jsx)(Canvas_1.Canvas, { canvasContent: canvasContent })] }));
|
|
64
|
-
if (canvasContent.type === 'asset') {
|
|
64
|
+
if (canvasContent.type === 'asset' || canvasContent.type === 'output') {
|
|
65
65
|
return content;
|
|
66
66
|
}
|
|
67
67
|
if (!resolved) {
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CheckboardToggle = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const remotion_1 = require("remotion");
|
|
7
6
|
const truthy_1 = require("../../truthy");
|
|
8
7
|
const colors_1 = require("../helpers/colors");
|
|
9
8
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
@@ -17,15 +16,11 @@ const accessibilityLabel = [
|
|
|
17
16
|
.join(' ');
|
|
18
17
|
const CheckboardToggle = () => {
|
|
19
18
|
const { checkerboard, setCheckerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
|
|
20
|
-
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
21
19
|
const onClick = (0, react_1.useCallback)(() => {
|
|
22
20
|
setCheckerboard((c) => {
|
|
23
21
|
return !c;
|
|
24
22
|
});
|
|
25
23
|
}, [setCheckerboard]);
|
|
26
|
-
if ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset') {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
24
|
return ((0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: (0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "fas", "data-icon": "game-board-alt", className: "svg-inline--fa fa-game-board-alt fa-w-16", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", style: { width: 16, height: 16 }, children: (0, jsx_runtime_1.jsx)("path", { fill: checkerboard ? colors_1.BLUE : 'white', d: "M480 0H32A32 32 0 0 0 0 32v448a32 32 0 0 0 32 32h448a32 32 0 0 0 32-32V32a32 32 0 0 0-32-32zm-32 256H256v192H64V256h192V64h192z" }) }) }));
|
|
30
25
|
};
|
|
31
26
|
exports.CheckboardToggle = CheckboardToggle;
|
|
@@ -59,13 +59,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
59
59
|
const style = (0, react_1.useMemo)(() => {
|
|
60
60
|
return {
|
|
61
61
|
...itemStyle,
|
|
62
|
-
backgroundColor: hovered
|
|
63
|
-
? selected
|
|
64
|
-
? colors_1.SELECTED_BACKGROUND
|
|
65
|
-
: colors_1.CLEAR_HOVER
|
|
66
|
-
: selected
|
|
67
|
-
? colors_1.SELECTED_BACKGROUND
|
|
68
|
-
: 'transparent',
|
|
62
|
+
backgroundColor: (0, colors_1.getBackgroundFromHoverState)({ hovered, selected }),
|
|
69
63
|
paddingLeft: 12 + level * 8,
|
|
70
64
|
};
|
|
71
65
|
}, [hovered, level, selected]);
|
|
@@ -21,6 +21,10 @@ const TitleUpdater = () => {
|
|
|
21
21
|
(0, document_title_1.setCurrentCanvasContentId)(canvasContent.compositionId);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
+
if (canvasContent.type === 'output') {
|
|
25
|
+
(0, document_title_1.setCurrentCanvasContentId)(canvasContent.path);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
24
28
|
(0, document_title_1.setCurrentCanvasContentId)(canvasContent.asset);
|
|
25
29
|
}, [canvasContent]);
|
|
26
30
|
(0, react_1.useEffect)(() => {
|
|
@@ -14,7 +14,9 @@ const noop = () => undefined;
|
|
|
14
14
|
const EditorContent = () => {
|
|
15
15
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
16
16
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
17
|
-
if (canvasContent === null ||
|
|
17
|
+
if (canvasContent === null ||
|
|
18
|
+
isStill ||
|
|
19
|
+
canvasContent.type !== 'composition') {
|
|
18
20
|
return (0, jsx_runtime_1.jsx)(TopPanel_1.TopPanel, {});
|
|
19
21
|
}
|
|
20
22
|
return ((0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { orientation: "horizontal", id: "top-to-bottom", maxFlex: 0.9, minFlex: 0.2, defaultFlex: 0.75, children: [(0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { type: "flexer", children: (0, jsx_runtime_1.jsx)(TopPanel_1.TopPanel, {}) }), (0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "none", onCollapse: noop }), (0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { type: "anti-flexer", children: (0, jsx_runtime_1.jsx)(Timeline_1.Timeline, {}) })] }));
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { AssetMetadata } from '../helpers/get-asset-metadata';
|
|
2
3
|
import type { AssetFileType } from './Preview';
|
|
3
4
|
export declare const FilePreview: React.FC<{
|
|
4
5
|
src: string;
|
|
5
6
|
fileType: AssetFileType;
|
|
6
7
|
currentAsset: string;
|
|
7
|
-
|
|
8
|
+
assetMetadata: AssetMetadata | null;
|
|
8
9
|
}>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FilePreview = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const format_bytes_1 = require("../../format-bytes");
|
|
5
6
|
const JSONViewer_1 = require("./JSONViewer");
|
|
6
7
|
const layout_1 = require("./layout");
|
|
7
8
|
const TextViewer_1 = require("./TextViewer");
|
|
@@ -12,9 +13,15 @@ const msgStyle = {
|
|
|
12
13
|
display: 'flex',
|
|
13
14
|
justifyContent: 'center',
|
|
14
15
|
};
|
|
15
|
-
const FilePreview = ({ fileType, src, currentAsset,
|
|
16
|
+
const FilePreview = ({ fileType, src, currentAsset, assetMetadata }) => {
|
|
17
|
+
if (!assetMetadata) {
|
|
18
|
+
throw new Error('expected to have assetMetadata');
|
|
19
|
+
}
|
|
20
|
+
if (assetMetadata.type === 'not-found') {
|
|
21
|
+
throw new Error('expected to have assetMetadata, got "not-found"');
|
|
22
|
+
}
|
|
16
23
|
if (fileType === 'audio') {
|
|
17
|
-
return (
|
|
24
|
+
return (0, jsx_runtime_1.jsx)("audio", { src: src, controls: true });
|
|
18
25
|
}
|
|
19
26
|
if (fileType === 'video') {
|
|
20
27
|
return (0, jsx_runtime_1.jsx)("video", { src: src, controls: true });
|
|
@@ -28,6 +35,6 @@ const FilePreview = ({ fileType, src, currentAsset, fileSize }) => {
|
|
|
28
35
|
if (fileType === 'txt') {
|
|
29
36
|
return (0, jsx_runtime_1.jsx)(TextViewer_1.TextViewer, { src: src });
|
|
30
37
|
}
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: msgStyle, children: currentAsset }),
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: msgStyle, children: currentAsset }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 0.5 }), (0, jsx_runtime_1.jsxs)("div", { style: msgStyle, children: ["Size: ", (0, format_bytes_1.formatBytes)(assetMetadata.size), " "] })] }));
|
|
32
39
|
};
|
|
33
40
|
exports.FilePreview = FilePreview;
|
|
@@ -70,6 +70,10 @@ const InitialCompositionLoader = () => {
|
|
|
70
70
|
selectAsset(canvasContentFromUrl.asset);
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
+
if (canvasContentFromUrl && canvasContentFromUrl.type === 'output') {
|
|
74
|
+
setCanvasContent(canvasContentFromUrl);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
73
77
|
if (compositions.length > 0) {
|
|
74
78
|
selectComposition(compositions[0], true);
|
|
75
79
|
}
|
|
@@ -83,14 +87,15 @@ const InitialCompositionLoader = () => {
|
|
|
83
87
|
(0, react_1.useEffect)(() => {
|
|
84
88
|
const onchange = () => {
|
|
85
89
|
const newCanvas = (0, ZoomPersistor_1.deriveCanvasContentFromUrl)();
|
|
86
|
-
if (newCanvas &&
|
|
90
|
+
if (newCanvas && newCanvas.type === 'composition') {
|
|
87
91
|
const newComp = window.location.pathname.substring(1);
|
|
88
92
|
const exists = compositions.find((c) => c.id === newComp);
|
|
89
93
|
if (exists) {
|
|
90
94
|
selectComposition(exists, false);
|
|
91
95
|
}
|
|
96
|
+
return;
|
|
92
97
|
}
|
|
93
|
-
|
|
98
|
+
if (newCanvas && newCanvas.type === 'asset') {
|
|
94
99
|
const staticFiles = (0, remotion_1.getStaticFiles)();
|
|
95
100
|
const exists = staticFiles.find((file) => {
|
|
96
101
|
return file.name === newCanvas.asset;
|
|
@@ -98,7 +103,9 @@ const InitialCompositionLoader = () => {
|
|
|
98
103
|
if (exists) {
|
|
99
104
|
setCanvasContent(newCanvas);
|
|
100
105
|
}
|
|
106
|
+
return;
|
|
101
107
|
}
|
|
108
|
+
setCanvasContent(newCanvas);
|
|
102
109
|
};
|
|
103
110
|
window.addEventListener('popstate', onchange);
|
|
104
111
|
return () => window.removeEventListener('popstate', onchange);
|
|
@@ -3,24 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LoopToggle = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const remotion_1 = require("remotion");
|
|
7
6
|
const colors_1 = require("../helpers/colors");
|
|
8
|
-
const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
|
|
9
7
|
const loop_1 = require("../state/loop");
|
|
10
8
|
const ControlButton_1 = require("./ControlButton");
|
|
11
9
|
const accessibilityLabel = 'Loop video';
|
|
12
10
|
const LoopToggle = ({ loop, setLoop }) => {
|
|
13
|
-
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
14
11
|
const onClick = (0, react_1.useCallback)(() => {
|
|
15
12
|
setLoop((c) => {
|
|
16
13
|
(0, loop_1.persistLoopOption)(!c);
|
|
17
14
|
return !c;
|
|
18
15
|
});
|
|
19
16
|
}, [setLoop]);
|
|
20
|
-
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
21
|
-
if (isStill || canvasContent === null || canvasContent.type === 'asset') {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
17
|
return ((0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: (0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 512 512", style: { width: 18, height: 18 }, children: (0, jsx_runtime_1.jsx)("path", { fill: loop ? colors_1.BLUE : 'white', d: "M493.544 181.463c11.956 22.605 18.655 48.4 18.452 75.75C511.339 345.365 438.56 416 350.404 416H192v47.495c0 22.475-26.177 32.268-40.971 17.475l-80-80c-9.372-9.373-9.372-24.569 0-33.941l80-80C166.138 271.92 192 282.686 192 304v48h158.875c52.812 0 96.575-42.182 97.12-94.992.155-15.045-3.17-29.312-9.218-42.046-4.362-9.185-2.421-20.124 4.8-27.284 4.745-4.706 8.641-8.555 11.876-11.786 11.368-11.352 30.579-8.631 38.091 5.571zM64.005 254.992c.545-52.81 44.308-94.992 97.12-94.992H320v47.505c0 22.374 26.121 32.312 40.971 17.465l80-80c9.372-9.373 9.372-24.569 0-33.941l-80-80C346.014 16.077 320 26.256 320 48.545V96H161.596C73.44 96 .661 166.635.005 254.788c-.204 27.35 6.495 53.145 18.452 75.75 7.512 14.202 26.723 16.923 38.091 5.57 3.235-3.231 7.13-7.08 11.876-11.786 7.22-7.16 9.162-18.098 4.8-27.284-6.049-12.735-9.374-27.001-9.219-42.046z" }) }) }));
|
|
25
18
|
};
|
|
26
19
|
exports.LoopToggle = LoopToggle;
|
|
@@ -3,13 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MuteToggle = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const remotion_1 = require("remotion");
|
|
7
|
-
const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
|
|
8
6
|
const media_volume_1 = require("../icons/media-volume");
|
|
9
7
|
const mute_1 = require("../state/mute");
|
|
10
8
|
const ControlButton_1 = require("./ControlButton");
|
|
11
9
|
const MuteToggle = ({ muted, setMuted }) => {
|
|
12
|
-
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
13
10
|
const onClick = (0, react_1.useCallback)(() => {
|
|
14
11
|
setMuted((m) => {
|
|
15
12
|
(0, mute_1.persistMuteOption)(!m);
|
|
@@ -17,10 +14,6 @@ const MuteToggle = ({ muted, setMuted }) => {
|
|
|
17
14
|
});
|
|
18
15
|
}, [setMuted]);
|
|
19
16
|
const accessibilityLabel = muted ? 'Unmute video' : 'Mute video';
|
|
20
|
-
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
21
|
-
if (isStill || canvasContent === null || canvasContent.type === 'asset') {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
17
|
return ((0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: muted ? (0, jsx_runtime_1.jsx)(media_volume_1.VolumeOffIcon, {}) : (0, jsx_runtime_1.jsx)(media_volume_1.VolumeOnIcon, {}) }));
|
|
25
18
|
};
|
|
26
19
|
exports.MuteToggle = MuteToggle;
|
|
@@ -12,6 +12,6 @@ export declare const getInputBorderColor: ({ status, isFocused, isHovered, }: {
|
|
|
12
12
|
status: 'error' | 'warning' | 'ok';
|
|
13
13
|
isFocused: boolean;
|
|
14
14
|
isHovered: boolean;
|
|
15
|
-
}) => "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)"
|
|
16
|
-
export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "key" | keyof React.InputHTMLAttributes<HTMLInputElement> | "
|
|
15
|
+
}) => "#ff3232" | "hsla(0, 0%, 100%, 0.15)" | "#f1c40f" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)";
|
|
16
|
+
export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | keyof React.InputHTMLAttributes<HTMLInputElement> | "rightAlign"> & React.RefAttributes<HTMLInputElement>>;
|
|
17
17
|
export {};
|
|
@@ -4,5 +4,5 @@ type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>
|
|
|
4
4
|
status: RemInputStatus;
|
|
5
5
|
name: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "key" | keyof React.InputHTMLAttributes<HTMLInputElement
|
|
7
|
+
export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
|
|
8
8
|
export {};
|
|
@@ -23,7 +23,6 @@ const forwardBackStyle = {
|
|
|
23
23
|
const PlayPause = ({ playbackRate, loop }) => {
|
|
24
24
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
25
25
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
26
|
-
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
27
26
|
player_1.PlayerInternals.usePlayback({
|
|
28
27
|
loop,
|
|
29
28
|
playbackRate,
|
|
@@ -187,9 +186,6 @@ const PlayPause = ({ playbackRate, loop }) => {
|
|
|
187
186
|
onEnter,
|
|
188
187
|
onSpace,
|
|
189
188
|
]);
|
|
190
|
-
if (isStill || canvasContent === null || canvasContent.type === 'asset') {
|
|
191
|
-
return null;
|
|
192
|
-
}
|
|
193
189
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": "Jump to beginning", title: "Jump to beginning", disabled: !videoConfig || isFirstFrame, onClick: jumpToStart, children: (0, jsx_runtime_1.jsx)(jump_to_start_1.JumpToStart, { style: forwardBackStyle }) }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": "Step back one frame", title: "Step back one frame", disabled: !videoConfig || isFirstFrame, onClick: oneFrameBack, children: (0, jsx_runtime_1.jsx)(step_back_1.StepBack, { style: forwardBackStyle }) }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": playing ? 'Pause' : 'Play', title: playing ? 'Pause' : 'Play', onClick: playing ? pause : play, disabled: !videoConfig, children: playing ? ((0, jsx_runtime_1.jsx)(pause_1.Pause, { style: {
|
|
194
190
|
height: 14,
|
|
195
191
|
width: 14,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { Size } from '@remotion/player';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { CanvasContent } from 'remotion';
|
|
4
|
+
import type { AssetMetadata } from '../helpers/get-asset-metadata';
|
|
4
5
|
import type { Dimensions } from '../helpers/is-current-selected-still';
|
|
5
|
-
type AssetFileType = 'audio' | 'video' | 'image' | 'json' | 'txt' | 'other';
|
|
6
|
+
export type AssetFileType = 'audio' | 'video' | 'image' | 'json' | 'txt' | 'other';
|
|
6
7
|
export declare const getPreviewFileType: (fileName: string | null) => AssetFileType;
|
|
7
8
|
export declare const VideoPreview: React.FC<{
|
|
8
9
|
canvasSize: Size;
|
|
9
10
|
contentDimensions: Dimensions | 'none' | null;
|
|
10
11
|
canvasContent: CanvasContent;
|
|
12
|
+
assetMetadata: AssetMetadata | null;
|
|
11
13
|
}>;
|
|
12
|
-
export {};
|
|
@@ -5,31 +5,22 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const player_1 = require("@remotion/player");
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
|
-
const format_bytes_1 = require("../../format-bytes");
|
|
9
8
|
const checkerboard_background_1 = require("../helpers/checkerboard-background");
|
|
10
|
-
const client_id_1 = require("../helpers/client-id");
|
|
11
9
|
const colors_1 = require("../helpers/colors");
|
|
12
10
|
const checkerboard_1 = require("../state/checkerboard");
|
|
13
11
|
const preview_size_1 = require("../state/preview-size");
|
|
14
|
-
const
|
|
15
|
-
const layout_1 = require("./layout");
|
|
12
|
+
const RenderPreview_1 = require("./RenderPreview");
|
|
16
13
|
const Spinner_1 = require("./Spinner");
|
|
17
|
-
const
|
|
18
|
-
const
|
|
14
|
+
const StaticFilePreview_1 = require("./StaticFilePreview");
|
|
15
|
+
const centeredContainer = {
|
|
19
16
|
display: 'flex',
|
|
20
17
|
flex: 1,
|
|
21
18
|
justifyContent: 'center',
|
|
22
19
|
alignItems: 'center',
|
|
23
20
|
};
|
|
24
|
-
const
|
|
25
|
-
fontSize: 13,
|
|
26
|
-
color: 'white',
|
|
21
|
+
const label = {
|
|
27
22
|
fontFamily: 'sans-serif',
|
|
28
|
-
|
|
29
|
-
justifyContent: 'center',
|
|
30
|
-
};
|
|
31
|
-
const errMsgStyle = {
|
|
32
|
-
...msgStyle,
|
|
23
|
+
fontSize: 14,
|
|
33
24
|
color: colors_1.LIGHT_TEXT,
|
|
34
25
|
};
|
|
35
26
|
const getPreviewFileType = (fileName) => {
|
|
@@ -78,67 +69,17 @@ const containerStyle = (options) => {
|
|
|
78
69
|
backgroundPosition: (0, checkerboard_background_1.getCheckerboardBackgroundPos)(checkerboardSize) /* Must be half of one side of the square */,
|
|
79
70
|
};
|
|
80
71
|
};
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const staticFiles = (0, remotion_1.getStaticFiles)();
|
|
85
|
-
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type;
|
|
86
|
-
const exists = staticFiles.find((file) => file.name === currentAsset);
|
|
87
|
-
if (connectionStatus === 'disconnected') {
|
|
88
|
-
return (0, jsx_runtime_1.jsx)("div", { style: errMsgStyle, children: "Studio server disconnected" });
|
|
89
|
-
}
|
|
90
|
-
if (!exists) {
|
|
91
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: errMsgStyle, children: [currentAsset, " does not exist in your public folder."] }));
|
|
92
|
-
}
|
|
93
|
-
const fileSize = () => {
|
|
94
|
-
const fileFromStaticFiles = staticFiles.find((file) => file.name === currentAsset);
|
|
95
|
-
if (fileFromStaticFiles) {
|
|
96
|
-
return (0, format_bytes_1.formatBytes)(fileFromStaticFiles === null || fileFromStaticFiles === void 0 ? void 0 : fileFromStaticFiles.sizeInBytes);
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
if (!currentAsset) {
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
if (fileType === 'audio') {
|
|
103
|
-
try {
|
|
104
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("audio", { src: staticFileSrc, controls: true }) }));
|
|
105
|
-
}
|
|
106
|
-
catch (err) {
|
|
107
|
-
return (0, jsx_runtime_1.jsx)("div", { style: errMsgStyle, children: "The audio could not be loaded" });
|
|
108
|
-
}
|
|
72
|
+
const VideoPreview = ({ canvasSize, contentDimensions, canvasContent, assetMetadata }) => {
|
|
73
|
+
if (assetMetadata && assetMetadata.type === 'not-found') {
|
|
74
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: centeredContainer, children: (0, jsx_runtime_1.jsx)("div", { style: label, children: "File does not exist" }) }));
|
|
109
75
|
}
|
|
110
|
-
if (
|
|
111
|
-
|
|
112
|
-
return (0, jsx_runtime_1.jsx)("video", { src: staticFileSrc, controls: true });
|
|
113
|
-
}
|
|
114
|
-
catch (err) {
|
|
115
|
-
return (0, jsx_runtime_1.jsx)("div", { style: errMsgStyle, children: "The video could not be loaded" });
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (fileType === 'image') {
|
|
119
|
-
try {
|
|
120
|
-
return (0, jsx_runtime_1.jsx)("img", { src: staticFileSrc });
|
|
121
|
-
}
|
|
122
|
-
catch (err) {
|
|
123
|
-
return (0, jsx_runtime_1.jsx)("div", { style: errMsgStyle, children: "The image could not be loaded" });
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
if (fileType === 'json') {
|
|
127
|
-
return (0, jsx_runtime_1.jsx)(JSONViewer_1.JSONViewer, { src: staticFileSrc });
|
|
128
|
-
}
|
|
129
|
-
if (fileType === 'txt') {
|
|
130
|
-
return (0, jsx_runtime_1.jsx)(TextViewer_1.TextViewer, { src: staticFileSrc });
|
|
131
|
-
}
|
|
132
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: msgStyle, children: currentAsset }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)("div", { style: msgStyle, children: ["Size: ", fileSize(), " "] })] }));
|
|
133
|
-
};
|
|
134
|
-
const VideoPreview = ({ canvasSize, contentDimensions, canvasContent }) => {
|
|
135
|
-
if (!contentDimensions) {
|
|
136
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: spinnerContainer, children: (0, jsx_runtime_1.jsx)(Spinner_1.Spinner, { duration: 0.5, size: 24 }) }));
|
|
76
|
+
if (contentDimensions === null) {
|
|
77
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: centeredContainer, children: (0, jsx_runtime_1.jsx)(Spinner_1.Spinner, { duration: 0.5, size: 24 }) }));
|
|
137
78
|
}
|
|
138
|
-
return ((0, jsx_runtime_1.jsx)(CompWhenItHasDimensions, { contentDimensions: contentDimensions, canvasSize: canvasSize, canvasContent: canvasContent }));
|
|
79
|
+
return ((0, jsx_runtime_1.jsx)(CompWhenItHasDimensions, { contentDimensions: contentDimensions, canvasSize: canvasSize, canvasContent: canvasContent, assetMetadata: assetMetadata }));
|
|
139
80
|
};
|
|
140
81
|
exports.VideoPreview = VideoPreview;
|
|
141
|
-
const CompWhenItHasDimensions = ({ contentDimensions, canvasSize, canvasContent }) => {
|
|
82
|
+
const CompWhenItHasDimensions = ({ contentDimensions, canvasSize, canvasContent, assetMetadata }) => {
|
|
142
83
|
const { size: previewSize } = (0, react_1.useContext)(preview_size_1.PreviewSizeContext);
|
|
143
84
|
const { centerX, centerY, yCorrection, xCorrection, scale } = (0, react_1.useMemo)(() => {
|
|
144
85
|
if (contentDimensions === 'none') {
|
|
@@ -184,7 +125,7 @@ const CompWhenItHasDimensions = ({ contentDimensions, canvasSize, canvasContent
|
|
|
184
125
|
centerY,
|
|
185
126
|
canvasContent,
|
|
186
127
|
]);
|
|
187
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: outer, children: canvasContent.type === 'asset' ? ((0, jsx_runtime_1.jsx)(
|
|
128
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: outer, children: canvasContent.type === 'asset' ? ((0, jsx_runtime_1.jsx)(StaticFilePreview_1.StaticFilePreview, { assetMetadata: assetMetadata, currentAsset: canvasContent.asset })) : canvasContent.type === 'output' ? ((0, jsx_runtime_1.jsx)(RenderPreview_1.RenderPreview, { path: canvasContent.path, assetMetadata: assetMetadata })) : ((0, jsx_runtime_1.jsx)(PortalContainer, { contentDimensions: contentDimensions, scale: scale, xCorrection: xCorrection, yCorrection: yCorrection })) }));
|
|
188
129
|
};
|
|
189
130
|
const PortalContainer = ({ scale, xCorrection, yCorrection, contentDimensions }) => {
|
|
190
131
|
const { checkerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const colors_1 = require("../helpers/colors");
|
|
8
|
+
const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
|
|
8
9
|
const timeline_layout_1 = require("../helpers/timeline-layout");
|
|
9
10
|
const loop_1 = require("../state/loop");
|
|
10
11
|
const CheckboardToggle_1 = require("./CheckboardToggle");
|
|
@@ -45,8 +46,10 @@ const PreviewToolbar = () => {
|
|
|
45
46
|
const { playbackRate, setPlaybackRate } = (0, react_1.useContext)(remotion_1.Internals.Timeline.TimelineContext);
|
|
46
47
|
const { mediaMuted } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
|
|
47
48
|
const { setMediaMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
|
|
49
|
+
const isVideoComposition = (0, is_current_selected_still_1.useIsVideoComposition)();
|
|
50
|
+
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
48
51
|
const [loop, setLoop] = (0, react_1.useState)((0, loop_1.loadLoopOption)());
|
|
49
52
|
const isFullscreenSupported = document.fullscreenEnabled || document.webkitFullscreenEnabled;
|
|
50
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", 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, {}), (0, jsx_runtime_1.jsx)(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(PlayPause_1.PlayPause, { 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)(CheckboardToggle_1.CheckboardToggle, {}), (0, jsx_runtime_1.jsx)(TimelineInOutToggle_1.TimelineInOutPointToggle, {}), (0, jsx_runtime_1.jsx)(MuteToggle_1.MuteToggle, { muted: mediaMuted, setMuted: setMediaMuted }), isFullscreenSupported && (0, jsx_runtime_1.jsx)(FullscreenToggle_1.FullScreenToggle, {}), (0, jsx_runtime_1.jsx)(layout_1.
|
|
53
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", 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, { 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)(CheckboardToggle_1.CheckboardToggle, {}), (0, jsx_runtime_1.jsx)(TimelineInOutToggle_1.TimelineInOutPointToggle, {}), (0, jsx_runtime_1.jsx)(MuteToggle_1.MuteToggle, { muted: mediaMuted, setMuted: setMediaMuted })] })) : null, isFullscreenSupported && (0, jsx_runtime_1.jsx)(FullscreenToggle_1.FullScreenToggle, {}), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(RenderButton_1.RenderButton, {}), (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, {})] }));
|
|
51
54
|
};
|
|
52
55
|
exports.PreviewToolbar = PreviewToolbar;
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const client_id_1 = require("../helpers/client-id");
|
|
7
7
|
const colors_1 = require("../helpers/colors");
|
|
8
|
+
const get_asset_metadata_1 = require("../helpers/get-asset-metadata");
|
|
8
9
|
const FilePreview_1 = require("./FilePreview");
|
|
9
10
|
const Preview_1 = require("./Preview");
|
|
10
11
|
const msgStyle = {
|
|
@@ -18,13 +19,13 @@ const errMsgStyle = {
|
|
|
18
19
|
...msgStyle,
|
|
19
20
|
color: colors_1.LIGHT_TEXT,
|
|
20
21
|
};
|
|
21
|
-
const RenderPreview = ({ path }) => {
|
|
22
|
+
const RenderPreview = ({ path, assetMetadata }) => {
|
|
22
23
|
const fileType = (0, Preview_1.getPreviewFileType)(path);
|
|
23
|
-
const src =
|
|
24
|
+
const src = get_asset_metadata_1.remotion_outputsBase + path;
|
|
24
25
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type;
|
|
25
26
|
if (connectionStatus === 'disconnected') {
|
|
26
27
|
return (0, jsx_runtime_1.jsx)("div", { style: errMsgStyle, children: "Studio server disconnected" });
|
|
27
28
|
}
|
|
28
|
-
return ((0, jsx_runtime_1.jsx)(FilePreview_1.FilePreview, {
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(FilePreview_1.FilePreview, { assetMetadata: assetMetadata, currentAsset: path, fileType: fileType, src: src }));
|
|
29
30
|
};
|
|
30
31
|
exports.RenderPreview = RenderPreview;
|
|
@@ -27,11 +27,12 @@ const supportsCopyingToClipboard = (job) => {
|
|
|
27
27
|
return false;
|
|
28
28
|
};
|
|
29
29
|
exports.supportsCopyingToClipboard = supportsCopyingToClipboard;
|
|
30
|
-
const RenderQueueCopyToClipboard = ({ job
|
|
30
|
+
const RenderQueueCopyToClipboard = ({ job }) => {
|
|
31
31
|
const renderCopyAction = (0, react_1.useCallback)((color) => {
|
|
32
32
|
return (0, jsx_runtime_1.jsx)(clipboard_1.ClipboardIcon, { style: revealIconStyle, color: color });
|
|
33
33
|
}, []);
|
|
34
|
-
const onClick = (0, react_1.useCallback)(() => {
|
|
34
|
+
const onClick = (0, react_1.useCallback)((e) => {
|
|
35
|
+
e.stopPropagation();
|
|
35
36
|
(0, actions_1.copyToClipboard)({ outName: job.outName })
|
|
36
37
|
.catch((err) => {
|
|
37
38
|
(0, NotificationCenter_1.sendErrorNotification)(`Could not copy to clipboard: ${err.message}`);
|