1

Further to my previous post about when/where to dynamically add items to a playlist, it appears that the jPlayer ready event handler function is not available when the Playlist add-on is used, as can be seen by a simple example:

$(function () {
        var MyPlayList = new jPlayerPlaylist({
            jPlayer: "#jquery_jplayer_1",
            cssSelectorAncestor: "#jp_container_1"
        }, [], {
            smoothPlayBar: true,
            supplied: "mp3"
        });
        $("#jquery_jplayer_1").jPlayer({
            ready: function () {
                alert('here');
             }
        });

Whether this is because the event is not raised or because the jPlayer object is 'wrapped' by the PlayList is not clear, but either way it seems like a fairly fundamental restriction if this is indeed the case and there is no other way of achieving the same.

2 Answers 2

1

You could try this :

    $("#jplayer_id").bind($.jPlayer.event.loadeddata, function(event) { 
        // do stuff
    });
-1

Actually, $.jPlayer.event.ready it is more appropriate.

$("#jplayer_id").bind($.jPlayer.event.ready, function(event) { 
        // do stuff
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.