Kodi Community Forum
Question Methof of Player? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Question Methof of Player? (/showthread.php?tid=229901)



Question Methof of Player? - abdujabbor1987 - 2015-06-18

Hi everybody, I have some question again. I have extend the class of Player as this:
PHP Code:
class MyPlayer(xbmc.Player):
    
def __init__(self, *args, **kwargs):
        
xbmc.Player.__init__(self)

    
# @staticmethod
    
def play(selfitem Nonelistitem Nonewindowed Truestartpos = -1):
        
# tlog('GET_CURRENT_FILE')
        
tlog("GET_CURRENT_FILE=" str(item))
        
# super(xbmc.PLAYER_CORE_AUTO).play(item, listitem, windowed, startpos)
        # MyPlayer(xbmc.PLAYER_CORE_AUTO).play(item, listitem, windowed, startpos)
        # self.play(item, listitem, windowed, startpos)
        
super(MyPlayerself).play(itemlistitemwindowedstartpos)
        
# while self.isPlaying():
        #     xbmc.sleep(1000)
    # @classmethod
    # def onQueueNextItem(self):
    #     super(MyPlayer,self).onQueueNextItem()

    
def getPlayingFile(self):
        
tlog("GET_PLAYING_FILE_CALLED")
        return 
super(MyPlayerself).getPlayingFile()

    
def onPlayBackStarted(self):
        
# tlog('ONPLAYBACKSTARTED')
        # print("ONPLAYBACKSTARTED")
        
tlog('START PLAYED FILE=' self.getPlayingFile())
        
# super(MyPlayer, self).onPlayBackStarted()
        # super(MyPlayer).onPlayBackStarted()
        # xbmc.Player(xbmc.PLAYER_CORE_AUTO).onPlayBackStarted()

    
def playnext(self):
        
tlog('START NEXT FILE . . .')
        
super(MyPlayerself).playnext() 

I am passing the playlist to play method. and it will automatically plays next video after end the current video.

My question is:
Does it exists method for detecting the playingHuh I want something for check as viewed when the next list item started play. but can't find the solution. on playnext, and onPlayBackStarted functions doesn't call on next file started play.