Leia addon bug - onPlayBackStarted
#1
Hi,

I've got an addon that worked with Krypton and now is broken with Leia Beta 3.  When playback starts, I check to see if it is a video and if so then I run the rest of my code.  Of note is the "isPlayingVideo" check works in other places in the same class (pause/resume).

Was this change intended?



class XBMCPlayer( xbmc.Player ):

    def __init__( self, *args ):
        pass
        
    def onPlayBackStarted(self):
        # Code here is reached
        if self.isPlayingVideo():
            # Code never reaches here - even if it is a video running.
Reply
#2
You need to call in __init__
xbmc.Player.__init__(self)
Reply
#3
Of course. That was merely a snippet for the purposes of describing the problem.
Reply
#4
(2018-10-10, 08:24)damonbrodie Wrote: Of course. That was merely a snippet for the purposes of describing the problem.


Ah. Smile

Could it be a simple delay? What if you add a small sleep before isPlayingVideo(), does it work? Is getPlayingFile() filled?
Reply
#5
I will check that for debugging purposes, but that's a pretty silly hack and I (hope) you're not suggesting this as the fix.
Reply
#6
(2018-10-10, 09:00)angelblue05 Wrote:
(2018-10-10, 08:24)damonbrodie Wrote: Of course. That was merely a snippet for the purposes of describing the problem.


Ah. Smile

Could it be a simple delay? What if you add a small sleep before isPlayingVideo(), does it work? Is getPlayingFile() filled? 
I tried a sleep after entering onPlayBackStarted - no joy it still doesn't  .isPlayingVideo() == true for videos.
Reply
#7
The solution is to use onAVStarted()

https://codedocs.xyz/xbmc/xbmc/group__py...bdaa77aace
Reply
#8
Wow that is so strange because I do call isPlayingVideo and it works in my case, with Leia. Anyway, glad you found another way to get there.
Reply
#9
(2018-10-11, 09:29)angelblue05 Wrote: Wow that is so strange because I do call isPlayingVideo and it works in my case, with Leia. Anyway, glad you found another way to get there.
 I opened (and closed a trouble ticket) and there the devs pointed out that isPlayingVideo inside of onPlayBackStarted is not guaranteed.  See:

https://codedocs.xyz/xbmc/xbmc/group__py...5fa963b266

"Video or audio might not be available at this point."

So it may or may not continue working in the future for you.  As of Leia, the recommendation is to switch to the new onAVStarted.
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Leia addon bug - onPlayBackStarted00