//正文中输出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=''; var configstr='"playlist":[{"url":"'+videoUrl+'","scaling":"fit","autoPlay":'+bautoPlay+',"autoBuffering":"false"}]'; flashUrl=flashUrl+''; flashUrl=flashUrl+''; flashUrl=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("不支持"); }