Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/371.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 嵌入声音不';播放firefox_Javascript_Firefox_Audio_Embed - Fatal编程技术网

Javascript 嵌入声音不';播放firefox

Javascript 嵌入声音不';播放firefox,javascript,firefox,audio,embed,Javascript,Firefox,Audio,Embed,当我使用Firefox时,声音不会播放 如果玩IE和Safari!代码如下: <embed src="http://www.myWebSite.com/Play/Sound/someSound.wav" autostart="false" width="1" height="1" id="someSound" enablejavascript="true" /> } 此外,当我尝试其他一些嵌入声音的网站时,它会播放! 为什么?任何线索欢迎:-)您可能缺少Firefox的Q

当我使用Firefox时,声音不会播放

如果玩IE和Safari!代码如下:

<embed src="http://www.myWebSite.com/Play/Sound/someSound.wav" autostart="false" width="1" height="1" 
    id="someSound" enablejavascript="true" />
}

此外,当我尝试其他一些嵌入声音的网站时,它会播放!
为什么?任何线索欢迎:-)

您可能缺少Firefox的Quicktime或WMP插件


Firefox 3.5+支持该标签,因此您可以选择查看该标签。

谢谢Eganr,但是:1-由于其他一些网页正在使用嵌入标签播放声音,我想我不会错过必要的插件。-2-我不能在同一页面上同时使用音频标签和嵌入标签!我需要一个跨浏览器的解决方案。@DidierLevy嗯,你总是考虑另一种方法。查看此问题:
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
    }
}