media.kodi
#
- class platypush.plugins.media.kodi.MediaKodiPlugin(host, http_port=8080, websocket_port=9090, username=None, password=None, **kwargs)[source]#
Bases:
MediaPlugin
Plugin to interact with a Kodi media player instance
Requires:
kodi-json (
pip install kodi-json
)
- __init__(host, http_port=8080, websocket_port=9090, username=None, password=None, **kwargs)[source]#
- Parameters:
host (str) – Kodi host name or IP
http_port (int) – Kodi JSON RPC web port. Remember to enable “Allow remote control via HTTP” in Kodi service settings -> advanced configuration and “Allow remote control from applications” on this system and, optionally, on other systems if the Kodi server is on another machine
websocket_port (int) – Kodi JSON RPC websocket port, used to receive player events
username (str) – Kodi username (optional)
password (str) – Kodi password (optional)
- back(offset=30, player_id=None, *args, **kwargs)[source]#
Move the player execution backward by delta_seconds
- Parameters:
offset (float) – Backward seek duration (default: 30 seconds)
player_id – ID of the target player (default: configured/current player).
- forward(offset=30, player_id=None, *args, **kwargs)[source]#
Move the player execution forward by delta_seconds
- Parameters:
offset (float) – Forward seek duration (default: 30 seconds)
player_id – ID of the target player (default: configured/current player).
- play(resource, *args, **kwargs)[source]#
Open and play the specified file or URL
- Parameters:
resource – URL or path to the media to be played
- seek(position, player_id=None, *args, **kwargs)[source]#
Move to the specified time position in seconds
- Parameters:
position (float) – Seek time in seconds
player_id – ID of the target player (default: configured/current player).
- send_text(text, *args, **kwargs)[source]#
Simulate a send_text input event
- Parameters:
text (str) – Text to send
- set_position(position, player_id=None, *args, **kwargs)[source]#
Move to the specified time position in seconds
- Parameters:
position (float) – Seek time in seconds
player_id – ID of the target player (default: configured/current player).