Bug player.onPlayBackStarted not firing for ext player
#1
Tested on Gotham RC1 on windows7 x64:
Using Python API
Code:
import xbmc

class CapturePlayer(xbmc.Player):

    def __init__(self, *args):
        xbmc.Player.__init__(self)

    def onPlayBackStarted(self):
        xbmc.log("##### TEST - playback started", level=xbmc.LOGNOTICE)

    def onPlayBackEnded(self):
        xbmc.log("##### TEST - playback ended", level=xbmc.LOGNOTICE)

    def onPlayBackStopped(self):
        xbmc.log("##### TEST - playback stopped", level=xbmc.LOGNOTICE)


def main():

    player = CapturePlayer()
    while not xbmc.abortRequested:
        xbmc.sleep(500)
    del player

main()

To reproduce:
Configure an external player in playercorefactory.xml. For example:
Code:
<player name="MPC-HC" type="ExternalPlayer" audio="false" video="true">
     <filename>C:\Program Files\MPC-HC\mpc-hc.exe</filename>
     <args>"{1}" /fullscreen /play /close</args>
     <hidexbmc>false</hidexbmc>
     <hideconsole>false</hideconsole>
     <warpcursor>topright</warpcursor>
</player>
Then start a video using the context menu -> 'Play using...'
If the native DVDPlayer is chosen, onPlayBackStarted event fires and event written to log.
If an external Player is chosen (i.e. MPC-HC) onPlayBackStarted event is not fired.
However, for both, either the onPlayBackEnded or the onPlayBackStopped event fires.

Will post to trac.xbmc.org if confirmed or if no one comments, will post tomorrow.
Reply
#2
In addition, while playing from an external player, player.isPlayingVideo() remains false so one cannot poll for that instead...

Edit: This isn't true...
For an example how to get around this bug for the time being, see here:
https://github.com/KenV99/script.testkv/...default.py
Reply
#3
Submitted to trac.xbmc.org: http://trac.xbmc.org/ticket/15279
Reply
#4
This was fixed and merged: 4855 (PR)
But won't be available until the next release after 13.1
Reply
#5
Good job bro !

Thanks for the help.

http://forum.xbmc.org/showthread.php?tid=196483
Reply

Logout Mark Read Team Forum Stats Members Help
player.onPlayBackStarted not firing for ext player0