Python jsonrpc add track to playlist from file
#1
Hi

in my addon I want to add an a dummy track to the audio playlist (and set the mode to repeat) as a workaround for the fact that xbmc addon windows don't fully absorb events and pass them on to the underlying player. This means my add on (which controls an external audio player) - raises annoying 'Playlist can't find next item to play' messages - I'd rather I add a dummy track with my add on name 'Xsqueeze Now Playing.mp3' and put the playlist to repeat so that it gives a better message/no message.

So, in short, I need to, in Python - add a track to the music playlist, and set the playlist to repeat.

I am at this but it doesn't parse:

Code:
result = xbmc.executeJSONRPC('{ "jsonrpc": "2.0", "method": "Playlist.Add", "id": 1, "params": {"Playlist.Item": "' + constants.DUMMYAUDIO + '"}}')
where constants.DUMMYAUDIO is the xbmc translated path to the file...

I think I am close...any ideas?

And on the second front - can the playlist be programmatically be set to repeat?

I guess I need to clear it first as well, thinking about it - and maybe clear it on exit as well.

Help appreciated - the jsonrpc docks are not replete with examples!!
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply


Messages In This Thread
Python jsonrpc add track to playlist from file - by bossanova808 - 2012-02-19, 08:52
[No subject] - by Mizaki - 2012-02-19, 12:58
[No subject] - by bossanova808 - 2012-02-19, 13:56
[No subject] - by Mizaki - 2012-02-19, 14:07
[No subject] - by bossanova808 - 2012-02-19, 15:42
[No subject] - by Mizaki - 2012-02-19, 16:59
[No subject] - by giftie - 2012-02-19, 19:14
[No subject] - by bossanova808 - 2012-02-20, 03:18
[No subject] - by bossanova808 - 2012-02-20, 04:15
[No subject] - by bossanova808 - 2012-02-20, 04:17
[No subject] - by bossanova808 - 2012-02-20, 04:35
[No subject] - by bossanova808 - 2012-02-20, 04:54
Logout Mark Read Team Forum Stats Members Help
Python jsonrpc add track to playlist from file0