platypush.plugins.media.gstreamer

class platypush.plugins.media.gstreamer.MediaGstreamerPlugin(sink: Optional[str] = None, *args, **kwargs)[source]

Plugin to play media over GStreamer.

Requires:

  • gst-python (pip install gst-python)

__init__(sink: Optional[str] = None, *args, **kwargs)[source]
Parameters

sink – GStreamer audio sink (default: None, automatic).

back(offset=60.0)[source]

Back by (default: 60) seconds

forward(offset=60.0)[source]

Forward by (default: 60) seconds

get_volume()float[source]

Get the volume.

Returns

Volume value between 0 and 100.

is_playing()[source]
Returns

True if it’s playing, False otherwise

load(resource, **args)[source]

Load/queue a resource/video to the player (alias for play()).

mute()[source]

Toggle mute state

pause()[source]

Toggle the paused state

play(resource: Optional[str] = None, **args)[source]

Play a resource.

Parameters

resource – Resource to play - can be a local file or a remote URL

quit()[source]

Stop and quit the player (alias for stop())

seek(position: float)dict[source]

Seek backward/forward by the specified number of seconds.

Parameters

position – Number of seconds relative to the current cursor.

set_position(position: float)dict[source]

Seek backward/forward to the specified absolute position.

Parameters

position – Stream position in seconds.

Returns

Player state.

set_volume(volume)[source]

Set the volume.

Parameters

volume – Volume value between 0 and 100.

status()dict[source]

Get the current player state.

stop()[source]

Stop and quit the player (alias for quit())

voldown(step=10.0)[source]

Volume down by (default: 10)%

volup(step=10.0)[source]

Volume up by (default: 10)%