v18 Solved: xbmc.player.play(windowed=True) fails to play in an xbmgui.Window
#1
In my screensaver script I am experimenting with using a windowed player in the hope that I will get more control over the actions, etc. Anyway, I start playing a curtain open sequence in plain python code, which works fine. But as soon as control switches to a WindowDialog (or Window) the curtain sequence stops and any further playing stalls. The logs appear to indicate that the buffers never fill. I have also seen an exception being eventually thrown.

Is this supposed to work? Does my use of a windowed player make sense? In my addon I want to handle ShowInfo and other actions myself since the behavior is a bit different than when playing a movie. I have made a good start on a kludged work around using a non-windowed player, but it would make things a lot easier if I had full control.

I'll do more research and collect logs, etc. if what I'm trying to do should work.

Thanks

Frank
Reply
#2
Further testing shows that if I have a WindowXML with a dynamically created TitleControl and run xbmc.Player().play() from within this window, then:
1) the player is invisible, it is apparently behind the window with black background
2) the player stutters audio on occasion
3) if you drag your mouse over the window you will see lots of artifacts (giant cursors) that are not removed.
4) You will see the "seeking" OSD show up on occasion and then disappear.
The CPU consumption appears a bit higher than normal (~10% of one cpu) but not bad

I did make the mistake of trying to add the same control twice to the window. The log complained about adding a  duplicate control when there was a modal dialog, although I was using a simple window. Perhaps the video player was modal, even though it was not displayed on top. Then the CPU was 100% and the stuttering a bit worse. Perhaps something like this was responsible for some earlier crashes.

If I use my remote to send action "FullScreen" then all is okay. But if I do this programatically in python, I see that the window state seems very unstable, with onInit, __init__ being called multiple times as well as other odd behavior. I don't see any of this with using Player.play(windowed=False).
Reply
#3
Code?
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#4
I finally have this figured out. The root cause was not realizing that you have to use a "videowindow" control type which can only be done via an xml file (not python). I am now able to play as I expect using a  xbmcgui.WindowXMLDialog which loads the videowindow control from an xml.

While I am happy to see that at least some ACTIONS (like showInfo) are ignored by kodi, not all are. More testing is required. I am hopeful that it will be easier to intercept the actions for this windowed video than for the normal one.  I haven't yet been able to find any windowId/name that corresponds to a videowindow, perhaps there isn't one, and it may not matter.
Reply

Logout Mark Read Team Forum Stats Members Help
Solved: xbmc.player.play(windowed=True) fails to play in an xbmgui.Window0