Skip to content

Media control #129

Closed Answered by bkbilly
bkbilly asked this question in Q&A
Discussion options

You must be logged in to vote

After a lot of hours searching, I managed to find how to send a message call to DBus. Apparently when it's using the interface_name, it doesn't get the attribute calls automatically so it has to be done manually.

This is the service call I used to control the media:

from dasbus.connection import SessionMessageBus
from gi.repository import Gio
bus = SessionMessageBus()
bus.connection.call(
    bus_name="org.mpris.MediaPlayer2.chromium.instance4730",
    object_path="/org/mpris/MediaPlayer2",
    interface_name="org.mpris.MediaPlayer2.Player",
    method_name="PlayPause",
    parameters=None,
    reply_type=None,
    flags=Gio.DBusCallFlags.NONE,
    timeout_msec=1,
    cancellable=None,
    

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by bkbilly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant