带播放列表插件的jplayer就绪事件 [英] jplayer ready event with playlist addon

查看:193
本文介绍了带播放列表插件的jplayer就绪事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我以前的文章中,关于何时/何处向播放列表动态添加项目的信息,似乎在使用播放列表"加载项时jPlayer ready事件处理程序功能不可用,如一个简单的示例所示:

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');
             }
        });

这是因为没有引发事件还是因为播放列表包装"了jPlayer对象,但尚不清楚,但是如果确实是这种情况,则没有任何其他办法似乎是一个非常基本的限制实现相同的目标.

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.

推荐答案

您可以尝试以下方法:

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

这篇关于带播放列表插件的jplayer就绪事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆