Do you hear something in Netscape, Opera, Mozilla ?

A

Asterbing

Hello,

Here is a page which contains an "evoluated" (to distinguish-it from the
simple one) way to hear sound on a html page event. From my memory, it
worked under all major browsers, but didn't succeed these last days.

I've just tried it today under IE6, Netscape 7, Mozilla 7 and Opera 1.6.
And it only works under IE.

Could you try, please. Is it the same for you ?

Here is the entire HTML file :
------------------------------
<html>
<head>
<!-- SOUND CODE (for évoluated way)
NB : not in external .js due to pb on insertAdjacentHTML -->
<script type="text/javascript" language="JavaScript"><!--
var arPreloadSounds = new Array();
arPreloadSounds[0] = "sound.wav"; // sounds to preload :

document.write('<BGSOUND ID="auIEContainer">');
var IE=(navigator.appVersion.indexOf("MSIE")!=-1 && document.all)?1:0;
var NS=(navigator.appName=="Netscape"&&navigator.plugins["LiveAudio"])?
1:0;
var ver4 = IE||NS? 1:0;

function PreloadSounds()
{
var Str;

if (!ver4)
return;

if (NS)
{
auEmb = new Layer(0,window);
}
else
{
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
document.body.insertAdjacentHTML("BeforeEnd",Str);
}

Str = '';
for (i=0; i<arPreloadSounds.length; i++)
Str += "<EMBED SRC='" + arPreloadSounds + "'
AUTOSTART='FALSE' HIDDEN='TRUE'>";

if (IE)
{
auEmb.innerHTML = Str;
}
else
{
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}

auCon = IE? document.all.auIEContainer:auEmb;
auCon.control = AudioControl;
}

function AudioControl(whSound,play)
{
if (IE)
this.src = play? arPreloadSounds[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);
}
//--></script>
</head>
<body>
<!-- SIMPLE WAY (IE ONLY) -->
<bgsound id=music loop=1 autostart="false">
<a href="#" onMouseOver="document.all.music.src='sound.wav'">SIMPLE WAY
</a><p>

<!-- EVOLUATED WAY (CROSS-BROWSER CONSIDERATION)
***TODO : doesn't seems to work under NN7, Mozilla 7 and Opera 1.6
???
-->
<a href="#" onMouseOver="PlaySound(0);">EVOLUATED WAY</a><p>
</body>
</html>
 
V

VK

Asterbing said:
Hello,

Here is a page which contains an "evoluated" (to distinguish-it from the
simple one) way to hear sound on a html page event. From my memory, it
worked under all major browsers, but didn't succeed these last days.

I've just tried it today under IE6, Netscape 7, Mozilla 7 and Opera 1.6.
And it only works under IE.

Yes, this is an old IE4 / NN4 cross-browser media script.
It uses <bgsound> object in IE and Java-based Bitnik Software plugin in
NN (with was build in NN 4.x).

NN 4 is gone as well as Bitnik Software itself (I even not sure if I
spelled it properly Bitnik? Bitnick? Bitnique? Sounded alike anyway).

AFAIK neither Netscape > 4, nor Opera not Firefox do not currently
provide a build-in media interface (?) So a scriptable Flash movie is
the only option (?)
 
R

Randy Webb

VK said the following on 12/1/2005 10:28 AM:
Yes, this is an old IE4 / NN4 cross-browser media script.
It uses <bgsound> object in IE and Java-based Bitnik Software plugin in
NN (with was build in NN 4.x).

NN 4 is gone as well as Bitnik Software itself (I even not sure if I
spelled it properly Bitnik? Bitnick? Bitnique? Sounded alike anyway).

AFAIK neither Netscape > 4, nor Opera not Firefox do not currently
provide a build-in media interface (?) So a scriptable Flash movie is
the only option (?)

<embed src="................
 
T

Thomas 'PointedEars' Lahn

VK said:
Yes, this is an old IE4 / NN4 cross-browser media script.
It uses <bgsound> object

You mean the `bgsound' _element_, which is not Valid HTML.
in IE and Java-based Bitnik Software plugin in
NN (with was build in NN 4.x).

NN 4 is gone as well as Bitnik Software itself

Neither is gone. As for the latter, it is only that Beatnik, Inc. has
discontinued its support. There are no new versions of that plugin
available:
(I even not sure if I spelled it properly Bitnik? Bitnick? Bitnique?
Sounded alike anyway).

AFAIK neither Netscape > 4, nor Opera not Firefox do not currently
provide a build-in media interface (?)

True, because that interface has always been provided by the plugin,
to be accessed through the DOM. Joined efforts of the major vendors
to standardize the former have begun some time ago:

<URL:http://www.mozilla.org/press/mozilla-2004-06-30.html>

BTW: Forget about `embed', that is not Valid HTML either. Use the
`object' element from HTML 4.01 instead, supported in the named
browsers. Be sure to use its content to provide for an alternative
in case it is not supported (I think a visible hyperlink to the used
media would suffice.)
So a scriptable Flash movie is the only option (?)

It is not. However, depending on the target environment, it is probably
the most reliable and fastest option (even though it requires another
plugin, the Macromedia Flash Player Plug-in).


PointedEars
 
A

Asterbing

You mean the `bgsound' _element_, which is not Valid HTML.


Neither is gone. As for the latter, it is only that Beatnik, Inc. has
discontinued its support. There are no new versions of that plugin
available:




True, because that interface has always been provided by the plugin,
to be accessed through the DOM. Joined efforts of the major vendors
to standardize the former have begun some time ago:

<URL:http://www.mozilla.org/press/mozilla-2004-06-30.html>

BTW: Forget about `embed', that is not Valid HTML either. Use the
`object' element from HTML 4.01 instead, supported in the named
browsers. Be sure to use its content to provide for an alternative
in case it is not supported (I think a visible hyperlink to the used
media would suffice.)


It is not. However, depending on the target environment, it is probably
the most reliable and fastest option (even though it requires another
plugin, the Macromedia Flash Player Plug-in).


PointedEars

OK, I'll see around <object>. Thanks for the help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top