<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">//正文中输出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='&lt;object '+mid+' align="'+align+'" style="'+style+'" type="application/x-shockwave-flash" data="/system/resource/swf/flowplayer.commercial.swf"  '+wWidth+'  '+wHeight+'&gt;';
		var configstr='&amp;quot;playlist&amp;quot;:[{&amp;quot;url&amp;quot;:&amp;quot;'+videoUrl+'&amp;quot;,&amp;quot;scaling&amp;quot;:&amp;quot;fit&amp;quot;,&amp;quot;autoPlay&amp;quot;:'+bautoPlay+',&amp;quot;autoBuffering&amp;quot;:&amp;quot;false&amp;quot;}]';
		flashUrl=flashUrl+'&lt;param name="flashvars" value="config={'+configstr+'}"&gt;';
		flashUrl=flashUrl+'&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="allowscriptaccess" value="sameDomain"&gt;&lt;param name="quality" value="high"&gt;&lt;param name="cachebusting" value="false"&gt;&lt;param name="bgcolor" value="#000000"&gt;&lt;param name="src" value="/system/resource/swf/flowplayer.commercial.swf"&gt;';
		flashUrl=flashUrl+'&lt;/object&gt;';
		return flashUrl;
}

function outPutHTML5Video(videoUrl,wHeight,wWidth,bautoPlay,align,style,mid)
{
		if(!mid||mid=="")
		{
		    mid="id=_vsb_player";
		}
		var res='&lt;video controlsList="nodownload" controls '+mid+' style="background-color:#474747;'+style+'" align="'+align+'" '+wWidth+'  '+wHeight;
		if(bautoPlay&amp;&amp;bautoPlay=="true")
		{
		    res+=' autoplay="autoplay" ';
		}
		res +='&gt;&lt;source src="'+videoUrl+'" type="video/mp4" /&gt;&lt;/video&gt; ';
		return  res;
}	

function outVideoForMobile(vurl,vheight,vwidth,vautoplay)
{
        //手机显示时，视频宽度为设备宽度
        if(hasPlayHtml5Vedio())
        {
		    var res='&lt;video controls="controls" controlsList="nodownload" width="'+document.body.clientWidth+'"';
    		if(vautoplay&amp;&amp;vautoplay=="true")
    		{
    		    res+=' autoplay="autoplay" ';
    		}
    		res +='&gt;&lt;source src="'+vurl+'" type="video/mp4" /&gt;&lt;/video&gt; ';
		
    		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+"&amp;showstop=1&amp;showvolume=1&amp;bgcolor1=eeeeee&amp;bgcolor2=a0a0a0";
    var autoplayStr = "";
    if(vautoplay=="true")
    {
        autoplayStr = "autoplay = 'true'";
        flashvars +="&amp;autoplay=1";
    }
    var outputHTML="";
    outputHTML +='&lt;audio src="'+aurl+'" width="'+vwidth+'" height="'+vheight+'"  '+autoplayStr+' align="'+align+'" style="'+styles+'"  controls="controls"&gt;&lt;embed align="'+align+'" style="'+styles+'" width="'+vwidth+'" height="'+vheight+'" src="'+playersrc+'" flashvars="'+flashvars+'" /&gt;&lt;/audio&gt;';
    document.write(outputHTML);
}</pre></body></html>