且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JPlayer + Ajax页面加载

更新时间:2023-11-10 23:51:46

I recommend using the playlist add-on.

  1. Create an empty player instance

    var jpplaylist = new jPlayerPlaylist({
        jPlayer: "#jquery_jplayer_1",
        cssSelectorAncestor: "#jp_container_1"
        }, [], {
            swfPath: "/path/to/swf",
            supplied: "mp3",
            wmode: "window"
        });
    

  2. After your AJAX page load, use the setPlaylist function to add your tracks:

    jpplaylist.add({
        title:"Song Title",
        mp3:"http://example.com/example.mp3"
    });
    

The full playlist specs are here: http://www.jplayer.org/latest/demo-02-jPlayerPlaylist/

相关阅读

推荐文章