Possibile fix imputstream per Android

This commit is contained in:
Alhaziel01
2020-07-03 19:13:47 +02:00
parent 77913e76a6
commit fde6c91ae1
+16 -11
View File
@@ -545,7 +545,7 @@ def play_video(item, strm=False, force_direct=False, autoplay=False):
# if it is a video in mpd format, the listitem is configured to play it ith the inpustreamaddon addon implemented in Kodi 17 # if it is a video in mpd format, the listitem is configured to play it ith the inpustreamaddon addon implemented in Kodi 17
# from core.support import dbg;dbg() # from core.support import dbg;dbg()
if mpd: if mpd:
if not os.path.exists(os.path.join(xbmc.translatePath('special://home/addons/'),'inputstream.adaptive')): install_inputstream() install_inputstream()
xlistitem.setProperty('inputstreamaddon', 'inputstream.adaptive') xlistitem.setProperty('inputstreamaddon', 'inputstream.adaptive')
xlistitem.setProperty('inputstream.adaptive.manifest_type', 'mpd') xlistitem.setProperty('inputstream.adaptive.manifest_type', 'mpd')
@@ -1069,15 +1069,20 @@ def resume_playback(item, return_played_time=False):
def install_inputstream(): def install_inputstream():
from xbmcaddon import Addon from xbmcaddon import Addon
try: if not os.path.exists(os.path.join(xbmc.translatePath('special://home/addons/'),'inputstream.adaptive')) and not os.path.exists(os.path.join(xbmc.translatePath('special://xbmcbinaddons/'),'inputstream.adaptive')):
# See if there's an installed repo that has it try:
xbmc.executebuiltin('InstallAddon(inputstream.adaptive)', wait=True) # See if there's an installed repo that has it
xbmc.executebuiltin('InstallAddon(inputstream.adaptive)', wait=True)
# Check if InputStream add-on exists! # Check if InputStream add-on exists!
Addon('inputstream.adaptive') Addon('inputstream.adaptive')
logger.info('InputStream add-on installed from repo.') logger.info('InputStream add-on installed from repo.')
return True except RuntimeError:
except RuntimeError: logger.info('InputStream add-on not installed.')
logger.info('InputStream add-on not installed.') else:
return False try:
Addon('inputstream.adaptive')
except:
xbmc.executebuiltin('UpdateLocalAddons')
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "id":1, "method": "Addons.SetAddonEnabled", "params": { "addonid": "inputstream.adaptive", "enabled": true }}')