New Features
* Adds Shortcut for Next Track * Press 'n' for next track * Changes in Shortcut * Press SPACE for pause instead of 'x' (blah)
This commit is contained in:
@@ -19,9 +19,10 @@
|
|||||||
<div class="modal-container">
|
<div class="modal-container">
|
||||||
<h3 class="text-center">Welcome to Retrowave Player</h3>
|
<h3 class="text-center">Welcome to Retrowave Player</h3>
|
||||||
<p class="mt-5">Here are the controls:</p>
|
<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 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">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
|
<p class="mt-5">(You can download the music history of your current browser by clicking the history link on
|
||||||
the player)</p>
|
the player)</p>
|
||||||
<p class="mt-5">All the music is fetched from retrowave.ru</p>
|
<p class="mt-5">All the music is fetched from retrowave.ru</p>
|
||||||
|
|||||||
@@ -66,8 +66,9 @@
|
|||||||
|
|
||||||
document.addEventListener("keyup", (event) => {
|
document.addEventListener("keyup", (event) => {
|
||||||
const { key } = event;
|
const { key } = event;
|
||||||
|
console.log("key pressed", key);
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case "x":
|
case " ":
|
||||||
togglePlay();
|
togglePlay();
|
||||||
break;
|
break;
|
||||||
case "a":
|
case "a":
|
||||||
@@ -80,6 +81,10 @@
|
|||||||
case "s":
|
case "s":
|
||||||
volumeDown();
|
volumeDown();
|
||||||
break;
|
break;
|
||||||
|
case "n":
|
||||||
|
playNextTrack();
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -230,6 +235,7 @@ https://retrowave.ru/${musicData.streamUrl}
|
|||||||
}
|
}
|
||||||
|
|
||||||
function playNextTrack() {
|
function playNextTrack() {
|
||||||
|
resetHowler();
|
||||||
currentTracks.shift();
|
currentTracks.shift();
|
||||||
if (currentTracks.length <= 3) {
|
if (currentTracks.length <= 3) {
|
||||||
getMusic();
|
getMusic();
|
||||||
@@ -247,7 +253,6 @@ https://retrowave.ru/${musicData.streamUrl}
|
|||||||
|
|
||||||
function initControls() {
|
function initControls() {
|
||||||
refreshBtn.addEventListener("click", () => {
|
refreshBtn.addEventListener("click", () => {
|
||||||
resetHowler();
|
|
||||||
playNextTrack();
|
playNextTrack();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user