I am currently trying to incorporate the ability to play an mp3 file within a Cordova + Ionic hybrid app.
The sound file is located at:
www/sounds/dubstep/sound.mp3
I am attempting to play the file from a service placed in /www/scripts/services/global.js
using the following code:
var sound = new Howl({
src: ['sounds/dubstep/sound.mp3'],
onend: function() {
console.log('Finished!');
},
onloaderror: function() {
console.log('Error!');
},
});
sound.play();
However, I keep encountering an onloaderror
.
Can anyone provide guidance on how I should correctly set the path?
Thank you for any assistance.