//正文中输出mp4播放代码
//浏览器支持flash时,使用flowplayer播放器,否则支持html5时使用html5的video标签播放
function showVsbVideo(vurl,vheight,vwidth,vautoplay,mid)
{
if(vurl=="")
{
return;
}
var outputHTML="";
//浏览器类型
var browserName= getBrowsers();
outputHTML=outPutHTML5Video(vurl,vheight,vwidth,vautoplay,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,mid)
{
if(!mid||mid=="")
{
mid="id=_vsb_player";
}
var flashUrl='';
return flashUrl;
}
function outPutHTML5Video(videoUrl,wHeight,wWidth,bautoPlay)
{
return ' '
}
//获得浏览器类别名称
function getBrowsers()
{
var userinfo = navigator.userAgent.toLowerCase();
var arrayBrowser = new Array("msie", "firefox", "android","chrome","safari", "opera", "netscape");
for(var i = 0; i < arrayBrowser.length; i ++)
{
if(userinfo.indexOf(arrayBrowser[i]) != -1)
{
return arrayBrowser[i];
}
}
return "other";
}