From c944e1eb4a746cbbe17aafc90030450721285b87 Mon Sep 17 00:00:00 2001 From: Armin Date: Wed, 8 Jul 2026 16:26:58 +0200 Subject: [PATCH] fix: stop audio playback when currently playing track is deleted --- index.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.html b/index.html index a9bcbf5..4adea64 100644 --- a/index.html +++ b/index.html @@ -1043,6 +1043,14 @@ function deleteTrack() { if (selectedIndices.size === 0) return; const sortedSel = [...selectedIndices].sort((a, b) => a - b); const willDeleteCurrent = selectedIndices.has(currentIndex); + if (willDeleteCurrent) { + audio.pause(); + audio.currentTime = 0; + if (isCrossfading) { + audioNext.pause(); + audioNext.currentTime = 0; + } + } if (selectedIndices.size === tracks.length) { for (const idx of sortedSel) { if (idx !== currentIndex) URL.revokeObjectURL(tracks[idx].url);