audiplayer: play_all calls stop() at first for clearing stuff and avoiding errors

This commit is contained in:
Manuel Cortez 2016-05-14 20:33:16 -05:00
parent a46e7a51a0
commit eaa70ef818

View File

@ -74,12 +74,10 @@ class audioPlayer(object):
self.stream.volume = self.vol/100.0 self.stream.volume = self.vol/100.0
def play_all(self, list_of_urls): def play_all(self, list_of_urls):
self.stop()
self.queue = list_of_urls self.queue = list_of_urls
self.play(self.queue[0]) self.play(self.queue[0])
self.queue.remove(self.queue[0]) self.queue.remove(self.queue[0])
if hasattr(self, "worker") and self.worker != None:
self.worker.cancel()
self.worker = None
self.worker = RepeatingTimer(5, self.player_function) self.worker = RepeatingTimer(5, self.player_function)
self.worker.start() self.worker.start()