I’ve been wanting to add a cross-browser audio player into a site for a while and I finally found a few minutes to find a solution and apply it.
A quick Google found the link above, which includes good demos and examples.
Edit jquery.jmp3.js and ensure the path names match. The site will probably have to change.
Update design.ini.append.php to add the jQuery MP3 code in.
I updated design/site/override/templates/page_layout.tpl to use jQuery from the jQuery CDN.
I also added the player load code directly into page_layout.tpl, since it was compact. A better approach is probably to add it in as a footer script using the admin interface.
Finally, I override the line/file template, testing to see if the filename ended in .mp3. If the file is an .mp3, the player code is added. In hindsight, a more graceful solution would be to create a custom class for .mp3s, but this works fine.
Many thanks to ’sean-o’ - see the link above.
I tested it on Windows and CentOS, with FireFox 3+, it works really nicely.
As a side note, while working on this, I needed to add the http:// to the URL, and it could not be encapsulated in double quotes, since the name is not assigned in an href or src attribute. eZ has two nice optional parameters for the ezurl function, the first indicating what type of quotes to use (in this case none), and whether to create a full URL or relative (in this case full).