From ea551d3a8498b61b40642e791db80bc4e7da7fb8 Mon Sep 17 00:00:00 2001 From: erew123 <35898566+erew123@users.noreply.github.com> Date: Sun, 17 Mar 2024 12:51:41 +0000 Subject: [PATCH] ID Playing reset on stop - corrected Corrected the ID playing from resetting when the Stop button is pressed. --- .../tts_chunk_player/tts_chunk_player.html | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/templates/tts_chunk_player/tts_chunk_player.html b/templates/tts_chunk_player/tts_chunk_player.html index 65e3063..675642d 100644 --- a/templates/tts_chunk_player/tts_chunk_player.html +++ b/templates/tts_chunk_player/tts_chunk_player.html @@ -1240,7 +1240,7 @@ } else { // In chunk mode, toggle the chunk play/pause if (isPlaying && currentlyPlayingIndex > 0) { - let currentSound = audioQueue[currentlyPlayingIndex - 1]; + let currentSound = audioQueue[currentlyPlayingIndex - 3]; if (currentSound.playing()) { currentSound.pause(); } else { @@ -1268,14 +1268,14 @@ } - function stopPlayback() { - Howler.stop(); - audioQueue = []; - // Unload each sound in the queue - audioQueue.forEach(sound => sound.unload()); - currentlyPlayingIndex = 0; - isPlaying = false; - } + // function stopPlayback() { + // Howler.stop(); + // audioQueue = []; + // // Unload each sound in the queue + // audioQueue.forEach(sound => sound.unload()); + // //currentlyPlayingIndex = 0; + // isPlaying = false; + // } function updatePlaybackButton() { const playbackButton = document.querySelector(".toggle-playback"); @@ -1663,10 +1663,10 @@ function stopPlayback() { Howler.stop(); audioQueue = []; - currentlyPlayingIndex = 0; + //currentlyPlayingIndex = 0; isPlaying = false; - highlightPlaying(null); - document.getElementById('startFromId').value = '1'; // Reset the startFromId input to 1 + //highlightPlaying(null); + //document.getElementById('startFromId').value = '1'; // Reset the startFromId input to 1 } function displayOutput(result) {