Mopidy extension for controlling Mopidy through the MPRIS D-Bus interface
An example of an MPRIS client is the Ubuntu Sound Menu.
- D-Bus Python bindings. The package is named python-dbus in Ubuntu/Debian.
- libindicate Python bindings is needed to expose Mopidy in e.g. the Ubuntu Sound Menu. The package is named python-indicate in Ubuntu/Debian.
- An .desktop file for Mopidy installed at the path set in the mpris/desktop_file config value. Mopidy installs this by default. See usage section below for details.
Install by running:
pip install Mopidy-MPRIS
Or, if available, install the Debian/Ubuntu package from apt.mopidy.com.
There’s no configuration needed for the MPRIS extension to work.
The following configuration values are available:
- mpris/enabled: If the MPRIS extension should be enabled or not.
- mpris/desktop_file: Path to Mopidy’s .desktop file.
The extension is enabled by default if all dependencies are available.
Testing the MPRIS API directly
To use the MPRIS API directly, start Mopidy, and then run the following in a Python shell:
import dbus bus = dbus.SessionBus() player = bus.get_object('org.mpris.MediaPlayer2.mopidy', '/org/mpris/MediaPlayer2')
Now you can control Mopidy through the player object. Examples:
To get some properties from Mopidy, run:
props = player.GetAll('org.mpris.MediaPlayer2', dbus_interface='org.freedesktop.DBus.Properties')
To quit Mopidy through D-Bus, run:
For details on the API, please refer to the MPRIS specification.
- Update to work with Mopidy 0.16 which changed some APIs.
- Remove redundant event loop setup already done by the mopidy process.
- Moved extension out of the main Mopidy project.
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size Mopidy_MPRIS-1.0.1-py27-none-any.whl (12.0 kB)||File type Wheel||Python version py27||Upload date||Hashes View|
|Filename, size Mopidy-MPRIS-1.0.1.tar.gz (12.4 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for Mopidy_MPRIS-1.0.1-py27-none-any.whl