Kodi Community Forum

Full Version: Question Methof of Player?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.