简体   繁体   中英

Play mp3 on iPad Safari

Is it possible to play embedded MP3 on iPad Safari (the way you do on normal desktop browsers)?

If yes, do we need to code separately for iPad Safari?

The reason I am asking is bcoz in my app, the desktop code for mp3 is not working on iPad.. The code for desktop is

<EMBED src="'+audioUrl+'" autostart=true loop=false volume=100 hidden=true>

Why don't you just use the <audio> tag, that's what it's there for.

To answer your question, yes it is possible.

You can use the HTML 5 <audio> tag. Check out w3schools - HTML5 Audio .

There is also a table on there telling you what formats work with what browsers.

To add to the excellent answers of Blindy and John, the IPad should be HTML5 compliant which means that you can use the HTML5 audio and vido tags. You can read more about this at The Safari Developer Library .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM