为kindeditor添加在线播放视频功能(基于原有flash上传,mp4,flv,flash)

本文介绍了如何为KindEditor编辑器添加在线播放视频功能,特别是针对MP4和FLV格式。通过修改kindeditor.js和flash.js文件,并结合jwplayer插件,实现了视频播放。在页面中引入jwplayer.js,并调整相关代码以支持视频源的正确显示。附带了详细修改步骤及下载链接。
摘要由CSDN通过智能技术生成

kindeditor本身支持上传flash功能,但是我们经常需要上传一些flv、mp4或则其它格式的视频。

其实具体的播放功能是通过jwplayer实现的。我只对kindeditor简单的修改了一下。需要修改的文件有两处。

打开kindeditor\kindeditor.js文件

将以下函数语句修改

//修改过的功能 by zhjx922
function _mediaEmbed(attrs) {
    var html = '<embed id="player" name="player" allowscriptaccess="always" allowfullscreen="true" ';
    _each(attrs, function(key, val) {
        html += key + '="' + val + '" ';
    });
    html += '/>';
    return html;
}

打开kindeditor\plugins\flash\flash.js文件

将一下内容:

var html = K.mediaImg(self.themesPath + 'common/blank.gif', {
								src : url,
								type : K.mediaType('.swf'),
								width : width,
								height : height,
								quality : 'high'
评论 17
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值