Example #1
0
 def play(self):
   if Debug: self.LOG('DEBUG: play()')
   title = unicode(xbmc.getInfoLabel("ListItem.Title"), "utf-8")
   listitem = xbmcgui.ListItem(title, iconImage=__icon__)
   listitem.setProperty('IsLive', 'true')
   # Play video...
   while xbmc.Player().play(self.Arguments('url'), listitem):
     time.sleep(10)
     print 'xbmc.isPlaying() = %s' % xbmc.isPlaying()
     if not xbmc.isPlaying():
       break
Example #2
0
    def runProgram(self):
        #run until XBMC quits
        while(not xbmc.abortRequested):

            structTime = time.localtime()
            now = time.time()
             
            #only do all this if we are in a new minute
            if(structTime[4] != self.last_check):
                self.last_check = structTime[4]
            
            if xbmc.getGlobalIdleTime() < min_idle_seconds:            
                xbmcgui.Dialog().notification('Idle time is less than ' + min_idle_seconds + ' seconds')            
            if not xbmc.getCondVisibility(System.ScreenSaverActive):
                xbmcgui.Dialog().notification('Screensaver is not active')            
            if xbmc.isPlaying():
                xbmcgui.Dialog().notification('Something is playing')
            
            #Switch off screen here
            xbmcgui.Dialog().notification('Would have switched off screen here!')
                
            xbmc.sleep(self.sleep_time)