Playlist: scrub/seek playback by clicking-dragging the waveform

Pointer on the waveform now seeks: scrub the playhead on the playing track
(new 'seek' output message setting currentTime) or start a stopped track from
the clicked point (playIndex(i, fromTime)). Grabbing within ~10px of the green/
red handles still adjusts the trim in/out instead of seeking.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
lucianoandClaude Opus 4.8 committed 2026-06-22 16:45:00 +02:00
1 parent 882dd4643a
commit 26a5000b04
3 files changed
+52 -17

No files matched your search

+8
View File
@@ -359,6 +359,14 @@ djv.onControl(async (m) => {
} catch (e) { djv.report({ type: 'error', message: e.message }); }
break;
case 'setTrim': audio.setTrim(m.start || 0, m.end || 0); break;
case 'seek': {
const el = audio.mediaEl;
if (el && isFinite(el.duration) && el.duration > 0) {
el.currentTime = Math.max(0, Math.min(el.duration - 0.05, m.time || 0));
audio._trimFired = false; // re-arm the trim-end check after seeking
}
break;
}
case 'probeDurations': probeDurations(m.paths || []); break;
case 'togglePlay': {
const playing = audio.togglePlay();