diff options
author | Indrajith K L | 2025-06-30 01:26:54 +0530 |
---|---|---|
committer | Indrajith K L | 2025-06-30 01:26:54 +0530 |
commit | c708bb42da85c880fd472217d853a5c99189b6b5 (patch) | |
tree | d54248cfb8b1d9446250f7d95becd693343eb455 | |
parent | 35ea31700fcfa18a4704fc9148fdf3589b98dc4e (diff) | |
download | retrowave-player-c708bb42da85c880fd472217d853a5c99189b6b5.tar.gz retrowave-player-c708bb42da85c880fd472217d853a5c99189b6b5.tar.bz2 retrowave-player-c708bb42da85c880fd472217d853a5c99189b6b5.zip |
New Features
* Adds Shortcut for Next Track
* Press 'n' for next track
* Changes in Shortcut
* Press SPACE for pause instead of 'x' (blah)
-rw-r--r-- | index.html | 3 | ||||
-rw-r--r-- | player.js | 9 |
2 files changed, 9 insertions, 3 deletions
@@ -19,9 +19,10 @@ <div class="modal-container"> <h3 class="text-center">Welcome to Retrowave Player</h3> <p class="mt-5">Here are the controls:</p> - <h4 class="mt-5">Play/Pause <span class="controls">x or Click or Touch</span></h4> + <h4 class="mt-5">Play/Pause <span class="controls">SPACE or Click or Touch</span></h4> <h4 class="mt-5">Volume Up <span class="controls">w or Swipe Up</span></h4> <h4 class="mt-5">Volume Down <span class="controls">s or Swipe Down</span></h4> + <h4 class="mt-5">Next Track<span class="controls"> n or Press the Refresh Button</span></h4> <p class="mt-5">(You can download the music history of your current browser by clicking the history link on the player)</p> <p class="mt-5">All the music is fetched from retrowave.ru</p> @@ -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(); }); } |