BUG - player.onPlayBackStarted not firing for ext player

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
KenV99 Offline
Senior Member
Posts: 202
Joined: Nov 2013
Reputation: 6
Post: #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.
(This post was last modified: 2014-06-06 00:10 by KenV99.)
find quote
KenV99 Offline
Senior Member
Posts: 202
Joined: Nov 2013
Reputation: 6
Post: #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
(This post was last modified: 2014-06-07 14:56 by KenV99.)
find quote
KenV99 Offline
Senior Member
Posts: 202
Joined: Nov 2013
Reputation: 6
Post: #3
Submitted to trac.xbmc.org: http://trac.xbmc.org/ticket/15279
find quote
KenV99 Offline
Senior Member
Posts: 202
Joined: Nov 2013
Reputation: 6
Post: #4
This was fixed and merged: https://github.com/xbmc/xbmc/pull/4855
But won't be available until the next release after 13.1
find quote
Ben91 Offline
Member
Posts: 57
Joined: Oct 2011
Reputation: 0
Post: #5
Good job bro !

Thanks for the help.

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