1、视频第三方插入bug
视频插入输入网址 显示视频路径错误 ,编译器中也没有对应的视频播放。
ueditor\ueditor.all.js
me.commands["insertvideo"] = {
execCommand: function (cmd, videoObjs, type){
videoObjs = utils.isArray(videoObjs)?videoObjs:[videoObjs];
var html = [],id = 'tmpVedio', cl;
for(var i=0,vi,len = videoObjs.length;i<len;i++){
vi = videoObjs[i];
cl = (type == 'upload' ? 'edui-upload-video video-js vjs-default-skin':'edui-faked-video');
//html.push(creatInsertStr( vi.url, vi.width || 420, vi.height || 280, id + i, null, cl, 'image')); //改前
html.push(creatInsertStr( vi.url, vi.width || 420, vi.height || 280, id + i, null, cl, 'video'));//改后
}
me.execCommand("inserthtml",html.join(""),true);
var rng = this.selection.getRange();
for(var i= 0,len=videoObjs.length;i<len;i++){
var img = this.document.getElementById('tmpVedio'+i);
domUtils.removeAttributes(img,'id');
rng.selectNode(img).select();
me.execCommand('imagefloat',videoObjs[i].align)
}
},
queryCommandState : function(){
var img = me.selection.getRange().getClosedNode(),
flag = img && (img.className == "edui-faked-video" || img.className.indexOf("edui-upload-video")!=-1);
return flag ? 1 : 0;
}
};
ueditor\ueditor.config.js
img: ['src', 'alt', 'title', 'width', 'height', 'id', '_src','_url','loadingclass', 'class', 'data-latex','style', 'data-backh', 'data-backw', 'data-copyright', 'data-ratio', 'data-type', 'data-w', 'data-s','data-type'],//添加_url
video: ['autoplay', 'controls', 'loop', 'preload', 'src', 'height', 'width', 'class', 'style'],
source: ['src', 'type'],//新增
embed: ['type', 'class', 'pluginspage', 'src', 'width', 'height', 'align', 'style'
, 'wmode', 'play', 'autoplay', 'loop', 'menu', 'allowscriptaccess', 'allowfullscreen', 'controls', 'preload'],//新增
iframe: ['src', 'class', 'height', 'width', 'max-width', 'max-height', 'align', 'frameborder', 'allowfullscreen']//新增
ueditor\dialogs\video\video.js
function createPreviewVideo(url){
if ( !url )return;
var conUrl = convert_url(url);
conUrl = utils.unhtmlForUrl(conUrl);
/*$G("preview").innerHTML = '<div class="previewMsg"><span>'+lang.urlError+'</span></div>'+
'<embed class="previewVideo" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"' +
' src="' + conUrl + '"' +
' width="' + 420 + '"' +
' height="' + 280 + '"' +
' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" controls="controls">' +
'</embed>';*///改前
$G("preview").innerHTML ='<video class="previewVideo" controls="controls" src="'+conUrl+'" style="width:420;height:280 "></video>'//改后
}