原因分析:
1:因为kindeditor对html5代码还不支持,kindeditor虽然是主流的在线编辑器之一,但是已经好多年没有升级更新了;
2:而且默认的kindeditor还有过滤代码的功能,所以没办法,只能修改下kindeditor;
解决办法:
1:首先把在线编辑器点击最左上角的“HTML代码”按钮切换到代码模式,然后把kindeditor添加的视频默认代码修改为如下代码:
2:修改kindeditor.js默认代码,添加白名单规则,避免代码被过滤导致无效;
添加方法就是在kindeditor.js大约275行
htmlTags : {
下面添加
video : ['src', 'type', 'width','height','autostart','loop'],
这样修改的video代码就不会被过滤掉了。
添加好的代码为: