Oddbean new post about | logout
 Hey #WordPress friends.
Is there any way to get the default media player to show an MP3's metadata and embedded image?
I'd rather not use (yet-another) plugin if I can help it. 
 @2fd7551e doubt. Can tell you from mine (in the video context) that I do this manually each time via HTML.

It's cumbersome but it is|was the only way for years to also add subtitles or alternative encodings. Sucks. 
 Well, that was slightly easier than expected!

Going from `[audio mp3="/path/to/file.mp3"]` to a nicer formatted HTML5 audio player.

* Use `wp_audio_shortcode_override`
* Get the audio attribute
* Get the library ID using `attachment_url_to_postid()`
* Get all the audio metadata with `wp_get_attachment_metadata()`
* Get the embedded image (if any) with `get_the_post_thumbnail_url()`
* Spit out some HTML and CSS.

#WordPress

https://files.mastodon.social/media_attachments/files/111/190/202/222/324/247/original/7781f981f173c7fc.png