问题
does the HTML5 audio tag with Jquery and Phonegap work to create an Android App? It works well in any browser, but I can't hear anything using the Android emulator, any idea? thank you!
回答1:
No, the audio tag is not supported everywhere, and probably not on your Android device. I found this blog on Android and audio support useful, plus he's got snippet of test code. Run in any browser, including Android browser, to see what's supported.
I used PhoneGap / Android / jQuery Mobile to write this tutorial for playing audio files in a mobile web app using PhoneGap Media API (source is there).
Cheers, Libby
回答2:
In 2.3 and newer you can use Audio tag just fine
It's true that HTML 5 audio (.ogg) works in the Android browser but not AFAIK with jQuery and Phonegap. I have code that works in Chrome, on the Android browser on my phone via LAN, even on the iPhone simulator (.mp3) but not in the installed Phonegap app (using Gingerbread 2.3.3).
回答3:
It depends on your Android version. In 2.3 and newer you can use Audio tag just fine, but in older versions you have to use Media API from Phonegap.
来源:https://stackoverflow.com/questions/5923187/html5-audio-phonegap-android