Module: BivouacHelpers::SoundView
- Defined in:
- lib/bivouac/helpers/view/goh/sound.rb
Instance Method Summary collapse
-
#disable_sound ⇒ Object
Disable sound.
-
#disable_sound_js ⇒ Object
:nodoc:.
-
#enable_sound ⇒ Object
Enable sound.
-
#enable_sound_js ⇒ Object
:nodoc:.
-
#play_sound(file, options = {}) ⇒ Object
Play the file
file
. -
#play_sound_js(file, options = {}) ⇒ Object
:nodoc:.
Instance Method Details
#disable_sound ⇒ Object
Disable sound
21 22 23 |
# File 'lib/bivouac/helpers/view/goh/sound.rb', line 21 def disable_sound( ) javascript_tag(disable_sound_js + ";\n") end |
#disable_sound_js ⇒ Object
:nodoc:
25 26 27 |
# File 'lib/bivouac/helpers/view/goh/sound.rb', line 25 def disable_sound_js( ) #:nodoc: %(Sound.disable(); return false) end |
#enable_sound ⇒ Object
Enable sound
30 31 32 |
# File 'lib/bivouac/helpers/view/goh/sound.rb', line 30 def enable_sound( ) javascript_tag(enable_sound_js + ";\n") end |
#enable_sound_js ⇒ Object
:nodoc:
34 35 36 |
# File 'lib/bivouac/helpers/view/goh/sound.rb', line 34 def enable_sound_js( ) #:nodoc: %(Sound.enable(); return false) end |
#play_sound(file, options = {}) ⇒ Object
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.
12 13 14 |
# File 'lib/bivouac/helpers/view/goh/sound.rb', line 12 def play_sound( file, = {} ) javascript_tag(play_sound_js(file, ) + ";\n") end |
#play_sound_js(file, options = {}) ⇒ Object
:nodoc:
16 17 18 |
# File 'lib/bivouac/helpers/view/goh/sound.rb', line 16 def play_sound_js( file, = {} ) #:nodoc: %(Sound.play('/public/#{file}', #{()}); return false) end |