*CSS 3 border-radius supported only by Firefox 2.x+, Safari (2.x?) as of April 2008 - perhaps IE 8 RTM..
This example uses SoundManager 2 to finds links to MP3 files, and makes them playable "in-place" on a page. The script assigns CSS classes to links to indicate their state (playing/paused, etc.)
Links pointing to MP3s are assigned an onclick handler which intercepts the click (preventing the browser from following the link and unloading the page. SM2 will then create sound objects as needed to play the MP3s.
CSS classes are dynamically applied as follows:
:hover effects are also active.
SoundManager 2 project page (not an MP3 link)
If you want to make your own UI from scratch, here is the base:
Default + hover state, "click to play":
a.sm2_link {}
a.sm2_link:hover {}
Playing + hover state, "click to pause":
a.sm2_playing {}
a.sm2_playing:hover {}
Paused + hover state, "click to resume":
a.sm2_paused {}
a.sm2_paused:hover {}
The class names which are applied are edited within the source JS also, for convenience.
See this basic demo for reference.