1. 程式人生 > 實用技巧 >百度編譯器ueditor插入視訊的時候。在預覽的視窗提示 “輸入的視訊地址有誤,請檢查後再試!

百度編譯器ueditor插入視訊的時候。在預覽的視窗提示 “輸入的視訊地址有誤,請檢查後再試!

ueditor.all.js:

搜尋me.commands["insertvideo"]

把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.config.js:

搜尋whitList

img裡面新增"_url"

video後面新增

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']

dialogs/video/video.js

搜尋function createPreviewVideo(url)

把下面的內容替換$G("preview").innerHTML = '<video class="previewVideo" controls="controls" src="'+conUrl+'" ></video>';

注意:

ueditor 在上傳視訊之後,編輯頁面,顯示空白。檢視html有視訊,就是顯示空白

ueditor.all.js

搜尋

setContent: function (html, isAppendTo, notFireSelectionchange)

修改完成後,清除瀏覽器快取,再試。