打开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了。
时间: 2024-11-08 12:24:58