Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi need to get working in both IE a

Status
Not open for further replies.

stvchez123

Programmer
Apr 18, 2002
59
US
Hi need to get working in both IE and Netscape. Though I do have it working in IE, I can't seem to get it in Netscape. I've been searching and found alot of info on it, but can't quite get it. I've attached the code snippet that I'm using so far. I'm wondering if maybe somebody has done this in the recent past and could help me out.


//code snippet
<script TYPE=&quot;text/javascript&quot;>
<!--
var filename=&quot;instrumental.wav&quot;;
if (navigator.appName == &quot;Microsoft Internet Explorer&quot;)
document.writeln ('<BGSOUND SRC=&quot;' + filename + '&quot;>');
else if (navigator.appName == &quot;Netscape&quot;)
document.writeln ('<EMBED SRC=&quot;' + filename + '&quot; AUTOSTART=TRUE WIDTH=144 HEIGHT=60><P>');
// -->
</SCRIPT>
<noscript>
<bgsound SRC=&quot;instrumental.wav&quot;>
</noscript>

// url
 
Hi there.

From what I can ascertain, Netscape (at least v7) doesn't have native support for wav files as IE does. If you happen to have a Quicktime/LiveAudio/etc plugin for Netscape, then it probably would work.

If you change to a mid (MIDI) file instead, you might have more success with both browsers, although this may not suit your purposes.

Hope this helps!

Dan
 
Probably the easiest (and most supported) method to do what you're trying is to create a 1x1 big 1 frame long looping flash movie with the music.
 
With flash you are still going to need to supply a plug-in (in fact, if you use flash, you will require a plugin for both NS and IE).

Why not just stick with the wav file (works fine in IE which is a majority of the browsers usually)... and have some browser check to provide information on where how to get the LiveAudio plugin for NS?

Jeff
 
True that flash needs to be installed separately but in this case it has multiple advantages. You can use mp3 compression which will result in a much much smaller file and by asking people to install flash in order to hear the music will give uniform result on all the browsers. The example in the first post launched a QuickTime plug-in, rendered the usual QT controls and played the song once in my Mozilla. That surely is not the desired behaviour.
 
The way I remember it, Flash Player will be installed with NS7+ unless you specifically ask it not to. Flash is the better choice here because the file compression will greatly reduce the download-to-play time.

There's always a better way. The fun is trying to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top