So I'm building a podcast website, I'd like to be able to upload songs and have the cover art appear next to the play button. I have jPlayer setup and the music part is all done, but how can I use - preferably PHP, but if not, javascript or jQuery - to grab the cover art that's embedded with the mp3 file and show it?
Thanks!
Album art is a data frame identified as “Attached picture” due ID3v2 specification, and getID3() now is only one way to write all possible data frames in ID3v2 with pure PHP.
Look at this source: http://getid3.sourceforge.net/source/write.id3v2.phps
Search for this text in the source:
// 4.14 APIC Attached picture
there's a piece of code responsible for writing album art.
Another way, that seems to be not as slow as pure PHP, is to use some external application, that will be launched by PHP script. If your service designed to work under a high load, binary compiled tool will be a better solution.
A better (faster) way to do this would be through an external application and the PHP exec() function to fun a command. I would recommend eyeD3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With