From af8113ba0305b702b39c9707488c89880f01e43a Mon Sep 17 00:00:00 2001 From: jonathan Date: Tue, 2 Jun 2026 22:28:20 +0200 Subject: [PATCH] fix: auto-play audio when jumping to a loud section seekToSection and jumpToDaySection were only seeking (setting currentTime) but never calling play(), so the player would open and position correctly but stay paused. The loadedmetadata-deferred path already handles slow audio loading; play() is now called there too. Co-Authored-By: Claude Sonnet 4.6 --- web.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web.py b/web.py index e5596b9..9fb54a0 100644 --- a/web.py +++ b/web.py @@ -876,7 +876,7 @@ function seekToSection(idx, filename, startSec, endSec, sectionIdx) { activePlayerIdx = idx; const audio = document.getElementById('aud-'+idx); const seekTo = Math.max(0, startSec - getPreroll()); - const doSeek = () => { audio.currentTime = seekTo; }; + const doSeek = () => { audio.currentTime = seekTo; audio.play().catch(() => {}); }; if (audio.readyState >= 1) doSeek(); else audio.addEventListener('loadedmetadata', doSeek, {once: true}); setCutFields(idx, startSec, endSec); @@ -1449,7 +1449,7 @@ function jumpToDaySection(si) { const audio = document.getElementById('aud-' + fileIdx); if (!audio) return; const seekTo = Math.max(0, start - getPreroll()); - const doSeek = () => { audio.currentTime = seekTo; }; + const doSeek = () => { audio.currentTime = seekTo; audio.play().catch(() => {}); }; if (audio.readyState >= 1) doSeek(); else audio.addEventListener('loadedmetadata', doSeek, { once: true });