Here's an mp3_player plugin for Rails. Check out handyrailstips.com/tips/7-playing-mp3-s-on-your-rails-site-with-mp3_player for more info
To install: script/plugin install git://github.com/GavinM/mp3_player.git
To setup: script/generate mp3_player [name of your mp3 directory]
This adds 'player.swf' to public/ and creates a new folder for storing all of your audio files.
To play an mp3 file found in public/mp3s/mysong.mp3 simply add <%= mp3_player(“mp3s/mysong.mp3”) %> to your view.
If you're using paperclip: <%= mp3_player @my_model.mp3.url %>.
Below is a list of the extra options you can specify: (All colors should be expressed as hexadecimal values minus the '#'. eg. <%= mp3_player @my_model.mp3.url, :bg => “99FFFF”) %>
width of the player when open in pixels, defaults to 290
class of the div wrapping the player, defaults to “mp3_player”
background colour, defaults to “BBBBBB”
background colour of the left tab, defaults to “AAAAAA”
background colour of the right tab, defaults to “AAAAAA”
colour of the right background as the cursor hovers over, defaults to “EEEEEE”
the colour of the speaker icon on the left, defaults to “222222”
colour of the play/pause icon on the right, defaults to “222222”
colour of the play/pause icon as the cursor hovers over, defaults to “222222”
colour of the text, defaults to “222222”
colour of the slider bar, defaults to “333333”
colour of the loaded data so far, defaults to “DDDFFF”
colour of the track on the slider, defaults to “888888”
colour of the buffer border, defaults to “333333”
This plugin is based on the Audio Player Worpress Plugin by Martin Laine www.1pixelout.net/code/audio-player-wordpress-plugin
Thanks to Matt Ittigson (github.com/mattenat) for inspiring changes to help support paperclip.
Copyright © 2009 Gavin Morrice (handyrailstips.com), released under the MIT license