kindeditor是一款不错的可视化编辑器,考虑到现在h5中的video标签的强大,于是决定将系统中的embed标记更好的video。修改kindeditor-all.js,具体操作如下:
1.将video添加为不需要过滤的标签
video : ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess','controls'],
2.加上MP4视频类型
if (/\.(mp4)(\?|$)/i.test(src)) {
return 'video/mp4';
}3.根据视频类型判断
if(attrs.type=="video/mp4"){
var html = '<video ';
_each(attrs, function(key, val) {
html += key + '="' + val + '" ';
});
html += 'controls="controls"/>';
}以下附件为修改好的KindEditor 4.1.11
下载地址
蓝奏网盘
本文共 89 个字数,平均阅读时长 ≈ 1分钟



评论 (0)