View Full Version : Script needs updating for NS

07-08-2003, 03:33 AM
This script from JSK needs updating since Netscape no longer uses LiveAudio. I just need it to also play a .wav in NS with whatever plugin they may have. If they don't have the plugin, it should probably include an alert to tell them it's required to hear the audio. Thanks

I've changed the LiveAudio to RealPlayer without success.

<script LANGUAGE="JavaScript"><!--
// Preload and play audio files with event handler (MouseOver sound)
// designed by JavaScript Archive, (c)1999
// Get more free javascripts at http://jsarchive.8m.com

var aySound = new Array();
// Below: source for sound files to be preloaded
aySound[0] = "laser.wav";

// DO NOT edit below this line
document.write('<BGSOUND ID="auIEContainer">')
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["RealPlayer"])? 1:0;
ver4 = IE||NS? 1:0;

function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
var Str = '';
for (i=0;i<aySound.length;i++)
Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
if (IE) auEmb.innerHTML = Str;
else {
auCon = IE? document.all.auIEContainer:auEmb;
auCon.control = auCtrl;
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }

07-08-2003, 05:02 AM
So er... you pasting the script that needs changing, or is this the changed version?

I don't do much audio these days, so forgive my ignorance, but if netscape (and so I presume, mozilla) don't use LiveAudio any more, what does it do to embed those kinds of sounds - or does it (hey ..cool if so) allow you to use <object> includes with a medai mime-type, and it just uses from whatever compatible plugin it can find in the OS ..?

07-08-2003, 08:20 PM
I've installed RealPlayer in NS7 and it still doesn't work. It should check for RealPlayer and an alert should notify them they need the plugin. Here's their plugins page: http://wp.netscape.com/plugins/index.html :rolleyes:

07-09-2003, 07:18 AM
What? No Nutscr...er...Netscapers in here wanna give it a shot?