You are not logged in.

#1 2021-12-26 10:09:01

TheStroyer
Member
Registered: 2018-08-28
Posts: 52

Mpris always uses the first player found

I recently installed MPRIS together with the mpris support for MPD (mpd-mpris). However, I don't like the default behavior of always controlling the player that's found first, which is in my case always firefox. What I actually want is for MPRIS's play-pause command to control the player that is currently playing and keep a memory of which player it last controlled.
For example, if mpd is playing, play-pause should pause mpd. When I play-pause again, mpd should start playing again, unless some other player is currently playing.

I get that it's possible to achieve this with the --player argument of playerctl, but that will require non-trivial logic, so I was wondering if something like this already exists. I can't be the only one with this problem

Last edited by TheStroyer (2022-01-06 12:32:38)

Offline

#2 2021-12-26 12:17:16

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 15,070

Re: Mpris always uses the first player found

Depends on the server, what are you already using as the MPRIS server provider?

Online

#3 2021-12-26 13:08:24

Lilitu-Blackstar
Member
Registered: 2021-12-23
Posts: 51

Re: Mpris always uses the first player found

you using mpdris2?  i found i needed that to interact with mpd and use a widget for a player in awesomewm from worrons config

Offline

#4 2022-01-05 20:48:22

TheStroyer
Member
Registered: 2018-08-28
Posts: 52

Re: Mpris always uses the first player found

V1del wrote:

Depends on the server, what are you already using as the MPRIS server provider?

I'm not aware of MPRIS needing any server, nor do I see something about it on the wiki. I'm using playerctl as the controller and mpd-mpris as MPRIS implementation for MPD.

Lilitu-Blackstar wrote:

you using mpdris2?  i found i needed that to interact with mpd and use a widget for a player in awesomewm from worrons config

Yeah you need some sort of mpris provider for MPD, as it's not built in natively, but I'm using mpd-mpris, not mpdris2. Don't think it makes a difference, though, as it seems that playerctl is the one deciding which player to control.

Last edited by TheStroyer (2022-01-05 20:50:17)

Offline

Board footer

Powered by FluxBB