开发者

How can a web page play mp3 on iPhone/iPad

开发者 https://www.devze.com 2023-01-17 02:23 出处:网络
As far as O know, web pages play mp3 sounds by embedding invisible Flash players. Since Flash is not available on mobile webkit (iphone/ipad), how is it possible to play mp3开发者_如何学Python on this

As far as O know, web pages play mp3 sounds by embedding invisible Flash players. Since Flash is not available on mobile webkit (iphone/ipad), how is it possible to play mp3开发者_如何学Python on this platform?


HTML5 supports these 2 tags (audio / video) which Safari supports:

In your case, you can use the audio tag.

<audio src="horse.ogg" controls="controls">
  your browser doesn't support HTML5 audio
</audio>

The only catch is getting the right format for your media. :-)

Safari supports MP3 for audio, and MPEG 4 for video... Firefox supports OGG for audio/video, (I believe Opera does too), and chrome supports both.


More information about the supported file formats in HTML5 are here:
http://www.html5laboratory.com/playing-with-audio-files.php

That links to a really useful page allowing you to test the format support on your particular browser:
http://www.jplayer.org/HTML5.Audio.Support/

0

精彩评论

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