我使用 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
}
}
}
此外,当我尝试其他一些带有嵌入声音的网站时,它可以播放! 为什么?欢迎任何线索:-)
最佳答案
您可能缺少 Firefox 的 Quicktime 或 WMP 插件!
Firefox 3.5+ 支持 <audio>
标记,以便您可以选择查看它。
关于javascript - 嵌入声音无法播放 Firefox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7677648/