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.3.0.tar.gz (14.8 kB view details)

Uploaded Source

File details

Details for the file mpris-api-1.3.0.tar.gz.

File metadata

  • Download URL: mpris-api-1.3.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.16

File hashes

Hashes for mpris-api-1.3.0.tar.gz
Algorithm Hash digest
SHA256 5ecb3be27acf949874224f2d919e671bb18b61077fbd697e9eefee619d02cae7
MD5 df8a771afd0a20a8a526bd41f43f226f
BLAKE2b-256 fcda046294d6fce9c7dabb74d36f4356ec8553645148526de6e311489b9115a8

See more details on using hashes here.

Supported by

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