1

When playing media from sites like youtube.com on Chromium (Chrome) it's shown in the sound indicator, you see thing like the title and you can control the playback. But the icon is always the fallback, general music icon. Chromium in sound indicator

Other applications like Spotify or Auryo are also detected and they do display the artwork of music that's playing. Spotify or Auryo in sound indicator

(Firefox doesn't currently show up at all, see: Can't control Firefox media through the sound indicator or keyboard shortcuts)

0

This is where we try to extract the artwork:
https://github.com/elementary/wingpanel-indicator-sound/blob/master/src/Widgets/MprisGui.vala#L523

I've tried logging what's in that metadata using the following but I'm not seeing any artwork data.

        metadata.foreach ((key, val) => {
            print ("%s => %s (%s)\n", key, val.print(true), val.get_type().dup_string ());
        });

Logged from https://googlechrome.github.io/samples/media-session/audio.html :

# Before starting playing
xesam:artist => [''] (as)
xesam:album => '' (s)
xesam:title => '' (s)
mpris:trackid => objectpath '/io/github/GnomeMpv/Track/0' (o)
mpris:length => int64 0 (x)
xesam:url => '' (s)

# First song
xesam:artist => ['Jan Morgenstern'] (as)
xesam:album => 'Sintel' (s)
xesam:title => 'Snow Fight' (s)

# Second song
xesam:artist => ['Jan Morgenstern'] (as)
xesam:album => 'Big Buck Bunny' (s)
xesam:title => 'Prelude' (s)

Trying this with Spotify I get:

xesam:discNumber => 1 (i)
xesam:url => 'https://open.spotify.com/track/6f0sKFgjcesnolqU8Fz8kB' (s)
xesam:title => 'Vengeance (The Return of the Night Driving Avenger) [Bonus Track]' (s)
xesam:trackNumber => 6 (i)
mpris:artUrl => 'https://open.spotify.com/image/ab67616d00001e02b8835366e419d606cd6ec015' (s)
xesam:autoRating => 0.35999999999999999 (d)
mpris:trackid => 'spotify:track:6f0sKFgjcesnolqU8Fz8kB' (s)
xesam:album => 'Nocturne City' (s)
mpris:length => uint64 300927000 (t)
xesam:artist => ['Perturbator'] (as)
xesam:albumArtist => ['Perturbator'] (as)

Chrome does seem to be a valid MPRIS provider, but it doesn't communicate the mpris:artUrl metadata. mpris:artUrl spec

Possibly relevant Chromium issue: https://bugs.chromium.org/p/chromium/issues/detail?id=951584 Relevant diffs:

Not seeing "artUrl". I've asked why they didn't include it.

Interestingly these Chrome/Chromium extensions do set this mpris:artUrl metadata:

I installed browser-playerctl and now I am getting more metadata on for example Youtube. (It didn't work with the Media Session API demo)

Now I get:

# Metadata update from extension
mpris:trackid => objectpath '/lopwv2ViNMw' (o)
mpris:artUrl => 'https://i.ytimg.com/vi/lopwv2ViNMw/hqdefault.jpg' (s)
mpris:length => int64 787000000 (x)
xesam:url => 'https://www.youtube.com/watch?v=lopwv2ViNMw' (s)
xesam:title => '(777) How Corning Created Gorilla Glass And Reinvented Itself' (s)

# Metadata update from Chromium
xesam:artist => ['CNBC'] (as)
xesam:album => '' (s)
xesam:title => 'How Corning Created Gorilla Glass And Reinvented Itself' (s)

And we see the artwork in the indicator: Chromium in indicator with artwork

Not sure what's up with the "(777)" part. The extension also doesn't correctly communicate the artist (while Chrome itself does). So I wouldn't recommend installing these extensions.

I guess all we can do is keep an eye on the relevant Chromium issue ( 951584: MPRIS: Add media metadata).

Some extra info: websites can share this info using the new Media Session API. Some resources:

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.