First attempt at supporting theme music

This commit is contained in:
angelblue05 2015-06-11 00:46:47 -05:00
parent 5b0c074279
commit a6497ce6c7
3 changed files with 80 additions and 4 deletions

View file

@ -187,12 +187,16 @@ class PlayUtils():
return False
return True
def directStream(self, result, server, id):
def directStream(self, result, server, id, type="Video"):
try:
# Play with Direct Stream
playurl = "%s/mediabrowser/Videos/%s/stream?static=true" % (server, id)
if type == "Video":
# Play with Direct Stream
playurl = "%s/mediabrowser/Videos/%s/stream?static=true" % (server, id)
elif type == "Audio":
playurl = "%s/mediabrowser/Audio/%s/stream.mp3" % (server, id)
return playurl
mediaSources = result[u'MediaSources']
if mediaSources[0].get('DefaultAudioStreamIndex') != None: