mardi 30 décembre 2014

Howler.JS + Angular - path for playing sound file

I'm trying to play mp3 file in cordova + ionic hybrid app.


Sound is stored in:


www/sounds/dubstep/sound.mp3


And i'm trying to play file from service placed in /www/scripts/services/global.js using following code:



var sound = new Howl({
src: ['sounds/dubstep/sound.mp3'],
onend: function() {
console.log('Finished!');
},
onloaderror: function() {
console.log('Error!');
},
});

sound.play();


But it is always throwing onloaderror.


How i should set path in right way?


Thanks for any help.


Aucun commentaire:

Enregistrer un commentaire