Posts: 7
Joined: Jul 2011
Reputation:
0
2011-07-22, 11:27
Hi!
I am developing an Interface based on JSON-RPC. For the "Now playing" screen I use the playlist.getItems method to get the playlist and its current field to find out which is currently playing.
BUT:
If I remove the item, that is currently playing from the playlist (Playlist.Remove) the song keeps playing in XBMC (which ist ok). But now, the "current" field of the playlist.getItems method is not pointing so the current song since that song is not in the playlist anymore.
Is there any way to get the now playing song if the song is not in the playlist?
Thanks for your help!
Posts: 7
Joined: Jul 2011
Reputation:
0
I am using AudioPlaylist.GetItems.
also, if I have a Playlist that looks like this:
Song1
Song2
Song3
Song4
Lets assume that Song3 is currently playing. If I query AudioPlaylist.GetItems the current field is 2, which is correct.
If I remove Song1 from the playlist and requery getitems the current field is still 2, wich is wrong now, since Song3 is now on position 1.
It seems like the current field is only updated when the next song is played and not when the playlist is modified...??
Posts: 4,549
Joined: Dec 2007
Reputation:
17
topfs2
Team-Kodi Developer
Posts: 4,549
If you get no response it sounds like the webserver isn't active or that you have a wrong location to post to.
Would appreciate full debug logs.
If you have problems please read
this before posting
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.
"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Posts: 444
Joined: Apr 2011
Reputation:
3
Background: I'm about to try adding support for scrobbling of streaming items using TraktUtilities and I have been checking what is required, I got ABC iView (I'm in Australia) to stream correctly, and the plugin that provides it has all the info, like title, season, episode, etc. and this is also present in the info screen when the video is being played. At my end TraktUtilities expects the 'data' part of the onPlay json notification to contain relevant data.
When I play a normal episode from my library I get the following json message
{"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"id":2459,"speed":1,"type":"episode"},"sender":"xbmc"}}
But when a streamed video is played as follows:
listitem=xbmcgui.ListItem(label=p.get_list_title(), iconImage=p.thumbnail, thumbnailImage=p.thumbnail)
listitem.setInfo('video', p.get_xbmc_list_item())
xbmc.Player().play(rtmp_url, listitem)
It is important to note that get_xbmc_list_item() provides all of the required info, like title, season, episode, etc.
The json message that results is as follows:
{"jsonrpc":"2.0","method":"Player.OnStop","params":{"data":null,"sender":"xbmc"}}
This on has 'data' set to null
What I want to know is, is it possible for the data passed to xbmc using the listitem to be passed on through the onplay message.
I would think this would make the data useful for most of the streamed data that is played in this way.