加载中…
个人资料
spotofleopard
spotofleopard
  • 博客等级:
  • 博客积分:0
  • 博客访问:267,019
  • 关注人气:28
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
相关博文
推荐博文
正文 字体大小:

make the shadowbox work with flowplayer

(2013-06-28 22:25:45)
分类: 技术
I used to use jwplayer with shadowbox, but there are two issues there:
1. the license option of jwplayer is expensive
2. it doesn't playback flv video returned by php file. it keeps complaining: the playlist file does not contain a valid playlist

So I turned to flowplayer free version. But shadowbox doesn't support it out of the box.
Fortunately, it's pretty easy to fix. We only need to change flashvars passed to flowplayer.
Here's what it should be like:

We only need to modify the embedSWF and createSWF function in shadowbox.js to achieve this.
in embedSWF:

par.flashvars='config={';
if (flashvarsObj && typeof flashvarsObj === OBJECT) {
    for (var k in flashvarsObj) {
         if (flashvarsObj[k] != Object.prototype[k]) {
                    par.flashvars += '"'+k + '":"' + flashvarsObj[k]+'",'         
          }
     }
}
if(par.flashvars.charAt(par.flashvars.length-1)==',')
    par.flashvars=par.flashvars.substr(0,par.flashvars.length-1);
par.flashvars +='}';

0

阅读 收藏 转载 喜欢 打印举报/Report
后一篇:推销民主
  

新浪BLOG意见反馈留言板 电话:4000520066 提示音后按1键(按当地市话标准计费) 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

新浪公司 版权所有