Create polished demo videos without editing skills. Mac/Windows/Linux
fix(windows): enable auto zoom for narrow captures
webadderalld62808b17f81
diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsxindex 84c973b4..3cfd072e 100644--- a/src/components/video-editor/VideoEditor.tsx+++ b/src/components/video-editor/VideoEditor.tsx@@ -252,6 +252,7 @@ export default function VideoEditor() {t,shortcuts,isMac,+ appPlatform,timeline,appearance,videoPath,diff --git a/src/components/video-editor/hooks/useFreshRecordingAutoZoom.ts b/src/components/video-editor/hooks/useFreshRecordingAutoZoom.tsindex bdde5833..e774f5b7 100644--- a/src/components/video-editor/hooks/useFreshRecordingAutoZoom.ts+++ b/src/components/video-editor/hooks/useFreshRecordingAutoZoom.ts@@ -11,6 +11,7 @@ import type { CursorTelemetryPoint, ZoomRegion } from "../types";import type { VideoPlaybackRef } from "../VideoPlayback";interface UseFreshRecordingAutoZoomParams {+ appPlatform: string;videoPath: string | null;loading: boolean;isPreviewReady: boolean;@@ -28,6 +29,7 @@ interface UseFreshRecordingAutoZoomParams {}export function useFreshRecordingAutoZoom({+ appPlatform,videoPath,loading,isPreviewReady,@@ -48,6 +50,8 @@ export function useFreshRecordingAutoZoom({}, [setAutoSuggestZoomsTrigger]);useEffect(() => {+ if (!appPlatform) return;+if (videoPath &&pendingFreshRecordingAutoZoomPathRef.current === videoPath &&@@ -55,6 +59,7 @@ export function useFreshRecordingAutoZoom({!shouldAutoApplyFreshRecordingZoomsForSource(videoPlaybackRef.current?.video?.videoWidth,videoPlaybackRef.current?.video?.videoHeight,+ appPlatform,)) {pendingFreshRecordingAutoZoomPathRef.current = null;@@ -107,6 +112,7 @@ export function useFreshRecordingAutoZoom({}, 500);}, [videoPath,+ appPlatform,loading,isPreviewReady,duration,@@ -122,6 +128,8 @@ export function useFreshRecordingAutoZoom({]);useEffect(() => {+ if (!appPlatform) return;+if (!videoPath ||!isPreviewReady ||@@ -130,6 +138,7 @@ export function useFreshRecordingAutoZoom({shouldAutoApplyFreshRecordingZoomsForSource(videoPlaybackRef.current?.video?.videoWidth,videoPlaybackRef.current?.video?.videoHeight,+ appPlatform,)) {return;@@ -142,6 +151,7 @@ export function useFreshRecordingAutoZoom({});}, [autoSuggestedVideoPathRef,+ appPlatform,isPreviewReady,setZoomRegions,videoPath,diff --git a/src/components/video-editor/hooks/useTimelineEditingController.ts b/src/components/video-editor/hooks/useTimelineEditingController.tsindex a61a29e1..4ea31153 100644--- a/src/components/video-editor/hooks/useTimelineEditingController.ts+++ b/src/components/video-editor/hooks/useTimelineEditingController.ts@@ -25,6 +25,7 @@ type Input = {t: ReturnType<typeof useI18n>["t"];shortcuts: ReturnType<typeof useShortcuts>["shortcuts"];isMac: boolean;+ appPlatform: string;timeline: ReturnType<typeof useTimelineState>;appearance: ReturnType<typeof useAppearanceState>;videoPath: string | null;@@ -154,6 +155,7 @@ export function useTimelineEditingController(input: Input) {],);const freshZoom = useFreshRecordingAutoZoom({+ appPlatform: input.appPlatform,videoPath: input.videoPath,loading: input.loading,isPreviewReady: input.isPreviewReady,diff --git a/src/components/video-editor/timeline/zoomSuggestionUtils.test.ts b/src/components/video-editor/timeline/zoomSuggestionUtils.test.tsindex f1a6dd21..5f237d5e 100644--- a/src/components/video-editor/timeline/zoomSuggestionUtils.test.ts+++ b/src/components/video-editor/timeline/zoomSuggestionUtils.test.ts@@ -38,6 +38,10 @@ describe("shouldAutoApplyFreshRecordingZoomsForSource", () => {expect(shouldAutoApplyFreshRecordingZoomsForSource(1080, 1080)).toBe(false);});+ it("allows narrow Windows window captures when click telemetry is available", () => {+ expect(shouldAutoApplyFreshRecordingZoomsForSource(936, 1028, "win32")).toBe(true);+ });+it("does not block when source dimensions are not available yet", () => {expect(shouldAutoApplyFreshRecordingZoomsForSource()).toBe(true);});diff --git a/src/components/video-editor/timeline/zoomSuggestionUtils.ts b/src/components/video-editor/timeline/zoomSuggestionUtils.tsindex bf38efa6..fbdc5a68 100644--- a/src/components/video-editor/timeline/zoomSuggestionUtils.ts+++ b/src/components/video-editor/timeline/zoomSuggestionUtils.ts@@ -43,7 +43,15 @@ export interface InteractionZoomSuggestionResult {export function shouldAutoApplyFreshRecordingZoomsForSource(sourceWidth?: number,sourceHeight?: number,+ platform?: string,): boolean {+ // Window capture on Windows legitimately produces portrait and near-square+ // sources. Click telemetry is already normalized to that captured window, so+ // its aspect ratio is not a reason to suppress interaction-based zooms.+ if (platform === "win32") {+ return true;+ }+if (!Number.isFinite(sourceWidth) ||!Number.isFinite(sourceHeight) ||