(2013-02-20, 16:16)gechu Wrote: Great work!
I use the XBMC plugin in Eventghost to control XBMC. When I press a key, like "OK", that keypress is sent to the XBMC window - and not the wrapped browser window. If I only could know when the ViaplayLauncher is started, I could make Eventghost change the configurations of my remote into the ones you´ve built support for.
It is possible to subscribe to XBMC event broadcasts in EventGhost, so one way for me to know when the browser is started, and closed, would be if your addon published events at launch and exit of ViaPlayLauncher. Have a look at this page: http://wiki.xbmc.org/index.php?title=JSO....NotifyAll
What do you think about it? Is it doable?
/Erik
According to the API reference (that you linked to) I should be able to do a NotifyAll broadcast when starting the viaplaylauncher and then calling the same when closing the launcher.
I've not tested the code yet, and to be honest I'm not really sure how to...
But in terms of code I think the following should work:
xbmcexecute.JSONRPC('{"jsonrpc": "6.0", "method": "JSONRPC.NotifyAll", "Sender": "Viaplay","Message":"Starting Viaplaylauncher"}')
xbmcexecute.JSONRPC('{"jsonrpc": "6.0", "method": "JSONRPC.NotifyAll", "Sender": "Viaplay","Message":"Closing Viaplaylauncher"}')
When starting the viaplaylauncher a NotifyAll is called with sender "Viaplay" and message "Starting Viaplaylauncher" and when the launcher is closed
a new NotifyAll is called with sender "Viaplay" and message "Closing Viaplaylauncher".
I'll try and put this in the addon and test it, or at least make sure that the code is not producing any script errors...