From 89038ae7a24fb261f68d5f45fced5a1cf7b5400b Mon Sep 17 00:00:00 2001 From: 4rjunc Date: Sun, 15 Mar 2026 14:31:44 +0530 Subject: [PATCH] feat: add safe file URL --- src/components/video-editor/timeline/TimelineEditor.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/video-editor/timeline/TimelineEditor.tsx b/src/components/video-editor/timeline/TimelineEditor.tsx index 4ecad060..4dfceaf0 100644 --- a/src/components/video-editor/timeline/TimelineEditor.tsx +++ b/src/components/video-editor/timeline/TimelineEditor.tsx @@ -23,6 +23,7 @@ import Item from "./Item"; import KeyframeMarkers from "./KeyframeMarkers"; import type { Range, Span } from "dnd-timeline"; import type { ZoomRegion, TrimRegion, AnnotationRegion, SpeedRegion, AudioRegion, CursorTelemetryPoint, ZoomFocus } from "../types"; +import { toFileUrl } from "../projectPersistence"; import { detectInteractionCandidates, normalizeCursorTelemetry } from "./zoomSuggestionUtils"; const ZOOM_ROW_ID = "row-zoom"; @@ -1068,7 +1069,7 @@ export default function TimelineEditor({ // Load the audio file to get its full duration const audioDurationMs = await new Promise((resolve) => { - const audio = new Audio(`file://${result.path}`); + const audio = new Audio(toFileUrl(result.path)); audio.addEventListener('loadedmetadata', () => { resolve(Math.round(audio.duration * 1000)); });