Now we play and stop
This commit is contained in:
parent
b21738d4ed
commit
c43c008715
2 changed files with 9 additions and 2 deletions
1
.tool-versions
Normal file
1
.tool-versions
Normal file
|
@ -0,0 +1 @@
|
|||
golang 1.21.4
|
10
main.go
10
main.go
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue