Open Bug 1710229 Opened 4 years ago Updated 1 year ago

MPRIS support for multiple media players

Categories

(Core :: Audio/Video: Playback, enhancement)

Firefox 88
enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: necauqua, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0

Steps to reproduce:

Open two YouTube videos in separate tabs etc.

Actual results:

One of them can be controlled via MPRIS interface, usually the latest one that had its state changed or from the latest focused tab, exact conditions are unknown, but it looks spotty.

Expected results:

Each media source should get a separate MPRIS object so that separate playbacks can be controlled independently.

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

From reading the MPRIS spec (https://specifications.freedesktop.org/mpris-spec/latest/) , looking at the d-bus behavior and the code, as far as I can tell, it "just" needs to open new d-dbus connections per active tab.

So widget/gtk/MPRISServiceHandler.cpp needs a change to the two times SprintfLiteral(serviceName, DBUS_MPRIS_SERVICE_NAME ".instance%d", getpid()); is used. I would append the id of the tab that's sending that audio.

I would guess a tabId would be best, but I have no idea of firefox internals. I also can't see a straight forward way to get that in that file, but I haven't done cpp in a few years.

Having looked a bit more at the structure, it might not be as simple, as I think the MPRISServiceHandler is depending on the media control buttons - which probably only can handle one instance.

You need to log in before you can comment on or make changes to this bug.