From 5ed5fcd59a674f248ef1b14a24399b06c7a207e2 Mon Sep 17 00:00:00 2001 From: digital-garbage <133010426+digital-garbage@users.noreply.github.com> Date: Sun, 14 Jun 2026 21:49:09 +0300 Subject: [PATCH] Editor: clip volume slider takes effect live (fix mute that won't un-mute) The timeline clip volume slider writes audio_volume via patchSceneQuiet, which updates state WITHOUT a re-render, so the player's cached clip.vol stayed stale. Dropping to 0% only "stuck" when some later action happened to rebuild the clips; dragging back above 0 never rebuilt, so the clip stayed muted. _applyFx now reads the scene's audio_volume (and audio_separated) LIVE from the store; it runs every frame during playback, so the slider tracks immediately both ways. Final-render volume already read live, so only preview was affected. Co-Authored-By: Claude Opus 4.8 --- movie_editor/frontend/player.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/movie_editor/frontend/player.js b/movie_editor/frontend/player.js index c9351839..c0deafd9 100644 --- a/movie_editor/frontend/player.js +++ b/movie_editor/frontend/player.js @@ -584,6 +584,14 @@ // a non-finite volume throws on assignment, which (in the rAF tick) would freeze playback. const keepOrig = (S.get().project || {}).keep_original_audio !== false; let vol = (clip && clip.vol != null) ? +clip.vol : 1; + // Read the scene's volume LIVE: the timeline slider changes audio_volume via + // patchSceneQuiet (no re-render), so the cached clip.vol would stay stale — + // a mute that never un-mutes when dragged back up. _applyFx runs every frame + // during playback, so a live read tracks the slider immediately. + if (clip && clip.sceneId && S.scene) { + const sc = S.scene(clip.sceneId); + if (sc) vol = sc.audio_separated ? 0 : (sc.audio_volume != null ? sc.audio_volume : 1); + } if (!isFinite(vol)) vol = 1; const nv = keepOrig ? Math.max(0, Math.min(1, vol)) : 0; if (v.volume !== nv) { try { v.volume = nv; } catch (_) {} }