一段代碼搞定KindEditor編輯器視頻上傳播放問題!
打開kindeditor-all.js 在304行的地方添加 Video標(biāo)簽
video : ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align','controls'],
然后找到 大概在 955 行
function _mediaEmbed(attrs) { var html = '<embed '; _each(attrs, function(key, val) { html += key + '="' + val + '" '; }); html += '/>'; return html; }
更改為
function _mediaEmbed(attrs) { var html = '<embed '; _each(attrs, function(key, val) { html += key + '="' + val + '" '; }); html += '/>'; // 一段簡(jiǎn)單的代碼 解決視頻上傳問題 if (attrs.type=="video/mp4"){ var html = '<video '; _each(attrs, function(key, val) { html += key + '="' + val + '" '; }); html += 'controls="controls" />'; } return html; }
OK 搞定了!看下效果
唯一的要注意的問題是
一定要引入kindeditor-all.js
一定要引入kindeditor-all.js
一定要引入kindeditor-all.js
微信掃碼
關(guān)注PHP中文網(wǎng)服務(wù)號(hào)
QQ掃碼
加入技術(shù)交流群
Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號(hào)