Search code examples
javascriptjqueryjplayer

jPlayer playlist title element


I have seen similar questions, but no solutions. I have jPlayer working beautifully except for one thing... In "playlist" mode, the title element is set to display:none. Is there a setting in the constructor to override this?

Thanks in advance


Solution

  • A solution is to use a jQuery listener and add the title programmatically as it plays...

    $("#music").bind($.jPlayer.event.play, function(event)
    {
        $.each(player.playlist, function(index, song)
        {
            if(index == player.current)
            {
                $(".songTitle").html(song.title);
            }
        });
    });
    

    Where #music is the div you initally attach jplayer too and .songTitle is the class of the element where you want the title displayed.