VOOZH about

URL: https://phabricator.services.mozilla.com/D67745

⇱ ⚙ D67745 Bug 1623971 - part1: Propagate the MediaSession Artwork Images to MPRIS, r=alwu


Bug 1623971 - part1: Propagate the MediaSession Artwork Images to MPRIS, r=alwu
AbandonedPublic

Authored by MeFisto94 on Mar 21 2020, 6:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 9, 2:23 PM
Unknown Object (File)
Tue, Jun 9, 2:23 PM
Unknown Object (File)
Tue, Jun 9, 12:30 PM
Unknown Object (File)
Tue, Jun 9, 9:19 AM
Unknown Object (File)
Sat, Jun 6, 3:26 AM
Unknown Object (File)
Wed, Jun 3, 5:59 AM
Unknown Object (File)
Thu, May 21, 12:29 AM
Unknown Object (File)
May 10 2026, 11:40 PM
Subscribers

Details

Reviewers
alwu
Bugzilla Bug ID
1623971

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Branch
default

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
Comment Actions

So this is only a preliminary patch because it has a few problems that still need addressing:

  1. MediaSession works like a charm. As noted in the comment, we might need a strategy to get the best artwork (highest resolution? closest to square dimensions? etc
  2. The default platform artwork would need to find the current installation directory (here I've taken my ubuntu path but still with a typo () ....))
  3. Since currently the higher API is passing me the svg file to , but that path doesn't exist for me, it stops at mozapps, I don't have places.
  4. The above path (icons/default) is not available in my build, only in real distributions, so we need to check those conditions, this is specifically relevant for other brandings.
Comment Actions

First, now I still don't know what the best way is to requery the file location of branding icon. If the user modifies their diretory name, such as renaming to then this code would pass an invalid path to user. Second, now we have guaranteed that artwork won't be empty, if we want to replace the favicon icon with branding icon, we should modify the code in [1]. Also, if we would like to use the branding image, we should check what current version Firefox we're using and then select the correct image.

[1] https://searchfox.org/mozilla-central/source/dom/media/mediasession/MediaSessionController.cpp#177-200


@baku we would like to show the branding icon on the virtual control interface that system provides. Do you know what the best way is to get the file-based URL for those branding images? Or you know who we can ask about this topic?
Thank you.

widget/gtk/MPRISServiceHandler.cpp
632

nit : this could be done in this patch as well.

We can check the length of and select the image with largest size [1], which can ensure that the image we show is the highest solution.

[1] https://searchfox.org/mozilla-central/source/__GENERATED__/dist/include/mozilla/dom/MediaSessionBinding.h#107

Comment Actions

BTW, will we have a part2 for this bug? I guess you would implement the SMTC part in part2?

Comment Actions

Exactly, I am just working on the Windows Part to specify a local file.
Part 3 could then be changing the branding icon etc, so this is a WIP.

Edit: " Second, now we have guaranteed that artwork won't be empty, if we want to replace the favicon icon with branding icon, we should modify the code in [1]"

Note that the MediaController in 1 probably doesn't know about the individual packaging of the user agent. For me there is a big difference between Ubuntu and Windows. But that all depends on what we can come up with, maybe there is a better solution from baku and others.

alwu requested changes to this revision.Mar 28 2020, 12:14 AM
Comment Actions

According to commet7 and comment8 [1] in bug1623971, we should not let external media framework load an URL because of both security and private concern. I will file a bug later to block this bug, which would provide a way to get an image bitmap from an image URL. That could be used for SMTC, but for MPRIS, we should only set the filed-based image, because MRPIS doesn't support an image bitmap as an input.

[1]
https://bugzilla.mozilla.org/show_bug.cgi?id=1623971#c7
https://bugzilla.mozilla.org/show_bug.cgi?id=1623971#c8

This revision now requires changes to proceed.Mar 28 2020, 12:14 AM
Comment Actions

We've found another solution and the bug is closed, so let's abandon this revision

Revision Contents

PathSize
widget/
gtk/
15 lines
CommitParentsAuthorSummaryDate
8497c82e2af5c4d2ca8f78b7Marc Streckfuss
Bug 1623971 - part1: Propagate the MediaSession Artwork Images to MPRIS, r=alwu (Show More…)
0

Diff 248269

widget/gtk/MPRISServiceHandler.cpp

Loading...