Entry
How can I embed a sound for both Internet Explorer and Netscape Navigator?
Aug 14th, 2000 02:54
Rey Nuņez,
You can use the EMBED element which both browsers support, as follows:
<EMBED SRC="midifile.mid" autostart=true hidden=true>
Like images, larger audio filesizes take longer to download, and tend
to hold up the display of a page while they do, so it is recommended to
place the tag towards the bottom of the source code (but still within
the BODY).
Some authors prefer to use browser-detection and create different tags
using features unique to each browser, for example:
<SCRIPT LANGUAGE="JavaScript">
<!--
var ver = navigator.appVersion;
if (ver.indexOf("MSIE") != -1){
document.write('<bgsound src="intro.mid" loop=infinite>')}
else
document.write('<embed src="intro.mid" autostart=true hidden=true
loop=true>')
// -->
</SCRIPT>
If you have problems with MIDI files, be sure your server has the
proper MIME types for MIDI files:
Audio/x-midi
Audio/midi