From c708bb42da85c880fd472217d853a5c99189b6b5 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Mon, 30 Jun 2025 01:26:54 +0530 Subject: New Features * Adds Shortcut for Next Track * Press 'n' for next track * Changes in Shortcut * Press SPACE for pause instead of 'x' (blah) --- index.html | 3 ++- player.js | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 53843eb..bfcf695 100644 --- a/index.html +++ b/index.html @@ -19,9 +19,10 @@
Here are the controls:
-(You can download the music history of your current browser by clicking the history link on the player)
All the music is fetched from retrowave.ru
diff --git a/player.js b/player.js index 2e6ee02..2c7e73f 100644 --- a/player.js +++ b/player.js @@ -66,8 +66,9 @@ document.addEventListener("keyup", (event) => { const { key } = event; + console.log("key pressed", key); switch (key) { - case "x": + case " ": togglePlay(); break; case "a": @@ -80,6 +81,10 @@ case "s": volumeDown(); break; + case "n": + playNextTrack(); + break; + } }); @@ -230,6 +235,7 @@ https://retrowave.ru/${musicData.streamUrl} } function playNextTrack() { + resetHowler(); currentTracks.shift(); if (currentTracks.length <= 3) { getMusic(); @@ -247,7 +253,6 @@ https://retrowave.ru/${musicData.streamUrl} function initControls() { refreshBtn.addEventListener("click", () => { - resetHowler(); playNextTrack(); }); } -- cgit v1.2.3