Closed Sinono3 closed 3 years ago
I'd love this as well, although I'm not sure how to represent the image. URL, or a type from the image
crate? I'm not sure if any platform natively supports URLs, so maybe just the second one?
Well, let's see:
MPRIS specification:
mpris:artUrl
URI: The location of an image representing the track or album. Clients should not assume this will continue to exist when the media player stops giving out the URL.
From my experience, when the album art is a local file the artUrl is a URI starting with file://
, leading to the cover image.
On Windows, updating the Thumbnail
field of SystemMediaTransportControlsDisplayUpdater is what we're looking for. It seems straightforward, it only needs to be fed a RandomAccessStreamReference
, which allows for more flexibility than an URI, it can also be created from files or streams.
I don't know about MacOS though 🥲
I guess we can just take an URI as input, and if the user wants to use an image in memory, allow them to input that and just optimize according to each specific platform. For example: a video player wants to procedurally extract a thumbnail of a video, and then feed it to souvlaki. The input could be just an image from the image crate.
tmpfs
, set mpris:artUrl
to the path, and delete the file on drop.If we do have this behaviour, maybe separating it in a feature and warning users would be a good idea, since it could be disruptive.
Thanks for the research! Good to know that URL is the only way on MPRIS, and in the end it's not so complicated to download it asynchronously in MacOS, either.
Closed with #8.
This feature is also crucial to souvlaki, especially on Windows, where the album art is displayed on the screen when pressing any media key.