JSON and Player info - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Development (/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (/forumdisplay.php?fid=174)
+---- Thread: JSON and Player info (/showthread.php?tid=110471)
JSON and Player info - DKreeK - 2011-09-19 11:26
I would like to retrieve informations about the movie or TV show currently play in XBMC :
- Episode or movie name
- And current position
It's possible with JSON-RPC ? And if yes, how ?
Thank's in advance.
- Montellese - 2011-09-19 15:12
What version of XBMC are you using? If you use the very latest nightly build (from today) you must first call Player.GetActivePlayers, retrieve the playerid of the currently playing item and then call Player.GetProperties to retrieve the "playlistid" and the "position". Then you can call Playlist.GetItems to retrieve all items of that playlist and retrieve the current item using the value of "position". Using the "fields" parameter you can define the details you would like to retrieve like "title", "thumbnail" and "runtime" in your case.
We will consider adding a "currentitem" property to Player.GetProperties but we couldn't decide yet what information to provide (just the database ID's or additional detail).
- DKreeK - 2011-09-19 16:28
I use the last stable version of XBMC. But if the version of the API change, I could manage different call with this number. So, I don't have the last nightly build what function I need to call ?
- Montellese - 2011-09-19 17:02
IIRC you need to call Player.GetActivePlayers to get the type of the player that is currently running. Then you need to call either VideoPlaylist.GetItems or AudioPlaylist.GetItems (depending on the type of player Player.GetActivePlayers returned). GetItems returns a list of items and a "current" value indicating the index of the currently playing item in the returned list of items. GetItems also takes the "fields" parameter to define what kind of information you would like.
RE: JSON and Player info - realjobe - 2012-04-11 11:19
Linking this to mine aswell. http://forum.xbmc.org/showthread.php?tid=125631