How to Embed Mp3 Music on a Website

It is easy to Embed Mp3 Music, Audio Files, or Songs on a Website or Webpage, so that your visitors can choose to play music in the background while they browse your site. This can be accomplished via the embed tag. However, some browsers like Firefox might not be natively hooked to a default media player, leaving the user to install additional plugins. Sure you could embed Windows Media Player, but the code would not function if the user was without Windows Media Player installed.

My proposed solution is to use a stand alone flash player that does not require Windows Media Player, Quicktime or any other proprietary media player be installed on the visitors machine. For this I personally prefer "Google Reader Mp3 Player" which is a non branded media player with volume controls, and automatic song duration calculation.

Embedded Google Reader Mp3 Player:

Google Reader HTML embed code snippet:

<embed type="application/x-shockwave-flash" flashvars="audioUrl=http://yoursite.com/song.mp3&autoPlay=true" src="http://www.google.com/reader/ui/3523697345-audio-player.swf" width="400" height="27" quality="best"></embed>

Simply copy and paste the code snippet above into your html, php pages, or template file in WordPress. Then change the Url=http://yoursite.com/song.mp3 to match the location of the audio file on your server. To disable the autoplay feature, simply remove &autoPlay=true from the code snippet.

Recommended Posts:

  • No Similar Posts Detected