aboutsummaryrefslogtreecommitdiff
path: root/player.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2022-07-26 22:23:37 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2022-07-26 22:23:37 +0200
commit33fd4442dd8297d02d284e82cf09bbfec01c705a (patch)
treebe15f36161859c24971f62b3f89c4effe9c1e349 /player.go
parent7e15ad1d8af4ee27f6c1d31e7b1608e2d751c402 (diff)
downloadWRMS-33fd4442dd8297d02d284e82cf09bbfec01c705a.tar.gz
WRMS-33fd4442dd8297d02d284e82cf09bbfec01c705a.zip
add youtube backend
Diffstat (limited to 'player.go')
-rw-r--r--player.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/player.go b/player.go
index a672288..49b6d11 100644
--- a/player.go
+++ b/player.go
@@ -28,6 +28,7 @@ func NewPlayer(wrms *Wrms) Player {
log.Println("Error during initialization of the spotify backend:", err.Error())
}
available_backends["spotify"] = spotify
+ available_backends["youtube"] = &YoutubeBackend{}
available_backends["dummy"] = &DummyBackend{}
@@ -45,19 +46,20 @@ func (player *Player) Play(song *Song) {
}
func (player *Player) runMpv() {
- out, err := player.mpv.CombinedOutput()
+ _, err := player.mpv.CombinedOutput()
if err != nil {
log.Fatal(err)
}
- log.Println("mpv finished with", out, "resetting mpv, the current song and call play")
+ log.Println("mpv finished. Resetting mpv, the current song and call play")
player.mpv = nil
player.wrms.CurrentSong.Uri = ""
player.wrms.PlayPause()
}
func (player *Player) PlayUri(uri string) {
- player.mpv = exec.Command("mpv", uri)
+ log.Println("Start mpv with ", uri)
+ player.mpv = exec.Command("mpv", "--no-video", uri)
go player.runMpv()
}