platypush.plugins.media.vlc

class platypush.plugins.media.vlc.MediaVlcPlugin(args=None, fullscreen=False, volume=100, *argv, **kwargs)[source]

Plugin to control vlc instances

Requires:

  • python-vlc (pip install python-vlc)
  • vlc executable on your system
__init__(args=None, fullscreen=False, volume=100, *argv, **kwargs)[source]

Create the vlc wrapper.

Parameters:
  • args (list[str]) – List of extra arguments to pass to the VLC executable (e.g. ['--sub-language=en', '--snapshot-path=/mnt/snapshots'])
  • fullscreen (bool) – Set to True if you want media files to be opened in fullscreen by default (can be overridden by .play()) (default: False)
  • volume (int) – Default media volume (default: 100)
back(offset=60.0)[source]

Back by (default: 60) seconds

forward(offset=60.0)[source]

Forward by (default: 60) seconds

is_playing()[source]
Returns:True if it’s playing, False otherwise
load(resource, **args)[source]

Load/queue a resource/video to the player

mute()[source]

Toggle mute state

pause()[source]

Toggle the paused state

play(resource, subtitles=None, fullscreen=None, volume=None)[source]

Play a resource.

Parameters:
  • resource (str) – Resource to play - can be a local file or a remote URL
  • subtitles (str) – Path to optional subtitle file
  • fullscreen (bool) – Set to explicitly enable/disable fullscreen (default: fullscreen configured value or False)
  • volume – Set to explicitly set the playback volume (default: volume configured value or 100)
quit()[source]

Quit the player (same as stop)

remove_subtitles()[source]

Removes (hides) the subtitles

seek(position)[source]

Seek backward/forward by the specified number of seconds

Parameters:position (int) – Number of seconds relative to the current cursor
set_fullscreen(fullscreen=True)[source]

Set fullscreen mode

set_position(position)[source]

Seek backward/forward to the specified absolute position (same as seek)

set_subtitles(filename, **args)[source]

Sets media subtitles from filename

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"
}
stop()[source]

Stop the application (same as quit)

toggle_fullscreen()[source]

Toggle the fullscreen mode

toggle_subtitles(visibile=None)[source]

Toggle the subtitles visibility

voldown(step=10.0)[source]

Volume down by (default: 10)%

volup(step=10.0)[source]

Volume up by (default: 10)%