JSON and Player info

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
DKreeK Offline
Junior Member
Posts: 21
Joined: Jan 2010
Reputation: 0
Post: #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.
find quote
Montellese Online
Team-XBMC Developer
Posts: 3,682
Joined: Jan 2009
Reputation: 34
Location: Switzerland
Post: #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 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
DKreeK Offline
Junior Member
Posts: 21
Joined: Jan 2010
Reputation: 0
Post: #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 ?
find quote
Montellese Online
Team-XBMC Developer
Posts: 3,682
Joined: Jan 2009
Reputation: 34
Location: Switzerland
Post: #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 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
realjobe Offline
Posting Freak
Posts: 1,022
Joined: Sep 2004
Reputation: 0
Post: #5
Linking this to mine aswell. http://forum.xbmc.org/showthread.php?tid=125631
find quote