Play-all removes the previous files in queue
This commit is contained in:
parent
b944700198
commit
66d2897650
@ -74,13 +74,12 @@ 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):
|
||||||
if len(self.queue) == 0:
|
self.queue = list_of_urls
|
||||||
self.queue = list_of_urls
|
|
||||||
else:
|
|
||||||
for i in list_of_urls:
|
|
||||||
self.queue.append(i)
|
|
||||||
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()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user