omxplayer package

Submodules

omxplayer.bus_finder module

class omxplayer.bus_finder.BusFinder(path=None)[source]

Bases: object

find_address_file()[source]

Finds the OMXPlayer DBus connection Assumes there is an alive OMXPlayer process. :return:

get_address()[source]
wait_for_dbus_address_to_be_written_to_file()[source]
wait_for_file()[source]
wait_for_path_to_exist()[source]

omxplayer.dbus_connection module

class omxplayer.dbus_connection.DBusConnection(bus_address)[source]

Bases: object

proxy

The proxy object by which one interacts with a dbus object, this makes communicating with a similar to that of communicating with a POJO.

root_interface

org.mpris.MediaPlayer2 interface proxy object

player_interface

org.mpris.MediaPlayer2.Player interface proxy object

exception omxplayer.dbus_connection.DBusConnectionError[source]

Bases: exceptions.Exception

Connection error raised when DBusConnection can’t set up a connection

omxplayer.player module

class omxplayer.player.FileCleaner(path)[source]

Bases: object

clean()[source]
exception omxplayer.player.FileNotFoundError[source]

Bases: exceptions.Exception

class omxplayer.player.OMXPlayer(filename, args=[], bus_address_finder=None, Connection=None, cleaner=<omxplayer.player.FileCleaner object at 0x7fc7b23d8f10>)[source]

Bases: object

OMXPlayer controller

This works by speaking to OMXPlayer over DBus sending messages.

Parameters:
  • filename (str) – Path to the file you wish to play
  • args (list) – used to pass option parameters to omxplayer.
  • argument example (multiple) –
  • OMXPlayer(‘path.mp4’, args=[‘–no-osd’, ‘–no-keys’, ‘-b’]) (#) –
  • infohttps://github.com/popcornmix/omxplayer#synopsis
action(code)[source]

Executes a keyboard command via a code

Parameters:code (int) – The key code you wish to emulate refer to keys.py for the possible keys
Returns:
Return type:None
can_control()[source]
Returns:
Return type:bool
can_go_next()[source]
Returns:Whether the player can move to the next item in the playlist
Return type:bool
can_go_previous()[source]
Returns:Whether the player can move to the previous item in the playlist
Return type:bool
can_pause()[source]
Returns:
Return type:bool
can_play()[source]
Returns:
Return type:bool
can_quit()[source]
Returns:
Return type:bool
can_seek()[source]
Returns:Whether the player can seek
Return type:bool
can_set_fullscreen()[source]
Returns:
Return type:bool
duration()[source]
Returns:The duration in seconds
Return type:float
get_filename()[source]
Returns:filename currently playing
Return type:str
identity()[source]

Get the ID of the media player

Returns:
Return type:bool
is_playing()[source]
Returns:
Return type:None
list_audio()[source]
Returns:A list of all known audio streams, each item is in the format: <index>:<language>:<name>:<codec>:<active>
Return type:[str]
list_subtitles()[source]
Returns:A list of all known subtitles, each item is in the format: <index>:<language>:<name>:<codec>:<active>
Return type:[str]
list_video()[source]
Returns:A list of all known video streams, each item is in the format: <index>:<language>:<name>:<codec>:<active>
Return type:[str]
maximum_rate()[source]
Returns:The maximum playback rate
Return type:str
minimum_rate()[source]
Returns:The minimum playback rate
Return type:str
mute()[source]

Turns mute on, if the audio is already muted, then this does not do anything

Returns:
Return type:None
pause()[source]
Returns:
Return type:None
play()[source]
Returns:
Return type:None
play_pause()[source]
Returns:
Return type:None
play_sync()[source]
Returns:
Return type:None
playback_status()[source]
Returns:One of (“Playing” | “Paused” | “Stopped”)
Return type:str
position()[source]
Returns:The position in seconds
Return type:float
quit()[source]
seek(relative_position)[source]
Parameters:relative_position (float) – The position in seconds to seek to.
set_position(position)[source]
Parameters:position (float) – The position in seconds.
set_volume(volume)[source]
Parameters:volume (float) – Volume in millibels
stop()[source]
unmute()[source]

Unmutes the video, if the audio is already unmuted, then this does not do anything

Returns:
Return type:None
volume()[source]
Returns:volume – Volume in millibels
Return type:float

Module contents

Table Of Contents

This Page