mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Change dialog to notification for direct play
Still allow for playback, while letting the user know.
This commit is contained in:
parent
9cb84906b1
commit
86c4db78f9
2 changed files with 15 additions and 12 deletions
|
@ -90,18 +90,20 @@ class PlayUtils():
|
||||||
if self.fileExists(result):
|
if self.fileExists(result):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
self.logMsg("Unable to direct play. Verify the following path is accessible by the device: %s. You might also need to add SMB credentials in the addon settings." % result[u'MediaSources'][0][u'Path'])
|
self.logMsg("Unable to direct play. Verify the following path is accessible by the device: %s. You might also need to add SMB credentials in the add-on settings." % result['MediaSources'][0]['Path'], 1)
|
||||||
if dialog:
|
if dialog:
|
||||||
# Let user know that direct play failed
|
|
||||||
dialog = xbmcgui.Dialog()
|
failCount = int(utils.settings('directSteamFailedCount'))
|
||||||
resp = dialog.select('Warning: Unable to direct play.', ['Play from HTTP', 'Play from HTTP and remember next time.'])
|
self.logMsg("Direct Play failCount: %s." % failCount, 1)
|
||||||
if resp == 1:
|
|
||||||
# Remember next time
|
if failCount < 2:
|
||||||
utils.settings('playFromStream', "true")
|
# Let user know that direct play failed
|
||||||
elif resp < 0:
|
utils.settings('directSteamFailedCount', value=str(failCount + 1))
|
||||||
# User decided not to proceed.
|
xbmcgui.Dialog().notification("Emby server", "Unable to direct play. Verify your log for more information.", icon="special://home/addons/plugin.video.emby/icon.png", sound=False)
|
||||||
self.logMsg("User cancelled HTTP selection dialog.", 1)
|
elif utils.settings('playFromStream') != "true":
|
||||||
self.WINDOW.setProperty("playurlFalse", "true")
|
# Permanently set direct stream as true
|
||||||
|
utils.settings('playFromStream', value="true")
|
||||||
|
xbmcgui.Dialog().notification("Emby server", "Enabled play from HTTP in add-on settings.", icon="special://home/addons/plugin.video.emby/icon.png", sound=False)
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
<setting id="resumeJumpBack" type="slider" label="On Resume Jump Back Seconds" default="10" range="0,1,120" option="int" visible="true" enable="true" />
|
<setting id="resumeJumpBack" type="slider" label="On Resume Jump Back Seconds" default="10" range="0,1,120" option="int" visible="true" enable="true" />
|
||||||
<setting id="playFromStream" type="bool" label="30002" visible="true" enable="true" default="false" />
|
<setting id="playFromStream" type="bool" label="30002" visible="true" enable="true" default="false" />
|
||||||
<setting id="videoBitRate" type="enum" label="30160" values="664 Kbps SD|996 Kbps HD|1.3 Mbps HD|2.0 Mbps HD|3.2 Mbps HD|4.7 Mbps HD|6.2 Mbps HD|7.7 Mbps HD|9.2 Mbps HD|10.7 Mbps HD|12.2 Mbps HD|13.7 Mbps HD|15.2 Mbps HD|16.7 Mbps HD|18.2 Mbps HD|20.0 Mbps HD|40.0 Mbps HD|100.0 Mbps HD [default]|1000.0 Mbps HD" visible="eq(-1,true)" default="17" />
|
<setting id="videoBitRate" type="enum" label="30160" values="664 Kbps SD|996 Kbps HD|1.3 Mbps HD|2.0 Mbps HD|3.2 Mbps HD|4.7 Mbps HD|6.2 Mbps HD|7.7 Mbps HD|9.2 Mbps HD|10.7 Mbps HD|12.2 Mbps HD|13.7 Mbps HD|15.2 Mbps HD|16.7 Mbps HD|18.2 Mbps HD|20.0 Mbps HD|40.0 Mbps HD|100.0 Mbps HD [default]|1000.0 Mbps HD" visible="eq(-1,true)" default="17" />
|
||||||
|
<setting id="directSteamFailedCount" type="number" visible="false" default="0" />
|
||||||
</category>
|
</category>
|
||||||
<category label="Extras">
|
<category label="Extras">
|
||||||
<setting id="disableCoverArt" type="bool" label="30157" default="false" visible="true" enable="true" />
|
<setting id="disableCoverArt" type="bool" label="30157" default="false" visible="true" enable="true" />
|
||||||
|
|
Loading…
Reference in a new issue