This commit is contained in:
Siddharth
2026-03-17 20:25:34 -07:00
parent 7a6efc5df9
commit 69f1b4d20f
3 changed files with 69 additions and 13 deletions
+25 -3
View File
@@ -1040,7 +1040,7 @@ export default function VideoEditor() {
if (saveResult.canceled) {
toast.info("Export canceled");
} else if (saveResult.success) {
} else if (saveResult.success && saveResult.path) {
handleExportSaved("GIF", saveResult.path);
} else {
setExportError(saveResult.message || "Failed to save GIF");
@@ -1167,7 +1167,7 @@ export default function VideoEditor() {
if (saveResult.canceled) {
toast.info("Export canceled");
} else if (saveResult.success) {
} else if (saveResult.success && saveResult.path) {
handleExportSaved("Video", saveResult.path);
} else {
setExportError(saveResult.message || "Failed to save video");
@@ -1232,11 +1232,16 @@ export default function VideoEditor() {
// Build export settings from current state
const sourceWidth = video.videoWidth || 1920;
const sourceHeight = video.videoHeight || 1080;
const aspectRatioValue =
aspectRatio === "native"
? getNativeAspectRatioValue(sourceWidth, sourceHeight, cropRegion)
: getAspectRatioValue(aspectRatio);
const gifDimensions = calculateOutputDimensions(
sourceWidth,
sourceHeight,
gifSizePreset,
GIF_SIZE_PRESETS,
aspectRatioValue,
);
const settings: ExportSettings = {
@@ -1260,7 +1265,17 @@ export default function VideoEditor() {
// Start export immediately
handleExport(settings);
}, [videoPath, exportFormat, exportQuality, gifFrameRate, gifLoop, gifSizePreset, handleExport]);
}, [
videoPath,
exportFormat,
exportQuality,
gifFrameRate,
gifLoop,
gifSizePreset,
aspectRatio,
cropRegion,
handleExport,
]);
const handleCancelExport = useCallback(() => {
if (exporterRef.current) {
@@ -1475,6 +1490,13 @@ export default function VideoEditor() {
videoPlaybackRef.current?.video?.videoHeight || 1080,
gifSizePreset,
GIF_SIZE_PRESETS,
aspectRatio === "native"
? getNativeAspectRatioValue(
videoPlaybackRef.current?.video?.videoWidth || 1920,
videoPlaybackRef.current?.video?.videoHeight || 1080,
cropRegion,
)
: getAspectRatioValue(aspectRatio),
)}
onExport={handleOpenExportDialog}
selectedAnnotationId={selectedAnnotationId}