Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.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 Internet Explorer 10:<;音频>&引用;“玩”;事件处理程序只发生一次?_Javascript_Internet Explorer 10_Html5 Audio - Fatal编程技术网

Javascript Internet Explorer 10:<;音频>&引用;“玩”;事件处理程序只发生一次?

Javascript Internet Explorer 10:<;音频>&引用;“玩”;事件处理程序只发生一次?,javascript,internet-explorer-10,html5-audio,Javascript,Internet Explorer 10,Html5 Audio,下面是一个简单的测试(): 音频测试 使用上述代码并多次播放音频文件,Internet Explorer 10仅运行console.log('played')一次。这种行为是微软故意的还是我做错了什么?有一个很好的解决方法吗?当前规范说触发play事件的先决条件是“paused最近为false” 因此,这可能意味着它仅在第一次启动时,以及从暂停状态切换后启动。您可以尝试调用audioElement.pause()onend onended="javascript:this.paused()

下面是一个简单的测试():


音频测试

使用上述代码并多次播放音频文件,Internet Explorer 10仅运行
console.log('played')一次。这种行为是微软故意的还是我做错了什么?有一个很好的解决方法吗?

当前规范说触发
play
事件的先决条件是“
paused
最近为false”

因此,这可能意味着它仅在第一次启动时,以及从暂停状态切换后启动。您可以尝试调用
audioElement.pause()
on
end

onended="javascript:this.paused(); console.log('ended');
因此,虽然这似乎可以解决问题,但根据您的需要,它可能不是一个适用的解决方法。在这种情况下,也许你可以利用

onended="javascript:this.paused(); console.log('ended');