PageSourceSearch

https://www.rubberasia.com/system/resource/js/news/mp4video.js

js rubberasia.com collected 2026-10-02 19:09:59 UTC 3,883 bytes, 96 lines download raw bytes

1//正文中输出mp4播放代码 
2//浏览器支持flash时,使用flowplayer播放器,否则支持html5时使用html5的video标签播放
3function showVsbVideo(vurl,vheight,vwidth,align,style,vautoplay,mid)
4{
5	if(vurl=="")
6	{
7	    return;   
8	}
9	var outputHTML="";
10    if (hasPlayHtml5Vedio())
11    {
12        outputHTML = outPutHTML5Video(vurl, vheight, vwidth, vautoplay, align, style, mid);
13    } else {
14        outputHTML = outPutFlashVideo(vurl, vheight, vwidth, vautoplay, align, style, mid);
15    }
16	document.write(outputHTML);      
17}
18
19function hasPlayHtml5Vedio()
20{
21	var a=document.createElement("video"),	c=!!a.canPlayType;
22	if(c)
23	{
24		c=new Boolean(c),
25		c.ogg=a.canPlayType('video/ogg; codecs="theora"');
26		var d='video/mp4; codecs="avc1.42E01E';
27		c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')
28	}
29	return c;			
30}
31function outPutFlashVideo(videoUrl,wHeight,wWidth,bautoPlay,align,style,mid)
32{
33		if(!mid||mid=="")
34		{
35		    mid="id=_vsb_player";
36		}
37		var flashUrl='<object '+mid+' align="'+align+'" style="'+style+'" type="application/x-shockwave-flash" data="/system/resource/swf/flowplayer.commercial.swf"  '+wWidth+'  '+wHeight+'>';
38		var configstr='&quot;playlist&quot;:[{&quot;url&quot;:&quot;'+videoUrl+'&quot;,&quot;scaling&quot;:&quot;fit&quot;,&quot;autoPlay&quot;:'+bautoPlay+',&quot;autoBuffering&quot;:&quot;false&quot;}]';
39		flashUrl=flashUrl+'<param name="flashvars" value="config={'+configstr+'}">';
40		flashUrl=flashUrl+'<param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="sameDomain"><param name="quality" value="high"><param name="cachebusting" value="false"><param name="bgcolor" value="#000000"><param name="src" value="/system/resource/swf/flowplayer.commercial.swf">';
41		flashUrl=flashUrl+'</object>';
42		return flashUrl;
43}
44
45function outPutHTML5Video(videoUrl,wHeight,wWidth,bautoPlay,align,style,mid)
46{
47		if(!mid||mid=="")
48		{
49		    mid="id=_vsb_player";
50		}
51		var res='<video controlsList="nodownload" controls '+mid+' style="background-color:#474747;'+style+'" align="'+align+'" '+wWidth+'  '+wHeight;
52		if(bautoPlay&&bautoPlay=="true")
53		{
54		    res+=' autoplay="autoplay" ';
55		}
56		res +='><source src="'+videoUrl+'" type="video/mp4" /></video> ';
57		return  res;
58}	
59
60function outVideoForMobile(vurl,vheight,vwidth,vautoplay)
61{
62        //手机显示时,视频宽度为设备宽度
63        if(hasPlayHtml5Vedio())
64        {
65		    var res='<video controls="controls" controlsList="nodownload" width="'+document.body.clientWidth+'"';
66    		if(vautoplay&&vautoplay=="true")
67    		{
68    		    res+=' autoplay="autoplay" ';
69    		}
70    		res +='><source src="'+vurl+'" type="video/mp4" /></video> ';
71		
72    		document.write(res);    
73		}    
74		else
75		    alert("不支持");        
76}
77//文章内容组件其实是不需要的  因为newscontent.js里面已经包含了这个方法,加到这里只要是为了简介组件使用
78//正文中输出mp3播放代码
79function showVsbAudio(aurl,vheight,vwidth,align,styles,vautoplay)
80{
81    if(aurl=="")
82    {
83        return;
84    }
85    var playersrc = "/system/resource/images/ueditor/musicFlash/player_mp3_maxi.swf";
86    var flashvars = "mp3="+aurl+"&showstop=1&showvolume=1&bgcolor1=eeeeee&bgcolor2=a0a0a0";
87    var autoplayStr = "";
88    if(vautoplay=="true")
89    {
90        autoplayStr = "autoplay = 'true'";
91        flashvars +="&autoplay=1";
92    }
93    var outputHTML="";
94    outputHTML +='<audio src="'+aurl+'" width="'+vwidth+'" height="'+vheight+'"  '+autoplayStr+' align="'+align+'" style="'+styles+'"  controls="controls"><embed align="'+align+'" style="'+styles+'" width="'+vwidth+'" height="'+vheight+'" src="'+playersrc+'" flashvars="'+flashvars+'" /></audio>';
95    document.write(outputHTML);
96}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.