10-04-2012 02:52 PM
Here is my follwing code:
playAudio: function(src) {
var fn = "audio/" + src;
try {
var playerInstance = new blackberry.audio.Player(fn, "audio/m4a", true);
playerInstance.play();
} catch(err) {
txt="Error playing audio\n\n" + fn + "\n\n";
txt+="Error: " + err.message + "\n\n";
txt+="Click OK to continue.\n\n";
alert(txt);
}
},
I have an "audio" file with the file "Confidence.m4a" in it, which is in the root file.
In another function, I have
this.playAudio("Confidence.m4a");
But I get an error: undefined when I try to call the method.
I've added
<feature id="blackberry.audio" version="1.0.0.0"/>
<feature id="blackberry.audio.Player" version="1.0.0.0"/>
to my config.xml file.
What is the problem here?