Sinono3 / souvlaki

A cross-platform library for handling OS media controls and metadata.
MIT License
80 stars 15 forks source link

Add some documentation on how `cover_url` is meant to be used #38

Open hasezoey opened 11 months ago

hasezoey commented 11 months ago

it would be great if there would be some documentation about MediaMetadata::cover_url, like what format it should be in, or if there is anything platform specific (and if needed what formats are supported, like recommending jpg?)

Sinono3 commented 11 months ago

It is very platform specific. As of now, Souvlaki leaves it up to the user to change the URL depending on the platform.

For Linux, we follow the MPRIS specification, which actually doesn't say much cover art apart from what's in here. It only says that local files should start with file:// and that it should be an UTF-8 string, which is enforced by Rust. Maybe you can look in the source code of desktop managers such as GNOME or KDE, since these read the field to display it on their media player controls.

For Windows, we use the SystemMediaTransportControlsDisplayUpdater, which has a thumbnail property. It accepts multiple formats, but we choose to create it using an URI. If setting an URL starting with file://, the file is automatically loaded by souvlaki.

For MacOS, you can look into these lines of the implementation. These lines refer to creating an MPMediaItemArtwork object.

I hope this is of use to you. If you find a good way to put this information in the docs, consider opening a pull request 🙂