![]() |
|
|
+ Search |
![]()
|
Apr 4th, 2008 20:03
ha mo, Colin Fraser, scott zeller, comp.lang.javascript
This answer may have come from Javascript Source or it may have been a
Martin Honnen post in the
comp.lang.javascript
newsgroup I cant be sure I am afraid.
Try this:
<script language="JavaScript"><!--
var can_play = false;
var mimetype = 'audio/midi';
if (navigator.mimeTypes) {
if (navigator.mimeTypes[mimetype] != null) {
if (navigator.mimeTypes[mimetype].enabledPlugin != null) {
can_play = true;
document.write('<embed src="sound.mid" hidden=true
loop=false autostart=false>');
}
}
}
if (document.all) {
can_play = true;
document.write('<embed src="sound.mid" hidden=true loop=false
autostart=false>');
}
function playSound() {
if (document.embeds && can_play) {
if (navigator.appName == 'Netscape')
document.embeds[0].play();
else
document.embeds[0].run();
}
}
function stopSound() {
if (document.embeds && can_play)
document.embeds[0].stop();
}
//--></script>
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com