Modify base.html websocket script to update elements on index.html. Modify index.html to show previous two tracks.

This commit is contained in:
scoobybejesus 2022-06-22 19:04:36 -04:00
parent 781aebc6ad
commit 25b46feac7
2 changed files with 9 additions and 2 deletions

View File

@ -46,6 +46,8 @@
// console.log(event.data);
json = JSON.parse(event.data);
np = json.now_playing;
document.querySelector("#prev_two").innerText = document.querySelector("#prev_one").innerText;
document.querySelector("#prev_one").innerText = document.querySelector("#now_playing").innerText;
document.querySelector("#now_playing").innerText = np;
// console.log(np);
return false;

View File

@ -13,8 +13,13 @@
<hr>
<audio controls src="/{{ settings.icecast2_mount }}">Your browser does not support the<code>audio</code> element.</audio>
<p> </p>
<h5>Now playing: </h5>
<div id="now_playing">Nothing here yet</div>
<h3>Now playing: </h3>
<div id="now_playing" style="padding-top:6px; margin-bottom:1.75rem;">Nothing here yet</div>
<h5>Previous: </h5>
<div id="prev_one" style="font-size:12px;">Nothing here yet</div>
<div id="prev_two" style="font-size:12px;"></div>
<hr>
<h4>Command list:</h4>