From 98ff361fa16ea0da42901347ae51d9306d5b6a9e Mon Sep 17 00:00:00 2001 From: 4rjunc Date: Sun, 15 Mar 2026 14:32:48 +0530 Subject: [PATCH] feat: add audio volume --- src/components/video-editor/VideoEditor.tsx | 2 +- src/components/video-editor/projectPersistence.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx index f4a1b325..b7b87649 100644 --- a/src/components/video-editor/VideoEditor.tsx +++ b/src/components/video-editor/VideoEditor.tsx @@ -1304,7 +1304,7 @@ export default function VideoEditor() { if (audio.src !== expectedSrc) { audio.src = expectedSrc; } - audio.volume = region.volume; + audio.volume = Math.max(0, Math.min(1, region.volume)); } return () => { diff --git a/src/components/video-editor/projectPersistence.ts b/src/components/video-editor/projectPersistence.ts index e7f13bc7..0985fc72 100644 --- a/src/components/video-editor/projectPersistence.ts +++ b/src/components/video-editor/projectPersistence.ts @@ -305,7 +305,7 @@ export function normalizeProjectEditor(editor: Partial): Pro startMs, endMs, audioPath: typeof region.audioPath === "string" ? region.audioPath : "", - volume: isFiniteNumber(region.volume) ? clamp(region.volume, 0, 2) : 1, + volume: isFiniteNumber(region.volume) ? clamp(region.volume, 0, 1) : 1, }; }) : [];