Ever since hypertext markup language (HTML) became the standard for producing web pages transmitted over the Internet, web designers look for ways to play sounds on web pages in a way that will work on all browsers and for all operating systems. This concept is called cross-compatibility, and it has been the Achilles heel of web design for many years. Even today it remains a significant web design issue.
This would cause the midi sound file to automatically start playing the moment a web visitor visited your page. Since most web designers quickly realized that the majority of web travelers considered this very annoying, the "EMBED" tag was used to present an actual sound player in the web page itself which gave the visitor the option to control the sound. The embed code looks like this:
|<embed src="yourfile.mid" autostart="true" width="130" height="40"> </embed>|
The "EMBED" tag has a number of properties that allow the web designer to configure the embedded player so that it is sized appropriately, automatically starts playing the music or not, or whether or not it's invisible. An invisible embedded player that autostarts is a lot like the "BGSOUND" tag. Even worse, such a setup can be configured to auto-loop so that the music never ends.
|<script> <!-- var sound1="yoursound.mid" if (navigator.appName=="Microsoft Internet Explorer") document.write('<bgsound src='+'"'+sound1+'"'+' loop="infinite">') else document.write('<embed src='+'"'+sound1+'"'+'hidden="true" border="0" width="10" height="10" autostart="true" loop="true">') //--> </script>|
|<EMBED SRC="YOURSOUND.MIDI" autostart=FALSE HIDDEN=TRUE NAME="LinkSound"> <A HREF="link_target.html" onMouseOver="playSound()" onClick="return false;">Link Text</A>|
When you call the function above (from anywhere in your web page), it will enable the "play" function of the embedded sound player called "LinkSound" as defined in your "EMBED" tag.