Кто-нибудь знает, как проиграть wav файл в Internet Explorere?
Требуется звук при наведении мыши на объект
From : Raidillon Eaurouge (2:5020/400)
Проверил в win98, IE5.0 (5.00.2614.3500)... Работает!
<sample runsInIE5_0="yes">
<HTML>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
var strOver = "1.wav";
var strClick = "2.wav";
var a = new Array("never", "say", "die");
for (var i = 0; i < a.length; i++)
document.writeln('<p><a href="#"'
+ ' onmouseover="soundIt(false)"'
+ ' onclick="soundIt(true)">'
+ a[i] + '</a></p>');
function soundIt(cause)
{
sounder.src = (cause ? strClick : strOver);
}
//-->
</SCRIPT>
<bgsound id="sounder"/>
</BODY>
</HTML>
</sample>
From: Andrew Rousev
Из ClientGuide JS1.3:
JavaScript Methods for Controlling LiveAudio*
LiveAudio provides the following major JavaScript controlling methods. For
these methods to be available to JavaScript (and the web page), you must
embed a LiveAudio console (any console will do, it can even be hidden) somewhere
on your page.
- play({loop[TRUE, FALSE or an INT]}, '{url_to_sound}')
- pause()
- stop()
- StopAll()
- start_time({number of seconds})
- end_time({number of seconds})
- setvol({percentage number - without "%" sign})
- fade_to({volume percent to fade to, without the "%"})
- fade_from_to({volume % start fade}, {volume % end fade})
- start_at_beginning()
- stop_at_end()
The following JavaScript state indication methods do not control the
LiveAudio plug-in, but they give you information about the current state
of the plug-in:
- IsReady
- IsPlaying
- IsPaused
- GetVolume
Using the LiveAudio LiveConnect Methods
One example of using JavaScript to control a LiveAudio plug-in is to have
JavaScript play a sound. In the following example, all of the HTML is needed
to make the plug-in play a sound.
<HTML><BODY>
<EMBED SRC="sound1.wav" HIDDEN=TRUE>
<A HREF="javascript:document.embeds[0].play(false)">Play the sound now!</A>
</BODY></HTML>
function Browser_getHostAddress(){
if (navigator.appName.lastIndexOf('Netscape')!=-1)
if(navigator.javaEnabled()==1){
window.onerror=null;
hostAddress=java.net.InetAddress.getLocalHost();
return(hostAddress.getHostAddress());
}
return null;
}
var browser=new Browser();
К огавлению
|