JSON-RPC API: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Montellese
>Montellese
(major refactoring)
Line 1: Line 1:
JSON RPC is a HTTP-based or raw TCP Socket interface for communicating with XBMC. It replaces the soon-to-be-depreceated HTTP API, and offers a more secure and robust mechanism in the same format. It is based upon the [http://groups.google.com/group/json-rpc/web/json-rpc-2-0?pli=1 JSON RPC 2.0 specification].
JSON-RPC is a HTTP- and/or raw TCP socket-based interface for communicating with XBMC. It replaces the soon-to-be-depreceated HTTP API, and offers a more secure and robust mechanism in the same format. It is based upon the [http://jsonrpc.org/spec.html JSON-RPC 2.0 specification].


Each method in the interface can have different security needs which means one client may be allowed to only control playback while another can only read and manipulate the library. In version 2 (first stable) all clients are granted full authority but will later be forced to ask for privileges and the user of XBMC will have to grant said client access. The design of JSON RPC is that most methods should behave roughly the same and maintain consistency while hiding the mechanics of XBMC from the client creator.
Each method in the interface can have different security needs which means one client may be allowed to only control playback while another can only read and manipulate the library. In version 2 (first stable) and 4 all clients are granted full authority but will later be forced to ask for privileges and the user of XBMC will have to grant said client access. The design of JSON-RPC is that most methods should behave roughly the same and maintain consistency while hiding the mechanics of XBMC from the client creator.


In XBMC JSON RPC can be accessed over a variety of transports and has been designed from the ground up to be flexible to allow control over new transports simply. Some of the transports have different limitations which will be enforced upon the interaction over that transport. As an example HTTP Transports allow response and downloading of files while the Raw TCP Transport allows response and announcements (events and information XBMC sends to its clients). Depending on the clients needs it will choose one (or many) of the transports.
In XBMC JSON-RPC can be accessed over a variety of transports and has been designed from the ground up to be flexible to allow control over new transports easily. Some of the transports have different limitations which will be enforced upon the interaction over that transport. As an example HTTP transports allow response and downloading of files while the raw TCP transport allows response and notifications (events and information XBMC sends to its clients). Depending on the client's needs it will choose one (or many) of the available transports.


{{TOC right}}
==Enabling JSON-RPC==
== Enabling JSON RPC ==
Since the interface is available on many transports enabling it depends on the transport.
Since the interface is available on many transports enabling it will depends on the transport.
* Python: Always enabled
* Python. Always enabled
* HTTP: In System/Settings/Network/Services activate ''Allow control of XBMC via HTTP''
* HTTP. Enable webserver
* TCP: In System/Settings/Network/Services activate ''Allow programs on this system to control XBMC'' for localhost access only and ''Allow programs on other systems to control XBMC'' for access from other computers as well
* TCP. "Allow External Control of XBMC" for localhost control and "Allow Control from other computers" for access from outside localhost.


Note: The EventServer is a different interface for sending remote keypresses to XBMC, and must be enabled separately, some programs may use both interfaces.
Note: The EventServer is a different interface for sending remote keypresses to XBMC, and must be enabled separately, some programs may use both interfaces.


== XBMC API ==
==Transports==
The XBMC JSON api is split up into namespaces, which contain methods that can be called. These namespaces are:
===Functionalities===
<pre>
TODO
JSONRPC          A variety of standard JSONRPC calls
Player          Manages all available players
Playlist        Playlist modification
Files            Shares information
AudioLibrary    Audio Library information
VideoLibrary    Video Library information
Input            Allows limited navigation within XBMC
Application      Application information and control
System          System controls and information
XBMC            Dumping ground for very XBMC specific operations
</pre>


==Methods==
===Comparison===
===Application===
The following table shows all the available transports and what functionalities they support
====Application.GetProperties====
{| class="wikitable" style="margin-right:0; font-size:85%;"
Retrieves the values of the given properties<br />
!style="width:15em"|
'''Permission:''' ReadData<br />
'''Parameters:'''
#''array'' properties
'''Returns: '''<br />
'''Type:''' ''[[#Application.Property.Value|Application.Property.Value]]''<br />
'''Optional:''' true


====Application.Quit====
!Response
Quit application<br />
!Notifications
'''Permission:''' ControlPower<br />
!Direct file download
'''Parameters:''' None
!Redirected file download
<br />
|-
'''Returns: '''<br />
|[[Python Development|Python]]
'''Type:''' ''string''<br />
|{{yes}}
'''Optional:''' true
|{{yes}}
|{{no}}
|{{no}}
|-
|[http://en.wikipedia.org/wiki/Transmission_Control_Protocol TCP]
|{{yes}}
|{{yes}}
|{{no}}
|{{no}}
|-
|[http://en.wikipedia.org/wiki/HTTP HTTP]
|{{yes}}
|{{no}}
|{{no}}
|{{yes}}
|-
|}


====Application.SetVolume====
==API versions==
Set the current volume<br />
The JSON-RPC API exposed by XBMC is constantly extended to provide better and more functionality to third party applications. For that reason XBMC provides a version information through the '''JSONRPC.Version''' method. The rule is that odd version numbers describe an API state, that is not stable and under heavy development whereas even version numbers describe a stable API. Therefore the version number can be used by third party clients to check if their application might not be fully compatible with the JSON-RPC API exposed by a users XBMC installation.
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''integer'' value
'''Returns: '''<br />
'''Type:''' ''integer''<br />
'''Optional:''' true


====Application.ToggleMute====
Since the first release of the JSON-RPC API in XBMC 10.0 (Dharma) there have been the following versions of the API:
Toggle mute/unmute<br />
* [[JSON-RPC/v2|JSON-RPC v2 (Dharma)]]
'''Permission:''' ControlPlayback<br />
* [[JSON-RPC/v3|JSON-RPC v3 (pre Eden)]]
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''integer''<br />
'''Optional:''' true


===AudioLibrary===
==Documentation==
====AudioLibrary.Clean====
TODO
Cleans the audio library from non-existent items<br />
'''Permission:''' RemoveData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true


====AudioLibrary.Export====
==Debugging==
Exports all items from the audio library<br />
===Output format===
'''Permission:''' WriteFile<br />
To be able to support easier debugging of (third party) development using the JSON-RPC API, the JSON output generated by XBMC can be pretty printed by setting
'''Parameters:'''
#[ ''boolean'' singlefile = True ]
#[ ''boolean'' images = False ]
#[ ''boolean'' overwrite = False ]
#[ ''string'' path = "" ]
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioLibrary.GetAlbumDetails====
Retrieve details about a specific album<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''[[#Library.Id|Library.Id]]'' albumid
#[ ''[[#Audio.Fields.Album|Audio.Fields.Album]]'' fields ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''[[#Audio.Details.Album|Audio.Details.Album]]'' albumdetails ]
 
 
====AudioLibrary.GetAlbums====
Retrieve all albums from specified artist or genre<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#Library.Id|Library.Id]]'' artistid = -1 ]
#[ ''[[#Library.Id|Library.Id]]'' genreid = -1 ]
#[ ''[[#Audio.Fields.Album|Audio.Fields.Album]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''array'' albums ]
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
====AudioLibrary.GetArtistDetails====
Retrieve details about a specific artist<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''[[#Library.Id|Library.Id]]'' artistid
#[ ''[[#Audio.Fields.Artist|Audio.Fields.Artist]]'' fields ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''[[#Audio.Details.Artist|Audio.Details.Artist]]'' artistdetails ]
 
 
====AudioLibrary.GetArtists====
Retrieve all artists<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#Optional.Boolean|Optional.Boolean]]'' albumartistsonly = null ]
#[ ''[[#Library.Id|Library.Id]]'' genreid = -1 ]
#[ ''[[#Audio.Fields.Artist|Audio.Fields.Artist]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
*[ ''array'' artists ]
 
 
====AudioLibrary.GetGenres====
Retrieve all genres<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#Library.Fields.Genre|Library.Fields.Genre]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''array'' genres
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
====AudioLibrary.GetRecentlyAddedAlbums====
Retrieve recently added albums<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#List.Amount|List.Amount]]'' albums = -1 ]
#[ ''[[#Audio.Fields.Album|Audio.Fields.Album]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''array'' albums ]
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
====AudioLibrary.GetRecentlyAddedSongs====
Retrieve recently added songs<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#List.Amount|List.Amount]]'' albums = -1 ]
#[ ''[[#Audio.Fields.Song|Audio.Fields.Song]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
*[ ''array'' songs ]
 
 
====AudioLibrary.GetSongDetails====
Retrieve details about a specific song<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''[[#Library.Id|Library.Id]]'' songid
#[ ''[[#Audio.Fields.Song|Audio.Fields.Song]]'' fields ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''[[#Audio.Details.Song|Audio.Details.Song]]'' songdetails ]
 
 
====AudioLibrary.GetSongs====
Retrieve all songs from specified album, artist or genre<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#Library.Id|Library.Id]]'' artistid = -1 ]
#[ ''[[#Library.Id|Library.Id]]'' albumid = -1 ]
#[ ''[[#Library.Id|Library.Id]]'' genreid = -1 ]
#[ ''[[#Audio.Fields.Song|Audio.Fields.Song]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
*[ ''array'' songs ]
 
 
====AudioLibrary.Scan====
Scans the audio sources for new library items<br />
'''Permission:''' UpdateData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
===AudioPlayer===
====AudioPlayer.BigSkipBackward====
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlayer.BigSkipForward====
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlayer.Forward====
Forward current playback<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlayer.GetPercentage====
Retrieve current playback progress in percentage<br />
'''Permission:''' ReadData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''number''<br />
'''Optional:''' true
 
====AudioPlayer.GetTime====
Retrieves the current and total time of the currently playing file<br />
'''Permission:''' ReadData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''[[#Player.TimeValues|Player.TimeValues]]''<br />
'''Optional:''' true
 
====AudioPlayer.PlayPause====
Pauses or unpause playback and returns the new state<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''[[#Player.State|Player.State]]''<br />
'''Optional:''' true
 
====AudioPlayer.Rewind====
Rewind current playback<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlayer.SeekPercentage====
Seek to a specific percentage<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Player.SeekPercentage|Player.SeekPercentage]]'' value
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlayer.SeekTime====
Seek to a specific time<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Player.SeekTime|Player.SeekTime]]'' value
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlayer.SkipNext====
Skips to next item on the playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlayer.SkipPrevious====
Skips to previous item on the playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlayer.SmallSkipBackward====
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlayer.SmallSkipForward====
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlayer.State====
Returns playback state of the audio player (if it is active)<br />
'''Permission:''' ReadData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''[[#Player.State.Extended|Player.State.Extended]]''<br />
'''Optional:''' true
 
====AudioPlayer.Stop====
Stops playback<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
===AudioPlaylist===
====AudioPlaylist.Add====
Add item(s) to playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Audio.Item|Playlist.Audio.Item]]'' item
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlaylist.Clear====
Clear playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlaylist.GetItems====
Get all items from playlist<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#Audio.Fields.Song|Audio.Fields.Song]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''[[#List.Items.Audio|List.Items.Audio]]'' items
*[ ''[[#Playlist.State|Playlist.State]]'' state ]
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
====AudioPlaylist.Insert====
Insert item(s) into playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Item.Position|Playlist.Item.Position]]'' index
#''[[#Playlist.Audio.Item|Playlist.Audio.Item]]'' item
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlaylist.Play====
Play current or a specific item<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#[ ''[[#Playlist.Item.Position|Playlist.Item.Position]]'' item = -1 ]
#[ ''[[#Library.Id|Library.Id]]'' songid = -1 ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''boolean'' success
 
 
====AudioPlaylist.Remove====
Remove item from playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Item.Position|Playlist.Item.Position]]'' item
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlaylist.Repeat====
Set the repeat mode of the playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Repeat|Playlist.Repeat]]'' state
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlaylist.Shuffle====
Shuffle playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlaylist.SkipNext====
Skip current item and play next item<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlaylist.SkipPrevious====
Skip current item and play previous item<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlaylist.State====
Provides information about the current state of the playlist<br />
'''Permission:''' ReadData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''[[#Playlist.State|Playlist.State]]''<br />
'''Optional:''' true
 
====AudioPlaylist.Swap====
Swap items in the playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Item.Position|Playlist.Item.Position]]'' item1
#''[[#Playlist.Item.Position|Playlist.Item.Position]]'' item2
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====AudioPlaylist.UnShuffle====
Unshuffle playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
===Files===
====Files.Download====
Takes a XBMC internal path to a file (e.g. special://masterprofile/Thumbnails/Music/e/ec96cd54.tbn) and returns the URL where the file can be downloaded (e. g.  http://192.168.1.2:8080/vfs/special://masterprofile/Thumbnails/Music/e/ec96cd54.tbn).
 
'''Permission:''' ReadData<br />
'''Parameters:'''
#''string'' path
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''string'' path
 
====Files.GetDirectory====
'''Permission:''' ReadData<br />
'''Parameters:'''
#''string'' directory
#[ ''[[#Files.Media|Files.Media]]'' media = "files" ]
#[ ''[[#List.Fields.All|List.Fields.All]]'' fields ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''[[#List.Items.Files|List.Items.Files]]'' files
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
====Files.GetSources====
Get the sources of the media windows<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''[[#Files.Media|Files.Media]]'' media
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''[[#List.Items.Shares|List.Items.Shares]]'' shares
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
===Input===
====Input.Back====
Goes back in GUI<br />
'''Permission:''' Navigate<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====Input.Down====
Navigate down in GUI<br />
'''Permission:''' Navigate<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====Input.Home====
Goes to home window in GUI<br />
'''Permission:''' Navigate<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====Input.Left====
Navigate left in GUI<br />
'''Permission:''' Navigate<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====Input.Right====
Navigate right in GUI<br />
'''Permission:''' Navigate<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====Input.Select====
Select current item in GUI<br />
'''Permission:''' Navigate<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====Input.Up====
Navigate up in GUI<br />
'''Permission:''' Navigate<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
===JSONRPC===
====JSONRPC.GetConfiguration====
Get client-specific configurations<br />
'''Permission:''' ReadData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''[[#Configuration|Configuration]]''<br />
'''Optional:''' true
 
====JSONRPC.Introspect====
Enumerates all actions and descriptions<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''boolean'' getdescriptions = True ]
#[ ''boolean'' getmetadata = False ]
#[ ''boolean'' filterbytransport = True ]
#[ ''object'' filter ]<br />
'''Properties:'''
*''string'' type
*''string'' id
*[ ''boolean'' getreferences = True ]
 
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true
 
====JSONRPC.NotifyAll====
Notify all other connected clients<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''string'' sender
#''string'' message
#[ ''any'' data = null ]
'''Returns: '''<br />
'''Type:''' ''any''<br />
'''Optional:''' true
 
====JSONRPC.Permission====
Retrieve the clients permissions<br />
'''Permission:''' ReadData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''boolean'' removedata
*''boolean'' controlplayback
*''boolean'' readdata
*''boolean'' updatedata
*''boolean'' writefile
*''boolean'' controlnotify
*''boolean'' controlpower
 
 
====JSONRPC.Ping====
Ping responder<br />
'''Permission:''' ReadData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====JSONRPC.SetConfiguration====
Change the client-specific configuration<br />
'''Permission:''' ControlNotify<br />
'''Parameters:'''
#[ ''object'' notifications ]<br />
'''Properties:'''
*[ ''[[#Optional.Boolean|Optional.Boolean]]'' gui = null ]
*[ ''[[#Optional.Boolean|Optional.Boolean]]'' system = null ]
*[ ''[[#Optional.Boolean|Optional.Boolean]]'' player = null ]
*[ ''[[#Optional.Boolean|Optional.Boolean]]'' audiolibrary = null ]
*[ ''[[#Optional.Boolean|Optional.Boolean]]'' other = null ]
*[ ''[[#Optional.Boolean|Optional.Boolean]]'' videolibrary = null ]
 
'''Returns: '''<br />
'''Type:''' ''[[#Configuration|Configuration]]''<br />
'''Optional:''' true
 
====JSONRPC.Version====
Retrieve the jsonrpc protocol version<br />
'''Permission:''' ReadData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
===PicturePlayer===
====PicturePlayer.MoveDown====
If picture is zoomed move viewport down<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====PicturePlayer.MoveLeft====
If picture is zoomed move viewport left otherwise skip previous<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====PicturePlayer.MoveRight====
If picture is zoomed move viewport right otherwise skip next<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====PicturePlayer.MoveUp====
If picture is zoomed move viewport up<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====PicturePlayer.PlayPause====
Pauses or unpause slideshow<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====PicturePlayer.Rotate====
Rotates current picture<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====PicturePlayer.SkipNext====
Skips to next picture in the slideshow<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====PicturePlayer.SkipPrevious====
Skips to previous picture in the slideshow<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====PicturePlayer.Stop====
Stops slideshow<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====PicturePlayer.Zoom====
Zooms current picture<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''integer'' value
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====PicturePlayer.ZoomIn====
Zoom in once<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====PicturePlayer.ZoomOut====
Zoom out once<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
===Player===
====Player.GetActivePlayers====
Returns all active players<br />
'''Permission:''' ReadData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''boolean'' picture
*''boolean'' audio
*''boolean'' video
 
 
===Playlist===
====Playlist.Add====
Add items to the playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Id|Playlist.Id]]'' playlist
#''[[#Playlist.Id|Playlist.Id]]'' items
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====Playlist.Clear====
Clear playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Id|Playlist.Id]]'' playlist
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====Playlist.Create====
Creates a virtual playlist from a given one from a file<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''[[#Playlist.Id|Playlist.Id]]'' playlist
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''string'' playlistid
 
 
====Playlist.Destroy====
Destroys a virtual playlist<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''string'' playlistid
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====Playlist.GetItems====
Retrieve items in the playlist<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''[[#Playlist.Id|Playlist.Id]]'' playlist
#[ ''[[#List.Fields.All|List.Fields.All]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''[[#List.Items.All|List.Items.All]]'' items
*[ ''string'' name = "" ]
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
====Playlist.Remove====
Remove item from the playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Id|Playlist.Id]]'' playlist
#''['string', 'integer']'' item
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====Playlist.Shuffle====
Shuffle playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Id|Playlist.Id]]'' playlist
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====Playlist.Swap====
Swap items in the playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Id|Playlist.Id]]'' playlist
#''[[#Playlist.Item.Position|Playlist.Item.Position]]'' item1
#''[[#Playlist.Item.Position|Playlist.Item.Position]]'' item2
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====Playlist.UnShuffle====
Unshuffle playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Id|Playlist.Id]]'' playlist
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
===System===
====System.GetProperties====
Retrieves the values of the given properties<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''array'' properties
'''Returns: '''<br />
'''Type:''' ''[[#System.Property.Value|System.Property.Value]]''<br />
'''Optional:''' true
 
====System.Hibernate====
Puts the system running XBMC into hibernate mode<br />
'''Permission:''' ControlPower<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====System.Reboot====
Reboots the system running XBMC<br />
'''Permission:''' ControlPower<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====System.Shutdown====
Shuts the system running XBMC down<br />
'''Permission:''' ControlPower<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====System.Suspend====
Suspends the system running XBMC<br />
'''Permission:''' ControlPower<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
===VideoLibrary===
====VideoLibrary.Clean====
Cleans the video library from non-existent items<br />
'''Permission:''' RemoveData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoLibrary.Export====
Exports all items from the video library<br />
'''Permission:''' WriteFile<br />
'''Parameters:'''
#[ ''boolean'' singlefile = True ]
#[ ''boolean'' images = False ]
#[ ''boolean'' actorthumbs = False ]
#[ ''boolean'' overwrite = False ]
#[ ''string'' path = "" ]
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoLibrary.GetEpisodeDetails====
Retrieve details about a specific tv show episode<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''[[#Library.Id|Library.Id]]'' episodeid
#[ ''[[#Video.Fields.Episode|Video.Fields.Episode]]'' fields ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''[[#Video.Details.Episode|Video.Details.Episode]]'' episodedetails ]
 
 
====VideoLibrary.GetEpisodes====
Retrieve all tv show episodes<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#Library.Id|Library.Id]]'' tvshowid = -1 ]
#[ ''integer'' season = -1 ]
#[ ''[[#Video.Fields.Episode|Video.Fields.Episode]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''array'' episodes ]
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
====VideoLibrary.GetGenres====
Retrieve all genres<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''string'' type
#[ ''[[#Library.Fields.Genre|Library.Fields.Genre]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''array'' genres
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
====VideoLibrary.GetMovieDetails====
Retrieve details about a specific movie<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''[[#Library.Id|Library.Id]]'' movieid
#[ ''[[#Video.Fields.Movie|Video.Fields.Movie]]'' fields ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''[[#Video.Details.Movie|Video.Details.Movie]]'' moviedetails ]
 
 
====VideoLibrary.GetMovieSetDetails====
Retrieve details about a specific movie set<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''[[#Library.Id|Library.Id]]'' setid
#[ ''[[#Video.Fields.MovieSet|Video.Fields.MovieSet]]'' fields ]
#[ ''object'' movies ]<br />
'''Properties:'''
*[ ''[[#List.Sort|List.Sort]]'' sort ]
*[ ''[[#Video.Fields.Movie|Video.Fields.Movie]]'' fields ]
*[ ''[[#List.Limits|List.Limits]]'' limits ]
 
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''[[#Video.Details.MovieSet.Extended|Video.Details.MovieSet.Extended]]'' setdetails ]
 
 
====VideoLibrary.GetMovieSets====
Retrieve all movie sets<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#Video.Fields.MovieSet|Video.Fields.MovieSet]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
*[ ''array'' sets ]
 
 
====VideoLibrary.GetMovies====
Retrieve all movies<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#Video.Fields.Movie|Video.Fields.Movie]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''array'' movies ]
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
====VideoLibrary.GetMusicVideoDetails====
Retrieve details about a specific music video<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''[[#Library.Id|Library.Id]]'' musicvideoid
#[ ''[[#Video.Fields.MusicVideo|Video.Fields.MusicVideo]]'' fields ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''[[#Video.Details.MusicVideo|Video.Details.MusicVideo]]'' musicvideodetails ]
 
 
====VideoLibrary.GetMusicVideos====
Retrieve all music videos<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#Library.Id|Library.Id]]'' artistid = -1 ]
#[ ''[[#Library.Id|Library.Id]]'' albumid = -1 ]
#[ ''[[#Video.Fields.MusicVideo|Video.Fields.MusicVideo]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''array'' musicvideos ]
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
====VideoLibrary.GetRecentlyAddedEpisodes====
Retrieve all recently added tv episodes<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#Video.Fields.Episode|Video.Fields.Episode]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''array'' episodes ]
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
====VideoLibrary.GetRecentlyAddedMovies====
Retrieve all recently added movies<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#Video.Fields.Movie|Video.Fields.Movie]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''array'' movies ]
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
====VideoLibrary.GetRecentlyAddedMusicVideos====
Retrieve all recently added music videos<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#Video.Fields.MusicVideo|Video.Fields.MusicVideo]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''array'' musicvideos ]
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
====VideoLibrary.GetSeasons====
Retrieve all tv seasons<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''[[#Library.Id|Library.Id]]'' tvshowid
#[ ''[[#Video.Fields.Season|Video.Fields.Season]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''array'' seasons ]
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
====VideoLibrary.GetTVShowDetails====
Retrieve details about a specific tv show<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''[[#Library.Id|Library.Id]]'' tvshowid
#[ ''[[#Video.Fields.TVShow|Video.Fields.TVShow]]'' fields ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''[[#Video.Details.TVShow|Video.Details.TVShow]]'' tvshowdetails ]
 
 
====VideoLibrary.GetTVShows====
Retrieve all tv shows<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#Video.Fields.TVShow|Video.Fields.TVShow]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
*[ ''array'' tvshows ]
 
 
====VideoLibrary.Scan====
Scans the video sources for new library items<br />
'''Permission:''' UpdateData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
===VideoPlayer===
====VideoPlayer.BigSkipBackward====
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlayer.BigSkipForward====
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlayer.Forward====
Forward current playback<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlayer.GetPercentage====
Retrieve current playback progress in percentage<br />
'''Permission:''' ReadData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''number''<br />
'''Optional:''' true
 
====VideoPlayer.GetTime====
Retrieves the current and total time of the currently playing file<br />
'''Permission:''' ReadData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''[[#Player.TimeValues|Player.TimeValues]]''<br />
'''Optional:''' true
 
====VideoPlayer.PlayPause====
Pauses or unpause playback and returns the new state<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''[[#Player.State|Player.State]]''<br />
'''Optional:''' true
 
====VideoPlayer.Rewind====
Rewind current playback<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlayer.SeekPercentage====
Seek to a specific percentage<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Player.SeekPercentage|Player.SeekPercentage]]'' value
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlayer.SeekTime====
Seek to a specific time<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Player.SeekTime|Player.SeekTime]]'' value
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlayer.SkipNext====
Skips to next item on the playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlayer.SkipPrevious====
Skips to previous item on the playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlayer.SmallSkipBackward====
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlayer.SmallSkipForward====
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlayer.State====
Returns playback state of the video player (if it is active)<br />
'''Permission:''' ReadData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''[[#Player.State.Extended|Player.State.Extended]]''<br />
'''Optional:''' true
 
====VideoPlayer.Stop====
Stops playback<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
===VideoPlaylist===
====VideoPlaylist.Add====
Add item(s) to playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Video.Item|Playlist.Video.Item]]'' item
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlaylist.Clear====
Clear playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlaylist.GetItems====
Get all items from playlist<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#[ ''[[#List.Fields.Video|List.Fields.Video]]'' fields ]
#[ ''[[#List.Limits|List.Limits]]'' limits ]
#[ ''[[#List.Sort|List.Sort]]'' sort ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''[[#List.Items.Video|List.Items.Video]]'' items
*[ ''[[#Playlist.State|Playlist.State]]'' state ]
*''[[#List.LimitsReturned|List.LimitsReturned]]'' limits
 
 
====VideoPlaylist.Insert====
Insert item(s) into playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Item.Position|Playlist.Item.Position]]'' index
#''[[#Playlist.Video.Item|Playlist.Video.Item]]'' item
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlaylist.Play====
Play current or a specific item<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#[ ''[[#Playlist.Item.Position|Playlist.Item.Position]]'' item = -1 ]
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''boolean'' success
 
 
====VideoPlaylist.Remove====
Remove item from playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Item.Position|Playlist.Item.Position]]'' item
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlaylist.Repeat====
Set the repeat mode of the playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Repeat|Playlist.Repeat]]'' state
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlaylist.Shuffle====
Shuffle playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlaylist.SkipNext====
Skip current item and play next item<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlaylist.SkipPrevious====
Skip current item and play previous item<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlaylist.State====
Provides information about the current state of the playlist<br />
'''Permission:''' ReadData<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''[[#Playlist.State|Playlist.State]]''<br />
'''Optional:''' true
 
====VideoPlaylist.Swap====
Swap items in the playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''[[#Playlist.Item.Position|Playlist.Item.Position]]'' item1
#''[[#Playlist.Item.Position|Playlist.Item.Position]]'' item2
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====VideoPlaylist.UnShuffle====
Unshuffle playlist<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:''' None
<br />
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
===XBMC===
====XBMC.GetInfoBooleans====
Retrieve info booleans about XBMC and the system<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''array'' booleans
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true
 
====XBMC.GetInfoLabels====
Retrieve info labels about XBMC and the system<br />
'''Permission:''' ReadData<br />
'''Parameters:'''
#''array'' labels
'''Returns: '''<br />
'''Type:''' ''object''<br />
'''Optional:''' true
 
====XBMC.Play====
Starts playback of the given file<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''string'' file
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
====XBMC.StartSlideshow====
Starts slideshow with the images from the given directory<br />
'''Permission:''' ControlPlayback<br />
'''Parameters:'''
#''string'' directory
#[ ''boolean'' random = True ]
#[ ''boolean'' recursive = True ]
'''Returns: '''<br />
'''Type:''' ''string''<br />
'''Optional:''' true
 
 
==Global types==
===Application===
====Application.Property.Name====
'''Type:''' ''string''<br />
'''Optional:''' true<br />
'''Default:''' "volume"
====Application.Property.Value====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''boolean'' muted = False ]
*[ ''integer'' volume = 0 ]
 
===Array===
====Array.Integer====
'''Type:''' ''array''<br />
'''Optional:''' true
====Array.String====
'''Type:''' ''array''<br />
'''Optional:''' true
===Audio===
====Audio.Details.Album====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''integer'' rating = 0 ]
*[ ''string'' style = "" ]
*[ ''string'' theme = "" ]
*[ ''string'' description = "" ]
*[ ''string'' artist = "" ]
*[ ''string'' fanart = "" ]
*[ ''string'' albumlabel = "" ]
*[ ''string'' thumbnail = "" ]
*[ ''string'' musicbrainzalbumartistid = "" ]
*''string'' label
*''[[#Library.Id|Library.Id]]'' albumid
*[ ''[[#Library.Id|Library.Id]]'' artistid = -1 ]
*[ ''integer'' year = 0 ]
*[ ''string'' genre = "" ]
*[ ''string'' title = "" ]
*[ ''string'' type = "" ]
*[ ''string'' musicbrainzalbumid = "" ]
*[ ''string'' mood = "" ]
 
====Audio.Details.Artist====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''string'' style = "" ]
*[ ''string'' description = "" ]
*[ ''string'' musicbrainzartistid = "" ]
*''string'' artist
*[ ''string'' fanart = "" ]
*[ ''string'' formed = "" ]
*[ ''string'' disbanded = "" ]
*[ ''string'' born = "" ]
*''[[#Library.Id|Library.Id]]'' artistid
*[ ''string'' yearsactive = "" ]
*[ ''string'' instrument = "" ]
*[ ''string'' genre = "" ]
*''string'' label
*[ ''string'' thumbnail = "" ]
*[ ''string'' died = "" ]
*[ ''string'' mood = "" ]
 
====Audio.Details.Song====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''string'' comment = "" ]
*[ ''integer'' rating = 0 ]
*[ ''string'' lyrics = "" ]
*[ ''string'' albumartist = "" ]
*[ ''string'' file = "" ]
*[ ''integer'' year = 0 ]
*[ ''integer'' duration = 0 ]
*[ ''string'' musicbrainzalbumid = "" ]
*[ ''string'' album = "" ]
*[ ''string'' title = "" ]
*[ ''string'' fanart = "" ]
*[ ''[[#Library.Id|Library.Id]]'' artistid = -1 ]
*''string'' label
*[ ''[[#Library.Id|Library.Id]]'' albumid = -1 ]
*[ ''string'' thumbnail = "" ]
*''[[#Library.Id|Library.Id]]'' songid
*[ ''integer'' track = 0 ]
*[ ''string'' musicbrainztrackid = "" ]
*[ ''string'' genre = "" ]
*[ ''string'' musicbrainzartistid = "" ]
*[ ''string'' artist = "" ]
*[ ''string'' musicbrainzalbumartistid = "" ]
*[ ''integer'' playcount = 0 ]
 
====Audio.Fields.Album====
'''Type:''' ''array''<br />
'''Optional:''' true
====Audio.Fields.Artist====
'''Type:''' ''array''<br />
'''Optional:''' true
====Audio.Fields.Song====
'''Type:''' ''array''<br />
'''Optional:''' true
===Configuration===
====Configuration====
'''Type:''' ''object''<br />
'''Optional:''' false<br />
'''Properties:'''
*''[[#Configuration.Notifications|Configuration.Notifications]]'' notifications
 
====Configuration.Notifications====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''boolean'' gui
*''boolean'' system
*''boolean'' player
*''boolean'' audiolibrary
*''boolean'' other
*''boolean'' videolibrary
 
===Files===
====Files.Media====
'''Type:''' ''string''<br />
'''Optional:''' true<br />
'''Default:''' "video"
===Global===
====Global.Time====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''integer'' hours
*''integer'' seconds
*''integer'' minutes
*''integer'' milliseconds
 
===Library===
====Library.Details.Genre====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''[[#Library.Id|Library.Id]]'' genreid
*[ ''string'' title = "" ]
*[ ''string'' thumbnail = "" ]
*''string'' label
 
====Library.Fields.Genre====
'''Type:''' ''array''<br />
'''Optional:''' true
====Library.Id====
'''Type:''' ''integer''<br />
'''Optional:''' true<br />
'''Default:''' -1
===List===
====List.Amount====
'''Type:''' ''integer''<br />
'''Optional:''' true<br />
'''Default:''' -1
====List.Fields.All====
'''Type:''' ''array''<br />
'''Optional:''' true
====List.Fields.Video====
'''Type:''' ''array''<br />
'''Optional:''' true
====List.Items.All====
'''Type:''' ''array''<br />
'''Optional:''' true
====List.Items.Audio====
'''Type:''' ''array''<br />
'''Optional:''' true
====List.Items.Files====
'''Type:''' ''array''<br />
'''Optional:''' true
====List.Items.Shares====
'''Type:''' ''array''<br />
'''Optional:''' true
====List.Items.Video====
'''Type:''' ''array''<br />
'''Optional:''' true
====List.Limits====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''integer'' start = 0 ]
*[ ''integer'' end = -1 ]
 
====List.LimitsReturned====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''integer'' start
*''integer'' total
*''integer'' end
 
====List.Sort====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''string'' order = "ascending" ]
*[ ''boolean'' ignorearticle = False ]
*[ ''string'' method = "none" ]
 
===Optional===
====Optional.Boolean====
'''Type:''' ''['null', 'boolean']''<br />
'''Optional:''' true<br />
'''Default:''' null
===Player===
====Player.SeekPercentage====
'''Type:''' ''number''<br />
'''Optional:''' true<br />
'''Default:''' 0
====Player.SeekTime====
'''Type:''' ''integer''<br />
'''Optional:''' true<br />
'''Default:''' 0
====Player.State====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''boolean'' paused
*''boolean'' playing
 
====Player.State.Extended====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''boolean'' paused
*''boolean'' partymode
*''boolean'' playing
 
====Player.TimeValues====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''boolean'' paused
*''[[#Global.Time|Global.Time]]'' total
*''boolean'' playing
*''[[#Global.Time|Global.Time]]'' time
 
===Playlist===
====Playlist.Audio.Item====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''[[#Playlist.Id|Playlist.Id]]'' playlist ]
*[ ''[[#Library.Id|Library.Id]]'' songid = -1 ]
*[ ''[[#Library.Id|Library.Id]]'' albumid = -1 ]
*[ ''[[#Library.Id|Library.Id]]'' artistid = -1 ]
*[ ''string'' file = "" ]
*[ ''string'' directory = "" ]
*[ ''[[#Library.Id|Library.Id]]'' genreid = -1 ]
 
====Playlist.Id====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''string'' id = "" ]
*[ ''string'' file = "" ]
 
====Playlist.Item.Position====
'''Type:''' ''integer''<br />
'''Optional:''' true<br />
'''Default:''' -1
====Playlist.Repeat====
'''Type:''' ''string''<br />
'''Optional:''' true<br />
'''Default:''' "off"
====Playlist.State====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*''integer'' current
*''boolean'' paused
*''[[#Playlist.Repeat|Playlist.Repeat]]'' repeat
*''boolean'' playing
*''boolean'' shuffled
 
====Playlist.Video.Item====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''[[#Playlist.Id|Playlist.Id]]'' playlist ]
*[ ''[[#Library.Id|Library.Id]]'' movieid = -1 ]
*[ ''[[#Library.Id|Library.Id]]'' episodeid = -1 ]
*[ ''string'' file = "" ]
*[ ''string'' directory = "" ]
*[ ''[[#Library.Id|Library.Id]]'' musicvideoid = -1 ]
 
===System===
====System.Property.Name====
'''Type:''' ''string''<br />
'''Optional:''' true<br />
'''Default:''' "canshutdown"
====System.Property.Value====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''boolean'' canreboot = False ]
*[ ''boolean'' cansuspend = False ]
*[ ''boolean'' canhibernate = False ]
*[ ''boolean'' canshutdown = False ]
 
===Video===
====Video.Cast====
'''Type:''' ''array''<br />
'''Optional:''' true
====Video.Details.Episode====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''number'' rating = 0 ]
*[ ''[[#Library.Id|Library.Id]]'' tvshowid = -1 ]
*[ ''string'' file = "" ]
*[ ''string'' plot = "" ]
*[ ''string'' votes = "" ]
*[ ''string'' title = "" ]
*[ ''string'' fanart = "" ]
*[ ''string'' writer = "" ]
*''string'' label
*[ ''string'' thumbnail = "" ]
*[ ''[[#Video.Streams|Video.Streams]]'' streamdetails ]
*[ ''[[#Video.Resume|Video.Resume]]'' resume ]
*[ ''integer'' season = 0 ]
*[ ''string'' director = "" ]
*[ ''string'' showtitle = "" ]
*[ ''integer'' episode = 0 ]
*[ ''string'' productioncode = "" ]
*[ ''string'' lastplayed = "" ]
*''[[#Library.Id|Library.Id]]'' episodeid
*[ ''string'' originaltitle = "" ]
*[ ''[[#Video.Cast|Video.Cast]]'' cast ]
*[ ''string'' firstaired = "" ]
*[ ''integer'' playcount = 0 ]
*[ ''string'' runtime = "" ]
 
====Video.Details.Movie====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''number'' rating = 0 ]
*[ ''[[#Array.String|Array.String]]'' set ]
*[ ''string'' tagline = "" ]
*[ ''string'' file = "" ]
*[ ''integer'' year = 0 ]
*[ ''[[#Array.Integer|Array.Integer]]'' setid ]
*[ ''string'' plot = "" ]
*[ ''string'' votes = "" ]
*[ ''string'' title = "" ]
*[ ''string'' fanart = "" ]
*[ ''string'' mpaa = "" ]
*[ ''string'' writer = "" ]
*''string'' label
*[ ''string'' thumbnail = "" ]
*[ ''[[#Video.Streams|Video.Streams]]'' streamdetails ]
*[ ''string'' plotoutline = "" ]
*[ ''[[#Video.Resume|Video.Resume]]'' resume ]
*[ ''string'' director = "" ]
*[ ''string'' imdbnumber = "" ]
*[ ''string'' studio = "" ]
*[ ''string'' showlink = "" ]
*[ ''string'' genre = "" ]
*''[[#Library.Id|Library.Id]]'' movieid
*[ ''string'' productioncode = "" ]
*[ ''string'' country = "" ]
*[ ''string'' lastplayed = "" ]
*[ ''string'' premiered = "" ]
*[ ''string'' originaltitle = "" ]
*[ ''[[#Video.Cast|Video.Cast]]'' cast ]
*[ ''string'' sorttitle = "" ]
*[ ''integer'' playcount = 0 ]
*[ ''string'' runtime = "" ]
*[ ''integer'' top250 = 0 ]
*[ ''string'' trailer = "" ]
 
====Video.Details.MovieSet====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''string'' title = "" ]
*[ ''string'' fanart = "" ]
*''string'' label
*[ ''integer'' playcount = 0 ]
*[ ''string'' thumbnail = "" ]
*''[[#Library.Id|Library.Id]]'' setid
 
====Video.Details.MovieSet.Extended====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''string'' title = "" ]
*[ ''string'' fanart = "" ]
*''string'' label
*[ ''array'' movies ]
*[ ''integer'' playcount = 0 ]
*[ ''string'' thumbnail = "" ]
*''[[#Library.Id|Library.Id]]'' setid
 
====Video.Details.MusicVideo====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''string'' album = "" ]
*[ ''string'' plot = "" ]
*[ ''string'' artist = "" ]
*[ ''string'' fanart = "" ]
*[ ''string'' lastplayed = "" ]
*[ ''integer'' year = 0 ]
*[ ''[[#Video.Resume|Video.Resume]]'' resume ]
*''string'' label
*[ ''string'' director = "" ]
*[ ''string'' thumbnail = "" ]
*[ ''string'' studio = "" ]
*[ ''string'' file = "" ]
*[ ''integer'' track = 0 ]
*[ ''string'' genre = "" ]
*[ ''string'' title = "" ]
*[ ''integer'' playcount = 0 ]
*[ ''string'' runtime = "" ]
*''[[#Library.Id|Library.Id]]'' musicvideoid
*[ ''[[#Video.Streams|Video.Streams]]'' streamdetails ]
 
====Video.Details.Season====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''[[#Library.Id|Library.Id]]'' tvshowid = -1 ]
*[ ''integer'' episode = 0 ]
*[ ''string'' fanart = "" ]
*''integer'' season
*''string'' label
*[ ''integer'' playcount = 0 ]
*[ ''string'' thumbnail = "" ]
*[ ''string'' showtitle = "" ]
 
====Video.Details.TVShow====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''string'' episodeguide = "" ]
*''[[#Library.Id|Library.Id]]'' tvshowid
*[ ''number'' rating = 0 ]
*[ ''string'' file = "" ]
*[ ''integer'' year = 0 ]
*[ ''string'' plot = "" ]
*[ ''string'' votes = "" ]
*[ ''string'' title = "" ]
*[ ''string'' fanart = "" ]
*[ ''string'' mpaa = "" ]
*''string'' label
*[ ''string'' thumbnail = "" ]
*[ ''string'' imdbnumber = "" ]
*[ ''string'' studio = "" ]
*[ ''string'' genre = "" ]
*[ ''integer'' episode = 0 ]
*[ ''string'' lastplayed = "" ]
*[ ''string'' premiered = "" ]
*[ ''string'' originaltitle = "" ]
*[ ''[[#Video.Cast|Video.Cast]]'' cast ]
*[ ''string'' sorttitle = "" ]
*[ ''integer'' playcount = 0 ]
 
====Video.Fields.Episode====
'''Type:''' ''array''<br />
'''Optional:''' true
====Video.Fields.Movie====
'''Type:''' ''array''<br />
'''Optional:''' true
====Video.Fields.MovieSet====
'''Type:''' ''array''<br />
'''Optional:''' true
====Video.Fields.MusicVideo====
'''Type:''' ''array''<br />
'''Optional:''' true
====Video.Fields.Season====
'''Type:''' ''array''<br />
'''Optional:''' true
====Video.Fields.TVShow====
'''Type:''' ''array''<br />
'''Optional:''' true
====Video.Resume====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''number'' position = 0 ]
*[ ''number'' total = 0 ]
 
====Video.Streams====
'''Type:''' ''object''<br />
'''Optional:''' true<br />
'''Properties:'''
*[ ''array'' video ]
*[ ''array'' audio ]
*[ ''array'' subtitle ]
 
==Notifications==
===AudioLibrary===
====AudioLibrary.OnRemove====
An audio item has been removed.<br />
'''Parameters:'''
#''string'' sender
#''object'' data<br />
'''Properties:'''
*''[[#Notifications.Library.Audio.Type|Notifications.Library.Audio.Type]]'' type
*''[[#Library.Id|Library.Id]]'' id
'''Returns: '''null
 
====AudioLibrary.OnUpdate====
An audio item has been updated.<br />
'''Parameters:'''
#''string'' sender
#''object'' data<br />
'''Properties:'''
*''string'' type
*''[[#Library.Id|Library.Id]]'' id
'''Returns: '''null
 
===Player===
====Player.OnPause====
Playback of a media item has been paused. If there is no ID available extra information will be provided.<br />
'''Parameters:'''
#''string'' sender
#''object'' data<br />
'''Properties:'''
*[ ''string'' album ]
*[ ''integer'' episode ]
*[ ''string'' artist ]
*[ ''integer'' track ]
*[ ''integer'' season ]
*[ ''string'' title ]
*[ ''integer'' year ]
*''[[#Notifications.Player.Type|Notifications.Player.Type]]'' type
*[ ''[[#Library.Id|Library.Id]]'' id ]
*[ ''string'' showtitle ]
'''Returns: '''null
 
====Player.OnPlay====
Playback of a media item has been started or the playback speed has changed. If there is no ID available extra information will be provided.<br />
'''Parameters:'''
#''string'' sender
#''object'' data<br />
'''Properties:'''
*[ ''string'' album ]
*[ ''integer'' episode ]
*[ ''string'' artist ]
*[ ''integer'' track ]
*[ ''integer'' season ]
*[ ''string'' title ]
*[ ''integer'' year ]
*''string'' type
*''integer'' speed
*[ ''[[#Library.Id|Library.Id]]'' id ]
*[ ''string'' showtitle ]
'''Returns: '''null
 
====Player.OnSeek====
The playback position has been changed.<br />
'''Parameters:'''
#''string'' sender
#''object'' data<br />
'''Properties:'''
*''integer'' seekoffset
*''integer'' time
'''Returns: '''null
 
====Player.OnStop====
Playback of a media item has been stopped. If there is no ID available extra information will be provided.<br />
'''Parameters:'''
#''string'' sender
#''object'' data<br />
'''Properties:'''
*[ ''string'' album ]
*[ ''integer'' episode ]
*[ ''string'' artist ]
*[ ''integer'' track ]
*[ ''integer'' season ]
*[ ''string'' title ]
*[ ''integer'' year ]
*[ ''[[#Notifications.Player.Type|Notifications.Player.Type]]'' type ]
*[ ''[[#Library.Id|Library.Id]]'' id ]
*[ ''string'' showtitle ]
'''Returns: '''null
 
===System===
====System.OnLowBattery====
The system is on low battery.<br />
'''Parameters:'''
#''string'' sender
#''null'' data
'''Returns: '''null
 
====System.OnQuit====
XBMC will be closed.<br />
'''Parameters:'''
#''string'' sender
#''null'' data
'''Returns: '''null
 
====System.OnRestart====
The system will be restarted.<br />
'''Parameters:'''
#''string'' sender
#''null'' data
'''Returns: '''null
 
====System.OnSleep====
The system will be suspended.<br />
'''Parameters:'''
#''string'' sender
#''null'' data
'''Returns: '''null
 
====System.OnWake====
The system woke up from suspension.<br />
'''Parameters:'''
#''string'' sender
#''null'' data
'''Returns: '''null
 
===VideoLibrary===
====VideoLibrary.OnRemove====
A video item has been removed.<br />
'''Parameters:'''
#''string'' sender
#''object'' data<br />
'''Properties:'''
*''[[#Notifications.Library.Video.Type|Notifications.Library.Video.Type]]'' type
*''[[#Library.Id|Library.Id]]'' id
'''Returns: '''null
 
====VideoLibrary.OnUpdate====
A video item has been updated.<br />
'''Parameters:'''
#''string'' sender
#''object'' data<br />
'''Properties:'''
*[ ''integer'' playcount = -1 ]
*''string'' type
*''[[#Library.Id|Library.Id]]'' id
'''Returns: '''null
 
== Debugging ==
=== Output format ===
To be able to support easier debugging of (third party) development using the JSON RPC API, the JSON output generated by XBMC can be pretty printed by setting
<source lang="xml">
<source lang="xml">
<jsonrpc>
<jsonrpc>
Line 2,175: Line 67:
in the [[Advancedsettings.xml#.3Cjsonrpc.3E|advancedsettings.xml]]. Default JSON output will be in compact format to minimize sent data (especially useful for mobile devices).
in the [[Advancedsettings.xml#.3Cjsonrpc.3E|advancedsettings.xml]]. Default JSON output will be in compact format to minimize sent data (especially useful for mobile devices).


=== Direct interaction ===
===Direct interaction===
To be able to test some methods of XBMC's JSON RPC API it can be of great help to be able to send a single hand-written JSON RPC request to XBMC to see its effect and the generated response. Depending on the transport protocol used there are different possibilities to do that:
To be able to test some methods of XBMC's JSON-RPC API it can be of great help to be able to send a single hand-written JSON-RPC request to XBMC to see its effect and the generated response. Depending on the transport protocol used there are different possibilities to do that:


==== TCP ====
====TCP====
With a '''[http://en.wikipedia.org/wiki/Telnet telnet]''' connection (using [http://en.wikipedia.org/wiki/PuTTY PuTTY] on Windows or telnet on Linux) to port 9090 of the machine running XBMC it is possible to send and receive raw json data to/from XBMC.
With a '''[http://en.wikipedia.org/wiki/Telnet telnet]''' connection (using [http://en.wikipedia.org/wiki/PuTTY PuTTY] on Windows or telnet on Linux) to port 9090 of the machine running XBMC it is possible to send and receive raw json data to/from XBMC.


==== HTTP ====
====HTTP====
A simple way of manually sending HTTP requests containing a JSON RPC request to XBMC is using the [http://chrome.google.com/extensions/detail/fhjcajmcbmldlhcimfajhfbgofnpcjmb Simple REST Client] extension for Google's Chrome/Chromium browser. It allows defining an URL and the HTTP request type ('''POST''' is what we need). The actual JSON RPC request can be defined in the '''Data''' field and then sent to XBMC.
A simple way of manually sending HTTP requests containing a JSON-RPC request to XBMC is using the [http://chrome.google.com/extensions/detail/fhjcajmcbmldlhcimfajhfbgofnpcjmb Simple REST Client] extension for Google's Chrome/Chromium browser. It allows defining an URL and the HTTP request type ('''POST''' is what we need). The actual JSON-RPC request can be defined in the '''Data''' field and then sent to XBMC.
 
== Development ==
=== Dharma (10.0) ===
==== Supported features of JSON RPC 2.0 ====
* Method calls (with or without parameters) over HTTP or TCP
* Server-side (XBMC) announcements (over TCP port 9090)
* by-name parameters
 
==== Unsupported features of JSON RPC 2.0 ====
* support for by-value OR by-position parameters
* "params" must always be an array (by-position) or an object (by-value) but never a simple type
* Client-side announcements (XBMC returns an error response)
* Bulk requests (XBMC returns a parse error response)


=== Eden (11.0) [WIP] ===
==External links==
==== Additionally supported features of JSON RPC 2.0 ====
*[http://jsonrpc.org/spec.html JSON-RPC 2.0 specification]
* Client-side announcements (methods can be called without the "id" field which will result in the execution of the method without returning a response) [http://github.com/xbmc/xbmc/commit/625699dcd724b771c327b2b1d1e018b8bf91b11c 625699dcd724b771c327]
*[http://tools.ietf.org/html/draft-zyp-json-schema-03 A JSON Media Type for Describing the Structure and Meaning of JSON Documents (Draft 03)]
* Bulk requests (multiple method calls can be sent as an array in a single json rpc request; all methods are executed and the response contains all responses of the bulk request in an array) [http://github.com/xbmc/xbmc/commit/605dbbc542e61c888be46b0d4114ce73b00e14d0 605dbbc542e61c888be4]
* Default JSON output in compact format ([[Advancedsettings.xml#.3Cjsonrpc.3E|Advanced Settings]] option to disable compact json output) [http://github.com/xbmc/xbmc/commit/20e18ee556b324da8f836ec9eb6678840297d7d7 20e18ee556b324da8f83]
* support for by-value OR by-position parameters [http://github.com/xbmc/xbmc/commit/774b8868ee59a1778ad5eeac7d3d712bb2585aed 774b8868ee59a1778ad5]
* "params" must always be an array (by-position) or an object (by-value) but never a simple type [http://github.com/xbmc/xbmc/commit/774b8868ee59a1778ad5eeac7d3d712bb2585aed 774b8868ee59a1778ad5]


[[Category:Inner Workings]]
[[Category:Inner Workings]]
[[Category:Development]]
[[Category:Development]]

Revision as of 21:08, 24 October 2011

JSON-RPC is a HTTP- and/or raw TCP socket-based interface for communicating with XBMC. It replaces the soon-to-be-depreceated HTTP API, and offers a more secure and robust mechanism in the same format. It is based upon the JSON-RPC 2.0 specification.

Each method in the interface can have different security needs which means one client may be allowed to only control playback while another can only read and manipulate the library. In version 2 (first stable) and 4 all clients are granted full authority but will later be forced to ask for privileges and the user of XBMC will have to grant said client access. The design of JSON-RPC is that most methods should behave roughly the same and maintain consistency while hiding the mechanics of XBMC from the client creator.

In XBMC JSON-RPC can be accessed over a variety of transports and has been designed from the ground up to be flexible to allow control over new transports easily. Some of the transports have different limitations which will be enforced upon the interaction over that transport. As an example HTTP transports allow response and downloading of files while the raw TCP transport allows response and notifications (events and information XBMC sends to its clients). Depending on the client's needs it will choose one (or many) of the available transports.

Enabling JSON-RPC

Since the interface is available on many transports enabling it depends on the transport.

  • Python: Always enabled
  • HTTP: In System/Settings/Network/Services activate Allow control of XBMC via HTTP
  • TCP: In System/Settings/Network/Services activate Allow programs on this system to control XBMC for localhost access only and Allow programs on other systems to control XBMC for access from other computers as well

Note: The EventServer is a different interface for sending remote keypresses to XBMC, and must be enabled separately, some programs may use both interfaces.

Transports

Functionalities

TODO

Comparison

The following table shows all the available transports and what functionalities they support

Response Notifications Direct file download Redirected file download
Python Yes Yes No No
TCP Yes Yes No No
HTTP Yes No No Yes

API versions

The JSON-RPC API exposed by XBMC is constantly extended to provide better and more functionality to third party applications. For that reason XBMC provides a version information through the JSONRPC.Version method. The rule is that odd version numbers describe an API state, that is not stable and under heavy development whereas even version numbers describe a stable API. Therefore the version number can be used by third party clients to check if their application might not be fully compatible with the JSON-RPC API exposed by a users XBMC installation.

Since the first release of the JSON-RPC API in XBMC 10.0 (Dharma) there have been the following versions of the API:

Documentation

TODO

Debugging

Output format

To be able to support easier debugging of (third party) development using the JSON-RPC API, the JSON output generated by XBMC can be pretty printed by setting

<jsonrpc>
    <compactoutput>false</compactoutput>
</jsonrpc>

in the advancedsettings.xml. Default JSON output will be in compact format to minimize sent data (especially useful for mobile devices).

Direct interaction

To be able to test some methods of XBMC's JSON-RPC API it can be of great help to be able to send a single hand-written JSON-RPC request to XBMC to see its effect and the generated response. Depending on the transport protocol used there are different possibilities to do that:

TCP

With a telnet connection (using PuTTY on Windows or telnet on Linux) to port 9090 of the machine running XBMC it is possible to send and receive raw json data to/from XBMC.

HTTP

A simple way of manually sending HTTP requests containing a JSON-RPC request to XBMC is using the Simple REST Client extension for Google's Chrome/Chromium browser. It allows defining an URL and the HTTP request type (POST is what we need). The actual JSON-RPC request can be defined in the Data field and then sent to XBMC.

External links