# idle time in minutesIDLE_TIME_MIN = 10FILENAME = 'your movie here'## Thanks Thor918 for this class ##class MyPlayer(xbmc.Player): def __init__(self, *args, **kwargs): if (kwargs.has_key('function')): self.function = kwargs['function'] xbmc.Player.__init__(self) def onPlayBackStopped(self): self.function() def onPlayBackEnded(self): self.function() def onPlayBackStarted(self): self.function()def stopLoop():def sleepLoop(): s = 1 while s > 0: # get idle time it = xbmc.getGlobalIdleTime() #calculate sleep time in msec s = ((IDLE_TIME_MIN * 60) - it ) * 1000 # sleep if (s > 0): xbmc.sleep(s) # log off xbmc.Player().play(FILENAME)sPlayer = MyPlayer(function=sleepLoop)sleepLoop()