使用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
}
}
}
此外,当我尝试其他嵌入声音的网站时,它会播放! 为什么?任何线索欢迎: - )