//正文中输出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,mid)
{
if(!mid||mid=="")
{
mid="id=_vsb_player";
}
var res=' ';
return res;
}
function outvideoformobile(vurl,vheight,vwidth,vautoplay)
{
//手机显示时,视频宽度为设备宽度
if(hasplayhtml5vedio())
{
var res=' ';
document.write(res);
}
else
alert("不支持");
}
//文章内容组件其实是不需要的 因为newscontent.js里面已经包含了这个方法,加到这里只要是为了简介组件使用
//正文中输出mp3播放代码
function showvsbaudio(aurl,vheight,vwidth,align,styles,vautoplay)
{
if(aurl=="")
{
return;
}
var playersrc = "/system/resource/images/ueditor/musicflash/player_mp3_maxi.swf";
var flashvars = "mp3="+aurl+"&showstop=1&showvolume=1&bgcolor1=eeeeee&bgcolor2=a0a0a0";
var autoplaystr = "";
if(vautoplay=="true")
{
autoplaystr = "autoplay = 'true'";
flashvars +="&autoplay=1";
}
var outputhtml="";
outputhtml +='';
document.write(outputhtml);
}