来自SHOUTcast的jPlayer和正在播放的数据

时间:2012-10-02 11:04:38

标签: jquery jplayer shoutcast playing

我正在尝试实现jPlayer来从SHOUTcast传输一些频道。一切顺利,直到“正在播放”的部分。

请在此处查看测试区域:http://www.powermixfmradio.com/2013/index.php

这个想法是,每当有人点击频道时,“现在在xxxxxx频道上播放:”应该根据所选频道进行更改,但我不知道该怎么做。我在PHP中创建了一个简单的脚本,它读取每个频道上的当前歌曲并将它们分配给$ trance,$ house(等)。例如,它使用<?php echo "$trance"; ?>来显示数据,但每次频道更改时如何进行更改(将<?php echo "$trance"; ?>更改为<?php echo "$house"; ?>等等)?

jPlayer的开发人员非常友好地指导我,并给了我一个开始:

select: function(index) {
        index = (index < 0) ? this.original.length + index : index; // Negative index relates to end of array.
        if(0 <= index && index < this.playlist.length) {
            this.current = index;
            this._highlight(index);
            $(this.cssSelector.jPlayer).jPlayer("setMedia", this.playlist[this.current]);
            // Add stuff here.
        } else {
            this.current = 0;
        }
    },

但由于我的jq知识非常有限,我不知道在那里添加或编辑什么。你能帮忙吗?

0 个答案:

没有答案