Use an empty video file to "fail" playback

This commit is contained in:
Croneter 2018-03-27 18:07:16 +02:00
parent b23c6e2932
commit fc836bebe6
3 changed files with 5 additions and 1 deletions

BIN
empty_video.mp4 Normal file

Binary file not shown.

View File

@ -3,6 +3,7 @@ Used to kick off Kodi playback
""" """
from logging import getLogger from logging import getLogger
from threading import Thread from threading import Thread
from os.path import join
from xbmc import Player, sleep from xbmc import Player, sleep
@ -26,6 +27,8 @@ import state
LOG = getLogger("PLEX." + __name__) LOG = getLogger("PLEX." + __name__)
# Do we need to return ultimately with a setResolvedUrl? # Do we need to return ultimately with a setResolvedUrl?
RESOLVE = True RESOLVE = True
# We're "failing" playback with a video of 0 length
NULL_VIDEO = join(v.ADDON_FOLDER, 'addons', v.ADDON_ID, 'empty_video.mp4')
############################################################################### ###############################################################################
@ -173,7 +176,7 @@ def _ensure_resolve(abort=False):
# Because playback won't start with context menu play # Because playback won't start with context menu play
state.PKC_CAUSED_STOP = True state.PKC_CAUSED_STOP = True
result = Playback_Successful() result = Playback_Successful()
result.listitem = PKC_ListItem(path='PKC_Dummy_Path_Which_Fails') result.listitem = PKC_ListItem(path=NULL_VIDEO)
pickle_me(result) pickle_me(result)
if abort: if abort:
# Reset some playback variables # Reset some playback variables

View File

@ -33,6 +33,7 @@ _ADDON = Addon()
ADDON_NAME = 'PlexKodiConnect' ADDON_NAME = 'PlexKodiConnect'
ADDON_ID = 'plugin.video.plexkodiconnect' ADDON_ID = 'plugin.video.plexkodiconnect'
ADDON_VERSION = _ADDON.getAddonInfo('version') ADDON_VERSION = _ADDON.getAddonInfo('version')
ADDON_FOLDER = try_decode(xbmc.translatePath('special://home'))
KODILANGUAGE = xbmc.getLanguage(xbmc.ISO_639_1) KODILANGUAGE = xbmc.getLanguage(xbmc.ISO_639_1)
KODIVERSION = int(xbmc.getInfoLabel("System.BuildVersion")[:2]) KODIVERSION = int(xbmc.getInfoLabel("System.BuildVersion")[:2])