Sound Manager 2 plugin

Plugin details

This is a wrapper around Scott Schill's SoundManager2 Javascript API (http://www.schillmania.com/projects/soundmanager2/).

Websitehttp://soundmanager2.rubyforge.org/ Repositoryhttp://soundmanager2.rubyforge.org/svn/soundmanager2 Author Lawrence J. Karnowski Tags sound LicenseMIT

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 documentation

Edit plugin | (0 older versions) | Last edited by: Guest, 8 months ago