2014-07-14, 21:39
Hey guys,
first of all I am pretty new to xbmc plugin development, and tried to figure it out myself and I used search function but I couldn't find a proper solution.
I am working on plugin and we are actually working on a sexy skin for our plugin. We are facing just one issue with some List control functions after playing a videostream.
//edit: need to say, that we do this with WindowXMLDialog. I included the definition of the class:
Here is my player class:
This is how we call the player:
Everything works fine, the videos are played and after they are finished or playback is stopped I see my window again and I see the list controls are filled with items.
However if a listitem is selected to start another video I get an error cause getSelectedItem() returns NONE.
Here is an example of such an error:
How does this come? What would be the proper way to close the window to bring it in the background, so the player is in foreground?
Thanks for all your support!
-- BaumSchorle
first of all I am pretty new to xbmc plugin development, and tried to figure it out myself and I used search function but I couldn't find a proper solution.
I am working on plugin and we are actually working on a sexy skin for our plugin. We are facing just one issue with some List control functions after playing a videostream.
//edit: need to say, that we do this with WindowXMLDialog. I included the definition of the class:
PHP Code:
class GamepassGUI(xbmcgui.WindowXMLDialog):
season_list = ''
weeks_list = ''
games_list = ''
selectedSeason = ''
selectedWeek = ''
main_selection = ''
def __init__(self, *args, **kwargs):
xbmcgui.WindowXMLDialog.__init__(self)
self.action_previous_menu = (9, 10, 92, 216, 247, 257, 275, 61467, 61448)
def onInit(self):
self.window = xbmcgui.Window(xbmcgui.getCurrentWindowDialogId())
self.season_list = self.window.getControl(210)
self.weeks_list = self.window.getControl(220)
self.games_list = self.window.getControl(230)
self.setFocus(self.window.getControl(100))
Here is my player class:
PHP Code:
class myPlayer(xbmc.Player):
def __init__(self, parent, *args, **kwargs):
xbmc.Player.__init__(self)
self.dawindow = parent
def onPlayBackStarted(self):
self.dawindow.close()
def onPlayBackStopped(self):
self.onPlayBackEnded()
def onPlayBackEnded(self):
self.dawindow.doModal()
This is how we call the player:
PHP Code:
def playUrl(self, url):
player = myPlayer(parent=window)
player.play(url)
while player.isPlaying():
xbmc.sleep(2000)
Everything works fine, the videos are played and after they are finished or playback is stopped I see my window again and I see the list controls are filled with items.
However if a listitem is selected to start another video I get an error cause getSelectedItem() returns NONE.
Here is an example of such an error:
PHP Code:
if self.main_selection == 'GP' and self.games_list.getSelectedItem().getProperty('isPlayable') == 'true':
AttributeError: 'NoneType' object has no attribute 'getProperty'
How does this come? What would be the proper way to close the window to bring it in the background, so the player is in foreground?
Thanks for all your support!
-- BaumSchorle