-
-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails setup #79
Comments
Hi, i assume the wrong path. |
Hi, thank you for your reply. Actually, the sound files are not yet in the HTML, because it should be triggered by the click on a button, triggering the .js.erb file containing (among other things) the code above. |
Hi again. I can't really say what is the problem here, i don't know Rails. |
It's only on my local dev environment for the moment. I provided the 3 different formats : .mp3, .aac, .ogg but when I look in the network tab of the console, I can see it is also attempting to load a .wav and a .mp4 which I didn't provide... |
You see, it tries to load different formats, this means it can't found the file. Please check again network tab and check file URL where. Is it correct? Try to open it manually. Or the path is wrong, or, maybe you server config does not have a permission to send this file types or something. |
I think I understand the mess, although I don't know how to solve it. |
I don't know, maybe write an exception for urls with *.mp3, *.ogg etc. |
I found out : I have to put my sound assets in /public directory to avoid the routing problem. I placed them in /public/sounds, but now it does nothing. They don't even load, so I'm at a loss to make it work... |
Now change path in script config
|
the ion.sound script to initialise the plugin has now : |
OK I finally found out after a lot of fiddling. It all comes down to my lack of skill making a difference between javascript and coffeescript. in your <controller_name>.js.coffee initialise plugin for ion sound$ -> $.ionSound in your .js.erb file: ion.sound.play("metal_plate") Note the differences between the 2 notations ($ -> $. / ionSound and ion.sound/"" and '') and the tabulations. If any tabulation is missing, or if any of this is missing. It just won't work. Thank you for your help IonDen! |
Np, nice that you figured it out. |
I'm trying to implement ion.sound with Rails 3.22
here is my .js.erb code:
<%-# initialise plugin for ion sound -%>
$.ionSound
sounds: [
{ name: 'caisse_enregistreuse' }
]
path: 'sounds/'
preload: true
multiplay: true
volume: 0.5
<%-# play sound -%>
$.ionSound.play("caisse_enregistreuse")
it doesn't produce any sound although I get no javascript error...
I tried to place the sounds in assets/, public/, public/sounds, assets/sounds
...to no avail
The text was updated successfully, but these errors were encountered: