【发布时间】:2011-12-02 10:06:53
【问题描述】:
使用 Firefox 时不播放声音。
如果玩 IE 和 Safari!代码如下:
<embed src="http://www.myWebSite.com/Play/Sound/someSound.wav" autostart="false" width="1" height="1"
id="someSound" enablejavascript="true" />
在 JS 的某个地方,我有这个:playSound("someSound");
function playSound(mySound) {
var snd = document.getElementById(mySound);
try {
snd.Play();
}
catch (e) {
try {
snd.DoPlay(); // Some browsers doesn't understand the Play() command
}
catch (e) {
// Do nothing if no Windows Media Player nor Quicktime installed
}
}
}
此外,当我尝试其他嵌入声音的网站时,它会播放! 为什么?欢迎任何线索:-)
【问题讨论】:
标签: javascript firefox audio embed