Class
AstalMprisPlayer
Description
class AstalMpris.Player : GObject.Object
{
/* No available fields */
}
Object which tracks players through their mpris DBus interface. The most simple way is to use AstalMprisMpris
which tracks
every player, but AstalMprisPlayer
can be constructed for dedicated players too.
Constructors
astal_mpris_player_new
Construct a Player that tracks a dbus name. For example “org.mpris.MediaPlayer2.spotify”. The “org.mpris.MediaPlayer2.”
prefix can be omitted so simply “spotify” would mean the same. AstalMprisPlayer:available
indicates whether the player
is actually running or not.
Instance methods
astal_mpris_player_raise
Brings the player’s user interface to the front using any appropriate mechanism available. The media player may be unable to control how
its user interface is displayed, or it may not have a graphical user interface at all. In this case, the [property@
AstalMpris.Player:can_raise] is false
and this method does nothing.
astal_mpris_player_quit
Causes the media player to stop running. The media player may refuse to allow clients to shut it down. In this case, the [property@ AstalMpris.Player:can_quit] property is false and this method does nothing.
astal_mpris_player_next
Skips to the next track in the tracklist. If there is no next track (and endless playback and track repeat are both off), stop
playback. If AstalMprisPlayer:can-go-next
is false
this method has no effect.
astal_mpris_player_previous
Skips to the previous track in the tracklist. If there is no previous track (and endless playback and track repeat are both off),
stop playback. If AstalMprisPlayer:can-go-previous
is false
this method has no effect.
astal_mpris_player_pause
Pauses playback. If playback is already paused, this has no effect. If AstalMprisPlayer:can-pause
is false
this method has
no effect.
astal_mpris_player_play_pause
Pauses playback. If playback is already paused, resumes playback. If playback is stopped, starts playback.
astal_mpris_player_stop
Stops playback. If playback is already stopped, this has no effect. If AstalMprisPlayer:can-control
is false
this method
has no effect.
astal_mpris_player_play
Starts or resumes playback. If already playing, this has no effect. If paused, playback resumes from the current position. If [property@
AstalMpris.Player:can_play] is false
this method has no effect.
astal_mpris_player_open_uri
Uri scheme should be an element of AstalMprisPlayer:supported-uri-schemes
and the mime-type should match one of the elements of AstalMprisPlayer:supported-mime-types
.
astal_mpris_player_loop
Change AstalMprisPlayer:loop-status
from none to track, from track to playlist, from playlist to none.
astal_mpris_player_get_meta
Lookup a key from AstalMprisPlayer:metadata
. This method is useful for languages that fail to introspect hashtables.
Properties
AstalMpris.Player:fullscreen
Indicates if the player is occupying the fullscreen. This is typically used for videos. Use astal_mpris_player_toggle_fullscreen()
to toggle fullscreen state.
AstalMpris.Player:can-set-fullscreen
Indicates if astal_mpris_player_toggle_fullscreen()
has any effect.
AstalMpris.Player:supported-uri-schemes
The URI schemes supported by the media player. This can be viewed as protocols supported by the player in almost all cases. Almost every media player will include support for the “file” scheme. Other common schemes are “http” and “rtsp”.
AstalMpris.Player:position
The current position of the track in seconds or -1 when it is unsupported. To get a progress percentage simply divide this with [property
AstalMpris
.Player:length].
AstalMpris.Player:can-control
Indicates if the player can be controlled with methods such as astal_mpris_player_play_pause()
.
AstalMpris.Player:art-url
The location of an image representing the track or album. You might prefer using AstalMprisPlayer:cover-art
.
Signals
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.