JSON-RPC API v3 (pre Eden)

From Official Kodi Wiki
Revision as of 22:29, 24 October 2011 by >Montellese (added json schema support tables)
Jump to navigation Jump to search

Version 3 is a development version of XBMC's JSON-RPC API and will be released as a stable version 4 with the release of Eden. It is a complete re-write and re-structuring of version 2 and therefore isn't backwards compatible to it. The main reason for this was the need to make this version fully compatible with all the functionality, features and requirements of the JSON-RPC 2.0 specification. This was a main concern during early development to make it easier for third party developers and applications to interact with XBMC's JSON-RPC API by using existing JSON-RPC libraries.

An rough and incomplete list of changes compared to version 2 can be found here. A more complete and detailed list can be found in the forum.

Documentation (JSON Schema)

Starting with JSON-RPC API version 3 a new way of API documentation has been introduced. All methods and data types are described using JSON Schema. This provides third party developers with an always complete and up-to-date documentation by calling JSONRPC.Introspect even during periods of heavy development. Furthermore the same method and data type specification that can be used by third party developers as a documentation is used by XBMC to check and verify method parameters and their values on every JSON-RPC request and allows to provide detailed error messages in case of a bad or missing parameter.

Supported features of JSON Schema

Schema IETF Draft 03
type Yes
properties Yes
patternProperties No
additionalProperties Yes
items Yes
additionalItems Yes
required Yes
dependencies No
minimum Yes
maximum Yes
Schema IETF Draft 03
exclusiveMinimum Yes
exclusiveMaximum Yes
minItems Yes
maxItems Yes
uniqueItems Yes
pattern No
minLength Yes
maxLength Yes
enum Yes
default Yes
Schema IETF Draft 03
title No
description Yes
format No
divisibleBy Yes
disallow No
extends Yes
id Yes
$ref Yes
$schema No
Hyper Schema No

Error message

If XBMC detects a bad or missing parameter in a JSON-RPC request it returns an error object. The JSON schema description of that error object is

{
  "type": "object",
  "properties": {
    "code": { "type": "integer", "required": true },
    "message": { "type": "string", "required": true },
    "data": { "type": "object",
      "properties": {
        "method": { "type": "string", "required": true },
        "stack": { "type": "object", "id": "Error.Stack",
          "properties": {
            "name": { "type": "string", "required": true },
            "type": { "type": "string", "required": true },
            "message": { "type": "string", "required": true },
            "property": { "$ref": "Error.Stack" }
          }
        }
      }
    }
  }
}

Namespaces

The XBMC JSON-RPC API is split up into namespaces, which contain methods that can be called. These namespaces are:

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

Methods

Application

Application.GetProperties

Retrieves the values of the given properties
Permission: ReadData
Parameters:

  1. array properties

Returns:
Type: Application.Property.Value
Optional: true

Application.Quit

Quit application
Permission: ControlPower
Parameters: None
Returns:
Type: string
Optional: true

Application.SetVolume

Set the current volume
Permission: ControlPlayback
Parameters:

  1. integer value

Returns:
Type: integer
Optional: true

Application.ToggleMute

Toggle mute/unmute
Permission: ControlPlayback
Parameters: None
Returns:
Type: integer
Optional: true

AudioLibrary

AudioLibrary.Clean

Cleans the audio library from non-existent items
Permission: RemoveData
Parameters: None
Returns:
Type: string
Optional: true

AudioLibrary.Export

Exports all items from the audio library
Permission: WriteFile
Parameters:

  1. [ boolean singlefile = True ]
  2. [ boolean images = False ]
  3. [ boolean overwrite = False ]
  4. [ string path = "" ]

Returns:
Type: string
Optional: true

AudioLibrary.GetAlbumDetails

Retrieve details about a specific album
Permission: ReadData
Parameters:

  1. Library.Id albumid
  2. [ Audio.Fields.Album fields ]

Returns:
Type: object
Optional: true
Properties:


AudioLibrary.GetAlbums

Retrieve all albums from specified artist or genre
Permission: ReadData
Parameters:

  1. [ Library.Id artistid = -1 ]
  2. [ Library.Id genreid = -1 ]
  3. [ Audio.Fields.Album fields ]
  4. [ List.Limits limits ]
  5. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


AudioLibrary.GetArtistDetails

Retrieve details about a specific artist
Permission: ReadData
Parameters:

  1. Library.Id artistid
  2. [ Audio.Fields.Artist fields ]

Returns:
Type: object
Optional: true
Properties:


AudioLibrary.GetArtists

Retrieve all artists
Permission: ReadData
Parameters:

  1. [ Optional.Boolean albumartistsonly = null ]
  2. [ Library.Id genreid = -1 ]
  3. [ Audio.Fields.Artist fields ]
  4. [ List.Limits limits ]
  5. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


AudioLibrary.GetGenres

Retrieve all genres
Permission: ReadData
Parameters:

  1. [ Library.Fields.Genre fields ]
  2. [ List.Limits limits ]
  3. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


AudioLibrary.GetRecentlyAddedAlbums

Retrieve recently added albums
Permission: ReadData
Parameters:

  1. [ List.Amount albums = -1 ]
  2. [ Audio.Fields.Album fields ]
  3. [ List.Limits limits ]
  4. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


AudioLibrary.GetRecentlyAddedSongs

Retrieve recently added songs
Permission: ReadData
Parameters:

  1. [ List.Amount albums = -1 ]
  2. [ Audio.Fields.Song fields ]
  3. [ List.Limits limits ]
  4. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


AudioLibrary.GetSongDetails

Retrieve details about a specific song
Permission: ReadData
Parameters:

  1. Library.Id songid
  2. [ Audio.Fields.Song fields ]

Returns:
Type: object
Optional: true
Properties:


AudioLibrary.GetSongs

Retrieve all songs from specified album, artist or genre
Permission: ReadData
Parameters:

  1. [ Library.Id artistid = -1 ]
  2. [ Library.Id albumid = -1 ]
  3. [ Library.Id genreid = -1 ]
  4. [ Audio.Fields.Song fields ]
  5. [ List.Limits limits ]
  6. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


AudioLibrary.Scan

Scans the audio sources for new library items
Permission: UpdateData
Parameters: None
Returns:
Type: string
Optional: true

AudioPlayer

AudioPlayer.BigSkipBackward

Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

AudioPlayer.BigSkipForward

Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

AudioPlayer.Forward

Forward current playback
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

AudioPlayer.GetPercentage

Retrieve current playback progress in percentage
Permission: ReadData
Parameters: None
Returns:
Type: number
Optional: true

AudioPlayer.GetTime

Retrieves the current and total time of the currently playing file
Permission: ReadData
Parameters: None
Returns:
Type: Player.TimeValues
Optional: true

AudioPlayer.PlayPause

Pauses or unpause playback and returns the new state
Permission: ControlPlayback
Parameters: None
Returns:
Type: Player.State
Optional: true

AudioPlayer.Rewind

Rewind current playback
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

AudioPlayer.SeekPercentage

Seek to a specific percentage
Permission: ControlPlayback
Parameters:

  1. Player.SeekPercentage value

Returns:
Type: string
Optional: true

AudioPlayer.SeekTime

Seek to a specific time
Permission: ControlPlayback
Parameters:

  1. Player.SeekTime value

Returns:
Type: string
Optional: true

AudioPlayer.SkipNext

Skips to next item on the playlist
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

AudioPlayer.SkipPrevious

Skips to previous item on the playlist
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

AudioPlayer.SmallSkipBackward

Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

AudioPlayer.SmallSkipForward

Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

AudioPlayer.State

Returns playback state of the audio player (if it is active)
Permission: ReadData
Parameters: None
Returns:
Type: Player.State.Extended
Optional: true

AudioPlayer.Stop

Stops playback
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

AudioPlaylist

AudioPlaylist.Add

Add item(s) to playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Audio.Item item

Returns:
Type: string
Optional: true

AudioPlaylist.Clear

Clear playlist
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

AudioPlaylist.GetItems

Get all items from playlist
Permission: ReadData
Parameters:

  1. [ Audio.Fields.Song fields ]
  2. [ List.Limits limits ]
  3. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


AudioPlaylist.Insert

Insert item(s) into playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Item.Position index
  2. Playlist.Audio.Item item

Returns:
Type: string
Optional: true

AudioPlaylist.Play

Play current or a specific item
Permission: ControlPlayback
Parameters:

  1. [ Playlist.Item.Position item = -1 ]
  2. [ Library.Id songid = -1 ]

Returns:
Type: object
Optional: true
Properties:

  • boolean success


AudioPlaylist.Remove

Remove item from playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Item.Position item

Returns:
Type: string
Optional: true

AudioPlaylist.Repeat

Set the repeat mode of the playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Repeat state

Returns:
Type: string
Optional: true

AudioPlaylist.Shuffle

Shuffle playlist
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

AudioPlaylist.SkipNext

Skip current item and play next item
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

AudioPlaylist.SkipPrevious

Skip current item and play previous item
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

AudioPlaylist.State

Provides information about the current state of the playlist
Permission: ReadData
Parameters: None
Returns:
Type: Playlist.State
Optional: true

AudioPlaylist.Swap

Swap items in the playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Item.Position item1
  2. Playlist.Item.Position item2

Returns:
Type: string
Optional: true

AudioPlaylist.UnShuffle

Unshuffle playlist
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
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
Parameters:

  1. string path

Returns:
Type: object
Optional: true
Properties:

  • string path

Files.GetDirectory

Permission: ReadData
Parameters:

  1. string directory
  2. [ Files.Media media = "files" ]
  3. [ List.Fields.All fields ]
  4. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


Files.GetSources

Get the sources of the media windows
Permission: ReadData
Parameters:

  1. Files.Media media
  2. [ List.Limits limits ]
  3. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


Input

Input.Back

Goes back in GUI
Permission: Navigate
Parameters: None
Returns:
Type: string
Optional: true

Input.Down

Navigate down in GUI
Permission: Navigate
Parameters: None
Returns:
Type: string
Optional: true

Input.Home

Goes to home window in GUI
Permission: Navigate
Parameters: None
Returns:
Type: string
Optional: true

Input.Left

Navigate left in GUI
Permission: Navigate
Parameters: None
Returns:
Type: string
Optional: true

Input.Right

Navigate right in GUI
Permission: Navigate
Parameters: None
Returns:
Type: string
Optional: true

Input.Select

Select current item in GUI
Permission: Navigate
Parameters: None
Returns:
Type: string
Optional: true

Input.Up

Navigate up in GUI
Permission: Navigate
Parameters: None
Returns:
Type: string
Optional: true

JSONRPC

JSONRPC.GetConfiguration

Get client-specific configurations
Permission: ReadData
Parameters: None
Returns:
Type: Configuration
Optional: true

JSONRPC.Introspect

Enumerates all actions and descriptions
Permission: ReadData
Parameters:

  1. [ boolean getdescriptions = True ]
  2. [ boolean getmetadata = False ]
  3. [ boolean filterbytransport = True ]
  4. [ object filter ]

Properties:

  • string type
  • string id
  • [ boolean getreferences = True ]

Returns:
Type: object
Optional: true

JSONRPC.NotifyAll

Notify all other connected clients
Permission: ReadData
Parameters:

  1. string sender
  2. string message
  3. [ any data = null ]

Returns:
Type: any
Optional: true

JSONRPC.Permission

Retrieve the clients permissions
Permission: ReadData
Parameters: None
Returns:
Type: object
Optional: true
Properties:

  • boolean removedata
  • boolean controlplayback
  • boolean readdata
  • boolean updatedata
  • boolean writefile
  • boolean controlnotify
  • boolean controlpower


JSONRPC.Ping

Ping responder
Permission: ReadData
Parameters: None
Returns:
Type: string
Optional: true

JSONRPC.SetConfiguration

Change the client-specific configuration
Permission: ControlNotify
Parameters:

  1. [ object notifications ]

Properties:

Returns:
Type: Configuration
Optional: true

JSONRPC.Version

Retrieve the jsonrpc protocol version
Permission: ReadData
Parameters: None
Returns:
Type: string
Optional: true

PicturePlayer

PicturePlayer.MoveDown

If picture is zoomed move viewport down
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

PicturePlayer.MoveLeft

If picture is zoomed move viewport left otherwise skip previous
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

PicturePlayer.MoveRight

If picture is zoomed move viewport right otherwise skip next
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

PicturePlayer.MoveUp

If picture is zoomed move viewport up
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

PicturePlayer.PlayPause

Pauses or unpause slideshow
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

PicturePlayer.Rotate

Rotates current picture
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

PicturePlayer.SkipNext

Skips to next picture in the slideshow
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

PicturePlayer.SkipPrevious

Skips to previous picture in the slideshow
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

PicturePlayer.Stop

Stops slideshow
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

PicturePlayer.Zoom

Zooms current picture
Permission: ControlPlayback
Parameters:

  1. integer value

Returns:
Type: string
Optional: true

PicturePlayer.ZoomIn

Zoom in once
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

PicturePlayer.ZoomOut

Zoom out once
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

Player

Player.GetActivePlayers

Returns all active players
Permission: ReadData
Parameters: None
Returns:
Type: object
Optional: true
Properties:

  • boolean picture
  • boolean audio
  • boolean video


Playlist

Playlist.Add

Add items to the playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Id playlist
  2. Playlist.Id items

Returns:
Type: string
Optional: true

Playlist.Clear

Clear playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Id playlist

Returns:
Type: string
Optional: true

Playlist.Create

Creates a virtual playlist from a given one from a file
Permission: ReadData
Parameters:

  1. Playlist.Id playlist

Returns:
Type: object
Optional: true
Properties:

  • string playlistid


Playlist.Destroy

Destroys a virtual playlist
Permission: ReadData
Parameters:

  1. string playlistid

Returns:
Type: string
Optional: true

Playlist.GetItems

Retrieve items in the playlist
Permission: ReadData
Parameters:

  1. Playlist.Id playlist
  2. [ List.Fields.All fields ]
  3. [ List.Limits limits ]
  4. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


Playlist.Remove

Remove item from the playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Id playlist
  2. ['string', 'integer'] item

Returns:
Type: string
Optional: true

Playlist.Shuffle

Shuffle playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Id playlist

Returns:
Type: string
Optional: true

Playlist.Swap

Swap items in the playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Id playlist
  2. Playlist.Item.Position item1
  3. Playlist.Item.Position item2

Returns:
Type: string
Optional: true

Playlist.UnShuffle

Unshuffle playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Id playlist

Returns:
Type: string
Optional: true

System

System.GetProperties

Retrieves the values of the given properties
Permission: ReadData
Parameters:

  1. array properties

Returns:
Type: System.Property.Value
Optional: true

System.Hibernate

Puts the system running XBMC into hibernate mode
Permission: ControlPower
Parameters: None
Returns:
Type: string
Optional: true

System.Reboot

Reboots the system running XBMC
Permission: ControlPower
Parameters: None
Returns:
Type: string
Optional: true

System.Shutdown

Shuts the system running XBMC down
Permission: ControlPower
Parameters: None
Returns:
Type: string
Optional: true

System.Suspend

Suspends the system running XBMC
Permission: ControlPower
Parameters: None
Returns:
Type: string
Optional: true

VideoLibrary

VideoLibrary.Clean

Cleans the video library from non-existent items
Permission: RemoveData
Parameters: None
Returns:
Type: string
Optional: true

VideoLibrary.Export

Exports all items from the video library
Permission: WriteFile
Parameters:

  1. [ boolean singlefile = True ]
  2. [ boolean images = False ]
  3. [ boolean actorthumbs = False ]
  4. [ boolean overwrite = False ]
  5. [ string path = "" ]

Returns:
Type: string
Optional: true

VideoLibrary.GetEpisodeDetails

Retrieve details about a specific tv show episode
Permission: ReadData
Parameters:

  1. Library.Id episodeid
  2. [ Video.Fields.Episode fields ]

Returns:
Type: object
Optional: true
Properties:


VideoLibrary.GetEpisodes

Retrieve all tv show episodes
Permission: ReadData
Parameters:

  1. [ Library.Id tvshowid = -1 ]
  2. [ integer season = -1 ]
  3. [ Video.Fields.Episode fields ]
  4. [ List.Limits limits ]
  5. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


VideoLibrary.GetGenres

Retrieve all genres
Permission: ReadData
Parameters:

  1. string type
  2. [ Library.Fields.Genre fields ]
  3. [ List.Limits limits ]
  4. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


VideoLibrary.GetMovieDetails

Retrieve details about a specific movie
Permission: ReadData
Parameters:

  1. Library.Id movieid
  2. [ Video.Fields.Movie fields ]

Returns:
Type: object
Optional: true
Properties:


VideoLibrary.GetMovieSetDetails

Retrieve details about a specific movie set
Permission: ReadData
Parameters:

  1. Library.Id setid
  2. [ Video.Fields.MovieSet fields ]
  3. [ object movies ]

Properties:

Returns:
Type: object
Optional: true
Properties:


VideoLibrary.GetMovieSets

Retrieve all movie sets
Permission: ReadData
Parameters:

  1. [ Video.Fields.MovieSet fields ]
  2. [ List.Limits limits ]
  3. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


VideoLibrary.GetMovies

Retrieve all movies
Permission: ReadData
Parameters:

  1. [ Video.Fields.Movie fields ]
  2. [ List.Limits limits ]
  3. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


VideoLibrary.GetMusicVideoDetails

Retrieve details about a specific music video
Permission: ReadData
Parameters:

  1. Library.Id musicvideoid
  2. [ Video.Fields.MusicVideo fields ]

Returns:
Type: object
Optional: true
Properties:


VideoLibrary.GetMusicVideos

Retrieve all music videos
Permission: ReadData
Parameters:

  1. [ Library.Id artistid = -1 ]
  2. [ Library.Id albumid = -1 ]
  3. [ Video.Fields.MusicVideo fields ]
  4. [ List.Limits limits ]
  5. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


VideoLibrary.GetRecentlyAddedEpisodes

Retrieve all recently added tv episodes
Permission: ReadData
Parameters:

  1. [ Video.Fields.Episode fields ]
  2. [ List.Limits limits ]
  3. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


VideoLibrary.GetRecentlyAddedMovies

Retrieve all recently added movies
Permission: ReadData
Parameters:

  1. [ Video.Fields.Movie fields ]
  2. [ List.Limits limits ]
  3. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


VideoLibrary.GetRecentlyAddedMusicVideos

Retrieve all recently added music videos
Permission: ReadData
Parameters:

  1. [ Video.Fields.MusicVideo fields ]
  2. [ List.Limits limits ]
  3. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


VideoLibrary.GetSeasons

Retrieve all tv seasons
Permission: ReadData
Parameters:

  1. Library.Id tvshowid
  2. [ Video.Fields.Season fields ]
  3. [ List.Limits limits ]
  4. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


VideoLibrary.GetTVShowDetails

Retrieve details about a specific tv show
Permission: ReadData
Parameters:

  1. Library.Id tvshowid
  2. [ Video.Fields.TVShow fields ]

Returns:
Type: object
Optional: true
Properties:


VideoLibrary.GetTVShows

Retrieve all tv shows
Permission: ReadData
Parameters:

  1. [ Video.Fields.TVShow fields ]
  2. [ List.Limits limits ]
  3. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


VideoLibrary.Scan

Scans the video sources for new library items
Permission: UpdateData
Parameters: None
Returns:
Type: string
Optional: true

VideoPlayer

VideoPlayer.BigSkipBackward

Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

VideoPlayer.BigSkipForward

Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

VideoPlayer.Forward

Forward current playback
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

VideoPlayer.GetPercentage

Retrieve current playback progress in percentage
Permission: ReadData
Parameters: None
Returns:
Type: number
Optional: true

VideoPlayer.GetTime

Retrieves the current and total time of the currently playing file
Permission: ReadData
Parameters: None
Returns:
Type: Player.TimeValues
Optional: true

VideoPlayer.PlayPause

Pauses or unpause playback and returns the new state
Permission: ControlPlayback
Parameters: None
Returns:
Type: Player.State
Optional: true

VideoPlayer.Rewind

Rewind current playback
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

VideoPlayer.SeekPercentage

Seek to a specific percentage
Permission: ControlPlayback
Parameters:

  1. Player.SeekPercentage value

Returns:
Type: string
Optional: true

VideoPlayer.SeekTime

Seek to a specific time
Permission: ControlPlayback
Parameters:

  1. Player.SeekTime value

Returns:
Type: string
Optional: true

VideoPlayer.SkipNext

Skips to next item on the playlist
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

VideoPlayer.SkipPrevious

Skips to previous item on the playlist
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

VideoPlayer.SmallSkipBackward

Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

VideoPlayer.SmallSkipForward

Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

VideoPlayer.State

Returns playback state of the video player (if it is active)
Permission: ReadData
Parameters: None
Returns:
Type: Player.State.Extended
Optional: true

VideoPlayer.Stop

Stops playback
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

VideoPlaylist

VideoPlaylist.Add

Add item(s) to playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Video.Item item

Returns:
Type: string
Optional: true

VideoPlaylist.Clear

Clear playlist
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

VideoPlaylist.GetItems

Get all items from playlist
Permission: ReadData
Parameters:

  1. [ List.Fields.Video fields ]
  2. [ List.Limits limits ]
  3. [ List.Sort sort ]

Returns:
Type: object
Optional: true
Properties:


VideoPlaylist.Insert

Insert item(s) into playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Item.Position index
  2. Playlist.Video.Item item

Returns:
Type: string
Optional: true

VideoPlaylist.Play

Play current or a specific item
Permission: ControlPlayback
Parameters:

  1. [ Playlist.Item.Position item = -1 ]

Returns:
Type: object
Optional: true
Properties:

  • boolean success


VideoPlaylist.Remove

Remove item from playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Item.Position item

Returns:
Type: string
Optional: true

VideoPlaylist.Repeat

Set the repeat mode of the playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Repeat state

Returns:
Type: string
Optional: true

VideoPlaylist.Shuffle

Shuffle playlist
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

VideoPlaylist.SkipNext

Skip current item and play next item
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

VideoPlaylist.SkipPrevious

Skip current item and play previous item
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

VideoPlaylist.State

Provides information about the current state of the playlist
Permission: ReadData
Parameters: None
Returns:
Type: Playlist.State
Optional: true

VideoPlaylist.Swap

Swap items in the playlist
Permission: ControlPlayback
Parameters:

  1. Playlist.Item.Position item1
  2. Playlist.Item.Position item2

Returns:
Type: string
Optional: true

VideoPlaylist.UnShuffle

Unshuffle playlist
Permission: ControlPlayback
Parameters: None
Returns:
Type: string
Optional: true

XBMC

XBMC.GetInfoBooleans

Retrieve info booleans about XBMC and the system
Permission: ReadData
Parameters:

  1. array booleans

Returns:
Type: object
Optional: true

XBMC.GetInfoLabels

Retrieve info labels about XBMC and the system
Permission: ReadData
Parameters:

  1. array labels

Returns:
Type: object
Optional: true

XBMC.Play

Starts playback of the given file
Permission: ControlPlayback
Parameters:

  1. string file

Returns:
Type: string
Optional: true

XBMC.StartSlideshow

Starts slideshow with the images from the given directory
Permission: ControlPlayback
Parameters:

  1. string directory
  2. [ boolean random = True ]
  3. [ boolean recursive = True ]

Returns:
Type: string
Optional: true


Global types

Application

Application.Property.Name

Type: string
Optional: true
Default: "volume"

Application.Property.Value

Type: object
Optional: true
Properties:

  • [ boolean muted = False ]
  • [ integer volume = 0 ]

Array

Array.Integer

Type: array
Optional: true

Array.String

Type: array
Optional: true

Audio

Audio.Details.Album

Type: object
Optional: true
Properties:

  • [ integer rating = 0 ]
  • [ string style = "" ]
  • [ string theme = "" ]
  • [ string description = "" ]
  • [ string artist = "" ]
  • [ string fanart = "" ]
  • [ string albumlabel = "" ]
  • [ string thumbnail = "" ]
  • [ string musicbrainzalbumartistid = "" ]
  • string label
  • Library.Id albumid
  • [ Library.Id artistid = -1 ]
  • [ integer year = 0 ]
  • [ string genre = "" ]
  • [ string title = "" ]
  • [ string type = "" ]
  • [ string musicbrainzalbumid = "" ]
  • [ string mood = "" ]

Audio.Details.Artist

Type: object
Optional: true
Properties:

  • [ string style = "" ]
  • [ string description = "" ]
  • [ string musicbrainzartistid = "" ]
  • string artist
  • [ string fanart = "" ]
  • [ string formed = "" ]
  • [ string disbanded = "" ]
  • [ string born = "" ]
  • Library.Id artistid
  • [ string yearsactive = "" ]
  • [ string instrument = "" ]
  • [ string genre = "" ]
  • string label
  • [ string thumbnail = "" ]
  • [ string died = "" ]
  • [ string mood = "" ]

Audio.Details.Song

Type: object
Optional: true
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 artistid = -1 ]
  • string label
  • [ Library.Id albumid = -1 ]
  • [ string thumbnail = "" ]
  • Library.Id songid
  • [ integer track = 0 ]
  • [ string musicbrainztrackid = "" ]
  • [ string genre = "" ]
  • [ string musicbrainzartistid = "" ]
  • [ string artist = "" ]
  • [ string musicbrainzalbumartistid = "" ]
  • [ integer playcount = 0 ]

Audio.Fields.Album

Type: array
Optional: true

Audio.Fields.Artist

Type: array
Optional: true

Audio.Fields.Song

Type: array
Optional: true

Configuration

Configuration

Type: object
Optional: false
Properties:

Configuration.Notifications

Type: object
Optional: true
Properties:

  • boolean gui
  • boolean system
  • boolean player
  • boolean audiolibrary
  • boolean other
  • boolean videolibrary

Files

Files.Media

Type: string
Optional: true
Default: "video"

Global

Global.Time

Type: object
Optional: true
Properties:

  • integer hours
  • integer seconds
  • integer minutes
  • integer milliseconds

Library

Library.Details.Genre

Type: object
Optional: true
Properties:

  • Library.Id genreid
  • [ string title = "" ]
  • [ string thumbnail = "" ]
  • string label

Library.Fields.Genre

Type: array
Optional: true

Library.Id

Type: integer
Optional: true
Default: -1

List

List.Amount

Type: integer
Optional: true
Default: -1

List.Fields.All

Type: array
Optional: true

List.Fields.Video

Type: array
Optional: true

List.Items.All

Type: array
Optional: true

List.Items.Audio

Type: array
Optional: true

List.Items.Files

Type: array
Optional: true

List.Items.Shares

Type: array
Optional: true

List.Items.Video

Type: array
Optional: true

List.Limits

Type: object
Optional: true
Properties:

  • [ integer start = 0 ]
  • [ integer end = -1 ]

List.LimitsReturned

Type: object
Optional: true
Properties:

  • integer start
  • integer total
  • integer end

List.Sort

Type: object
Optional: true
Properties:

  • [ string order = "ascending" ]
  • [ boolean ignorearticle = False ]
  • [ string method = "none" ]

Optional

Optional.Boolean

Type: ['null', 'boolean']
Optional: true
Default: null

Player

Player.SeekPercentage

Type: number
Optional: true
Default: 0

Player.SeekTime

Type: integer
Optional: true
Default: 0

Player.State

Type: object
Optional: true
Properties:

  • boolean paused
  • boolean playing

Player.State.Extended

Type: object
Optional: true
Properties:

  • boolean paused
  • boolean partymode
  • boolean playing

Player.TimeValues

Type: object
Optional: true
Properties:

Playlist

Playlist.Audio.Item

Type: object
Optional: true
Properties:

Playlist.Id

Type: object
Optional: true
Properties:

  • [ string id = "" ]
  • [ string file = "" ]

Playlist.Item.Position

Type: integer
Optional: true
Default: -1

Playlist.Repeat

Type: string
Optional: true
Default: "off"

Playlist.State

Type: object
Optional: true
Properties:

  • integer current
  • boolean paused
  • Playlist.Repeat repeat
  • boolean playing
  • boolean shuffled

Playlist.Video.Item

Type: object
Optional: true
Properties:

System

System.Property.Name

Type: string
Optional: true
Default: "canshutdown"

System.Property.Value

Type: object
Optional: true
Properties:

  • [ boolean canreboot = False ]
  • [ boolean cansuspend = False ]
  • [ boolean canhibernate = False ]
  • [ boolean canshutdown = False ]

Video

Video.Cast

Type: array
Optional: true

Video.Details.Episode

Type: object
Optional: true
Properties:

  • [ number rating = 0 ]
  • [ Library.Id tvshowid = -1 ]
  • [ string file = "" ]
  • [ string plot = "" ]
  • [ string votes = "" ]
  • [ string title = "" ]
  • [ string fanart = "" ]
  • [ string writer = "" ]
  • string label
  • [ string thumbnail = "" ]
  • [ Video.Streams streamdetails ]
  • [ Video.Resume resume ]
  • [ integer season = 0 ]
  • [ string director = "" ]
  • [ string showtitle = "" ]
  • [ integer episode = 0 ]
  • [ string productioncode = "" ]
  • [ string lastplayed = "" ]
  • Library.Id episodeid
  • [ string originaltitle = "" ]
  • [ Video.Cast cast ]
  • [ string firstaired = "" ]
  • [ integer playcount = 0 ]
  • [ string runtime = "" ]

Video.Details.Movie

Type: object
Optional: true
Properties:

  • [ number rating = 0 ]
  • [ Array.String set ]
  • [ string tagline = "" ]
  • [ string file = "" ]
  • [ integer year = 0 ]
  • [ Array.Integer setid ]
  • [ string plot = "" ]
  • [ string votes = "" ]
  • [ string title = "" ]
  • [ string fanart = "" ]
  • [ string mpaa = "" ]
  • [ string writer = "" ]
  • string label
  • [ string thumbnail = "" ]
  • [ Video.Streams streamdetails ]
  • [ string plotoutline = "" ]
  • [ Video.Resume resume ]
  • [ string director = "" ]
  • [ string imdbnumber = "" ]
  • [ string studio = "" ]
  • [ string showlink = "" ]
  • [ string genre = "" ]
  • Library.Id movieid
  • [ string productioncode = "" ]
  • [ string country = "" ]
  • [ string lastplayed = "" ]
  • [ string premiered = "" ]
  • [ string originaltitle = "" ]
  • [ Video.Cast cast ]
  • [ string sorttitle = "" ]
  • [ integer playcount = 0 ]
  • [ string runtime = "" ]
  • [ integer top250 = 0 ]
  • [ string trailer = "" ]

Video.Details.MovieSet

Type: object
Optional: true
Properties:

  • [ string title = "" ]
  • [ string fanart = "" ]
  • string label
  • [ integer playcount = 0 ]
  • [ string thumbnail = "" ]
  • Library.Id setid

Video.Details.MovieSet.Extended

Type: object
Optional: true
Properties:

  • [ string title = "" ]
  • [ string fanart = "" ]
  • string label
  • [ array movies ]
  • [ integer playcount = 0 ]
  • [ string thumbnail = "" ]
  • Library.Id setid

Video.Details.MusicVideo

Type: object
Optional: true
Properties:

  • [ string album = "" ]
  • [ string plot = "" ]
  • [ string artist = "" ]
  • [ string fanart = "" ]
  • [ string lastplayed = "" ]
  • [ integer year = 0 ]
  • [ 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 musicvideoid
  • [ Video.Streams streamdetails ]

Video.Details.Season

Type: object
Optional: true
Properties:

  • [ 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
Optional: true
Properties:

  • [ string episodeguide = "" ]
  • 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 cast ]
  • [ string sorttitle = "" ]
  • [ integer playcount = 0 ]

Video.Fields.Episode

Type: array
Optional: true

Video.Fields.Movie

Type: array
Optional: true

Video.Fields.MovieSet

Type: array
Optional: true

Video.Fields.MusicVideo

Type: array
Optional: true

Video.Fields.Season

Type: array
Optional: true

Video.Fields.TVShow

Type: array
Optional: true

Video.Resume

Type: object
Optional: true
Properties:

  • [ number position = 0 ]
  • [ number total = 0 ]

Video.Streams

Type: object
Optional: true
Properties:

  • [ array video ]
  • [ array audio ]
  • [ array subtitle ]

Notifications

AudioLibrary

AudioLibrary.OnRemove

An audio item has been removed.
Parameters:

  1. string sender
  2. object data

Properties:

Returns: null

AudioLibrary.OnUpdate

An audio item has been updated.
Parameters:

  1. string sender
  2. object data

Properties:

Returns: null

Player

Player.OnPause

Playback of a media item has been paused. If there is no ID available extra information will be provided.
Parameters:

  1. string sender
  2. object data

Properties:

  • [ string album ]
  • [ integer episode ]
  • [ string artist ]
  • [ integer track ]
  • [ integer season ]
  • [ string title ]
  • [ integer year ]
  • Notifications.Player.Type type
  • [ 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.
Parameters:

  1. string sender
  2. object data

Properties:

  • [ string album ]
  • [ integer episode ]
  • [ string artist ]
  • [ integer track ]
  • [ integer season ]
  • [ string title ]
  • [ integer year ]
  • string type
  • integer speed
  • [ Library.Id id ]
  • [ string showtitle ]

Returns: null

Player.OnSeek

The playback position has been changed.
Parameters:

  1. string sender
  2. object data

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.
Parameters:

  1. string sender
  2. object data

Properties:

  • [ string album ]
  • [ integer episode ]
  • [ string artist ]
  • [ integer track ]
  • [ integer season ]
  • [ string title ]
  • [ integer year ]
  • [ Notifications.Player.Type type ]
  • [ Library.Id id ]
  • [ string showtitle ]

Returns: null

System

System.OnLowBattery

The system is on low battery.
Parameters:

  1. string sender
  2. null data

Returns: null

System.OnQuit

XBMC will be closed.
Parameters:

  1. string sender
  2. null data

Returns: null

System.OnRestart

The system will be restarted.
Parameters:

  1. string sender
  2. null data

Returns: null

System.OnSleep

The system will be suspended.
Parameters:

  1. string sender
  2. null data

Returns: null

System.OnWake

The system woke up from suspension.
Parameters:

  1. string sender
  2. null data

Returns: null

VideoLibrary

VideoLibrary.OnRemove

A video item has been removed.
Parameters:

  1. string sender
  2. object data

Properties:

Returns: null

VideoLibrary.OnUpdate

A video item has been updated.
Parameters:

  1. string sender
  2. object data

Properties:

  • [ integer playcount = -1 ]
  • string type
  • Library.Id id

Returns: null

See also

External links