Alias
05-04-2003, 06:06 PM
Hello folks
This is my solution for development of sound in html:
<script language="JavaScript"><!--
var aySound = new Array();
aySound[0] = "websound.wav";
var navA=navigator.userAgent;
var op=(navA.indexOf("Opera")>-1 && dom);
if (document.all && !op)
document.write('<bgsound src="#" id="bgmusic" loop="infinite" autostart="true">');
else
document.write('<embed src="websound.wav" name="embmusic" hidden="true" autostart="false" loop="true" MASTERSOUND></embed>');
//-->
</script>
<script language="JavaScript">
var navA=navigator.userAgent;
var op=(navA.indexOf("Opera")>-1 && dom);
function stopp() {
if (document.all && !op) {
document.execCommand('Stop');
}
else {
document.embmusic.stop();
}
}
function playmusic() {
if (document.all && !op) {
document.all.bgmusic.src='websound.wav';
}
else {
if (navigator.mimeTypes["audio/x-wav"]) {
document.embmusic.play();
}
else {
if (confirm("AUDIO PLUGIN NOT FOUND. \n\nTo listen to the music from this website you need to \ndownload and install audio plugin for your browser. \n\n\nDo you want to download it now? \nhttp://plugins.netscape.com"))
window.open("http://plugins.netscape.com","_blank")
}
}
}
</script>
<a href="javascript:stopp();">stop</a> <a href="javascript:playmusic();">play</a>
(note: onclick="stopp();" for IE 4.0 doesn't work! - must be - href="javascript:stopp();") (???)
This works fine in IE 4.0 +, Netscape 4.07 and Netscape 4.6 (where to download version 4.7?)
but it not works for Netscape 6.0, Netscape 7.02 and Mozila 1.0 + ...
well, I know that I don't have a plugins for NS 6.0 and 7.0 ... it's ok ...
My problem and question is -
to leave this:
if (navigator.mimeTypes["audio/x-wav"] || navigator.mimeTypes["audio/wav"])
or to remove it ?
What is your opinion about all this approach ...
Best Regards
This is my solution for development of sound in html:
<script language="JavaScript"><!--
var aySound = new Array();
aySound[0] = "websound.wav";
var navA=navigator.userAgent;
var op=(navA.indexOf("Opera")>-1 && dom);
if (document.all && !op)
document.write('<bgsound src="#" id="bgmusic" loop="infinite" autostart="true">');
else
document.write('<embed src="websound.wav" name="embmusic" hidden="true" autostart="false" loop="true" MASTERSOUND></embed>');
//-->
</script>
<script language="JavaScript">
var navA=navigator.userAgent;
var op=(navA.indexOf("Opera")>-1 && dom);
function stopp() {
if (document.all && !op) {
document.execCommand('Stop');
}
else {
document.embmusic.stop();
}
}
function playmusic() {
if (document.all && !op) {
document.all.bgmusic.src='websound.wav';
}
else {
if (navigator.mimeTypes["audio/x-wav"]) {
document.embmusic.play();
}
else {
if (confirm("AUDIO PLUGIN NOT FOUND. \n\nTo listen to the music from this website you need to \ndownload and install audio plugin for your browser. \n\n\nDo you want to download it now? \nhttp://plugins.netscape.com"))
window.open("http://plugins.netscape.com","_blank")
}
}
}
</script>
<a href="javascript:stopp();">stop</a> <a href="javascript:playmusic();">play</a>
(note: onclick="stopp();" for IE 4.0 doesn't work! - must be - href="javascript:stopp();") (???)
This works fine in IE 4.0 +, Netscape 4.07 and Netscape 4.6 (where to download version 4.7?)
but it not works for Netscape 6.0, Netscape 7.02 and Mozila 1.0 + ...
well, I know that I don't have a plugins for NS 6.0 and 7.0 ... it's ok ...
My problem and question is -
to leave this:
if (navigator.mimeTypes["audio/x-wav"] || navigator.mimeTypes["audio/wav"])
or to remove it ?
What is your opinion about all this approach ...
Best Regards