diff --git a/index.html b/index.html index d87c3b1..b7cd031 100644 --- a/index.html +++ b/index.html @@ -105,7 +105,7 @@ return; if (g_previous_idx >= (g_previous.length - 1)) { - if (g_shuffle || g_current === -1) { + if (g_shuffle) { g_current = Math.floor (Math.random () * g_playlist.length); } else { @@ -188,6 +188,9 @@ if (elements.length > 0) { elements[0].click (); } else { + if (g_current === -1) { + g_current = Math.floor (Math.random () * g_playlist.length); + } playNextTrack (); } }