Page 60 of 94
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Tue Dec 31, 2013 6:38 pm
by jonib
leothlon wrote:When i try to run activate window in the experimental json action I get error:
XBMC2: JSONRPC: GUI.ActivateWindow
Error:
{
"code": -32600,
"message": "Invalid request."
}
Without knowing what parameters you are using it's impossible for me to help you.
jonib
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Wed Jan 01, 2014 11:51 am
by leothlon
maby i understood the whole json-rpc wrong,
i go into json-rpc action, select gui namespace and activatewindow method, then in the field below i type the window id i want to open right? (10502 in this case).
More exactly what i want to do is:
ActivateWindow(10502, "musicdb://3/spotify:playlist:15/",return)
got that function from adding the playlist i want to open to xbmc homescreen then editing it.
so i know the function works, i just need to figure out how to send it to xbmc.
alternativly is there anyway to start playing the playlist with another json command?
i know you can do command to start a normal playlist but seeng as this one dont have any actuall playlist file i am not sure how or even if its possible?
what i want to do is on my smarthome controll webpage to add 2 buttons first is: play calm relaxing playlist. second is: play playlist with rock.
so if there is a way to start playing "musicdb://3/spotify:playlist:15/" directly from a json function that would be great, otherwise i guess i could make a macro that first do "ActivateWindow(10502, "musicdb://3/spotify:playlist:15/",return)" to open the playlist then an action to start playing.
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Thu Jan 02, 2014 7:24 pm
by pavel.kuzub
Hello jonib,
First, I want to Thank you for your time and efforts spending on XBMC2 plugin
Second, this is to report that experimental function to get currently playing file does not work under XBMC 13 Gotham Alpha10 (at least)
I have used a brutal way (below) to detect the filename in Gotham. Would be great if detection is enhanced in XBMC2 plugin. Thank you
Code: Select all
# Get currently playing movie file
responce = eg.plugins.XBMC2.plugin.JSON_RPC.send('Player.GetItem', json.loads('{"playerid": 1, "properties": ["file"] }'))
if responce.has_key('result'):
file = responce['result']['item']['file']
print 'File:',file
else:
print "Current File NOT detected"
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Tue Jan 07, 2014 11:44 am
by kasph
Hi jonib
Great plugin!
I was wondering if you can make events when playing airplay content? As of now i just writes player.onplay.unknown
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Tue Jan 07, 2014 9:29 pm
by jonib
kasph wrote:Great plugin!
Thanks
I was wondering if you can make events when playing airplay content? As of now i just writes player.onplay.unknown
I don't know anything about airplay in XBMC, but if you are getting an event, activate the "Log raw events" in XBMC2 settings and post the raw event(s) and I'll see if they can be made more useful.
jonib
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Tue Jan 07, 2014 9:34 pm
by jonib
pavel.kuzub wrote:First, I want to Thank you for your time and efforts spending on XBMC2 plugin
Thanks and sorry for the late reply.
Second, this is to report that experimental function to get currently playing file does not work under XBMC 13 Gotham Alpha10 (at least)
I have used a brutal way (below) to detect the filename in Gotham. Would be great if detection is enhanced in XBMC2 plugin. Thank you
I think it's been broken for a while, I'll see if I can fix it or maybe find another solution.
jonib
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Tue Jan 07, 2014 9:40 pm
by jonib
Sorry for the late reply.
leothlon wrote:maby i understood the whole json-rpc wrong,
i go into json-rpc action, select gui namespace and activatewindow method, then in the field below i type the window id i want to open right? (10502 in this case).
Unfortunately it's not as simple in JSON-RPC, the syntax is different in JSON-RPC, you better ask in
XBMC JSON-RPC forum what the same command would be in JSON-RPC then it would be easy to use in the XBMC2 plugin.
jonib
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Tue Jan 07, 2014 11:15 pm
by Kartix
xbmc is my main use with eventghost and it works perfectly.
Excellent plugin.
I see you started working on the plugin in 2009 and still keeping supporting it. Impressive dedication.
Thanks for all your hard work, jonib. Much appreciated.
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Wed Jan 08, 2014 1:47 pm
by kasph
jonib wrote:kasph wrote:Great plugin!
Thanks
I was wondering if you can make events when playing airplay content? As of now i just writes player.onplay.unknown
I don't know anything about airplay in XBMC, but if you are getting an event, activate the "Log raw events" in XBMC2 settings and post the raw event(s) and I'll see if they can be made more useful.
jonib
I'm really just wanting a player.onplay.airplay and player.onstop.airplay (if it is possible of course), as this would separate the events from all other random sound/video in XBMC.
Hoping this is what you where seeking:
XBMC2: Raw event: '{"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"item":{"type":"unknown"},"player":{"playerid":-1,"speed":1}},"sender":"xbmc"}}'
Raw event: {u'params': {u'data': {u'item': {u'type': u'unknown'}, u'player': {u'playerid': -1, u'speed': 1}}, u'sender': u'xbmc'}, u'jsonrpc': u'2.0', u'method': u'Player.OnPlay'}
XBMC2: Raw event: '{"jsonrpc":"2.0","method":"Player.OnStop","params":{"data":{"end":false,"item":{"type":"unknown"}},"sender":"xbmc"}}'
Raw event: {u'params': {u'data': {u'item': {u'type': u'unknown'}, u'end': False}, u'sender': u'xbmc'}, u'jsonrpc': u'2.0', u'method': u'Player.OnStop'}
Thanks
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Wed Jan 08, 2014 1:56 pm
by jonib
kasph wrote:I'm really just wanting a player.onplay.airplay and player.onstop.airplay (if it is possible of course), as this would separate the events from all other random sound/video in XBMC.
Unfortunately XBMC don't seem to send any airplay specific data, so I can't do anything sorry. You need to ask in the
XBMC forum if there is a way to get airplay specific events or maybe you need to make a feature request to add it.
jonib
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Wed Jan 08, 2014 2:00 pm
by kasph
Yeah that's what i thought. Too bad. Thanks for checking anyway
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Fri Jan 10, 2014 5:13 am
by spencerthomass
First off, thanks for this plugin. I appreciate your hard work. I have a question, Is there a way to perform an action in eventghost when a certain movie is played? I have some 3d movies and I would love to have the projector automatically switch to the correct 3d format depending on which movie is played. In the log of eventghost it does say which movie is started but I cannot assign a specific action to that event. Only to a generic play action. when I play a movie I see, XBMC2.Player.OnPlay.movie {u'item': {u'id': 8}, u'player': {u'playerid': 1, u'speed': 1}}. When I drag that action over I get, XBMC2.Player.OnPlay.movie. Even if I try to change it it doesnt work. It will work if I leave as a generic onplay.movie but not when I try to do an action to a specific movie played. Any ideas? Thanks in advance.
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Fri Jan 10, 2014 12:56 pm
by jonib
spencerthomass wrote:First off, thanks for this plugin. I appreciate your hard work.
I have a question, Is there a way to perform an action in eventghost when a certain movie is played?
Off course.
I have some 3d movies and I would love to have the projector automatically switch to the correct 3d format depending on which movie is played. In the log of eventghost it does say which movie is started but I cannot assign a specific action to that event. Only to a generic play action. when I play a movie I see, XBMC2.Player.OnPlay.movie {u'item': {u'id': 8}, u'player': {u'playerid': 1, u'speed': 1}}. When I drag that action over I get, XBMC2.Player.OnPlay.movie. Even if I try to change it it doesnt work. It will work if I leave as a generic onplay.movie but not when I try to do an action to a specific movie played. Any ideas? Thanks in advance.
When you get the "OnPlay.movie" event you need to have a Python script extract from the events payload the movie info and then determine what to do. The event only has the movieid so you need to use an JSON-RPC command to get more information about the movie.
I don't know what kind of 3D info XBMC has so I will have to look into it. I'll try to make an example script for you later.
jonib
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Tue Jan 14, 2014 7:57 pm
by leothlon
if i take json-rpc under experimental, set it to player - open
then i type " [{"file":"musicdb://3/spotify:playlist:1/"}] " in the field. any idea why that dont work?
in eg it gives events:
xbmc2.playlist.onclear{u'playlistid':0}
xbmc2.player.onstop.unknown[u'end':False}
Also is it possible to get ├Ñ├ñ├ in payload for xbmc2.onplay.music event?
Its in the title sometimes for my swedish music

Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Wed Jan 15, 2014 5:58 pm
by leothlon
i also need help parsing some events...
XBMC2.Player.OnPlay.song {u'item': {u'album': u'The Storm', u'track': 4, u'title': u'Young Dad', u'artist': [u'HOFFMAESTRO']}, u'playlistid': 0, u'position': 3}
XBMC2.Player.OnPlay.song {u'item': {u'album': u'Worlds Collide', u'track': 7, u'title': u"I Don't Care", u'artist': [u'Apocalyptica']}, u'player': {u'playerid': 0, u'speed': 1}}
XBMC2.Player.OnPlay.song {u'item': {u'album': u'N\xe4\xe4\xe4k Vem?', u'track': 2, u'title': u'Lyckas Alltid (feat. Alpis & Mackish Price)', u'artist': [u'N\xe4\xe4\xe4k']}, u'playlistid': 0, u'position': 1}
The entire thing seems to be in 1 payload?
so i cant do payload[3] for example.
i first did split on " ' " but i see now that some titles have " around them rather than ', so that dont work.
also how as you see on the last one it gives \xe4 rather than ä.. how can i fix this?