diff --git a/empty_video.mp4 b/empty_video.mp4 new file mode 100644 index 00000000..299de0ff Binary files /dev/null and b/empty_video.mp4 differ diff --git a/resources/lib/playback.py b/resources/lib/playback.py index 60db0262..0822d7ea 100644 --- a/resources/lib/playback.py +++ b/resources/lib/playback.py @@ -3,6 +3,7 @@ Used to kick off Kodi playback """ from logging import getLogger from threading import Thread +from os.path import join from xbmc import Player, sleep @@ -26,6 +27,8 @@ import state LOG = getLogger("PLEX." + __name__) # Do we need to return ultimately with a setResolvedUrl? 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 state.PKC_CAUSED_STOP = True result = Playback_Successful() - result.listitem = PKC_ListItem(path='PKC_Dummy_Path_Which_Fails') + result.listitem = PKC_ListItem(path=NULL_VIDEO) pickle_me(result) if abort: # Reset some playback variables diff --git a/resources/lib/variables.py b/resources/lib/variables.py index 0431662e..ed70569c 100644 --- a/resources/lib/variables.py +++ b/resources/lib/variables.py @@ -33,6 +33,7 @@ _ADDON = Addon() ADDON_NAME = 'PlexKodiConnect' ADDON_ID = 'plugin.video.plexkodiconnect' ADDON_VERSION = _ADDON.getAddonInfo('version') +ADDON_FOLDER = try_decode(xbmc.translatePath('special://home')) KODILANGUAGE = xbmc.getLanguage(xbmc.ISO_639_1) KODIVERSION = int(xbmc.getInfoLabel("System.BuildVersion")[:2])