周大胖子 发表于 2019-11-29 17:11:19

Ueditor 引入第三方视频网址问题

第一个问题表现:   添加时候,不论是上传视频还是直接贴的地址, 链接地址都没有了 =。=
   原因: Ueditor 真坑啊 -。- 鬼知道什么原因 ;
   1、在配置文件ueditor.config.js中,定位 //xss过滤白名单,即,whitList:{ },对 img: 增加 “_url” 属性:
img:    ['src', 'alt', 'title', 'width', 'height', 'id', '_src', '_url', 'loadingclass', 'class', 'data-latex'],   2、在 video 标签后新增3给标签,使Ueditor分别能支持embed标签和iframe标签:
            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']

然后修改没问题了,冒出第二个问题:

第二个问题: 前台引入的第三方视频网址,在编辑器添加视频地址时,总说地址错误,即使强行在html中添加,在前台也无法显示
解决办法:
      在: 1、ueditor.all.js 搜索其中的插入视频字符串方法creatInsertStr(
                  然后: 删除<embed>其中的type类型(type="application/x-shockwave-flash")。
                ueditor.all.min.js 中同样的操作,不过 直接搜 type="application/x-shockwave-flash" 才能找到 ,然后删除;


         2.ueditor/dialogs/video/video.js 中 搜索其中方法createPreviewVideo(url), 删除<embed>其中的type类型(type="application/x-shockwave-flash") ;





结束;
上述两步 必须都走一遍
参考文献:https://blog.csdn.net/qq_16241043/article/details/53894847【问题1】
参考文献: http://www.ntzhengtong.com/tool/155.html【问题2】











页: [1]
查看完整版本: Ueditor 引入第三方视频网址问题