欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ueditor上传视频再次访问回显失败问题

程序员文章站 2022-07-13 15:43:35
...

一、ueditor上传视频,第一次可以回显,当再次打开页面或者点击了工具栏左上角的html标签后视频回显失败的解决方法:
在网上看到好多关于修改whitList的,具体操作如下(ps:本人的没有效果,但依旧记录下来供参考):
1、修改ueditor.config.js文件中的whitList(大约在364行,设置白名单)中的img,在img标签名单后面添加’_url’和’style’,并且添加source和embed
ueditor上传视频再次访问回显失败问题
ueditor上传视频再次访问回显失败问题
ueditor上传视频再次访问回显失败问题

img:    ['src', 'alt', 'title', 'width', 'height', 'id', '_src','_url', 'loadingclass', 'class', 'data-latex','style'],
source: ['src', 'type'],
embed: ['type', 'class', 'pluginspage', 'src', 'width', 'height', 'align', 'style', 'wmode', 'play',
                   'loop', 'menu', 'allowscriptaccess', 'allowfullscreen']

2、在ueditor.all.js(或者 ueditor.all.min.js)中,找到函数UE.plugins[‘defaultfilter’] 编辑器默认的过滤转换机制
ueditor上传视频再次访问回显失败问题
第一种 在函数里添加return; 所有过滤机制失效。

第二种 将case ‘img’ 部分的代码注释掉
ueditor上传视频再次访问回显失败问题
二、我是做了如下修改后回显成功的(本来是用于去掉添加视频后显示空白的问题,结果解决了回显问题):
将ueditor.all.js中的

  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'));

注释掉图片中的三行(ueditor.all.js中的):
ueditor上传视频再次访问回显失败问题
ueditor上传视频再次访问回显失败问题

相关标签: ueditor video