我有这个代码适用于Firefox,但是当我尝试让IE播放音频文件时出现错误(播放被中止)
我不想仅为一个浏览器优化我的网站,所以我想知道我做错了什么。
<html>
<HEAD>
<TITLE>...</TITLE>
</HEAD>
<BODY>
<H1 ALIGN="CENTER">...</H1>
<P ALIGN="CENTER"> <IMG SRC="../picture/1.jpg"></P>
<P ALIGN="CENTER"> ...</P>
<P ALIGN="CENTER"> <audio controls><source src="../audio/1.mp3" type="audio/mpeg"></audio></P>
<P ALIGN="CENTER"> ...</P>
<P ALIGN="CENTER"> <audio controls><source src="../audio/2.mp3" type="audio/mpeg"></audio></P>
<P ALIGN="CENTER"> ...</P>
<P ALIGN="CENTER"> <audio controls><source src="../audio/3.mp3" type="audio/mpeg"></audio></P>
<P ALIGN="CENTER"> ...</P>
<P ALIGN="CENTER"> <audio controls><source src="../audio/4.mp3" type="audio/mpeg"></audio></P>
</BODY>
</html>
我已经编辑了标题。为什么IE限制脚本或活动X控件?
答案 0 :(得分:1)
It is a safety feature. As you are running the file locally (not on a server or trusted site), Internet Explorer blocks the ActiveX controls and scripts because it considers that they may unsafe or harmful to your computer. I guess the idea is that IE doesn't know if you developed that page yourself, or if you downloaded it from somewhere potentially dangerous.
In SuperUser there is a possible solution for this. It is from 2010, but it sill applies to IE11: