2013-11-30, 01:37
Hello
How can I determine in a python addon whether the user wants to play a movie / wants to start the Player? The onPlayBackStarted(...) method is called too late and the onQueueNextItem(...) method does not work for me unfortunately...
I tried it like in this example:
Dont know why but the method was not called when I put something in the queue?! Is something wrong with the code or is it a bug in 12.2?
I would need something like a onBeforePlay method or better a method to catch and discard the play-command if a (library) item is selected... It should also work if the mediasource is not available...
Do you have any ideas?
Thanks in advance
4
EDIT:
I have found now that the "onQueueNextItem" method is only called a few seconds before a Playlistitem is changed. Not when the Playlist is getting a new Item... Sorry... My mistake
Would something like a "onBeforePlay"- or "onLibraryItemSelectedToPlay"-method be a new candidate for a feture request for the xbmc.player-class?
Would it be possible to integrate this into XBMC?
Regards
4
How can I determine in a python addon whether the user wants to play a movie / wants to start the Player? The onPlayBackStarted(...) method is called too late and the onQueueNextItem(...) method does not work for me unfortunately...
I tried it like in this example:
Code:
import xbmc
import xbmcaddon
addon = xbmcaddon.Addon()
class test(xbmc.Player):
def onQueueNextItem(self):
xbmc.log(msg='Queue NextItem')
xbmc.executebuiltin('Notification(Queue, NextItem)')
t = test()
while (not xbmc.abortRequested) and (addon.getSetting('service_enabled') == 'true'):
xbmc.sleep(200)
del t
Dont know why but the method was not called when I put something in the queue?! Is something wrong with the code or is it a bug in 12.2?
I would need something like a onBeforePlay method or better a method to catch and discard the play-command if a (library) item is selected... It should also work if the mediasource is not available...
Do you have any ideas?
Thanks in advance
4
EDIT:
I have found now that the "onQueueNextItem" method is only called a few seconds before a Playlistitem is changed. Not when the Playlist is getting a new Item... Sorry... My mistake
Would something like a "onBeforePlay"- or "onLibraryItemSelectedToPlay"-method be a new candidate for a feture request for the xbmc.player-class?
Would it be possible to integrate this into XBMC?
Regards
4