mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
Some fixes for URL Player
This commit is contained in:
parent
49073bc151
commit
6c47dd2fa9
19
src/sound.py
19
src/sound.py
@ -129,24 +129,7 @@ class URLStream(object):
|
|||||||
self.stream.volume = float(volume)
|
self.stream.volume = float(volume)
|
||||||
self.stream.play()
|
self.stream.play()
|
||||||
log.debug("played")
|
log.debug("played")
|
||||||
call_threaded(self.delete_when_done)
|
# call_threaded(self.delete_when_done)
|
||||||
|
|
||||||
def is_playable(self, url,play=False,volume=1.0):
|
|
||||||
try:
|
|
||||||
log.debug("Checking URL playability...")
|
|
||||||
self.prepare(url)
|
|
||||||
if self.prepared == True:
|
|
||||||
stream=sound_lib.stream.URLStream(url=self.url)
|
|
||||||
if play:
|
|
||||||
return self.play(stream=stream,volume=volume,announce=False)
|
|
||||||
return True
|
|
||||||
except:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def delete_when_done(self):
|
|
||||||
while hasattr(self,'stream') and self.stream.is_playing:
|
|
||||||
pass
|
|
||||||
del self.stream
|
|
||||||
|
|
||||||
def stop_audio(self,delete=False):
|
def stop_audio(self,delete=False):
|
||||||
if hasattr(self, "stream"):
|
if hasattr(self, "stream"):
|
||||||
|
Loading…
Reference in New Issue
Block a user