Skip to main content

Make your multimedia app discoverable by linux desktop.

Project description

PyPI pyversions PyPI version shields.io PyPI license Downloads

MPRIS API


Make your multimedia app discoverable by linux desktop.

Desciption

This package provides an implementation of MPRIS DBus interface.

MPRIS standard: MPRIS D-Bus Interface Specification

Usage

Minimal:

from mpris_api.MprisService import MprisService
from mpris_api.adapter.IMprisAdapterRoot import IMprisAdapterRoot
from mpris_api.adapter.IMprisAdapterPlayer import IMprisAdapterPlayer

class SampleMprisAdapterRoot(IMprisAdapterRoot):
    pass  # TODO: Implement interface methods here!

class SampleMprisAdapterPlayer(IMprisAdapterPlayer):
    pass  # TODO: Implement interface methods here!

with MprisService(
    name='my_app_name',
    adapterRoot=SampleMprisAdapterRoot(),
    adapterPlayer=SampleMprisAdapterPlayer(),
) as mprisService:
    mprisService.awaitStop()

Full (including tracklists and playlists support):

from mpris_api.MprisService import MprisService
from mpris_api.adapter.IMprisAdapterRoot import IMprisAdapterRoot
from mpris_api.adapter.IMprisAdapterPlayer import IMprisAdapterPlayer
from mpris_api.adapter.IMprisAdapterTrackList import IMprisAdapterTrackList
from mpris_api.adapter.IMprisAdapterPlayLists import IMprisAdapterPlayLists

class SampleMprisAdapterRoot(IMprisAdapterRoot):
    pass  # TODO: Implement interface methods here!

class SampleMprisAdapterPlayer(IMprisAdapterPlayer):
    pass  # TODO: Implement interface methods here!

class SampleMprisAdapterTrackList(IMprisAdapterTrackList):
    pass  # TODO: Implement interface methods here!

class SampleMprisAdapterPlayLists(IMprisAdapterPlayLists):
    pass  # TODO: Implement interface methods here!

with MprisService(
    name='my_app_name',
    adapterRoot=SampleMprisAdapterRoot(),
    adapterPlayer=SampleMprisAdapterPlayer(),
    adapterTrackList=SampleMprisAdapterTrackList(),
    adapterPlayLists=SampleMprisAdapterPlayLists(),
) as mprisService:
    mprisService.awaitStop()

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpris-api-1.2.1.tar.gz (14.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page