aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.html3
-rw-r--r--player.js9
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 @@
<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>
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();
});
}