Aylur/dotfiles

[Bug] Duplicate media controllers when playing in browser after installing plasma-browser-integration

jin-li opened this issue · 2 comments

When I play music in the browser (Firefox), there are two media controller in the quick settings window:
2024-06-14_01-41-09

This happened after I installed the plasma-browser-integration(both the browser extension and the pacman package). I installed it because without it, the position slider (including the position and song length) in the media controller will not show.

After I installed plasma-browser-integration, two media controllers show up, one with the position slider and the other without.

It seems like the mpris detects the playing media twice but I am not sure. Can anyone help me get rid of the one without position slider?

Here is my system info from neofetch:
2024-06-14_01-32-30

you can get a list of mpris players with something like

ags -r 'Service.import("mpris").then(({ players }) => players.map(p => p.busName))'

then you would need to filter it out in code here

children: players.as(p => p.map(Player)),

you can get a list of mpris players with something like

ags -r 'Service.import("mpris").then(({ players }) => players.map(p => p.busName))'

then you would need to filter it out in code here

children: players.as(p => p.map(Player)),

Thanks! It works! I can filter out the duplicated player with following code (I use Firefox browser):

    children: players.as(p => {
        if (p.some(player => player.busName.includes("plasma-browser-integration"))) {
            return p.filter(player => !player.busName.includes("firefox")).map(Player);
        } else {
            return p.map(Player);
        }
    }),