Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
266 views
in Technique[技术] by (71.8m points)

html - HTML5 <audio> tag on Android

I have found many threads discussing the support of tag on Android. So far it looks, that even Android Froyo 2.2 cannot play audio (i have made tests on nexus One).

According to the www.html5test.com web page, the tag itself is supported, but no codecs are in the browser (mp3, ogg..). So how I can solve the problem?

So far I see only one solution, use the embedded Flex or Flash player, which can stream mp3. Is that correct? Is that the only way I can play the .mp3 or other audio stream in Android web browser?

Does Android 2.3 Gingerbread support some audio stream???

Thanks a lot BR STeN

Added later:The working solution I finally used is a small Flex .swf for streaming. It can be pretty easily integrated with the HTML web page (Flex-Javascript communication works pretty well). The only problem is that on some phones the Flash Player is not reinstalled and must be downloaded from Android Market first.

Added even later: Well, the <audio> element is buggy even on Android 2.3 - I do not know what are doing in Google that such a simple thing is a problem. Using the Flex Player is okey, but the problem is that on some phones the Adobe Flash player cannot be installed from Android market, because there are some Adobe HW requirements like 1Ghz CPU, etc. Some vendors like HTC are providing the own Flash players, but those are pretty bad and do not work correctly with the AS 3.0... So far everything works perfectly especially on Samsung phones (like Nexus S or Galaxy S).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

What you dug up agrees with what I've run into as well. 2.2 supports the audio tag but has no codecs to back it, this is apparently a bug that's been fixed in releases beyond Froyo:

http://code.google.com/p/android/issues/detail?id=9372

I've used the audio tag with an mp3 file on my Nexus S, it's working correctly there (for the most recent firmware release at least).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...