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/%E4%BA%8E%E5%AE%8F%E6%B4%81/%E5%9F%BA%E7%A1%80%E7%A5%9E%E5%AD%A6-%E4%BA%8E%E5%AE%8F%E6%B4%81/%E5%9F%BA%E7%A1%80%E7%A5%9E%E5%AD%A6%EF%BC%8811%EF%BC%89-%E5%85%A8%E5%A4%87%E7%9A%84%E6%95%91%E6%81%A9%EF%BC%881%EF%BC%89-%E3%80%8E%E7%A7%B0%E4%B9%89%E3%80%8F%E4%B8%8E%E3%80%8E%E6%88%90%E5%9C%A3%E3%80%8F-%E4%BA%8E%E5%AE%8F%E6%B4%81-%E6%88%90%E4%BA%BA%E4%B8%BB%E6%97%A5%E5%AD%A6.mp3", id:17437, title:"基础神学(11)-全备的救恩(1)-『称义』与『成圣』-于宏洁-成人 ", 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)); } }); }