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:
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: