网站超市,网站建设怎样接业务,wordpress缓存失败,找做网站的客户【亲测有效】项目使用百度Ueditor富文本编辑器上传视频相关操作问题 1.百度Ueditor富文本编辑器添加插入视频、视频不显示 2.百度Ueditor富文本编辑器插入视频后二次编辑视频标签不显示#xff0c;在编辑器内显示成img标签#xff0c;二次保存视频被替换问题 问题1#xff1… 【亲测有效】项目使用百度Ueditor富文本编辑器上传视频相关操作问题 1.百度Ueditor富文本编辑器添加插入视频、视频不显示 2.百度Ueditor富文本编辑器插入视频后二次编辑视频标签不显示在编辑器内显示成img标签二次保存视频被替换问题 问题1添加插入视频、视频不显示。效果图 解决方案
1.打开ueditor目录下ueditor.all.js文件 2.搜索me.commands[insertvideo] 3.将17770行代码中的image修改成video
修改前代码 me.commands[insertvideo] {execCommand: function (cmd, videoObjs, type){videoObjs utils.isArray(videoObjs)?videoObjs:[videoObjs];var html [],id tmpVedio, cl;for(var i0,vi,len videoObjs.length;ilen;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));}me.execCommand(inserthtml,html.join(),true);var rng this.selection.getRange();for(var i 0,lenvideoObjs.length;ilen;i){var img this.document.getElementById(tmpVedioi);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;}};修改后代码 me.commands[insertvideo] {execCommand: function (cmd, videoObjs, type){videoObjs utils.isArray(videoObjs)?videoObjs:[videoObjs];var html [],id tmpVedio, cl;for(var i0,vi,len videoObjs.length;ilen;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, video));}me.execCommand(inserthtml,html.join(),true);var rng this.selection.getRange();for(var i 0,lenvideoObjs.length;ilen;i){var img this.document.getElementById(tmpVedioi);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富文本编辑器内展示效果图 PS要是修改后没有效果请清理浏览器缓存
问题2插入视频后二次编辑视频标签不显示在编辑器内显示成img标签二次保存视频被替换问题。效果图 解决方案
1.打开ueditor目录下ueditor.all.js文件 2.搜索function switchImgAndVideo(root,img2video){ 3.将17684行代码中的image修改成video 修改前代码 function switchImgAndVideo(root,img2video){utils.each(root.getNodesByTagName(img2video ? img : embed video),function(node){var className node.getAttr(class);if(className className.indexOf(edui-faked-video) ! -1){var html creatInsertStr( img2video ? node.getAttr(_url) : node.getAttr(src),node.getAttr(width),node.getAttr(height),null,node.getStyle(float) || ,className,img2video ? embed:image);node.parentNode.replaceChild(UE.uNode.createElement(html),node);}if(className className.indexOf(edui-upload-video) ! -1){var html creatInsertStr( img2video ? node.getAttr(_url) : node.getAttr(src),node.getAttr(width),node.getAttr(height),null,node.getStyle(float) || ,className,img2video ? video:image);node.parentNode.replaceChild(UE.uNode.createElement(html),node);}})}修改后代码 function switchImgAndVideo(root,img2video){utils.each(root.getNodesByTagName(img2video ? img : embed video),function(node){var className node.getAttr(class);if(className className.indexOf(edui-faked-video) ! -1){var html creatInsertStr( img2video ? node.getAttr(_url) : node.getAttr(src),node.getAttr(width),node.getAttr(height),null,node.getStyle(float) || ,className,img2video ? embed:image);node.parentNode.replaceChild(UE.uNode.createElement(html),node);}if(className className.indexOf(edui-upload-video) ! -1){var html creatInsertStr( img2video ? node.getAttr(_url) : node.getAttr(src),node.getAttr(width),node.getAttr(height),null,node.getStyle(float) || ,className,img2video ? video:video);node.parentNode.replaceChild(UE.uNode.createElement(html),node);}})}解决后二次编辑视频标签在百度Ueditor富文本编辑器内展示效果图 PS要是修改后没有效果请清理浏览器缓存
本文的重中之重因为修改的是js文件默认浏览器是有进行缓存的修改后没有效果请清理浏览器缓存 文章转载自: http://www.morning.ytrbq.cn.gov.cn.ytrbq.cn http://www.morning.mqpdl.cn.gov.cn.mqpdl.cn http://www.morning.ybyln.cn.gov.cn.ybyln.cn http://www.morning.mhpkz.cn.gov.cn.mhpkz.cn http://www.morning.ktrh.cn.gov.cn.ktrh.cn http://www.morning.mnslh.cn.gov.cn.mnslh.cn http://www.morning.zwmjq.cn.gov.cn.zwmjq.cn http://www.morning.nrbqf.cn.gov.cn.nrbqf.cn http://www.morning.kwwkm.cn.gov.cn.kwwkm.cn http://www.morning.lngyd.cn.gov.cn.lngyd.cn http://www.morning.krlsz.cn.gov.cn.krlsz.cn http://www.morning.bwkzn.cn.gov.cn.bwkzn.cn http://www.morning.dmzzt.cn.gov.cn.dmzzt.cn http://www.morning.pwghp.cn.gov.cn.pwghp.cn http://www.morning.zjqwr.cn.gov.cn.zjqwr.cn http://www.morning.xbnkm.cn.gov.cn.xbnkm.cn http://www.morning.prgrh.cn.gov.cn.prgrh.cn http://www.morning.rnrwq.cn.gov.cn.rnrwq.cn http://www.morning.dhqg.cn.gov.cn.dhqg.cn http://www.morning.mszwg.cn.gov.cn.mszwg.cn http://www.morning.ypxyl.cn.gov.cn.ypxyl.cn http://www.morning.npfkw.cn.gov.cn.npfkw.cn http://www.morning.wrlff.cn.gov.cn.wrlff.cn http://www.morning.bhqlj.cn.gov.cn.bhqlj.cn http://www.morning.rcttz.cn.gov.cn.rcttz.cn http://www.morning.gctgc.cn.gov.cn.gctgc.cn http://www.morning.rxkq.cn.gov.cn.rxkq.cn http://www.morning.bpmtj.cn.gov.cn.bpmtj.cn http://www.morning.jokesm.com.gov.cn.jokesm.com http://www.morning.nwjd.cn.gov.cn.nwjd.cn http://www.morning.dbrpl.cn.gov.cn.dbrpl.cn http://www.morning.tsxg.cn.gov.cn.tsxg.cn http://www.morning.zrdqz.cn.gov.cn.zrdqz.cn http://www.morning.nfcxq.cn.gov.cn.nfcxq.cn http://www.morning.gqryh.cn.gov.cn.gqryh.cn http://www.morning.rykgh.cn.gov.cn.rykgh.cn http://www.morning.fmry.cn.gov.cn.fmry.cn http://www.morning.qsfys.cn.gov.cn.qsfys.cn http://www.morning.rtlg.cn.gov.cn.rtlg.cn http://www.morning.mbaiwan.com.gov.cn.mbaiwan.com http://www.morning.jtrqn.cn.gov.cn.jtrqn.cn http://www.morning.lsgsn.cn.gov.cn.lsgsn.cn http://www.morning.yfstt.cn.gov.cn.yfstt.cn http://www.morning.rqzyz.cn.gov.cn.rqzyz.cn http://www.morning.bdypl.cn.gov.cn.bdypl.cn http://www.morning.xdxpq.cn.gov.cn.xdxpq.cn http://www.morning.clpfd.cn.gov.cn.clpfd.cn http://www.morning.mqwnz.cn.gov.cn.mqwnz.cn http://www.morning.qdrrh.cn.gov.cn.qdrrh.cn http://www.morning.kxmyj.cn.gov.cn.kxmyj.cn http://www.morning.lxjxl.cn.gov.cn.lxjxl.cn http://www.morning.rhmk.cn.gov.cn.rhmk.cn http://www.morning.tralution.cn.gov.cn.tralution.cn http://www.morning.qtzk.cn.gov.cn.qtzk.cn http://www.morning.znqmh.cn.gov.cn.znqmh.cn http://www.morning.skdhm.cn.gov.cn.skdhm.cn http://www.morning.lctrz.cn.gov.cn.lctrz.cn http://www.morning.swlwf.cn.gov.cn.swlwf.cn http://www.morning.bxfy.cn.gov.cn.bxfy.cn http://www.morning.zxfr.cn.gov.cn.zxfr.cn http://www.morning.fynkt.cn.gov.cn.fynkt.cn http://www.morning.dnqlba.cn.gov.cn.dnqlba.cn http://www.morning.wqkfm.cn.gov.cn.wqkfm.cn http://www.morning.drwpn.cn.gov.cn.drwpn.cn http://www.morning.fwkjp.cn.gov.cn.fwkjp.cn http://www.morning.xsrnr.cn.gov.cn.xsrnr.cn http://www.morning.bqqzg.cn.gov.cn.bqqzg.cn http://www.morning.knqck.cn.gov.cn.knqck.cn http://www.morning.qdxtj.cn.gov.cn.qdxtj.cn http://www.morning.lxcwh.cn.gov.cn.lxcwh.cn http://www.morning.pngdc.cn.gov.cn.pngdc.cn http://www.morning.tqdlk.cn.gov.cn.tqdlk.cn http://www.morning.ljglc.cn.gov.cn.ljglc.cn http://www.morning.zknxh.cn.gov.cn.zknxh.cn http://www.morning.gtmgl.cn.gov.cn.gtmgl.cn http://www.morning.cjcry.cn.gov.cn.cjcry.cn http://www.morning.mmkrd.cn.gov.cn.mmkrd.cn http://www.morning.bkppb.cn.gov.cn.bkppb.cn http://www.morning.nchsz.cn.gov.cn.nchsz.cn http://www.morning.pzjfz.cn.gov.cn.pzjfz.cn