//正文中输出mp4播放代码
//浏览器支持flash时,使用flowplayer播放器,否则支持html5时使用html5的video标签播放
function showvsbvideo(vurl,vheight,vwidth,align,style,vautoplay,mid)
{
if(vurl=="")
{
return;
}
var outputhtml="";
if (hasplayhtml5vedio())
{
outputhtml = outputhtml5video(vurl, vheight, vwidth, vautoplay, align, style, mid);
} else {
outputhtml = outputflashvideo(vurl, vheight, vwidth, vautoplay, align, style, mid);
}
document.write(outputhtml);
}
function hasplayhtml5vedio()
{
var a=document.createelement("video"), c=!!a.canplaytype;
if(c)
{
c=new boolean(c),
c.ogg=a.canplaytype('video/ogg; codecs="theora"');
var d='video/mp4; codecs="avc1.42e01e';
c.h264=a.canplaytype(d+'"')||a.canplaytype(d+', mp4a.40.2"'),c.webm=a.canplaytype('video/webm; codecs="vp8, vorbis"')
}
return c;
}
function outputflashvideo(videourl,wheight,wwidth,bautoplay,align,style,mid)
{
if(!mid||mid=="")
{
mid="id=_vsb_player";
}
var flashurl='';
return flashurl;
}
function outputhtml5video(videourl,wheight,wwidth,bautoplay,align,style)
{
var res=' ';
return res;
}
function outvideoformobile(vurl,vheight,vwidth,vautoplay)
{
//手机显示时,视频宽度为设备宽度
if(hasplayhtml5vedio())
{
var res=' ';
document.write(res);
}
else
alert("不支持");
}