Updated to the latest radiospiral server
This commit is contained in:
parent
17a5df5959
commit
9c15e00066
2 changed files with 15 additions and 2 deletions
12
main.go
12
main.go
|
@ -59,7 +59,7 @@ import (
|
|||
)
|
||||
|
||||
// Enums and constants
|
||||
const RADIOSPIRAL_STREAM = "https://radiospiral.radio/stream.mp3"
|
||||
const RADIOSPIRAL_STREAM = "https://radiospiral.radio:8000/stream.mp3"
|
||||
const RADIOSPIRAL_JSON_ENDPOINT = "https://radiospiral.net/wp-json/radio/broadcast"
|
||||
|
||||
const (
|
||||
|
@ -191,8 +191,16 @@ func main() {
|
|||
volumeUp := widget.NewButtonWithIcon("", theme.VolumeUpIcon(), func() {
|
||||
streamPlayer.IncVolume()
|
||||
})
|
||||
volumeMute := widget.NewButtonWithIcon("", theme.VolumeMuteIcon(), func() {
|
||||
|
||||
var volumeMute *widget.Button
|
||||
|
||||
volumeMute = widget.NewButtonWithIcon("", theme.VolumeMuteIcon(), func() {
|
||||
streamPlayer.Mute()
|
||||
if streamPlayer.IsMuted() {
|
||||
volumeMute.SetText("x")
|
||||
} else {
|
||||
volumeMute.SetText("")
|
||||
}
|
||||
})
|
||||
controlContainer := container.NewHBox(
|
||||
nowPlayingLabelHeader,
|
||||
|
|
|
@ -36,6 +36,7 @@ import (
|
|||
type RadioPlayer interface {
|
||||
Load(stream_url string)
|
||||
IsPlaying() bool
|
||||
IsMuted() bool
|
||||
Play()
|
||||
Mute()
|
||||
Stop()
|
||||
|
@ -144,6 +145,10 @@ func (player *StreamPlayer) Close() {
|
|||
}
|
||||
}
|
||||
|
||||
func (player *StreamPlayer) IsMuted() bool {
|
||||
return player.otoPlayer.Volume() == 0.0
|
||||
}
|
||||
|
||||
func (player *StreamPlayer) Mute() {
|
||||
if player.IsPlaying() {
|
||||
if player.otoPlayer.Volume() > 0 {
|
||||
|
|
Loading…
Reference in a new issue