XBMC Community Forum
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - 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-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263)



- sphere - 2011-10-08 22:34

Hi,

is there any way to get the xbmc internal GlobalIdleTime over jsonrpc?
I already tried to get this value via "System.GetProperties", "Application.GetProperties" or "XBMC.GetInfoLabels" but without success. Do I miss something?

In python this is doable via "xbmc.getGlobalIdleTime()".

regards,
sphere


- khargy - 2011-10-09 06:26

Ok, this seems to be the place to ask my JSON-RPC questions...

I'm trying to switch back and forth between a video play list and a slideshow.

I start the video playlist using:

Code:
{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "special://profile/playlists/video/all videos.m3u" } }, "id": 1 }

I start the slide show using:

Code:
{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "path": "smb://HP-MEDIA-SERVER/Photos/Melissa Scans Part 1" } }, "id": 1 }

Sometimes this seems to work ok, although there is a flash of the GUI. But sometimes instead of playing it'll only show the current activity or go back to the home screen or whatever. Is there something I'm doing wrong?

Also it doesn't seem like the video playlist is random, which seems to be the default, what is the syntax to add the random property?


- Montellese - 2011-10-09 10:32

Mizaki Wrote:Am I right in thinking there is no way to retrieve what order an episode is in (DVD, absolute, "normal")? I want to make sure I'm not missing it before I make a feature request.

Thanks.

Correct. AFAIK XBMC only provides the possibility to specify the episode order for tv sources and then passes this information on to the scraper but from there on there is no way to tell what order episodes in a season/show are in. So this is not really a jsonrpc feature as it is not even available in XBMC itself.


- Montellese - 2011-10-09 11:12

sphere Wrote:is there any way to get the xbmc internal GlobalIdleTime over jsonrpc?
I already tried to get this value via "System.GetProperties", "Application.GetProperties" or "XBMC.GetInfoLabels" but without success. Do I miss something?
No there isn't (AFAIK). IIRC there already is a pull request for this but as it is a very XBMC specific feature we haven't decided yet how to make it available through JSONRPC.

khargy Wrote:Ok, this seems to be the place to ask my JSON-RPC questions...

I'm trying to switch back and forth between a video play list and a slideshow.
What do you mean by "switch back and forth"? You can't view a slideshow while watching a video and starting a video "destroys" the slideshow.

khargy Wrote:But sometimes instead of playing it'll only show the current activity or go back to the home screen or whatever.
What do you mean by "current activity"?

khargy Wrote:Is there something I'm doing wrong?
The calls to jsonrpc look correct. I can't test the exact same procedure because I don't have any video playlist files but starting a video using Player.Open and then starting a slideshow using Player.Open doesn't work for me either anymore. The video stops but the slideshow isn't started. Can you please create a bug ticket for this and cc me. Thanks.

khargy Wrote:Also it doesn't seem like the video playlist is random, which seems to be the default, what is the syntax to add the random property?
Yeah Player.Open doesn't provide the possibility to specify a "random" parameter for the videos or music, only for slideshows. And by default random is disabled for videos because I normally prefer to watch my tv episodes in the right order and not in a random order Wink But you can call "Player.Shuffle" after you started the video playlist to randomize the playlist.


- khargy - 2011-10-09 15:18

Montellese Wrote:What do you mean by "switch back and forth"? You can't view a slideshow while watching a video and starting a video "destroys" the slideshow.

No not at the same time, so I have a bunch of home movies and a bunch of photos. I want to play the movies for like 10 minutes then play the photos for 10 minutes and keep going back and forth. Since they will be on random order you'll see different stuff for the most part each time. (This will on the tv at my wedding!)


Montellese Wrote:What do you mean by "current activity"?

So lets say I started the first play.open (playlist) when I was on the weather screen. When I do the 2nd one (slideshow), I'm back on the weather screen basically as if I stopped the player. if I run the slideshow play.open a 2nd time in a row and it'll start.


Montellese Wrote:Yeah Player.Open doesn't provide the possibility to specify a "random" parameter for the videos or music, only for slideshows. And by default random is disabled for videos because I normally prefer to watch my tv episodes in the right order and not in a random order Wink But you can call "Player.Shuffle" after you started the video playlist to randomize the playlist.

So after I called player.open for the video playlist I called:

Code:
{"jsonrpc": "2.0", "method": "Player.Shuffle", "params": [1], "id": 1}

I get an "ok" result but when I go to the next item it's still in order.


- khargy - 2011-10-09 16:37

Ok, so this is interesting... sometimes when I called my video playlist I would use "path" and sometimes I would use "file", so:

Code:
{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "path": "special://profile/playlists/video/all videos.m3u"  } }, "id": 1 }

Code:
{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "special://profile/playlists/video/all videos.m3u"  } }, "id": 1 }

if I use "file" it plays the video in order, but if I use "path" it plays them randomly... but with "path" it seems to be playing them in player ID 2 which, if I understand things correctly is the picture player.

Although I'm still getting the issue where on the 2nd play it'll get stuck on the GUI - sometimes it'll say "loading" forever, but if I just send the play.open command again it'll go.


- Montellese - 2011-10-09 16:43

khargy Wrote:So after I called player.open for the video playlist I called:

Code:
{"jsonrpc": "2.0", "method": "Player.Shuffle", "params": [1], "id": 1}

I get an "ok" result but when I go to the next item it's still in order.
I'll have to investigate this later. I only tried it with playlist I created within XBMC (using the "Queue" option from the context menu) and there it worked fine.

khargy Wrote:Ok, so this is interesting... sometimes when I called my video playlist I would use "path" and sometimes I would use "file", so:

Code:
{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "path": "special://profile/playlists/video/all videos.m3u"  } }, "id": 1 }

Code:
{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "special://profile/playlists/video/all videos.m3u"  } }, "id": 1 }

if I use "file" it plays the video in order, but if I use "path" it plays them randomly... but with "path" it seems to be playing them in player ID 2 which, if I understand things correctly is the picture player.

Although I'm still getting the issue where on the 2nd play it'll get stuck on the GUI - sometimes it'll say "loading" forever, but if I just send the play.open command again it'll go.

Yeah the "path" parameter is meant for slideshows only whereas the "file" parameter can take any kind of media (but not a directory full of media files in which case you should use the "directory" parameter instead of the "file" parameter).


- grywnn - 2011-10-10 16:40

Just noticed that Files.getSources no longer returns a file/directory name per source, only a label (XBMC OS X, build from 10/09).
Pretty useless this way Smile
Got no time to open a ticket, but can do tomorrow if necessary.

BTW Player.getItem is GREAT!


- Montellese - 2011-10-10 22:11

grywnn Wrote:Just noticed that Files.getSources no longer returns a file/directory name per source, only a label (XBMC OS X, build from 10/09).
Pretty useless this way Smile
Got no time to open a ticket, but can do tomorrow if necessary.
Thanks for the report. I fixed it in https://github.com/xbmc/xbmc/commit/69ea94f3f485e2f5530c6b122c1ad1b07f8cffa4 so should be fixed in the nightly of tomorrow or the day after tomorrow.

grywnn Wrote:BTW Player.getItem is GREAT!
Glad to hear that.


- grywnn - 2011-10-10 22:23

You're my hero Smile