JSON and Player info
#1
Hi,

I would like to retrieve informations about the movie or TV show currently play in XBMC :
- Episode or movie name
- Thumb
- Duration
- And current position

It's possible with JSON-RPC ? And if yes, how ?

Thank's in advance.
Reply
#2
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).
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
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 ?
Reply
#4
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.
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
#5
Linking this to mine aswell. http://forum.xbmc.org/showthread.php?tid=125631
Reply

Logout Mark Read Team Forum Stats Members Help
JSON and Player info0