Mic*_*nez 6 flash mp4 fallback mediaelement.js video-player
我在我的网站上使用了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>
Run Code Online (Sandbox Code Playgroud)
播放器朝这个方向工作"http://www.teletica.com/html5"
我遇到了同样的问题,并在另一篇文章中发现了一个未记录的功能:mode:shim
〜不确定它具体在做什么,但它似乎迫使所有浏览器重新使用 Flash。
由于 chrome、ios 等可以正常处理 html5 视频,因此我使用条件注释来指定 IE9 并强制回退(flash 或 silverlight):
var player = new MediaElementPlayer('video', {
/*@cc_on
@if (@_jscript_version == 9)
mode: 'shim',
@end
@*/
// remove or reorder to change plugin priority
plugins: ['flash','silverlight'],
// etc...
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
7828 次 |
最近记录: |