1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-06-25 22:23:16 +00:00

Fixed prev and next buttons

This commit is contained in:
jcorporation 2018-06-18 22:26:00 +01:00
parent bd00810072
commit ef7b7b9017
2 changed files with 10 additions and 2 deletions

View File

@ -38,7 +38,7 @@
</div>
<div class="btn-toolbar col-auto" role="toolbar">
<div class="btn-group mr-2" role="group">
<button id="btnPrev" type="button" class="btn btn-secondary" onclick="socket.send('MPD_API_SET_PREV');">
<button id="btnPrev" type="button" class="btn btn-secondary" onclick="clickPrev();;">
<span class="material-icons">skip_previous</span>
</button>
<button id="btnStop" type="button" class="btn btn-secondary" onclick="clickStop();">
@ -47,7 +47,7 @@
<button id="btnPlay" type="button" class="btn btn-secondary" onclick="clickPlay();">
<span class="material-icons">pause</span>
</button>
<button id="btnNext" type="button" class="btn btn-secondary" onclick="socket.send('MPD_API_SET_NEXT');">
<button id="btnNext" type="button" class="btn btn-secondary" onclick="clickNext();">
<span class="material-icons">skip_next</span>
</button>
</div>

View File

@ -988,6 +988,14 @@ function clickStop() {
sendAPI(JSON.stringify({"cmd":"MPD_API_SET_STOP"}));
}
function clickPrev() {
sendAPI(JSON.stringify({"cmd":"MPD_API_SET_PREV"}));
}
function clickNext() {
sendAPI(JSON.stringify({"cmd":"MPD_API_SET_NEXT"}));
}
function setLocalStream(mpdhost,streamport) {
var mpdstream = 'http://';
if ( mpdhost == '127.0.0.1' || mpdhost == 'localhost')