Reputation: 11247
I am having problem playing sound in Icenium Cordova 3.2 project on my iPhone 5S. I am using the following code:
if (device.platform == "Android") {
src = new Media("/android_asset/www/audio/multimedia.mp3");
} else {
src = new Media("audio/multimedia.mp3"); // this line runs on my device
}
src.play();
The audio file multimedia.mp3 exists in a folder called audio
under the main project folder. I've tried different paths like /audio/multimedia.mp3
and multimedia.mp3
and the sound is not playing on my device.
When I use an absolute path to an external URL (http://somesite.com/audiofile.mp3
) the audio file plays on my device. I haven't tested the code in Android yet. Thanks.
Upvotes: 0
Views: 606
Reputation: 8975
I think you have miss to add phonegap.js
plugin.So your FileReader is not working or may be forget to add file plugin.
Upvotes: 1