Kodi Community Forum
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174)
+---- Thread: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263)



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-01-07

Input.SendText only works for text input into edit controls / virtual keyboard, it doesn't work anywhere else.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Millencolin007 - 2013-01-07

(2013-01-06, 23:57)Montellese Wrote: This is more of a problem on how or rather when XBMC retrieves the details for an item. When you view it in the GUI, it gets the details directly from the plugin and has it available when you queue it. Through JSON-RPC there's only the filename/stream URL and it doesn't look up the information. IMO there should be some logic to retrieve those details before adding the item to the playlist but I'm not sure if that's even possible with plugins right now (i.e. retrieving details for a single item).

True, the best thing would be if xbmc can resolve the information itself but I think that this is never going to work if you just pass a http url because xbmc cannot associate it to any plugin and has therefore no chance to get the thumbnail. On the other side if you queue a youtube video using a youtube:// url there is already some logic to resolve the thumbnail properly (when adding to the queue thumbnail and label are blank, but when playback starts the proper information is resolved)


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Ayla - 2013-01-07

(2013-01-07, 16:32)Montellese Wrote: Input.SendText only works for text input into edit controls / virtual keyboard, it doesn't work anywhere else.

Thanks for the reply,

So there's no way to send a keypress command with JSON?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - kevinkelm - 2013-01-07

(2013-01-07, 16:23)Ayla Wrote:
(2013-01-07, 00:51)Ayla Wrote:
(2013-01-06, 23:57)Montellese Wrote: I'm not sure I follow. JSON-RPC's Input.* methods do not care about keymaps as they already execute actions (and not keypresses). So when you send Input.Action "left" it will do whatever happens for the "left" action and not for the "left" key.

Can I achieve what I want by sending keypresses for all my commands instead of Input.Action etc., and still use JSON-RPC?

For example, send key "a" to go left (under global in keyboard.xml) and use "a" to rewind (under fullscreenvideo in keyboard.xml)

If so, could you post the command line I need to use to send keypress "a" with JSON?

Thanks again

Montellese; Should I use Input.SendText for this or will it only work for navigation (I see Permissions: Navigation listed)?

I tried this with sendtext but it only seemed to work in text input fields. It wouldn't execute any key presses in menus.



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Ayla - 2013-01-08

(2013-01-07, 21:49)kevinkelm Wrote:
(2013-01-07, 16:23)Ayla Wrote:
(2013-01-07, 00:51)Ayla Wrote: Can I achieve what I want by sending keypresses for all my commands instead of Input.Action etc., and still use JSON-RPC?

For example, send key "a" to go left (under global in keyboard.xml) and use "a" to rewind (under fullscreenvideo in keyboard.xml)

If so, could you post the command line I need to use to send keypress "a" with JSON?

Thanks again

Montellese; Should I use Input.SendText for this or will it only work for navigation (I see Permissions: Navigation listed)?

I tried this with sendtext but it only seemed to work in text input fields. It wouldn't execute any key presses in menus.

OK, I'm not sure what would be the best approach then, if one want's to use both JSON and keymaps (when there's not that many buttons available, the keymaps are really needed)?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - johnsills1 - 2013-01-10

I'm having some trouble controlling music Play/Pause and all of the seek functions and fast forward/rewind controls. They work for movies, but not music. I thought player controls were supposed to work across the board. Can someone give me some insight?

jsonrpc?{"jsonrpc": "2.0", "method": "Player.Stop", "params": { "playerid": 1 }, "id": 1}
jsonrpc?{"jsonrpc": "2.0", "method": "Player.PlayPause", "params": { "playerid": 1 }, "id": 1}

just for example work for movies but not music.....


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-01-10

for music you need to use "playerid": 0 and for slideshow you need to use "playerid": 2. Player.GetActivePlayers will provide you with a list of the currently active (i.e. playing) players with their playerid and what kind of media the player is playing.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - johnsills1 - 2013-01-10

(2013-01-10, 00:33)Montellese Wrote: for music you need to use "playerid": 0 and for slideshow you need to use "playerid": 2. Player.GetActivePlayers will provide you with a list of the currently active (i.e. playing) players with their playerid and what kind of media the player is playing.

Once again you have been a big help Montellese, thanks alot



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - oldmobil - 2013-01-10

Hello,
With a JSON-PRC call possible to start audio CD ripping? I can't find it in wiki pages.
Thanks,


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-01-10

(2013-01-10, 14:03)oldmobil Wrote: Hello,
With a JSON-PRC call possible to start audio CD ripping? I can't find it in wiki pages.
Thanks,

Nope.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2013-01-10

Hi
I am trying to make some tests using the chrome Simple Rest Client (POST)
Quote:Url: http://192.168.0.10:8080
data: jsonrpc?{"jsonrpc":"2.0","method":"Input.Down","id":1}
I get the status 200 ok, but in the xbmc i dont see the action, what am i doing wrong ?
Thanks


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-01-10

(2013-01-10, 14:55)claymic Wrote: Hi
I am trying to make some tests using the chrome Simple Rest Client (POST)
Quote:Url: http://192.168.0.10:8080
data: jsonrpc?{"jsonrpc":"2.0","method":"Input.Down","id":1}
I get the status 200 ok, but in the xbmc i dont see the action, what am i doing wront ?
Thanks

The URL must be (in your case)
Code:
http://192.168.0.10:8080/jsonrpc
and the data must be
Code:
{"jsonrpc":"2.0","method":"Input.Down","id":1}

Furthermore you need to set the following HTTP header field:
Code:
Content-Type: application/json



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Ayla - 2013-01-10

Montellese, will you consider adding some sort of keymap support for JSON?

I use a remote application (iRule) on my iPhone and iPad and there are a limited number of gestures available, so context based commands would be very nice.

Before JSON, I used the HTTP interface and sent keypresses to XBMC, so that I could still use the keymap xml.

Thanks


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2013-01-10

Ok Montellese, very thanks for all your help here, i tested and works.
Clayton
little preview of my app for CommandFusion (tvshow wall)
http://www.youtube.com/watch?v=Zet2q79_PmU


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-01-10

(2013-01-10, 15:02)Ayla Wrote: Montellese, will you consider adding some sort of keymap support for JSON?

I use a remote application (iRule) on my iPhone and iPad and there are a limited number of gestures available, so context based commands would be very nice.

Before JSON, I used the HTTP interface and sent keypresses to XBMC, so that I could still use the keymap xml.

Thanks

I already had it coded up once and submitted a PR containing an Input.SendKey() method but it was "rejected" and suggested to introduce Input.SendText() and that's what I did. I can give it another shot if I have some time.