From cb696853f5e4db96854b44aa8dffa66b307d71c2 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Tue, 19 Jul 2022 11:40:36 +0200 Subject: [PATCH] try to fix broken remove song Signed-off-by: Christian Richter --- assets/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/index.html b/assets/index.html index 2f8e090..e021726 100644 --- a/assets/index.html +++ b/assets/index.html @@ -91,7 +91,7 @@ function onPlayerStateChange(event) { if (event.data == 0) { console.log("playing stopped"); - removeFromPlaylist(currentVideoID); + // it seems like there is a race condition happening here playNext(); } //if (event.data == YT.PlayerState.PLAYING && !done) { @@ -170,6 +170,7 @@ } function playNext() { + removeFromPlaylist(currentVideoID); if (playlist[0] != null && playlist[0] != "") { player.loadVideoById(playlist[0].videoId); player.playVideo(); -- 2.49.1