Android javascript audio not working

81 views Asked by At

I am writing a Cordova application, and I am not able to play sounds on a 4.2.2 Android device.

I have tried the 2 things mentioned here, that is PhoneGap's Media class (not working) and this syntax (not working):

var audio = new Audio('coins.mp3');
audio.play();

I have also tried this plugin but without success.

Also the workaround mentioned in code.google.com (using Video instead of Audio) does work when I am in debug, but not after deploying the app to the store and then downloading it:

var success = document.createElement("video");
success.setAttribute("src", "success.mp3");
success.play();

So it is not possible to play audio with javascript on older Android devices?

0

There are 0 answers