Sound Manager 2 plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install http://soundmanager2.rubyforge.org/svn/soundmanager2
Use the supplied generator to install the SoundManager2 Javascript and Flash files in your Rails app like this:
./script/generate sound_manager2
This will create the following files:
public/soundmanager2.swf public/javascripts/soundmanager2.js public/javascripts/soundmanager2-jsmin.js public/javascripts/soundmanager2-rails.js public/images/SoundManager2/pause-control.gif public/images/SoundManager2/play-control.gif
Then, to add basic play/stop functionality to your view, add the following to your ERB files:
<%= javascript_include_tag :defaults %> <% sounds = [ ["sound1", "http://url/to/sound1.mp3"], ["sound2", url_for(:controller => "sounds", :action => "listen", :id => "2")], ] %> <%= initialize_sounds(sounds) %>
div Play sound #1: <%= toggle_sound "sound1" %>/div divPlay sound #2: <%= toggle_sound "sound2" %>/div
And that's it! You can use as much or as little of SoundManager2's API directly, but I hope to add a complete API wrapper eventually.
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: Guest, 8 months ago

