解决 KindEditor编辑器4.1.7版本上传视频不能播放的问题

1、问题截图:

2、调试后截图:


3、更改代码(两处):

①:kindeditor/plugins/media/media.js中

“var html = K.mediaImg(self.themesPath + 'common/blank.gif', {”改为:

“var html = K.mediaImg(self.themesPath + 'common/blank.gif', 'zdy', {”

②:kindeditor/kindeditor.js中

A、“function _mediaImg(blankPath,attrs) {”改为

“function _mediaImg(blankPath,zdy,attrs) {”

B、同时此方法内容改成:

截图版:


代码版:

var width = attrs.width,
height = attrs.height,
type = attrs.type || _mediaType(attrs.src),
srcTag = _mediaEmbed(attrs),
style = '';

if(zdy=='zdy'){ //视频
var html=srcTag;
}else{
if (width > 0) {
style += 'width:' + width + 'px;';
}
if (height > 0) {
style += 'height:' + height + 'px;';
}
var html = '<img class="' + _mediaClass(type) + '" src="' + blankPath + '" ';
if (style !== '') {
html += 'style="' + style + '" ';
}
html += 'data-ke-tag="' + escape(srcTag) + '" alt="" />';
}

return html;

如下,解决了该问题

猜你喜欢

转载自blog.csdn.net/qq_36376116/article/details/79226835