var current_time; var current_song_id = 0; var play_list = new jPlayerPlaylist({ jPlayer: "#jquery_jplayer_1", cssSelectorAncestor: "#jp_container_1" }, [ { mp3:"http://112.84.125.239:1230/jiangdao/7%E5%A9%9A%E5%A7%BB%E5%AE%B6%E5%BA%AD/%E8%8C%83%E5%A4%A7%E9%99%B5%E8%AF%81%E9%81%93%E9%9B%86/%E6%BB%A1%E6%B1%89%E5%85%A8%E5%B8%AD.mp3", id:5999, title:"满汉全席", artist_id:0, artist:"", album_id:0, album:"范大陵", cover:"" }, { mp3:"http://112.84.125.239:1230/jiangdao/7%E5%A9%9A%E5%A7%BB%E5%AE%B6%E5%BA%AD/%E8%8C%83%E5%A4%A7%E9%99%B5%E8%AF%81%E9%81%93%E9%9B%86/%E8%AE%A4%E8%AF%86%E5%B1%9E%E7%81%B5%E7%9A%84%E7%81%B0%E5%A7%91%E5%A8%98.mp3", id:6000, title:"认识属灵的灰姑娘", artist_id:0, artist:"", album_id:0, album:"范大陵", cover:"" }, { mp3:"http://112.84.125.239:1230/jiangdao/7%E5%A9%9A%E5%A7%BB%E5%AE%B6%E5%BA%AD/%E8%8C%83%E5%A4%A7%E9%99%B5%E8%AF%81%E9%81%93%E9%9B%86/%E8%8D%A3%E7%A5%9E%E7%9B%8A%E4%BA%BA%E7%9A%84%E4%BA%B2%E5%AD%90%E5%85%B3%E7%B3%BB.mp3", id:6001, title:"荣神益人的亲子关系", artist_id:0, artist:"", album_id:0, album:"范大陵", cover:"" }, { mp3:"http://112.84.125.239:1230/jiangdao/7%E5%A9%9A%E5%A7%BB%E5%AE%B6%E5%BA%AD/%E8%8C%83%E5%A4%A7%E9%99%B5%E8%AF%81%E9%81%93%E9%9B%86/%E7%94%9F%E5%91%BD%E5%88%86%E4%BA%AB-%E8%8C%83%E5%A4%A7%E9%99%B5.mp3", id:6002, title:"生命分享-范大陵", artist_id:0, artist:"", album_id:0, album:"范大陵", cover:"" }, { mp3:"http://112.84.125.239:1230/jiangdao/7%E5%A9%9A%E5%A7%BB%E5%AE%B6%E5%BA%AD/%E8%8C%83%E5%A4%A7%E9%99%B5%E8%AF%81%E9%81%93%E9%9B%86/%E5%A4%A9%E8%B5%90%E5%A4%A7%E7%A4%BC.mp3", id:6003, title:"天赐大礼", artist_id:0, artist:"", album_id:0, album:"范大陵", cover:"" }, { mp3:"http://112.84.125.239:1230/jiangdao/7%E5%A9%9A%E5%A7%BB%E5%AE%B6%E5%BA%AD/%E8%8C%83%E5%A4%A7%E9%99%B5%E8%AF%81%E9%81%93%E9%9B%86/%E9%9B%85%E6%AF%94%E6%96%AF%E7%9A%84%E7%A5%B7%E5%91%8A-%E8%8C%83%E5%A4%A7%E9%99%B5.mp3", id:6004, title:"雅比斯的祷告-范大陵", 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://112.84.125.239:1230/jiangdao/" + 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:"112.84.125.239:1230/jiangdao/" + 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)); } }); }