: Simple future-proof, backwards-compatible way to play audio mp3 files in-place on the page? I have a site for a musician that includes music in mp3 format, but these are played through a Flash
I have a site for a musician that includes music in mp3 format, but these are played through a Flash file (xspfplayer). Of course, without Flash this is useless.
Is there a better future-proof, and reasonably backwards-compatible way to include mp3 audio snippets on a page without forcing users to use Flash, and also not forcing them to download the mp3 first, or to leave the page entirely?
More posts by @Dunderdale272
3 Comments
Sorted by latest first Latest Oldest Best
Another solution is to use a JavaScript library called Sound Manager. By default, it embeds an invisible Flash object in the page and uses it to play audio files (including MP3s). The newest version includes the ability to use HTML5's audio tag when available.
You can then write your player in HTML/CSS/JS, and have Sound Manager figure out whether to use Flash or audio tag to play the audio file. This way your player will work in IE6 and also on the iPhone/iPad.
I believe this solution matches your requirements more exactly:
Create an M3U playlist file which points to the MP3's URL, upload the M3U to your server, and then create a link to the M3U file on your page.
When the visitor clicks the link to the M3U file the (tiny) M3U file will be downloaded and he or she will have the option to open it in the media player of his or her choice (i.e. whatever's already installed on the machine - no need for Flash whatsoever).
Once opened, the MP3 will begin streaming.
Your best bet is to continue to use the Flash player and use the HTML5 audio tag, for any browsers that supports it. Eventually, all browsers will support HTML5 and you will be able to kill off the flash audio player.
There is a great document on the HTML5 audio tag and how to use it here, html5doctor.com/native-audio-in-the-browser/. It seems to be extremely easy to use.
It looks like Safari 4, and Chrome 3 both support the tag AND the mp3 format. Opera and FF 3.5 support WAV format.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.