Welcome to WebmasterWorld Guest from 23.20.223.88

Forum Moderators: incrediBILL

Message Too Old, No Replies

Background sound using Netscape

HTML code for background sound with Netscape

     
8:45 am on Feb 23, 2006 (gmt 0)

10+ Year Member



I think this is close. When I set hidden to "False" and view the page with MSIE , a quicktime player appears on the screen. What I'm trying to do is automaticaly play an mp3 audio file in the background when the page is viewed using the Netscape browser. Help!

<html>
<head>
<title>Background sound Netscape</title>
</head>

<body>
<EMBED SRC="Audio.mp3" AUTOSTART=TRUE, HIDDEN=True, VOLUME=100, LOOP=TRUE>
</body>
</html>

9:30 am on Feb 23, 2006 (gmt 0)

WebmasterWorld Senior Member blobfisk is a WebmasterWorld Top Contributor of All Time 10+ Year Member



<embed> is a Mozilla/Netscape support tag only - <object> is what you need for MSIE.

What about using Flash?

6:50 pm on Feb 23, 2006 (gmt 0)

10+ Year Member



Thank you for your reply and you're correct. I've got the background music working with MSIE using the code <BGSOUND SRC=Audio.mp3 LOOP=INFINITE>

Now I'm trying to get the page to play background music when viewed with the Netscape browser. I think the above code is close, but for some reason the music doesn't start when the above code is viewed with the Netscape browser. Help!

7:15 pm on Feb 23, 2006 (gmt 0)

5+ Year Member



Netscape, which version? Do you need support for 4.x browsers?

User should have control over the background sound/music therefore media player controls should always be visible. Don't try to script your own controls since they not work in all environments. If "branded" music player skin is absolutely needed then the best bet is to use flash based music player solution.
---
One valid way to do autostart (background) music player is to use Windows Media Player Active-X with IE and offer general solution to others: QuickTime, MPlayer plugins etc. If suitable player doesn't exist then fallback to plain link.
Code:
<!--[if IE]>
<object id="player" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="288" height="69">
<param name="URL" value="madonna.mid">
</object>
<![endif]-->
<!--[if!IE]> <-->
<object id="player" type="audio/midi" data="madonna.mid" width="288" height="69">
<a href="madonna.mid">Play background music (Madonna) [MIDI]</a>
</object>
<!--> <![endif]-->

If you want to maximize number of user who can hear music without clicking a link then you can use the following:
Code:
<object id="player" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="288" height="69">
<param name="URL" value="madonna.mid">
<embed type="audio/midi" src="madonna.mid" width="288" height="69" />
</object>

Drawbacks of this methdod are that it uses deprecated embed element and external fallback link is needed.

Other widely supported types are:
audio/x-wav for wav files
audio/mpeg for mp3 files

Note that Mozilla/Firefox users need to have QuickTime plug-in or equivalent if you use mp3, midi since Windows Media player-netscape plug-in only exposes windows-media format file types (wma, WebmasterWorld) to the browser.

Also check that your server sends correct MIME-types.

8:38 am on Feb 25, 2006 (gmt 0)

10+ Year Member



Thank you T. I think I'm going to give it a rest for a few days.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month