打開plugins\media下面的media.js,打開,找到下面的代碼:
var html = K.mediaImg(self.themesPath + ‘common/blank.gif’, {
src: url,
type: K.mediaType(url),
width: width,
height: height,
autostart: autostartBox[0].checked ? ‘true’: ‘false’,
loop: ‘true’
});
修改為:
if (url.slice( – 4).toUpperCase() == ‘.FLV’) {
var html = K.mediaImg(self.themesPath + ‘common/blank.gif’, {
src: ‘/files//Flvplayer.swf’,
type: K.mediaType(url),
flashvars: ‘vcastr_file=’ + url + ‘&autostart=’ + (autostartBox[0].checked ? ‘true’: ‘false’) + ”,
width: width,
height: height,
quality: ‘high’,
allowfullscreen: ‘true’,
loop: ‘true’
});
} else {
var html = K.mediaImg(self.themesPath + ‘common/blank.gif’, {
src: url,
type: K.mediaType(url),
width: width,
height: height,
autostart: autostartBox[0].checked ? ‘true’: ‘false’,
loop: ‘true’
});
}
在KindEditor下面建一個files文件夾,把flvplayer.swf拷貝進去
flashvars 這個屬性不能帶到embed標簽里去,還有allowfullscreen這個屬性也不能,他自己定義的屬性就可以帶去
源碼kindeditor.js 發現有個東東,embed : ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'], 這個東東很重要,kindeditor通過他來過濾屬性的不在里面定義是不會帶進去的。所以把 'flashvars','allowfullscreen'這兩個屬性加進入去就OK了。
