method to add and print radio stations

workspace
Brendan Howell 4 years ago
parent 15d4273929
commit 86f9411b48

@ -19,7 +19,7 @@ class Audio(Bureau):
Bureau.__init__(self) Bureau.__init__(self)
self.urldb = self.open_db("urldb") self.urldb = self.open_db("urldb")
self.player = vlc.MediaPlayer() self.player = vlc.MediaListPlayer()
@add_command("p", "Play an album, track or a live stream.") @add_command("p", "Play an album, track or a live stream.")
def play(self, data): def play(self, data):
@ -33,7 +33,9 @@ class Audio(Bureau):
url = self.urldb.get(shortcode) url = self.urldb.get(shortcode)
self.log.debug(" playing url " + url) self.log.debug(" playing url " + url)
self.player.set_mrl(url) playlist = vlc.MediaList()
playlist.add_media(url)
self.player.set_media_list(playlist)
self.player.play() self.player.play()
@add_command("stop", "Halt audio playback.") @add_command("stop", "Halt audio playback.")

Loading…
Cancel
Save