|
Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
General functions on Kodi. More...
Topics | |
| InfoTagGame | |
| Kodi's game info tag class. | |
| InfoTagMusic | |
| Kodi's music info tag class. | |
| InfoTagPicture | |
| Kodi's picture info tag class. | |
| InfoTagRadioRDS | |
| Kodi's radio RDS info tag class. | |
| Actor | |
| Actor class used in combination with InfoTagVideo. | |
| VideoStreamDetail | |
| Video stream details class used in combination with InfoTagVideo. | |
| AudioStreamDetail | |
| Audio stream details class used in combination with InfoTagVideo. | |
| SubtitleStreamDetail | |
| Subtitle stream details class used in combination with InfoTagVideo. | |
| InfoTagVideo | |
| Kodi's video info tag class. | |
| Keyboard | |
| Kodi's keyboard class. | |
| Monitor | |
| Kodi's monitor class. | |
| Player | |
| Kodi's player. | |
| PlayList | |
| Kodi's Play List class. | |
| RenderCapture | |
| Kodi's render capture. | |
Functions | |
| log (...) | |
| |
| shutdown () | |
| |
| restart () | |
| |
| executescript (...) | |
| |
| executebuiltin (...) | |
| |
| executeJSONRPC (...) | |
| |
| sleep (...) | |
| |
| getLocalizedString (...) | |
| |
| getSkinDir () | |
| |
| getLanguage (...) | |
| |
| getIPAddress () | |
| |
| getDVDState () | |
| |
| getFreeMem () | |
| |
| getInfoLabel (...) | |
| |
| getInfoImage (...) | |
| |
| getDatabaseName (...) | |
| |
| playSFX (...) | |
| |
| stopSFX () | |
| |
| enableNavSounds (...) | |
| |
| getCondVisibility (...) | |
| |
| getGlobalIdleTime () | |
| |
| getDevicePowerStatus (...) | |
| |
| getCecAdapterNames () | |
| |
| getCacheThumbName (...) | |
| |
| getCleanMovieTitle (...) | |
| |
| getRegion (...) | |
| |
| getSupportedMedia (...) | |
| |
| skinHasImage (...) | |
| |
| startServer (...) | |
| |
| audioSuspend () | |
| |
| audioResume () | |
| |
| getUserAgent () | |
| |
| convertLanguage (...) | |
| |
General functions on Kodi.
Offers classes and functions that provide information about the media currently playing and that allow manipulation of the media player (such as starting a new song). You can also find system information using the functions available in this library.
| audioResume | ( | ) |
Function: xbmc.audioResume() Example:
| audioSuspend | ( | ) |
Function: xbmc.audioSuspend() Example:
| convertLanguage | ( | ... | ) |
Function: xbmc.convertLanguage(language, format) Returns the given language converted to the given format as a string.
| language | string either as name in English, two letter code (ISO 639-1), or three letter code (ISO 639-2/T(B) | ||||||||
| format | format of the returned language string
|
Example:
| enableNavSounds | ( | ... | ) |
Function: xbmc.enableNavSounds(yesNo) | yesNo | bool - enable (True) or disable (False) nav sounds |
Example:
| executebuiltin | ( | ... | ) |
Function: xbmc.executebuiltin(function) | function | string - builtin function to execute. |
| wait | [opt] bool - If Kodi should wait for the builtin function execution to finish (default False) |
Example:
| executeJSONRPC | ( | ... | ) |
Function: xbmc.executeJSONRPC(jsonrpccommand) | jsonrpccommand | string - jsonrpc command to execute. |
Example:
| executescript | ( | ... | ) |
Function: xbmc.executescript(script) | script | string - script filename to execute. |
Example:
| getCacheThumbName | ( | ... | ) |
Function: xbmc.getCacheThumbName(path) | path | string - path to file |
Example:
| getCecAdapterNames | ( | ) |
Function: xbmc.getCecAdapterNames() Example:
| getCleanMovieTitle | ( | ... | ) |
Function: xbmc.getCleanMovieTitle(path[, usefoldername]) | path | string - String to clean |
| usefoldername | [opt] bool - use folder names (defaults to false) |
Example:
| getCondVisibility | ( | ... | ) |
Function: xbmc.getCondVisibility(condition) | condition | string - condition to check |
Example:
| getDatabaseName | ( | ... | ) |
Function: xbmc.getDatabaseName(dbType) | dbType | string - database type of the database name to be returned. |
Example:
| getDevicePowerStatus | ( | ... | ) |
Function: xbmc.getDevicePowerStatus([adapterName]) | adapterName | [opt] string - the CEC adapter to query, either its name (e.g. HDMI 1) or, for an adapter that the driver didn't name, its port. Defaults to empty, which queries the first adapter that reports a status. |
| Value | Description |
|---|---|
| xbmc.DEVICE_POWER_NO_ADAPTER | No CEC adapter present |
| xbmc.DEVICE_POWER_ON | Device is powered on |
| xbmc.DEVICE_POWER_STANDBY | Device is in standby |
| xbmc.DEVICE_POWER_TRANSITION_TO_ON | Device is powering on |
| xbmc.DEVICE_POWER_TRANSITION_TO_STANDBY | Device is going to standby |
| xbmc.DEVICE_POWER_UNKNOWN | Power status could not be determined |
DEVICE_POWER_UNKNOWN means the device could not be found or queried on the CEC bus. DEVICE_POWER_NO_ADAPTER means no CEC adapter is present, no adapter matches the given name, or the matching adapter isn't running.Example:
| getDVDState | ( | ) |
Function: xbmc.getDVDState() | Value | Name |
|---|---|
| 1 | xbmc.DRIVE_NOT_READY |
| 16 | xbmc.TRAY_OPEN |
| 64 | xbmc.TRAY_CLOSED_NO_MEDIA |
| 96 | xbmc.TRAY_CLOSED_MEDIA_PRESENT |
Example:
| getFreeMem | ( | ) |
Function: xbmc.getFreeMem() Example:
| getGlobalIdleTime | ( | ) |
Function: xbmc.getGlobalIdleTime() Example:
| getInfoImage | ( | ... | ) |
Function: xbmc.getInfoImage(infotag) | infotag | string - infotag for value you want returned |
List of InfoTags - http://kodi.wiki/view/InfoLabels
Example:
| getInfoLabel | ( | ... | ) |
Function: xbmc.getInfoLabel(infotag) | infotag | string - infoTag for value you want returned. |
Example:
| getIPAddress | ( | ) |
Function: xbmc.getIPAddress() Example:
| getLanguage | ( | ... | ) |
Function: xbmc.getLanguage([format], [region]) | format | [opt] format of the returned language string
| ||||||||
| region | [opt] append the region delimited by "-" of the language (setting) to the returned language string |
Example:
| getLocalizedString | ( | ... | ) |
Function: xbmc.getLocalizedString(id) | id | integer - id# for string you want to localize. |
\language\{yourlanguage}\ for which id you need for a string.Example:
| getRegion | ( | ... | ) |
Function: xbmc.getRegion(id) | id | string - id of setting to return |
Example:
| getSkinDir | ( | ) |
Function: xbmc.getSkinDir() Example:
| getSupportedMedia | ( | ... | ) |
Function: xbmc.getSupportedMedia(media) | media | string - media type |
Example:
| getUserAgent | ( | ) |
| log | ( | ... | ) |
Function: xbmc.log(msg[, level]) | msg | string - text to output. | ||||||||||||
| level | [opt] integer - log level to output at. (default=LOGDEBUG)
|
LOGDEBUG as the default logging level and to use conservative logging (log only if needed). Excessive logging makes it harder to debug kodi itself.Logging in kodi has a global configuration level that controls how text is written to the log. This global logging behaviour can be changed in the GUI (Settings -> System -> Logging) (debug toggle) or furthered configured in advancedsettings (loglevel setting).
Text is written to the log for the following conditions:
LOGINFO, LOGWARNING, LOGERROR and LOGFATAL) - Default kodi behaviourLOGNOTICE to LOGDEBUG LOGNOTICE (use LOGINFO) and LOGSEVERE (use LOGFATAL)Example:
| playSFX | ( | ... | ) |
Function: xbmc.playSFX(filename,[useCached]) | filename | string - filename of the wav file to play |
| useCached | [opt] bool - False = Dump any previously cached wav associated with filename |
Example:
| restart | ( | ) |
Function: xbmc.restart() Example:
| shutdown | ( | ) |
Function: xbmc.shutdown() Example:
| skinHasImage | ( | ... | ) |
Function: xbmc.skinHasImage(image) | image | string - image filename |
Example:
| sleep | ( | ... | ) |
Function: xbmc.sleep(time) | time | integer - number of msec to sleep. |
| PyExc_TypeError | If time is not an integer. |
Example:
| startServer | ( | ... | ) |
Function: xbmc.startServer(typ, bStart, bWait) | typ | integer - use SERVER_* constants
| ||||||||||||||||
| bStart | bool - start (True) or stop (False) a server |
Example:
| stopSFX | ( | ) |
Function: xbmc.stopSFX() Example: