Audio previews like iTunes, Amazon Music.

markfc

macrumors 65816
Hi,

I have a table with a list of songs, next to each song I want to put a play button which will play the associated .MP3

I've tried the html 5 audio controls ;

<audiocontrols>
<sourcesrc="horse.mp3"type="audio/mpeg">
Your browser does not support the audio element.
</audio>

Which work great but each row of the table ends up with a full media player which looks messy.

How can I get just the play button, similar to how iTunes and Amazon Music do it?

Thanks
 
You want the html5 audio, but with your own styling (vs. the default browser audiocontrols UI), then you'll need some JS to trigger the audio API - I'd look into something like JPlayer, where they'd done most of that work for you :)

http://www.jplayer.org/
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.
Back
Top