Thread Rating:
  • 1 Vote(s) - 5 Average
Using JSON-RPC ...
#1
Hi,

Just having issues JSON-RPC with the Eden Nightlies, so I wanted to list out a couple of examples.

1) Retrieve Information from XBMC with a Command

{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": 1 }

2) Retrieve Information from XBMC with a Command and a Parameter

{ "jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": { "properties": [ "playcount" ] }, "id": 1 }

3) Retrieve Information from XBMC with a Command and more than 1 Parameter

{ "jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": { "properties": [ "playcount", "year" ] }, "id": 1 }

So, those all work, but the one I'm currently having issue with is ...

Player.GetItem

USING: { "jsonrpc": "2.0", "method": "Player.GetItem", "params": { "playerid": 1 }, "id": 1 }
or
USING: { "jsonrpc": "2.0", "method": "Player.GetItem", "params": { "playerid": 1, "properties": ["title"] }, "id": 1 }

ERROR: {"error":{"code":-32100,"message":"Failed to execute method."},"id":1,"jsonrpc":"2.0"}

Any ideas what the appropriate call is for Player.GetItem ?
Reply
#2
You first need to call Player.GetActivePlayers to see which player is active and then use the "playerid" you got from that response to call Player.GetItem. Player.GetItem (and all the other Player methods) will return "Failed to execute method" if you pass a playerid to a player which is not active.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
Ah cool ... thanks for that. I did have something playing initially when I started testing, but it had obviously stopped and I thought if it was stopped it would bring back 0 or Nothing Playing as it's status. So, good to know.

Thanks for pointing me in the right direction.
Reply
#4
Thank you aswell. I've also been working with this new-world.
http://forum.xbmc.org/showthread.php?tid=125631
Smile
Reply



Using JSON-RPC ...51