From dec004eddd553ed9c915c14a74b9fb6e8249eea7 Mon Sep 17 00:00:00 2001 From: webadderall <131426131+webadderall@users.noreply.github.com> Date: Sat, 18 Apr 2026 18:38:38 +1000 Subject: [PATCH] fix: use drift-compensating scheduler in recording handler, fix media URL consistency - Replace setInterval in recording handler with startCursorSampling() so the drift-compensating scheduler is used for actual recordings (was missed) - Pass realpath-resolved path to buildMediaUrl for symlink consistency - Use resolvedWebcamVideoUrl in thumbnail/export configs with file:// fallback --- electron/ipc/register/project.ts | 2 +- electron/ipc/register/recording.ts | 6 +++--- src/components/video-editor/VideoEditor.tsx | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/electron/ipc/register/project.ts b/electron/ipc/register/project.ts index a6e9d4c9..6562b219 100644 --- a/electron/ipc/register/project.ts +++ b/electron/ipc/register/project.ts @@ -394,7 +394,7 @@ export function registerProjectHandlers() { console.warn(`[get-local-media-url] Blocked unapproved path: ${resolved}`); return { success: false as const }; } - return { success: true as const, url: buildMediaUrl(baseUrl, filePath) }; + return { success: true as const, url: buildMediaUrl(baseUrl, resolved) }; }); } diff --git a/electron/ipc/register/recording.ts b/electron/ipc/register/recording.ts index c1551058..78184758 100644 --- a/electron/ipc/register/recording.ts +++ b/electron/ipc/register/recording.ts @@ -5,7 +5,7 @@ import path from "node:path"; import { promisify } from "node:util"; import { app, BrowserWindow, desktopCapturer, dialog, ipcMain, shell, systemPreferences } from "electron"; import { showCursor } from "../../cursorHider"; -import { ALLOW_RECORDLY_WINDOW_CAPTURE, CURSOR_SAMPLE_INTERVAL_MS } from "../constants"; +import { ALLOW_RECORDLY_WINDOW_CAPTURE } from "../constants"; import type { SelectedSource, NativeMacRecordingOptions, PauseSegment, CursorTelemetryPoint } from "../types"; import { selectedSource, @@ -53,7 +53,6 @@ import { setCachedSystemCursorAssets, cachedSystemCursorAssetsSourceMtimeMs, setCachedSystemCursorAssetsSourceMtimeMs, - setCursorCaptureInterval, setCursorCaptureStartTimeMs, setActiveCursorSamples, setPendingCursorSamples, @@ -113,6 +112,7 @@ import { clamp, stopCursorCapture, sampleCursorPoint, + startCursorSampling, snapshotCursorTelemetryForPersistence, } from "../cursor/telemetry"; import { @@ -1083,7 +1083,7 @@ export function registerRecordingHandlers( setLinuxCursorScreenPoint(null) setLastLeftClick(null) sampleCursorPoint() - setCursorCaptureInterval(setInterval(sampleCursorPoint, CURSOR_SAMPLE_INTERVAL_MS)) + startCursorSampling() void startInteractionCapture() } else { setIsCursorCaptureActive(false) diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx index cefb383b..3edc0427 100644 --- a/src/components/video-editor/VideoEditor.tsx +++ b/src/components/video-editor/VideoEditor.tsx @@ -781,7 +781,7 @@ export default function VideoEditor() { padding, cropRegion, webcam, - webcamUrl: webcam.sourcePath ? toFileUrl(webcam.sourcePath) : null, + webcamUrl: resolvedWebcamVideoUrl ?? (webcam.sourcePath ? toFileUrl(webcam.sourcePath) : null), videoWidth: previewVideo.videoWidth, videoHeight: previewVideo.videoHeight, annotationRegions, @@ -3539,7 +3539,7 @@ export default function VideoEditor() { videoPadding: padding, cropRegion, webcam, - webcamUrl: webcam.sourcePath ? toFileUrl(webcam.sourcePath) : null, + webcamUrl: resolvedWebcamVideoUrl ?? (webcam.sourcePath ? toFileUrl(webcam.sourcePath) : null), annotationRegions, autoCaptions, autoCaptionSettings, @@ -3708,7 +3708,7 @@ export default function VideoEditor() { padding, cropRegion, webcam, - webcamUrl: webcam.sourcePath ? toFileUrl(webcam.sourcePath) : null, + webcamUrl: resolvedWebcamVideoUrl ?? (webcam.sourcePath ? toFileUrl(webcam.sourcePath) : null), annotationRegions, autoCaptions, autoCaptionSettings,