更新时间:2023-11-10 23:51:46
I recommend using the playlist add-on.
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"
});
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/