Now we play and stop

This commit is contained in:
José Carlos Cuevas 2023-12-04 01:28:03 +01:00
parent b21738d4ed
commit c43c008715
2 changed files with 9 additions and 2 deletions

1
.tool-versions Normal file
View file

@ -0,0 +1 @@
golang 1.21.4

10
main.go
View file

@ -133,10 +133,16 @@ func main() {
radiospiral_label,
nowplaying_label,
widget.NewButton("Play", func() {
nowplaying_label.SetText("Playing!")
mplayer.Play("http://radiospiral.radio/stream.mp3")
if !mplayer.is_playing {
nowplaying_label.SetText("Playing!")
mplayer.Play("http://radiospiral.radio/stream.mp3")
} else {
nowplaying_label.SetText("Stopped")
mplayer.Pause()
}
}),
))
window.ShowAndRun()
mplayer.Close()
}