diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx index 769e88e..9666c33 100644 --- a/src/components/video-editor/VideoEditor.tsx +++ b/src/components/video-editor/VideoEditor.tsx @@ -42,7 +42,7 @@ import { type PlaybackSpeed, } from "./types"; import { VideoExporter, GifExporter, type ExportProgress, type ExportQuality, type ExportSettings, type ExportFormat, type GifFrameRate, type GifSizePreset, GIF_SIZE_PRESETS, calculateOutputDimensions } from "@/lib/exporter"; -import { type AspectRatio, getAspectRatioValue } from "@/utils/aspectRatioUtils"; +import { type AspectRatio, getAspectRatioValue, getNativeAspectRatioValue } from "@/utils/aspectRatioUtils"; import { getAssetPath } from "@/lib/assetPath"; import { useShortcuts } from "@/contexts/ShortcutsContext"; import { matchesShortcut } from "@/lib/shortcuts"; @@ -833,9 +833,11 @@ export default function VideoEditor() { videoPlaybackRef.current?.pause(); } - const aspectRatioValue = getAspectRatioValue(aspectRatio); const sourceWidth = video.videoWidth || 1920; const sourceHeight = video.videoHeight || 1080; + const aspectRatioValue = aspectRatio === 'native' + ? getNativeAspectRatioValue(sourceWidth, sourceHeight, cropRegion) + : getAspectRatioValue(aspectRatio); // Get preview CONTAINER dimensions for scaling const playbackRef = videoPlaybackRef.current; @@ -1130,7 +1132,7 @@ export default function VideoEditor() {
{/* Video preview */}
-
+
{ + setAspectRatio(ratio); + if (ratio === 'native') setPadding(0); + }} />
diff --git a/src/components/video-editor/VideoPlayback.tsx b/src/components/video-editor/VideoPlayback.tsx index 2801f1a..7ca784c 100644 --- a/src/components/video-editor/VideoPlayback.tsx +++ b/src/components/video-editor/VideoPlayback.tsx @@ -11,7 +11,7 @@ import { updateOverlayIndicator } from "./videoPlayback/overlayUtils"; import { layoutVideoContent as layoutVideoContentUtil } from "./videoPlayback/layoutUtils"; import { applyZoomTransform } from "./videoPlayback/zoomTransform"; import { createVideoEventHandlers } from "./videoPlayback/videoEventHandlers"; -import { type AspectRatio, formatAspectRatioForCSS } from "@/utils/aspectRatioUtils"; +import { type AspectRatio, formatAspectRatioForCSS, getNativeAspectRatioValue } from "@/utils/aspectRatioUtils"; import { AnnotationOverlay } from "./AnnotationOverlay"; interface VideoPlaybackProps { @@ -797,7 +797,7 @@ const VideoPlayback = forwardRef(({ : { background: resolvedWallpaper || '' }; return ( -
+
{/* Background layer - always render as DOM element with blur */}