我有这样的文件夹结构
文件夹 interactive_pages_test
C:\Users\用户名\Desktop\interactive_pages_test\test.html
C:\Users\用户名\Desktop\interactive_pages_test\2_Hot_Cross_Buns.mp3
文件夹测试
C:\Users\用户名\Desktop\test\test.html
C:\Users\用户名\Desktop\test\2_Hot_Cross_Buns.mp3
文件 test.html
和 2_Hot_Cross_Buns.mp3
是一样的。当我在 IE 11 中打开 C:\Users\username\Desktop\interactive_pages_test\test.html
时,它抛出一个错误:音频播放被中止
。但是 C:\Users\username\Desktop\test\test.html
在 IE 中运行良好。在 chrome 和 Mozilla 中,这两个文件都可以正常播放。任何人都可以就这个问题提出建议吗?
<html>
<head>
<title>Tile</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" >
alert("hi");
</script>
</head>
<body>
<audio src="./2_Hot_Cross_Buns.mp3" controls="">Audio not supported</audio>
</body>
</html>
最佳答案
其实Windows 8以上的IE都是使用activeX控件来播放音频的,所以当你html文件的时候会提示ActiveX控件被阻止,如果你点击允许被阻止的内容就可以正常播放了。
关于javascript - 错误 : Audio playback was aborted IE 11 Windows 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38103399/