Merge pull request #1652 from croneter/py3-stream-option

Add playback settings to let the user choose whether Plex or Kodi provides the default audio or subtitle stream on playback start
This commit is contained in:
croneter 2021-10-09 17:26:39 +02:00 committed by GitHub
commit d867ac537d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 1 deletions

View file

@ -670,6 +670,16 @@ msgctxt "#30546"
msgid "Pick the first video if several versions are present"
msgstr ""
# PKC Settings - Playback
msgctxt "#30547"
msgid "Who picks the audio stream on playback start?"
msgstr ""
# PKC Settings - Playback
msgctxt "#30548"
msgid "Who picks subtitles on playback start?"
msgstr ""
# Welcome to Plex notification
msgctxt "#33000"
msgid "Welcome"

View file

@ -28,6 +28,7 @@ class KodiMonitor(xbmc.Monitor):
"""
PKC implementation of the Kodi Monitor class. Invoke only once.
"""
def __init__(self):
self._already_slept = False
self._switched_to_plex_streams = True
@ -389,7 +390,10 @@ class KodiMonitor(xbmc.Monitor):
if not self._switched_to_plex_streams:
# We need to switch to the Plex streams ONCE upon playback start
# after onavchange has been fired
item.switch_to_plex_streams()
if utils.settings('audioStreamPick') == '0':
item.switch_to_plex_stream('audio')
if utils.settings('subtitleStreamPick') == '0':
item.switch_to_plex_stream('subtitle')
self._switched_to_plex_streams = True
else:
item.on_av_change(playerid)

View file

@ -115,6 +115,8 @@
<setting id="trailerNumber" type="slider" label="39000" default="3" visible="eq(-2,true)" range="1,1,15" option="int" />
<setting id="enableSkipIntro" type="bool" label="30525" default="true" /><!-- Enable skipping of intros -->
<setting id="firstVideoStream" type="bool" label="30546" default="false" /><!-- Pick the first video if several versions are present -->
<setting id="audioStreamPick" type="enum" label="30547" values="Plex|Kodi" default="0" /><!-- Who picks the audio stream on playback start? -->
<setting id="subtitleStreamPick" type="enum" label="30548" values="Plex|Kodi" default="0" /><!-- Who picks subtitles on playback start? -->
<setting id="ignoreSpecialsNextEpisodes" type="bool" label="30527" default="false" />
<setting id="resumeJumpBack" type="slider" label="30521" default="10" range="0,1,120" option="int" visible="false"/>
<setting type="sep" />