Table of contents
Problem: The last video does not display
First: Find the ueditor.config.js file, about the whitList attribute in line 365
First, we upload a video, as shown in the figure:
It was found that the video was successfully uploaded, indicating that the background has successfully returned
After clicking confirm, it was found that the video was not successfully inserted into the editor, and it was found that a picture was displayed, not a video
Open the console of the browser, review the elements, and find that the inserted element tag is img, not vidoe
Viewing html code in Baidu rich text editor Ueditor still shows video
At this point, the problem is found, and the next step is to solve the problem
First: Find the ueditor.config.js file, about the whitList attribute in line 365
Add the following code in the attribute of whitlList
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']
as the picture shows:
It should be noted here that some versions may not have this attribute. If you do not have this attribute, you can skip this step first and try the following steps to see if it is useful
Second, find the ueditor.all.js file and search for the me.commands["insertvideo"] method, which is about line 17780; find
change image to video
code:
for(var i=0,vi,len = videoObjs.length;i<len;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'));
}
After completing this step, we upload the video again, and the video can be displayed normally
We click on html to view the code, it seems to be normal
However, when I click to display it again, I found that the video has changed to a picture again, but the picture is not displayed (placeholder)
Found a bug, continue to modify
Third: Find the me.commands["insertvideo"] method in the ueditor.all.js file, about line 17780; find: note the following code; as shown in the figure
This basically solves the problem of uploading videos
Personally, I also suggest changes:
In the ueditor.all.js file, find the UE.plugins['video'] method, which is about line 17632.
将 去掉:type="application/x-shockwave-flash" class=" + classname + "pluginspage="http://www.macromedia.com/go/getflashplayer"'
Here, the video problem is solved
Finally, if the version is wrong, you can download this version