Skip to content

Create polished demo videos without editing skills. Mac/Windows/Linux

feat: add audio volume

4rjunc9cc577fd5f8c
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<ProjectEditorState>): 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,
};
})
: [];