ueditor插入video后面有source标签,怎么去掉source标签?

ueditor插入video后面有source标签,怎么去掉source标签?

阅读 4.3k
2 个回答

UE.plugins["video"] = function () {

    var me = this;

    function creatInsertStr(url, width, height, id, align, classname, type) {
        url = utils.unhtmlForUrl(url);
        align = utils.unhtml(align);
        classname = utils.unhtml(classname);
        width = parseInt(width, 10) || 0;
        height = parseInt(height, 10) || 0;
        var str;
        switch (type) {
            case"image":
                str = "<img " + (id ? 'id="' + id + '"' : "") + ' width="' + width + '" height="' + height + '" _url="' + url + '" class="' + classname.replace(/\bvideo-js\b/, "") + '" src="' + me.options.UEDITOR_HOME_URL + 'themes/default/images/spacer.gif" style="background:url(' + me.options.UEDITOR_HOME_URL + "themes/default/images/videologo.gif) no-repeat center center; border:1px solid gray;" + (align ? "float:" + align + ";" : "") + '" />';
                break;
            case"embed":
                str = '<embed type="application/x-shockwave-flash" class="' + classname + '" pluginspage="http://www.macromedia.com/go/getflashplayer" src="' + utils.html(url) + '" width="' + width + '" height="' + height + '"' + (align ? ' style="float:' + align + '"' : "") + ' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >';
                break;
            case"video":
                var ext = url.substr(url.lastIndexOf(".") + 1);
                if (ext == "ogv") {
                    ext = "ogg"
                }
                str = "<video" + (id ? ' id="' + id + '"' : "") + ' class="' + classname + ' video-js" ' + (align ? ' style="float:' + align + '"' : "") + ' controls preload="none" width="' + width + '" height="' + height + '" src="' + url + '" data-setup="{}">' +
                    // '<source src="' + url + '" type="video/' + ext + '" />' +
                    '</video>';
                break
        }
        return str
    }
    
    
    
    全文搜索,这是Ueditor代码,ueditor.all.js 最终便签插入图片和视频,在这儿生成,你可以注释掉<source>
新手上路,请多包涵

百度编辑器 插入video,无法编辑

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进