var current_time; var current_song_id = 0; var play_list = new jPlayerPlaylist({ jPlayer: "#jquery_jplayer_1", cssSelectorAncestor: "#jp_container_1" }, [ { mp3:"http://jd.wzxx.org:13322/2%E7%81%B5%E5%91%BD%E8%BF%9B%E6%B7%B1/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA%EF%BC%88%E4%BA%8E%E5%AE%8F%E6%B4%81%EF%BC%89/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA01a.mp3", id:554, title:"保罗行踪01a", artist_id:0, artist:"", album_id:0, album:"于宏洁", cover:"" }, { mp3:"http://jd.wzxx.org:13322/2%E7%81%B5%E5%91%BD%E8%BF%9B%E6%B7%B1/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA%EF%BC%88%E4%BA%8E%E5%AE%8F%E6%B4%81%EF%BC%89/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA01b.mp3", id:555, title:"保罗行踪01b", artist_id:0, artist:"", album_id:0, album:"于宏洁", cover:"" }, { mp3:"http://jd.wzxx.org:13322/2%E7%81%B5%E5%91%BD%E8%BF%9B%E6%B7%B1/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA%EF%BC%88%E4%BA%8E%E5%AE%8F%E6%B4%81%EF%BC%89/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA02b.mp3", id:556, title:"保罗行踪02b", artist_id:0, artist:"", album_id:0, album:"于宏洁", cover:"" }, { mp3:"http://jd.wzxx.org:13322/2%E7%81%B5%E5%91%BD%E8%BF%9B%E6%B7%B1/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA%EF%BC%88%E4%BA%8E%E5%AE%8F%E6%B4%81%EF%BC%89/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA05a.mp3", id:561, title:"保罗行踪05a", artist_id:0, artist:"", album_id:0, album:"于宏洁", cover:"" }, { mp3:"http://jd.wzxx.org:13322/2%E7%81%B5%E5%91%BD%E8%BF%9B%E6%B7%B1/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA%EF%BC%88%E4%BA%8E%E5%AE%8F%E6%B4%81%EF%BC%89/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA05b.mp3", id:562, title:"保罗行踪05b", artist_id:0, artist:"", album_id:0, album:"于宏洁", cover:"" }, { mp3:"http://jd.wzxx.org:13322/2%E7%81%B5%E5%91%BD%E8%BF%9B%E6%B7%B1/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA%EF%BC%88%E4%BA%8E%E5%AE%8F%E6%B4%81%EF%BC%89/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA06a.mp3", id:563, title:"保罗行踪06a", artist_id:0, artist:"", album_id:0, album:"于宏洁", cover:"" }, { mp3:"http://jd.wzxx.org:13322/2%E7%81%B5%E5%91%BD%E8%BF%9B%E6%B7%B1/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA%EF%BC%88%E4%BA%8E%E5%AE%8F%E6%B4%81%EF%BC%89/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA06b.mp3", id:564, title:"保罗行踪06b", artist_id:0, artist:"", album_id:0, album:"于宏洁", cover:"" }, { mp3:"http://jd.wzxx.org:13322/2%E7%81%B5%E5%91%BD%E8%BF%9B%E6%B7%B1/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA%EF%BC%88%E4%BA%8E%E5%AE%8F%E6%B4%81%EF%BC%89/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA07a.mp3", id:565, title:"保罗行踪07a", artist_id:0, artist:"", album_id:0, album:"于宏洁", cover:"" }, { mp3:"http://jd.wzxx.org:13322/2%E7%81%B5%E5%91%BD%E8%BF%9B%E6%B7%B1/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA%EF%BC%88%E4%BA%8E%E5%AE%8F%E6%B4%81%EF%BC%89/%E4%BF%9D%E7%BD%97%E8%A1%8C%E8%B8%AA07b.mp3", id:566, title:"保罗行踪07b", artist_id:0, artist:"", album_id:0, album:"于宏洁", cover:"" }, ],{ play: function(obj){ init_lrc(obj.jPlayer.status.media.id); }, timeupdate : function (obj){ current_time = obj.jPlayer.status.currentTime; } }); function init_lrc(song_id){ var url = "/api/music/lrc/"; var data = "id=" + song_id; $.getJSON(url,data,function(response){ if(response.result == "SUCCESS"){ $.lrc.start(response.message,function(){ return current_time; }); } }); } function start_play(url_data){ var url = "/music/player/?"; window.location.href=url+url_data; } function play(ids){ var url_data = "&ids=" + ids; start_play(url_data); } function play_album(album_id){ var url_data = "&album_id=" + album_id; start_play(url_data); } function play_box(box_id){ var url_data = "&box_id=" + box_id; start_play(url_data); } function play_book(book_id){ var url_data = "&book_id=" + book_id; start_play(url_data); } function play_favor(){ var url_data = "&favor=1"; start_play(url_data); } function play_callback(media_list){ var media_arr = []; for(var i = 0; i < media_list.length; i++){ var media = { mp3:"http://www.jiangdaowang.com:12421/" + media_list[i].url, id:media_list[i].id, title:media_list[i].title, artist_id:media_list[i].artist_id, artist:media_list[i].artist, album_id:media_list[i].album_id, album:media_list[i].album, cover:media_list[i].cover }; media_arr.push(media); } play_list.addList(media_arr,true); } function add(ids){ var data = "ids=" + ids; get_media_list(data,add_callback); } function add_album(album_id){ var data = "album_id=" + album_id; get_media_list(data,add_callback); } function add_callback(media_list){ var media_arr = []; for(var i = 0; i < media_list.length; i++){ var media = { mp3:"http://www.jiangdaowang.com:12421/" + media_list[i].url, id:media_list[i].id, title:media_list[i].title, artist_id:media_list[i].artist_id, artist:media_list[i].artist, album_id:media_list[i].album_id, album:media_list[i].album, cover:media_list[i].cover }; media_arr.push(media); } play_list.addList(media_arr,false); } function get_media_list(data,callback){ var url = "/api/music/song/"; $.getJSON(url,data,function(response){ if(response.result == "SUCCESS"){ callback(eval(response.message)); } }); }