aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2022-08-01 22:51:38 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2022-08-01 22:51:38 +0200
commita315477b92d2c6f96c5b4d2b25e2447f250f9682 (patch)
tree9ab90bf7b699baa6dc99c7ef5c1241b314999068
parent5900302b27ef2ee45bfe14c7184f78706b863931 (diff)
downloadWRMS-a315477b92d2c6f96c5b4d2b25e2447f250f9682.tar.gz
WRMS-a315477b92d2c6f96c5b4d2b25e2447f250f9682.zip
add and handle stop event
-rw-r--r--web/client.html5
-rw-r--r--wrms.go1
2 files changed, 6 insertions, 0 deletions
diff --git a/web/client.html b/web/client.html
index 9998940..20a53ed 100644
--- a/web/client.html
+++ b/web/client.html
@@ -166,6 +166,11 @@
document.getElementById("ppbutton").innerHTML = 'Play';
}
+ function handleStop() {
+ document.getElementById("ppbutton").innerHTML = 'Play';
+ playing = document.getElementById("playing").innerHTML = "";
+ }
+
function handlePlay(currentSong) {
document.getElementById("ppbutton").innerHTML = 'Pause';
diff --git a/wrms.go b/wrms.go
index 607798c..252c14e 100644
--- a/wrms.go
+++ b/wrms.go
@@ -121,6 +121,7 @@ func (wrms *Wrms) PlayPause() {
wrms.Next()
if wrms.CurrentSong.Uri == "" {
llog.Info("No song left to play")
+ wrms.Broadcast(Event{"stop", []Song{}})
return
}
}