--- misc/xbmc/plugin.video.todic/default.py 2011/12/04 16:31:58 1650 +++ misc/xbmc/plugin.video.todic/default.py 2012/01/23 15:50:40 1677 @@ -1,3 +1,6 @@ +# This Python file uses the following encoding: utf-8 + + ''' Todic plugin for XBMC Version 0.0.2 @@ -20,6 +23,39 @@ __backend__ = "http://todic.dk/xbmc.php?xbmckey=" + __key__ fanartImage = os.path.join(__addon__.getAddonInfo('path'), 'fanart.jpg') + +class TodicPlayer(xbmc.Player): + def __init__(self, *args, **kwargs): + #xbmc.Player.__init__(selv,*args,**kwargs) + xbmc.Player.__init__(self, xbmc.PLAYER_CORE_MPLAYER ) + self.stopped = False + self.started = False + print "[TodicPlayer] init" + +# @catchall + def onPlayBackStarted(self): + self.started = True + print "[TodicPlayer] : started" +# super.onPlayBackStarted() + + def onPlayBackStopped(self): + self.stopped = True + print "[TodicPlayer] : stopped" + + def onPlayBackEnded(self): + self.stopped = True + print "[TodicPlayer] : ended" + + def callbackLoop(self): + print "[Todic] startLoop" + while (self.stopped == False): + if (self.started == True ): + print "[todic] " + str(self.getTime()) + xbmc.sleep(5000) + + + + def open_url(url): req = urllib2.Request(url) content = urllib2.urlopen(req) @@ -29,7 +65,7 @@ def rootMenu(): - buildList(__backend__, "") # call default list + buildList(__backend__, "", False) # call default list # Adde xtra items to root menu listitem = xbmcgui.ListItem(label = "Søg film ...", iconImage = 'DefaultFolder.png', thumbnailImage = 'DefaultFolder.png') @@ -41,7 +77,7 @@ xbmcplugin.endOfDirectory(int(sys.argv[1])) -def buildList(url,title): +def buildList(url,title, endlist=True): print '[TODIC]:'+str(url) link = open_url(url) ty=re.compile('