Section 24
MORE ABOUT MUSIC/SOUNDS (using <EMBED...> and/or <BGSOUND...>)
One source says you could use this to allow music/sound files to play
for both Internet Explorer and Netscape. But I think there would be a
problem for those using other web browsers. Try it if you want to:
<EMBED SRC="filename.ext" hidden=true autostart=true loop=false>
<NOEMBED>
<BGSOUND SRC="filename.ext">
</NOEMBED>
The problem I see with the above is that Internet Explorer supports
both EMBED and BGSOUND (and I don't know what web browsers would understand
the <NOEMBED> and </NOEMBED> part... probably just ignored as non-standard
HTML code instead). As such, the above could work for both Internet
Explorer and Netscape, but I don't know (or think) that it helps out for
anyone with a different web browser.
As I mentioned, Microsoft's Internet Explorer does support the
Netscape <EMBED...> tag (although sometimes is a bit weird about it).
I have found more information about EMBED that may work out better than
how I described using it in my tutorial. If you do not want a box (or
play/stop buttons) displayed with EMBED you can use HIDDEN=TRUE as an
option like this:
<EMBED SRC="filename.ext" HIDDEN="true" AUTOSTART="true" LOOP="false">
This seems to work with both Netscape and IE to automatically play a
sound file on a web page without displaying anything. I have included the
full information I found for the Netscape EMBED tag at the end of this
document.
I have also played with the WIDTH and HEIGHT to see how things work
out (if you actually do want play/stop/etc. controls to show on the
screen). As suggested in my tutorial a WIDTH="145" HEIGHT="60" seems to
work out for both Netscape and Internet Explorer (although it looks weird
in IE). I have found the following to make things look a bit nicer:
For Netscape the following seems to work out:
For Full controls(including volume): WIDTH="145" HEIGHT="60"
For just the Stop/Play/Pause Buttons only: WIDTH="145" HEIGHT="35"
For Internet Explorer (since it will normally use some type of Media
Player from Microsoft instead) things may look a little weird, but the
WIDTH="145" HEIGHT="60" should show most controls (Play/Pause/Stop). With
the Microsoft version 6.0 Media Player I have found these settings to work:
For all controls (including Position/Mute/Volume): WIDTH="274" HEIGHT="46"
For Play/Pause/Stop/Position controls: WIDTH="70" HEIGHT="46"
For Play/Pause/Stop Buttons only: WIDTH="70" HEIGHT="24"
I'll also mention that with the version of Netscape (3.04 and its
media player) that I'm using for testing, the volume control does not seem
to function. The one in my Internet Explorer 4.01 SP1 (with Microsoft's
Media Player version 6.0) does work. Maybe in a higher version of Netscape
the volume control would also work (I'll have to try it someday I guess).
I won't run (play) an example music file on this web page because
too many of my other web pages are already cluttered with music/sounds.
[Previous Section]
[Table of Contents]
[Addendum]
[Milt's Micro Digest Home Page]
[Next Section]
The names Microsoft, Internet Explorer, Netscape, and others used in this document
are Trademarks, or Registered Trademarks of the companies represented.
E-mail questions, comments, or suggestions to: miltst@hotmail.com
© 1999 miltst@hotmail.com

(This page was last modified on: Monday, February 08, 1999)