Html5 audio+ Phonegap + Android?

十年热恋 提交于 2019-12-11 02:12:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!