This question is locked. New answers and comments are not allowed.
Hello,
I could use some advice on how to play a small MP3 audio file using the Cordova Media plugin (v 0.2.5). The following test code plays in the simulator when called maybe 3 out of 10 times, then never plays again. It never plays on an iPhone. Even when it does play in the simulator, every call throws an error in the console: "Uncaught module cordova/plugin/Media not found". cordova.js: 262. I've tried specifying the success and error functions to the Media object, but they are never called.
On a real phone, I can get the call to play if I use a Uri of a remote file on the net, but I can't get it to play a local file. I've tinkered with the path to the file, making sure to use an absolute path to the file, but no joy.
Also, since I've enabled the media plugin to the project in AppBuilder, every Save crashes the simulator with a System.InvalidOperationException.
Thank you,
Kelly
I could use some advice on how to play a small MP3 audio file using the Cordova Media plugin (v 0.2.5). The following test code plays in the simulator when called maybe 3 out of 10 times, then never plays again. It never plays on an iPhone. Even when it does play in the simulator, every call throws an error in the console: "Uncaught module cordova/plugin/Media not found". cordova.js: 262. I've tried specifying the success and error functions to the Media object, but they are never called.
var
test =
function
() {
media =
new
Media(
"media/whoosh.mp3"
);
media.play({numberOfLoops: 1});
};
On a real phone, I can get the call to play if I use a Uri of a remote file on the net, but I can't get it to play a local file. I've tinkered with the path to the file, making sure to use an absolute path to the file, but no joy.
Also, since I've enabled the media plugin to the project in AppBuilder, every Save crashes the simulator with a System.InvalidOperationException.
Thank you,
Kelly