Solved isPlayingVideo not working in v18?
#1
Hello guys,

I noticed one my addon broke in v18 alpha 3. It is using XBMCPlayer class to react when something is played (this works) and then isPlayingVideo to see if what being played is audio or video. i.e. But it just doesn't work. It always returns FALSE. When I run it several times, eventualy it catches up and returns TRUE, but most of the time it deosn't work. As if there is a delay in setting it after I get onPlayBackStarted. It worked fine in v16 and v17.

Any clues?
Thanx!
D.
 
Quote:    player = XBMCPlayer()

class XBMCPlayer(xbmc.Player):
    def __init__(self):
        xbmc.Player.__init__(self)

    def onPlayBackStarted(self):
        if self.isPlayingVideo():
            isVideo = True
        else:
            isVideo = False
Reply
#2
Have you tried to use onAvStarted (https://codedocs.xyz/xbmc/xbmc/group__py...bdaa77aace) ?
If I understand this correctly, onPlaybackStarted is not exactly what we, addon devs, though it was. OnPlaybackStarted means the player was created but it doesn't have yet any stream. OnAvStarted will be triggered when the player actually started the playback. OnAVChanged will be triggered when it gets a stream (either video or audio)

PS: You don't need to explicitly call the the player initializer
Reply
#3
onPlaybackStarted works fine, but when I want to check if it is a video with isPlayingVideo it doesn't work...

Just tried onAvStarted and it behaves much much better... Smile
Reply
#4
Likely because when the event is triggered there is no stream in the player...
Try onAVStarted, all this was reworked for v18.

Saw you edit the post. Marking as solved.
Reply

Logout Mark Read Team Forum Stats Members Help
isPlayingVideo not working in v18?0