其实也算简单。本人亲测不同格式视频是否可播放情况。
1.可播放:.mp4,.flv,.mov。
1.可播放:.mp4,.flv,.mov。
2.不可播放:.avi,.rmvb,.mpg,.vob,.swf,.wma,.3pg。(对于不可播放的视频,可利用ffmpeg进行转码)。
参考代码如下:
<script src="jaris/js/swfobject.js" type="text/javascript"></script>
<script type="text/javascript">
var flashvarsVideo = {
source:"videos/<s:property value="video.VideoUrl"/>",
type: "video",
streamtype: "file",
server: "",//Used for rtmp streams
duration: "52",
poster: "videoPoster/<s:property value="video.VideoPost"/>",
autostart: "false",
hardwarescaling: "false",
darkcolor: "000000",
brightcolor: "4c4c4c",
controlcolor: "FFFFFF",
hovercolor: "67A8C1",
controltype: 1
};
var params = {
menu: "false",
scale: "noScale",
allowFullscreen: "true",
allowScriptAccess: "always",
bgcolor: "#000000",
quality: "high",
wmode: "opaque"
};
var attributes = {
id:"JarisFLVPlayer"
};
swfobject.embedSWF("JarisFLVPlayer.swf", "altContentOne", "576px", "360px", "10.0.0", "expressInstall.swf", flashvarsVideo, params, attributes);
</script>