![]() |
# Module: BivouacHelpers::SoundView [ "README", "AUTHORS", "COPYING", "lib/bivouac/helpers/view/goh/base.rb", "lib/bivouac/helpers/view/goh/form.rb", "lib/bivouac/helpers/view/goh/html.rb", "lib/bivouac/helpers/view/goh/sound.rb", "lib/bivouac/helpers/view/goh/scriptaculous.rb", "lib/bivouac/helpers/view/goh/javascript.rb", nil].each do JavaScriptGenerator.view_html BivouacHelpers.view_html BivouacHelpers::SoundView.view_html BivouacHelpers::ScriptAculoUsView.view_html BivouacHelpers::BaseView.view_html BivouacHelpers::JavaScriptView.view_html BivouacHelpers::HtmlView.view_html BivouacHelpers::FormView.view_html end |
bivouac/helpers/view/html

Disable sound
[ show source ]
# File lib/bivouac/helpers/view/goh/sound.rb, line 21
21: def disable_sound( )
22: javascript_tag(disable_sound_js + ";\n")
23: end

Enable sound
[ show source ]
# File lib/bivouac/helpers/view/goh/sound.rb, line 30
30: def enable_sound( )
31: javascript_tag(enable_sound_js + ";\n")
32: end

Play the file file
Example:
play_sound("my_song.mp3", :replace => true)
The file must be in public
You can change the behaviour with various options, see script.aculo.us for more documentation.
[ show source ]
# File lib/bivouac/helpers/view/goh/sound.rb, line 12
12: def play_sound( file, options = {} )
13: javascript_tag(play_sound_js(file, options) + ";\n")
14: end