Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Fix mpris slot name #19

Merged
merged 1 commit into from
Feb 15, 2023
Merged

Fix mpris slot name #19

merged 1 commit into from
Feb 15, 2023

Conversation

jayschwa
Copy link

@jayschwa jayschwa commented Jan 12, 2023

Resolves brave/brave-browser#16187

MPRIS enables desktop environments (e.g. GNOME) to provide media player
controls for media playing in the browser.

Brave uses DBus name org.mpris.MediaPlayer2.chromium whereas Snap sets
an AppArmor rule for org.mpris.MediaPlayer2.brave by default. Setting
the name parameter explicitly for the slot makes Snap generate a
compatible AppArmor rule.

@wknapik
Copy link

wknapik commented Feb 2, 2023

@mihaiplesa we should probably run this through QA, wdyt?

@jayschwa thanks for the pr! Would you have any test steps to share? So we could verify that the change does what it's supposed to and doesn't break anything?

@jayschwa
Copy link
Author

jayschwa commented Feb 2, 2023

The easiest way to test this is to use a GNOME-based Linux desktop environment (e.g. Ubuntu 22.xx) and play a video on YouTube. Media controls should appear in GNOME's notification area (accessible by clicking date-time area at top of desktop). Chrome, Firefox, and APT-installed Brave will all show the media controls. Snap-installed Brave will not. After applying this patch, re-test and observe the media controls are now present. I have been running my full-time browser with this patch since I created the PR and have not observed any regressions.

@wknapik
Copy link

wknapik commented Feb 2, 2023

Thanks @jayschwa. That sounds pretty straightforward.

We'll merge the other open PR first, once we're done testing it, and then move on to this one.

@jayschwa
Copy link
Author

jayschwa commented Feb 2, 2023

Okay. I'll rebase this PR after #18 is merged.

@wknapik
Copy link

wknapik commented Feb 9, 2023

#18 is merged

@wknapik wknapik requested a review from fmarier February 9, 2023 13:56
MPRIS enables desktop environments (e.g. GNOME) to provide media player
controls for media playing in the browser.

Brave uses DBus name `org.mpris.MediaPlayer2.chromium` whereas Snap sets
an AppArmor rule for `org.mpris.MediaPlayer2.brave` by default. Setting
the name parameter explicitly for the slot makes Snap generate a
compatible AppArmor rule.

Fixes brave/brave-browser#16187
@fmarier
Copy link
Member

fmarier commented Feb 9, 2023

That looks good to me, but I wonder: should we fix the dbus name instead and identify as org.mpris.MediaPlayer2.brave? Right now, we would conflict with vanilla Chromium, right?

@jayschwa
Copy link
Author

jayschwa commented Feb 9, 2023

#18 is merged

I have rebased and am now running with the new build as my main browser.

That looks good to me, but I wonder: should we fix the dbus name instead and identify as org.mpris.MediaPlayer2.brave? Right now, we would conflict with vanilla Chromium, right?

That would probably be a cleaner fix, yes. However, I don't think there is any conflict or harm if it remains "chromium". I can play videos in both browsers at the same time and I don't notice any sort of problem w.r.t. the OS media controls.

Copy link
Member

@fmarier fmarier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would probably be a cleaner fix, yes. However, I don't think there is any conflict or harm if it remains "chromium". I can play videos in both browsers at the same time and I don't notice any sort of problem w.r.t. the OS media controls.

Thanks for testing this.

This sounds like a good fix to me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show media notifications for player controls (Linux)
4 participants