Kodi Community Forum
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174)
+---- Thread: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263)



- noem - 2010-07-23

dstruktiv Wrote:Yes. AudioPlayer.PlayPause, AudioPlayer.Stop, AudioPlayer.SkipPrevious and AudioPlayer.SkipNext. Also works for VideoPlayer.

Yes but I wont do to that on the interface like move the focus up and down etc...

sorry I didnt ask the question right.


- Tolriq - 2010-07-23

For the moment httpapi or eventserver (would recommand the second one Smile )


- dstruktiv - 2010-07-24

Writer and Studio fields don't seem to be parsed in VideoLibrary.GetMovies, see call and reply below (The movie in question does have writer and studio fields when viewed in xbmc):

Code:
24/07/2010 9:09:21 p.m. - Invoke: {"jsonrpc":"2.0","method":"VideoLibrary.GetMovies","params":{"fields":["plot","director","writer","studio","genre","year","runtime","rating","tagline","plotoutline"],"start":1,"end":2},"id":1}
24/07/2010 9:09:21 p.m. - {"end":2,"movies":[{"director":"Richard Donner","file":"G:\\Media\\Movies\\16 Blocks\\16 Blocks.avi","genre":"Action / Crime / Drama / Thriller","label":"16 Blocks","movieid":2,"plot":"Jack Mosley, a burnt-out detective, is assigned the unenviable task of transporting a fast-talking convict from jail to a courthouse 16 blocks away. However, along the way he learns that the man is supposed to testify against Mosley's colleagues, and the entire NYPD wants him dead. Mosley must choose between loyalty to his colleagues and protecting the witness, and never has such a short distance seemed so long...","plotoutline":"An aging cop is assigned the ordinary task of escorting a fast-talking witness from police custody to a courthouse. There are however forces at work trying to stop prevent them from making it.","rating":6.699999809265137,"runtime":"101 min","tagline":"scraper error","thumbnail":"special://masterprofile/Thumbnails/Video/5/5dd6ef35.tbn","year":2006}],"start":1,"total":4}



- dstruktiv - 2010-07-25

Audio.Playlist and VideoPlaylist.GetItems only return a label, file and thumbnail no matter what fields you pass. Is it possible for these to return all info? I.e For each item in the Audio.Playlist it would return the songid, artist, album etc.

Edit: I take that back it is parsing all fields except songid which would be useful if it could return that.


- Danone-KiD - 2010-07-29

topfs2 Wrote:When you get stuff it will always return thumbnail if it exists, fanart I haven't added, shall see if I can add it.

Hi,

I'm coding a library for manage the music library on a Windev application.
You plan to add support of fanart on the json library ?

Thanks


- Malard - 2010-07-29

dstruktiv Wrote:Audio.Playlist and VideoPlaylist.GetItems only return a label, file and thumbnail no matter what fields you pass. Is it possible for these to return all info? I.e For each item in the Audio.Playlist it would return the songid, artist, album etc.

Edit: I take that back it is parsing all fields except songid which would be useful if it could return that.

Please provide an example of this not work, it works fine for me.


- dstruktiv - 2010-07-30

Malard Wrote:Please provide an example of this not work, it works fine for me.

Sorry, catch all and continue exception handling kind of hides things :p

songid is being parsed and returned but XBMC.Play(songid) is returning invalid params.

Code:
7/30/2010 2:00:18 PM - Invoke: {
  "jsonrpc": "2.0",
  "method": "XBMC.Play",
  "params": {
    "songid": 231
  },
  "id": 898
}

7/30/2010 2:00:18 PM - Response: Invalid Params

I'll get the latest SVN build as Topfs2 mentions on the last page he fixed this perhaps my build is outdated.

Edit: Yeah dammit sorry my build was too old. Hard to keep up with the nightlies lol.


- marksoccer - 2010-07-31

Is there a way to show a single picture? I was hoping that if I provided XBMC.Play or XBMC.StartSlideshow with the filename of a picture, that the picture would be shown.

Also, is there a way to check whether a filename is part of the library and thus get the data associated with it? I ask because if I start playing a file using it's filename, I can only see the filename when using Audio/VideoPlaylist.GetItems. It would be awesome if there was a way to see all the additional details of the file if it is already in the library.


- topfs2 - 2010-08-01

StartSlideshow with file as parameter should only start with the one file IIRC.

Regarding files filling metadata, this is intended but I haven't decided were this should be done. i.e. if XBMC core should fill out on start of playback if no metadata exist or if jsonrpc should go out of its way querying the data from the database, IMO it should be cores job.

At any rate, I suggest to use database as much as possible, i.e. start playback with movieid, songid, artistid so on and so forth, that way you will get metadata available.


- marksoccer - 2010-08-02

I can't get StartSlideshow to work by providing one file.


VideoLibrary sorting dosn't work - noem - 2010-08-02

Does the sortmethod and sortorder methods work because I can't get it to work it always ignores those fields

Code:
HTTP request: {
    id = 0;
    jsonrpc = "2.0";
    method = "VideoLibrary.GetSeasons";
    params =     {
        fields =         (
            season
        );
        sortmethod = season;
        sortorder = ascending;
        tvshowid = 12;
    };
}


Code:
JSON result: {
    id = 0;
    jsonrpc = "2.0";
    result =     {
        end = 10;
        seasons =         (
                        {
                label = "Season 1";
                season = 1;
                thumbnail = "special://masterprofile/Thumbnails/Video/9/9bb2a0cd.tbn";
            },
                        {
                label = "Season 10";
                season = 10;
                thumbnail = "special://masterprofile/Thumbnails/Video/6/68c4506f.tbn";
            },
                        {
                label = "Season 2";
                season = 2;
                thumbnail = "special://masterprofile/Thumbnails/Video/9/96f18614.tbn";
            },
                        {
                label = "Season 3";
                season = 3;
                thumbnail = "special://masterprofile/Thumbnails/Video/9/92309ba3.tbn";
            },
                        {
                label = "Season 4";
                season = 4;
                thumbnail = "special://masterprofile/Thumbnails/Video/8/8c77cba6.tbn";
            },
                        {
                label = "Season 5";
                season = 5;
                thumbnail = "special://masterprofile/Thumbnails/Video/8/88b6d611.tbn";
            },
                        {
                label = "Season 6";
                season = 6;
                thumbnail = "special://masterprofile/Thumbnails/Video/8/85f5f0c8.tbn";
            },
                        {
                label = "Season 7";
                season = 7;
                thumbnail = "special://masterprofile/Thumbnails/Video/8/8134ed7f.tbn";
            },
                        {
                label = "Season 8";
                season = 8;
                thumbnail = "special://masterprofile/Thumbnails/Video/b/b97b50c2.tbn";
            },
                        {
                label = "Season 9";
                season = 9;
                thumbnail = "special://masterprofile/Thumbnails/Video/b/bdba4d75.tbn";
            }
        );
        start = 0;
        total = 10;
    };
}



- topfs2 - 2010-08-02

Well none of those are proper JSON so hard to tell ...
Both method and order needs to be strings, and it should be "sort": { "order": "ascending", "method": "season" }. Please read the jsonrpc poc webinterface, IIRC it uses sorting


- Qu3uk - 2010-08-05

Sorry if I've missed any updated link on the thread, i've just read the 29 odd pages but didn't see anything..

Is this up to date?

http://pastebin.com/m4f937676


- Tolriq - 2010-08-05

no Smile You need to install xbmc and connect to the web page and the go to dev part Smile


- Ishiro - 2010-08-10

Hello,

I'd like to make a simple remote controller for XBMC optimized for iPhone, with a nice UI.

I tought it will quite easy to do something with some HTML, CSS and JS using JSON-RPC, but I can't find a good way to send keyboard events... Unless with HTTP API (ie. http://machine:port/xbmcCmds/xbmcHttp?command=SendKey(code)) which seems to be deprecated.

So, any advice ? Will XBMC implement a similar function in the future (through JSON-RPC) ?

Secondly, is there a nice way to start XBMC with a remote based on http ? (I think no, because the web server is not started, but perhaps a helper exists...).

Thanks !

A preview of the UI :

Image

Edit:
I'm trying HTTP-API, and finally SendAction() method is more useful than SendKey, actually. Wink