I have a create a small test script, where I want the following functionality:
1) When the script launches, start xbmc.player with a streamed TV channel
2) Leave the video playing in the background, and continue with starting a small python script to do some action based on key pressed
This is my small script:
Quote:import xbmc, xbmcgui
#get actioncodes from keymap.xml
ACTION_PREVIOUS_MENU = 10
ACTION_SELECT_ITEM = 7
def onAction(self, action):
if action == ACTION_PREVIOUS_MENU:
if action == ACTION_SELECT_ITEM:
self.strAction = xbmcgui.ControlLabel(300, 200, 200, 200, "", "font14", "0xFF00FF00")
mydisplay = MyClass()
When I run this script I get a black screen, and the audio from the TV playing. My script is running, because I see a "Hello world" when I press the select button.
When I press the menu button, the video (streamed TV) will appear, but my own code is no longer running. (Pressing the select key will show mplayer info.).
Pressing the stop key stops the video playback, and return to the scripts menu page.
I have tried to start the xbmc.player in different ways, with the the command "xbmc.executescript('q:\\scripts\\showtv.py')", but then I only see the video, and my code is not running.
Pressing the stop key now, will start my code, and I can press the select key again to see the "Hello world" message.
Any ideas on how to have the video running in the background, and my code handle the keys pressed action, and display something on the screen ?