帝国cms7.5二次开发集成CKPlayer播放器教程

电脑杂谈  发布时间:2020-04-02 16:08:47  来源:网络整理

手机ckplayer使用教程_手机视频格式转换器完美使用教程_手机apktool使用教程

Empire cms7.5集成CKPlayer教程,Empire cms7.5二次开发ckplayer播放器教程

将empire cms7.5编辑器与CKPlayer播放器集成在一起,支持在一页上播放多个视频

手机ckplayer使用教程_手机apktool使用教程_手机视频格式转换器完美使用教程

1. 下载ckplayer播放器,下载地址:

2手机ckplayer使用教程,解压后放置/ e / data / ckplayer /目录

手机视频格式转换器完美使用教程_手机ckplayer使用教程_手机apktool使用教程

3. 在信息编辑器中替换视频上传js控件,路径为: /e/admin/ecmseditor/infoeditor/plugins/etranmedia/dialogs/etranmedia.js

(function() {  
    CKEDITOR.dialog.add("etranmedia",   
    function(ecmseditorv) {  
        return {  
            title: "插入视频",  
            minWidth: "500",  
            minHeight:"400",  
            contents: [{  
                id: "etmediainfo1",  
                label: "常规",  
                title: "常规",  
                expand: true,  
                width: "500px",  
                height: "400px",  
                padding: 0,  
                elements: [
    					{type:"hbox",widths:["90%","10%"],align:"right",children:[
					{id:"etmediaurl",type:"text",label:" ",style:"width:100%;float:left;","default":""}
					,{type:"button",id:"browse",filebrowser:{action:"Browse",target:"etmediainfo1:etmediaurl",url:ecmseditorv.config.filebrowserFlashUploadUrl+'FileMain.php?'+ecmseditorv.config.filebrowserImageBrowseUrl+'&doecmspage=TranMedia&type=3&tranfrom=1&field=&InstanceId='+ecmseditorv.id+'&InstanceName='+ecmseditorv.name},style:"display:inline-block;margin-top:14px;",hidden:!0,label:"选择"}]},
					
					{type:"hbox",widths:["25%","25%","25%","25%"],align:"right",children:[
					{id:"etmediawidth",type:"text",label:"宽度",style:"width:100%;float:left","default":"100%"},
					{id:"etmediaheight",type:"text",label:"高度",style:"width:100%;float:left","default":"auto"},
					
					{
						id: 'etmediatoplay',
						type: 'select',
						label: '播放器',
						default:"7",
						items: [
							[ '自动选择', '0' ],
							[ 'HTML5Video', '5' ],
							[ 'HTML5Audio', '6' ],
							[ 'Media Player', '1' ],
							[ 'Real Player', '2' ],
							[ 'Flv Player', '3' ],
							[ 'Flash Player', '4' ],
							[ 'CKPlayer', '7' ]
						]
					},
					
					{
						id: 'etmediaplaymod',
						type: 'select',
						label: '播放模式',
						items: [
							[ '自动播放', '0' ],
							[ '手动播放', '1' ]
						]
					}
					]},
					
					{type:"html",id:"preview",style:"width:100%;",html:""}
				
				]  
            },
			
{id:"Upload",label:ecmseditorv.lang.image.upload,elements:[	
	{ 
  	 	type: "html",
	 	style: "width:500;height:250",
	 	html: ' '
	}
]},
			
			
			],  
            onOk: function() {  
				var ehtmlstr='';
				var emediaurl=this.getValueOf('etmediainfo1','etmediaurl');
				var ewidth=this.getValueOf('etmediainfo1','etmediawidth');
				var eheight=this.getValueOf('etmediainfo1','etmediaheight');
				var etoplay=this.getValueOf('etmediainfo1','etmediatoplay');
				var eplaymod=this.getValueOf('etmediainfo1','etmediaplaymod');
				ehtmlstr=etmediaViewFile(emediaurl,ewidth,eheight,etoplay,eplaymod);
                //点击确定按钮后的操作    
				ecmseditorv.insertHtml(ehtmlstr);
				document.getElementById('cke_MediaPreviewBox_'+ecmseditorv.name).innerHTML='';
            },
			
			onCancel: function() {
				document.getElementById('cke_MediaPreviewBox_'+ecmseditorv.name).innerHTML='';
            }
			
        }  
    })  
})(); 
//预览
function etmediaview(viewid){	
	var ehtmlstr='';
	var emediaurl=CKEDITOR.dialog.getCurrent().getContentElement('etmediainfo1','etmediaurl').getValue();
	var ewidth=CKEDITOR.dialog.getCurrent().getContentElement('etmediainfo1','etmediawidth').getValue();
	var eheight=CKEDITOR.dialog.getCurrent().getContentElement('etmediainfo1','etmediaheight').getValue();
	var etoplay=CKEDITOR.dialog.getCurrent().getContentElement('etmediainfo1','etmediatoplay').getValue();
	var eplaymod=CKEDITOR.dialog.getCurrent().getContentElement('etmediainfo1','etmediaplaymod').getValue();
	ehtmlstr=etmediaViewFile(emediaurl,ewidth,eheight,etoplay,eplaymod);
	document.getElementById(viewid).innerHTML=ehtmlstr;
}
function get_uid(){
    function S4() {
       return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
    }
    return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
}
//返回播放器代码
function etmediaViewFileCode(toplay,width,height,autostart,furl){
	var fname='';
	var addauto='';
	if(autostart=="true")
	{
		addauto=' autoplay="autoplay"';
	}
	if(toplay==1)//media
	{
		imgstr="";
	}
	else if(toplay==5)//html5video
	{
		imgstr='';
	}
	else if(toplay==6)//html5audio
	{
		imgstr='';
	}
	else if(toplay==3)//flv
	{
		imgstr="";
	}
	else if(toplay==4)//flash
	{
		imgstr="";
	}
	else if(toplay==7)//CKPlayer
	{
		var uid = get_uid();
		var vid = "video-"+uid;
		var pid = "player-"+uid;
	 	imgstr=``;
	}
	else//reaplayer
	{
		imgstr="
";
	}
	return imgstr;
}
//返回
function etmediaViewFile(furl,width,height,toplay,playmod){
	var imgstr="";
	var autostart;
	var mediatypes=",.wmv,.asf,.wma,.mp3,.asx,.mid,.midi,";
	var realtypes=",.rm,.ra,.rmvb,.mp4,.mov,.avi,.wav,.ram,.mpg,.mpeg,";
	var html5types=",.mp4,.ogg,.webm,";
	var html5audiotypes=",.mp3,.ogg,.wav,";
	var filetype;
	if(furl=='')
	{
		return '';
	}
	autostart="true";
	if(playmod==1)
	{
		autostart="false";
	}
	if(toplay==0)
	{
		filetype=etmediaToGetFiletype(furl);
		if(filetype=='.flv')
		{
			toplay=3;
		}
		else if(html5types.indexOf(','+filetype+',')!=-1)
		{
			toplay=5;
		}
		else if(html5audiotypes.indexOf(','+filetype+',')!=-1)
		{
			toplay=6;
		}
		else if(filetype=='.swf')
		{
			toplay=4;
		}
		else if(mediatypes.indexOf(','+filetype+',')!=-1)
		{
			toplay=1;
		}
		else
		{
			toplay=2;
		}
	}
	imgstr=etmediaViewFileCode(toplay,width,height,autostart,furl);
	return imgstr;
}
function etmediaToGetFiletype(sfile){
	var filetype,s;
	s=sfile.lastIndexOf(".");
	filetype=sfile.substring(s+1).toLowerCase();
	return '.'+filetype;
}
function EHEcmsEditorDoTranMedia(str){
	CKEDITOR.dialog.getCurrent().getContentElement('etmediainfo1','etmediaurl').setValue(str);
	CKEDITOR.dialog.getCurrent().selectPage('etmediainfo1');
}

手机apktool使用教程_手机ckplayer使用教程_手机视频格式转换器完美使用教程

4. 清除浏览器缓存后.

帝国cms7.5集成CKPlayer帝国cms7.5二次开发集成CKPlayer播放器教程

手机apktool使用教程_手机视频格式转换器完美使用教程_手机ckplayer使用教程

扫描并关注beylze微信公众号手机ckplayer使用教程,以获取有关网站建设优化的最新更新

本文地址:

()


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/bofangqi/article-161422-1.html

    相关阅读
      发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

      热点图片
      拼命载入中...