KindEditor完美集成ckplayer(项目中实践可用)

ckplayer播放示例图
KindEditor为当前最新版本——v4.1.10,下载地址为:
ckplayer为当前最新版本——6.6,下载地址为:
上传了flv、mp4文件,经测试可用,其他格式暂未测试



1.在kindeditor\plugins下新建文件夹InsertPlugins 

2.将ckplayer文件夹拷贝到kindeditor\plugins\InsertPlugins下

3.修改kindeditor\kindeditor.js (目的是增加getpath(url)方法)

K.mediaImg = _mediaImg;
K.clearMsWord = _clearMsWord;
K.tmpl = _tmpl;

下方新增一个可调用方法

K.getpath = _getpath;

复制代码
K.formatUrl = _formatUrl;
K.formatHtml = _formatHtml;
K.getCssList = _getCssList;
K.getAttrList = _getAttrList;
K.mediaType = _mediaType;
K.mediaAttrs = _mediaAttrs;
K.mediaEmbed = _mediaEmbed;
K.mediaImg = _mediaImg;
K.clearMsWord = _clearMsWord;
K.tmpl = _tmpl;
K.getpath = _getpath;
复制代码

上方添加

复制代码
function _getpath(z){
     
	var d = unescape(window.location.href).replace('file:///', '');
	var k = parseInt(document.location.port);
	var u = document.location.protocol + '//' + document.location.hostname;
	var l = '',e = '',t = '';
	var s = 0;
	var r = z.split('//');
	if (r.length > 0) {
		l = r[0] + '//'
	}
	var h = 'http|https|ftp|rtsp|mms|ftp|rtmp';
	var a = h.split('|');
	if(k!=80){
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值