Mediaelement.js 在 IE 中出现故障,无法闪退
我在我的网站中使用了 mediaelement.js
,我在示例中使用了带有 H.264 编解码器的 .mp4 文件,在所有浏览器中都能正常工作,但在任何版本的 Internet Explorer 中都不起作用当我发布网站时。在我的本地主机上,它没有任何问题(闪存回退工作正常),但在我的服务器上它不起作用。
我使用的代码是:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>VIDEO HTML5</title>
<script type="text/javascript" src="player_files/jquery.js"></script>
<script type="text/javascript" src="player_files/mediaelement-and-player.min.js"></script>
<link href="player_files/mediaelementplayer.min.css" rel="Stylesheet" />
</head>
<body>
<video id="video1" src="http://www.teletica.com/html5/videos/precious.mp4" width="640" height="360" poster="http://www.teletica.com/html5/videos/precious.jpg" controls="controls" preload="none"></video>
<video width="640" height="360" id="video2" poster="videos/precious.jpg" controls="controls" preload="none">
<source type="video/mp4" src="http://teletica.com/html5/videos/precious.mp4" />
<source type="video/webm" src="http://teletica.com/html5/videos/precious.webm" />
<object width="640" height="360" type="application/x-shockwave-flash" data="player_files/flashmediaelement.swf">
<param name="movie" value="player_files/flashmediaelement.swf" />
<param name="flashvars" value="controls=true&file=http://teletica.com/html5/videos/precious.mp4" />
<img src="player_files/precious.jpg" width="640" height="360" alt="Here we are" title="No video playback capabilities" />
</object>
</video>
<script type="text/javascript">
$('video, audio').mediaelementplayer();
</script>
播放器朝这个方向http://www.teletica.com/html5
工作。
I used the mediaelement.js
in my site, I used for the example a .mp4 file with H.264 codec, works well in all browsers, but it doesn't works in any version of Internet Explorer when I publish the site. On my localhost, it doesn't have any problems (the flash fallback works well), but in my server it doesn't works.
The code I used is:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>VIDEO HTML5</title>
<script type="text/javascript" src="player_files/jquery.js"></script>
<script type="text/javascript" src="player_files/mediaelement-and-player.min.js"></script>
<link href="player_files/mediaelementplayer.min.css" rel="Stylesheet" />
</head>
<body>
<video id="video1" src="http://www.teletica.com/html5/videos/precious.mp4" width="640" height="360" poster="http://www.teletica.com/html5/videos/precious.jpg" controls="controls" preload="none"></video>
<video width="640" height="360" id="video2" poster="videos/precious.jpg" controls="controls" preload="none">
<source type="video/mp4" src="http://teletica.com/html5/videos/precious.mp4" />
<source type="video/webm" src="http://teletica.com/html5/videos/precious.webm" />
<object width="640" height="360" type="application/x-shockwave-flash" data="player_files/flashmediaelement.swf">
<param name="movie" value="player_files/flashmediaelement.swf" />
<param name="flashvars" value="controls=true&file=http://teletica.com/html5/videos/precious.mp4" />
<img src="player_files/precious.jpg" width="640" height="360" alt="Here we are" title="No video playback capabilities" />
</object>
</video>
<script type="text/javascript">
$('video, audio').mediaelementplayer();
</script>
The player works in this direction http://www.teletica.com/html5
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
感谢一百万的调查工作和解决方案 - 我最终选择了稍微更独立的代码
Thanks a million for the investigative work and the solution — I ended up going with the slightly more separated code of
只是将其放在这里以便其他人看到它,我尝试使用此代码
,最终在 Internet Explorer 9 中遇到问题,浏览器似乎正在制作我的视频的另一个实例,该实例在其他所有内容上播放,但我无法完全控制。我最终选择了这个。
Just putting it here so other people see it, I tried using this code
And I ended up having issues in Internet Explorer 9, it seems that the browser was making an other instance of my video that played over everything else and that I couldn't control at all. I ended up going with this instead.
由于您的问题仅与您的系统有关,因此您的设置或 Flash 播放器可能有问题。您可以尝试以下一些操作:
您还可以重新安装 Internet Explorer 并查看它是否有效。一切顺利! :)
Since your problem persists with your system only, there might be problem with either your setting or the flash player. Here are some things you may try:
You can also, re-install your Internet Explorer and see if it works. All the best! :)
我遇到了同样的问题,并在 另一个中发现了未记录的功能post:
mode:shim
~ 不确定它具体在做什么,但它似乎迫使所有浏览器重新使用 flash。由于 chrome、ios 等可以正常处理 html5 视频,因此我使用条件注释来指定 IE9 并强制回退(flash 或 silverlight):
I had the same problem and found an undocumented feature in another post:
mode:shim
~ not sure of what its doing, specifically, but it seems to force all browsers to fall back on to flash.Since chrome, ios, et al were working properly with html5 video, I used conditional comments to specify IE9 and force the fall back (flash or silverlight):