mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 18:26:15 +00:00
Merge pull request #310 from Lumenol/fix_change_audio_subtitle_stream_remotely
Fix choose the audio stream and the subtitle stream remotely
This commit is contained in:
commit
f0bb8dfc3a
2 changed files with 7 additions and 1 deletions
|
@ -389,6 +389,8 @@ class Monitor(xbmc.Monitor):
|
||||||
elif command == 'SetSubtitleStreamIndex':
|
elif command == 'SetSubtitleStreamIndex':
|
||||||
self.player.set_audio_subs(None, args['Index'])
|
self.player.set_audio_subs(None, args['Index'])
|
||||||
|
|
||||||
|
# Kodi needs a bit of time to update it's current status
|
||||||
|
xbmc.sleep(500)
|
||||||
self.player.report_playback()
|
self.player.report_playback()
|
||||||
|
|
||||||
elif command == 'DisplayMessage':
|
elif command == 'DisplayMessage':
|
||||||
|
|
|
@ -155,6 +155,10 @@ class Player(xbmc.Player):
|
||||||
LOG.info("-->[ play/%s ] %s", item['Id'], item)
|
LOG.info("-->[ play/%s ] %s", item['Id'], item)
|
||||||
|
|
||||||
def set_audio_subs(self, audio=None, subtitle=None):
|
def set_audio_subs(self, audio=None, subtitle=None):
|
||||||
|
if audio:
|
||||||
|
audio=int(audio)
|
||||||
|
if subtitle:
|
||||||
|
subtitle=int(subtitle)
|
||||||
|
|
||||||
''' Only for after playback started
|
''' Only for after playback started
|
||||||
'''
|
'''
|
||||||
|
@ -169,7 +173,7 @@ class Player(xbmc.Player):
|
||||||
if audio and len(self.getAvailableAudioStreams()) > 1:
|
if audio and len(self.getAvailableAudioStreams()) > 1:
|
||||||
self.setAudioStream(audio - 1)
|
self.setAudioStream(audio - 1)
|
||||||
|
|
||||||
if subtitle == -1 or subtitle is None:
|
if subtitle is None or subtitle == -1:
|
||||||
self.showSubtitles(False)
|
self.showSubtitles(False)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue