Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Playing a mp3 file on a web page

Tags:

asp.net

mp3

In an ASP.NET environment, what's the best way to play a mp3 file? Do I need to use a flash plugin (some users may not have flash). Also, this needs to work on a IPhone or an IPod.

like image 346
user300981 Avatar asked May 17 '10 02:05

user300981


People also ask

How do I play an MP3 file from a website?

Audio hosting websites like SoundCloud or Anchor.fm make it easy for you to embed audio files in your web pages and blogs. Just upload your file - like an MP3 song or an audio podcast - to any of these sites and they'll provide the HTML embed code that you can copy-paste in your web template.

Can you make music play on a website?

You need permission to play most music, as commercial and popular music is all copyrighted. To play music legally, you will need permission from the copyright holder or holders. Not doing so can have serious legal and financial consequences. You can also use music that is on the public domain for free.

Can Chrome play MP3 files?

It can play audio files by dropping them into the interface. It also can play the audio stream of video containers. The extension uses the well-known FFmpeg library to decode audio files. It supports FLV, WMA, MP3, MP4, WebM, and many more codecs.


2 Answers

The HTML 5 audio tag will be your best option for the iPhone since Flash is not supported but keep in mind that HTML 5 is not yet supported on the majority of PCs on the internet because the behemoth of the browser world (Internet Explorer) does not yet support it. This will change with IE9 when it is released, but there will still be quite a lot of people/entities that will not upgrade.

If you care about the audience that does not support HTML 5, you will need to use an alternative method like Flash or Silverlight. Fortunately, the audio tag takes this into account by allowing you to specify alternate content if the tag is not supported.

<audio src="blah.mp3" controls="controls">
  Put alternate content here
</audio>
like image 189
Bradley Mountford Avatar answered Sep 16 '22 22:09

Bradley Mountford


The HTML 5 <audio> tag is perfect for this situation. It works on the iPhone/iPod perfectly as well, contrary to the buggy, bloated and unnecessary cruft of Flash.

like image 20
Delan Azabani Avatar answered Sep 19 '22 22:09

Delan Azabani