Designed for 1024x768 and Firefox Browser
Bugging You?Mississippi's State Bird
Mississippi's State Bird:

PayneLess Designs - Adding Music or Sound to Your Website

The Way to Economical Web Site Designs

Web Pages Designed With Your Wallet In Mind!

Simple and Easy to Do! (Do Not Recommend Using Embed Tag) ***
Page copy protected against web site content infringement by Copyscape

You can embed the sound on your site to auto play when the page loads or leave it to user to click Play button. Other options are: set play in a continuous loop or play once only; set how many times to play the sound/movie; set how loud to play the sound; set which sound control to display; set if controls should be displayed; set the object in a sound group with the sound to use; set how far into the sound to start and stop; set when to finish playing and many more. Many of these you may never use or need to use.

The HTML tag that plays music from a website is the <embed> tag. This tag has never been accepted by the W3C so you will always get a code error flagged on it after validating your web page.

Inside the embed tag, you need to define several things called attributes. Some you will not need to use at times. Always use lowercase to meet current HTML 4.01 Standards:

  1. src: URL of resource to be embedded
  2. width: Width of area in which to show resource
  3. height: Height of area in which to show resource
  4. align: How text should flow around the picture
  5. name: Name of the embedded object
  6. pluginspage: Where to get the plugin software
  7. pluginurl: Where to get the JAR archive for automatic installation
  8. hidden: If the object is visible or not
  9. href: Make this object a link
  10. target: Frame to link to
  11. autostart: If the sound/movie should start automatically
  12. loop: How many times to play the sound/movie
  13. playcount: How many times to play the sound/movie
  14. volume: How loud to play the sound
  15. controls: Which sound control to display
  16. controller: If controls should be displayed
  17. mastersound: Indicates the object in a sound group with the sound to use
  18. starttime: How far into the sound to start and stop
  19. endtime: When to finish playing

Here is a sample bit of code that has all of the attributes included. Notice there is no need for a closing </embed> tag. HTML Tidy will flag this if you put one in.:

<embed src="mysong.mid" autostart="true" loop="true" hidden="false" width="145" height="30">

This is a Flash example:

<embed src="http://servername/path/to/media.file" quality="high" style="background-color:#fff;
width:320px; height:240px;" loop="false" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">

QuickTime example (playing from a web server):

<embed src="http://servername/path/to/media.file" style="width:320px; height:255px;" autoplay="true"
controller="true" loop="false" pluginspage="http://www.apple.com/quicktime/download/">

QuickTime example (playing from a streaming server):

<embed src="qtlogo.mov" qtsrc="rtsp://servername/path/to/media.file" style="width:320px; height:255px;"
autoplay="true" controller="true" loop="false" pluginspage="http://www.apple.com/quicktime/download/">

Windows Media Player example:

<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" id="mediaPlayer" name="mediaPlayer" displaysize="4" autosize="-1" videoborder3d="-1" showcontrols="true" showtracker="-1" showdisplay="0" showstatusbar="-1" style="background-color:#000068; width:320px; height:285px;" src="http://servername/path/to/media.file" autostart="true" designtimesp="5311" loop="false">

*** The correct way to embed audio, movies, flash, what have you, is to use the <object></object> tags. The <embed> tag is used in conjunction with the <object></object> tags to provide compatibility with some browsers. One solution, which is not a cure-all, is to use JavaScript to write the embed code for the player.

Valid HTML 4.01 StrictValid CSS!