faqts : Computers : Internet : Web : HTML

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

27 of 28 people (96%) answered Yes
Recently 5 of 5 people (100%) answered Yes

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