//正文中输出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);
}