• 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 15
Working JSON RPC API Examples
#76
(2015-11-03, 23:59)atailo Wrote: I am trying to create a keyboard for irule program json commands to the kodi, but nocmando send text when I send the first texte he does not allow write the second, for instance created text with the letter "a" and the letter "b "but if I hit any of the two he did not add another, only replacing the letter by the other. is there any way to solve?


{"jsonrpc":"2.0","method":"Input.SendText","params": {"text": "A", "done":false},"id":1}
{"jsonrpc":"2.0","method":"Input.SendText","params": {"text": "B", "done":false},"id":1}

Did you get this to work with irule?

I can't get it working at all :-(
Reply
#77
Hi,

Looking for some example which returns the player state on video and if possible also on audio.

So i want to know if the current video is on 'play' or 'pause, 'stopped' or maybe 'ended' etc

How can i get these playerstates using the api?

Thx for any help!
Reply
#78
This should give you basic info. http://kodi.wiki/view/JSON-RPC_API/Examp...playing.3F

But if you really want to act on pause/stop/play you shouldn't look to json RPC but to the python API.
For e.g. for pause: http://mirrors.kodi.tv/docs/python-docs/...BackPaused
Reply
#79
No i want to know if the player is on play, start or stop

Not what is playing etc or to control the player,just reading the actual state, the api docu in the wiki does not return the player state itself, only media info.

I want to use this for a home automation system, so if a movie is playing (player state: play) then light off, when a movie is on pause i could set light on dimmed and when movie ended or stopped i could turn lights on again, i want to trigger/read this from the home automation, not by kodi itself, that is why i what to get it by api call.

To get this to work i have to know what the actual player state is, i cannot find this in the API manual, only the movie/media info (title etc ) is returned but not the player state itself.

So anyone an idea how i can get the actual live player state?
Reply
#80
I have an absolute-directory or playlist navigation question that I'm hoping is a simple task. As a baseline, I know I can access the "Movietitles" interface under "Videos" as follows...
Code:
jsonrpc?request={"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"videos","parameters":["movietitles"]},"id":"1"}}

If I'm looking to get to an interface showing the files within a specific absolute path, such as "/storage/gopro/moto/practice", I know how to navigate manually within "Videos --> Files".

Can I use a variant of the above command to directly navigate to that particular directory in a single step?

UPDATE:
Okay, I'm attempting to short-cut this a bit. I've added that directory under "files", then set that it does not contain any particular file type (to avoid library integration). I can get to the "Files" directory with a variant of above, but can I directly get to a sub-directory of that, such as "files/motopractice"?

Other possible option: the directory holding the practice clips has been identified and is stored in "mediasources.xml" with a particular ID. Is there a JSON command that would let me open a window directly to that media source?
Reply
#81
(2016-03-07, 14:48)Razze Wrote: This should give you basic info. http://kodi.wiki/view/JSON-RPC_API/Examp...playing.3F

But if you really want to act on pause/stop/play you shouldn't look to json RPC but to the python API.
For e.g. for pause: http://mirrors.kodi.tv/docs/python-docs/...BackPaused

(2016-03-07, 14:54)B3rt Wrote: No i want to know if the player is on play, start or stop

Not what is playing etc or to control the player,just reading the actual state, the api docu in the wiki does not return the player state itself, only media info.

I want to use this for a home automation system, so if a movie is playing (player state: play) then light off, when a movie is on pause i could set light on dimmed and when movie ended or stopped i could turn lights on again, i want to trigger/read this from the home automation, not by kodi itself, that is why i what to get it by api call.

To get this to work i have to know what the actual player state is, i cannot find this in the API manual, only the movie/media info (title etc ) is returned but not the player state itself.

So anyone an idea how i can get the actual live player state?

You could use a combination of if media info is returned and refer to this post with sample below using the speed property. Although I am not sure why you would not want to use Kodi to perform these actions via an add-on as @Razze suggested.

Code:
{"jsonrpc": "2.0", "id": 1, "method": "Player.GetProperties", "params": {"properties": ["speed"], "playerid": 1}}
returns:

Paused:
Code:
{"id":1,"jsonrpc":"2.0","result":{"speed":0}}
(Nothing) Playing:
Code:
{"id":1,"jsonrpc":"2.0","result":{"speed":1}}
Reply
#82
Hi,

I can't find the appropriate API method to get the "name" of a given window from its ID.
api.method(window.id) --> window.name

The idea is to save this window name in a variable to get the screen back later using GUI.ActivateWi​ndow which needs a window.name as parameter and not a simple window.id unfortunately. :/

Please help me ! Smile
Reply
#83
The values are well known AFAIK : https://github.com/xbmc/xbmc/blob/master...indowIDs.h
Reply
#84
(2016-03-18, 11:48)Tolriq Wrote: The values are well known AFAIK : https://github.com/xbmc/xbmc/blob/master...indowIDs.h

Tks Tolriq,
will try to manage with that if there's no direct method.
Reply
#85
Hi,

Ive seen various examples of how this should work, yet I cant get mine to change

I can the channel ids and names via pvr.getchanels.....

However the following returns "file not found"

http://192.168.0.34/jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "channelid": 45} }, "id": 1 }

Ive tried many different channel ids all return the file not found.
Reply
#86
I found the answer in an old thread.... the correct syntax that works for me is :

http://192.168.0.34/jsonrpc?request={"id":1,"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"channelid":14}}}

Thanks
Reply
#87
Hi,

how to change this old format to new json api?
Code:
--Get the currently playing info from the XBMC
function getCurrentlyPlayingInfo(self)
    local http = SocketHttp(jnt, settings["xbmc_ip_address"], settings["xbmc_port"], "xbmc")    
    local req = RequestHttp( function(chunk, err)
            if chunk then
                parseCurrentlyPlayingInfo(self, chunk)                                    --Parse the recieved info
            end
        end,
        'GET',
        '/xbmcCmds/xbmcHttp?command=GetCurrentlyPlaying')
    http:fetch(req)
end
Reply
#88
friends, I am not managing to filter movies based on cast, property name. I can filter based on year but would like to filter based on the artist because the artist created filter and would like to use the name of each artist to find the films he participates.

I used this example json. can anybody help me ? (in my collection has a movie with actor this example.)

{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "filter": {"field": "cast", "operator": "contains", "value": "Ben Affleck"}, "limits": { "start" : 0, "end": 75 }, "properties" : ["cast"], "sort": { "order": "ascending", "method": "label", "ignorearticle": true } }, "id": "libMovies"}
Reply
#89
does anyone have the kodi command to query the player for the TV Show season cover art?

the command /jsonrpc?request={"jsonrpc":"2.0","method":"Player.GetItem","params":{"properties":["thumbnail"],"playerid":1},"id":"VideoGetItem"} returns the eppisode image but i want the season cover.

Thanks
Reply
#90
please help me!
I do not know what to do! I want to visit the download subtitles( setSubtitleStream)
Who can help me write the code Json?
Thank you so much
Example:
{"Jsonrpc": "2.0", "method": "Input.ExecuteAction", "params": {"action": "pause"}, "id": 1}
Reply
  • 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 15

Logout Mark Read Team Forum Stats Members Help
Working JSON RPC API Examples0