Wordpress Widget for ENHANCED XSPF Player Plugin (Wordpress音乐插件的Widget)

一直很想给我的WP加个音乐插件,几经挑选决定使用XSPF Player,歌曲及分类信息放在数据库里,前台显示有4种模式,而且在后台还可以设置播放器宽度和高度,嗯,不错。

载下来后发现是个non-widget版的,就是说要在页面中使用,必须禁用widget机制,修改template,虽然我还没发现widget到底除了设置方便外还有什么好处,不过这么非重用的方法显然要唾弃!

然后决定凭这些天对WP的研究自己写个widget把它包含在侧边栏里。。结果是写出来了。。不过天亮了。。

废话不说了,包含 Widget的XSPF Player Plugin:
Download(942 times)

安装说明:

  1. 解压.rar到plugins目录,这样你就会有个wp-content/plugins/xspf_player/目录了对吧
  2. 到admin界面,插件里把xspf_player和xspf_player-widget依次激活
  3. 到外观的Widgets里把xspf_player-widget拖上去!可以设置title
  4. 这时在主页里应该就有播放器栏了
  5. 顺便再把管理面板的位置介绍下吧,反正不想睡了^^对歌曲/分类管理是在管理->XSPF Player下,对外观管理是在选项->XSPF Player下(真不知道干嘛不做到一起去)

Additional:

This widget has been enhanced by others so that when a visiter open two posts of your blog, he/she will hear the same music!

好了就是这样。

不过有几个XSPF Player的小问题,如果作者不更新的话我就自己修改解决了

  1. 音量过大
  2. 不提供排序功能
  3. 放在数据库里是不是对效率影响太大?是不是不如作为变量放在.php文件里?(对PHP文件引用和数据库查询效率的疑问一直困扰我)
  4. 不能设置一首歌是否可以播放,如果你想暂时把它从播放列表上取下,唯一的办法就是删除它!

另外给对XSPF Player的分类功能有兴趣的朋友一个Hint:其实可以默认选择只播放一个分类的,只不过要改PHP,而不是放在Wordpress的Options里,为了简化Widget的安装我就没有定制这个选项。

如果有任何问题请回复或发邮件到hjrgenius(_a_)163.com,有任何更新我也会发布在这篇日志里,thanks!

Related posts

22 Responses to “Wordpress Widget for ENHANCED XSPF Player Plugin (Wordpress音乐插件的Widget)”


  1. 1 (沙发) Lejlagirl

    Hallo, thank you very much for your effort do make it Widgetized! ;)
    Did you heard about the "enhanced" Version XSPF Player Plugin?
    How can I solve to use it also in Widget, I read in a forum, the is a Code to invoke the PLayer with:
    [xspf]_start(FALSE, autoresume=’1′)[/xspf]
    How I can implement the code in your "xspf_player-widget.php"?
    Did you have any solution?

    Thank you in advance for a answer!! ;)

    Lejlagirl

  2. 2 (板凳) Jerry

    To Lejlagirl:
    Thank you for sharing the "enhanced" Versin XSPF Player Plugin with me! Well, I noticed that plugin before. It's great enough to let different parts of your site play the same music, but I also found out that was a beta version so I want to wait for the release version~
    Sorry that these days I'm being driven crazy to exams>.< and in July I shall have time to look into the solution.
    Thanks again!! ( You are the first foreigner commenting my blog except for spams~haha~)

  3. 3 (地毯) Jerry

    I tried to overwrite the file xspf_player_class.php and change line 48 of xspf_player-widget.php to xspf_player::start(FALSE, 'autoresume=1');
    But it doesn't work.

  4. 4 (地板) Jerry

    Forget above, It seems working!
    Simple though:
    1.Download from
    http://www.boriel.com/files/xspf_player_autoresume.zip and replace the xspf_player_class.php with the downloaded one.
    2.Download from
    http://www.boutell.com/xspf/xspf-boutell.zip and replace the xspf_player_slim.swf and xspf_player.swf with the downloaded ones.
    3.Change line 48 of xspf_player-widget.php to xspf_player::start(FALSE, ‘autoresume=1′);

    Try it!

  5. 5 (地下室) Jerry

    I have updated the file in the main post. Just REPLACE THE ORIGINAL ONE WITH IT shall be fine.

  6. 6 (地基) Lejlagirl

    WOWOWOWO, it works without problem!! ;)
    You deserve honor! ;)
    Thank you very, very much to give us a solution (in your stress situation!) you are so great!! ;)
    For the info, Boriel made a new board for the XSPF Player, maybe would be a good way to inform other people!!!!
    http://www.boriel.com/phpbb2/

    So long

    Lejla

  7. 7 (地壳) Jerry

    I find out that this new feature doesn't work in firefox tabs, but it does work fine in ie windows or ie&firefox windows.
    Well, let's wait for boutell's release version.

  8. 8 (地幔) elderwang

    好像在ie下显示有问题,firefox就没事

  9. 9 (地核) Jerry

    显示的问题?在我这儿没问题啊……不都是个FLASH的小播放器么?
    IE和FIREFOX显示上的唯一区别就是那个该死的Calendar

  10. 10 (地球另一面) simple

    请问下你用的虚拟主机操作系统是:windows还是unix的?

  11. 11 (水星人) Jerry

    ls那位朋友可以看这里。。http://www.512j.com/host/show_detail.php?flag=php

  12. 12 (金星人) ohyeahok

    jerry我想请问一下你,这个插放器怎样设置才能像你的主页一样可以
    开启页面时自动播放,并且转换页面时,能从刚刚停顿的地方开始自动接着播放呢.

  13. 13 (都是幻觉) Jerry

    @ohyeahok
    自动播放设置在wordpress后台的settings->XSPF Player里
    转换自动播放涉及到FLASH的原理,应该是不需要设置就可以达成的……

  14. 14 (火星人) Jonathan

    好像复杂了一点,我刚好正在寻找wordpress的播放器插件,主要是用在文章中。

  15. 15 (木星人) 盲流北丐

    膜拜达人。。。

  16. 16 (土星人) 盲流北丐

    达人啊。。。我装上了。。能听歌了,后台也是选了您这样的播放样式,但为什么我前台没有像后台那样显示呢?Enter the URL of your XSPF flash player.这是什么意思啊?

  17. 17 (天王星人) Lost.aspx

    您好,请问您播放器里的For Love那首钢琴曲实际是叫什么名字,我在网上找了很久都没有找到。
    如果可以,是否可以把它发到我的信箱:42348031@vip.qq.com
    万分感谢。。。

  18. 18 (海王星人) 左边的童话

    thank so much for sharing!!!!!

    Having been looking for ages

  19. 19 (above第二宇宙速度) TY

    谢谢你作好这些工作!

  20. 20 (囧神) xzhang

    Hi,
    我昨天开始使用这个插件,因为对WP不是很熟悉,费了好大劲(其实就是在后台找了半天设置),发现只能改template加上这个player,于是改了template,顺利用上了这个插件,不过我觉得插件的后台管理很无力……只能设置样式和增删歌曲,有几个我很想要的功能都没有:
    1. 对歌曲的高级管理,现在的分类只是最基本的,而且是上传歌曲的时候就分好的,我希望至少可以随时建立,修改或删除一个playlist,然后可以控制把一首歌曲增加到某个playlist或者从某个list移出;
    2. 相应的player就可以在后台控制是选择播放所有,某一首或者某一个playlist;
    3. 我觉得widget的管理形式比较好,毕竟改template还是比较不爽的……

    一会儿试用下你的修改版本,另外想问问有没有出更新的功能更全的这样的WP插件?如果没有我想打算也自己改进这个了……呵呵,谢谢!

  21. 21 (靐仙) Jerry

    @xzhang
    Hi,
    如果想不改Theme而用上这个Plugin,一种方法是用我写的这个Widget Plugin,另一种方法是用Daiko's Text Widget,就是Text Widget的加强版,可以填PHP代码的,很方便。
    这个插件我是不想改了,我觉得对于Developer的个人网站来说太完善的后台其实并无必要,大不了直接改数据库嘛~等你改了我来用吧,呵呵。

  1. 1 任务完成 | 破落户的飘零子弟

Leave a Reply