开发者

Audio on the web page

I am working on a project, and my current task is add a feature to listen audio file directly in the web page. What options do I have? All files are mp3, and the page contains about 15 audio files

Unfortunately, the flash player looks like only one possible solution and I just hope if somebody will give me a clue how to make the feature done without i开发者_StackOverflow社区t.

Update: Thanks for the direction with audio tag!


The short answer is that native HTML5 audio will not work in all browsers (such as IE6, 7, and 8). Likewise, Flash audio will not work in mobile Safari. Your best bet for a production-grade solution is an audio abstraction framework that will use either HTML5 or Flash-based audio based on the client's browser. Fortunately, there is such a framework, based in jQuery, called jPlayer.


The <audio> tag! Note that different browsers support different compression solutions. Currently OGG Vorbis seems to be the most appropriate format to convert the audio into.

Edit: I seems that some browsers support OGG and some browsers support MP3. If you can, have both versions available and upload both. Then, in the markup have a declaration that looks like this:

<audio controls autobuffer>
    <source src="audio.mp3" />
    <source src="audio.ogg" />
</audio>


Try the audio tag in html5

http://www.w3schools.com/html5/tag_audio.asp

http://html5doctor.com/native-audio-in-the-browser/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜