media.mpv
#
- class platypush.plugins.media.mpv.MediaMpvPlugin(args=None, *argv, **kwargs)[source]#
Bases:
MediaPlugin
Plugin to control MPV instances
Requires:
python-mpv (
pip install python-mpv
)mpv executable on your system
- get_property(property)[source]#
Get a player property (e.g. pause, fullscreen etc.). See
man mpv
for a full list of the available properties
- seek(position)[source]#
Seek backward/forward by the specified number of seconds
- Parameters:
position (int) – Number of seconds relative to the current cursor
- set_position(position)[source]#
Seek backward/forward to the specified absolute position (same as
seek
)
- set_property(**props)[source]#
Set the value of an mpv property (e.g. fullscreen, sub_visibility etc.). See
man mpv
for a full list of properties- Parameters:
props (dict) – Key-value args for the properties to set
- set_volume(volume)[source]#
Set the volume
- Parameters:
volume (float) – Volume value between 0 and 100
- status()[source]#
Get the current player state.
- Returns:
A dictionary containing the current state.
Example:
output = { "filename": "filename or stream URL", "state": "play" # or "stop" or "pause" }