kindeditor支持flv视频播放方法


打开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了。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM