Im trying to play an mp3 tone in my PhoneGap application. Works fine with iOS but the tone wont play on Android (4.2.2).
html
<audio type="audio/mp3" id="audiotag1"
src="http://url.com/tone.mp3" preload="auto" >
</audio>
js:
document.getElementById('audiotag1').play();
You cannot play mp3 files inside of a webview for Android using strictly html5. You have to use Cordova's Media object: http://docs.phonegap.com/en/edge/cordova_media_media.md.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.