Using JSON-RPC ...

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
sikosis Offline
Junior Member
Posts: 12
Joined: Sep 2011
Reputation: 0
Post: #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 ?
find quote
Montellese Offline
Team-XBMC Developer
Posts: 3,715
Joined: Jan 2009
Reputation: 34
Location: Switzerland
Post: #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 XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]
find quote
sikosis Offline
Junior Member
Posts: 12
Joined: Sep 2011
Reputation: 0
Post: #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.
find quote
realjobe Offline
Posting Freak
Posts: 1,022
Joined: Sep 2004
Reputation: 0
Post: #4
Thank you aswell. I've also been working with this new-world.
http://forum.xbmc.org/showthread.php?tid=125631
Smile
find quote