var myMusic = null; var MyMusic = function(){ var _this = this; var musicBox_H = document.getElementById("musicBox"); var music = "音乐播放器/images/music/"; //音乐列表 var musicFiles=[ new MusicObj("All Creatures of Our God and King Doxology","/yinyue/外语诗歌/英语诗歌(2)/All Creatures of Our God and King Doxology.mp3","外语诗歌",0,1), new MusicObj("Arise O Lord","/yinyue/外语诗歌/英语诗歌(2)/Arise O Lord.mp3","外语诗歌",0,1), new MusicObj("By Your Blood","/yinyue/外语诗歌/英语诗歌(2)/By Your Blood.mp3","外语诗歌",0,1), new MusicObj("Come To The Table","/yinyue/外语诗歌/英语诗歌(2)/Come To The Table.mp3","外语诗歌",0,1), new MusicObj("Draw Me Lord.","/yinyue/外语诗歌/英语诗歌(2)/Draw Me Lord..mp3","外语诗歌",0,1), new MusicObj("h_myking","/yinyue/外语诗歌/英语诗歌(2)/h_myking.mp3","外语诗歌",0,1), new MusicObj("He Binds The Broken Hearted (Reprise)","/yinyue/外语诗歌/英语诗歌(2)/He Binds The Broken Hearted (Reprise).mp3","外语诗歌",0,1), new MusicObj("He Binds The Broken Hearted","/yinyue/外语诗歌/英语诗歌(2)/He Binds The Broken Hearted.mp3","外语诗歌",0,1), new MusicObj("He Shall Reign","/yinyue/外语诗歌/英语诗歌(2)/He Shall Reign.mp3","外语诗歌",0,1), new MusicObj("Here Am I","/yinyue/外语诗歌/英语诗歌(2)/Here Am I.mp3","外语诗歌",0,1), new MusicObj("I Will Praise Him","/yinyue/外语诗歌/英语诗歌(2)/I Will Praise Him.mp3","外语诗歌",0,1), new MusicObj("In Your Presence","/yinyue/外语诗歌/英语诗歌(2)/In Your Presence.mp3","外语诗歌",0,1), new MusicObj("Let Your Fire Fall","/yinyue/外语诗歌/英语诗歌(2)/Let Your Fire Fall.mp3","外语诗歌",0,1), new MusicObj("Lord, Send Me","/yinyue/外语诗歌/英语诗歌(2)/Lord, Send Me.mp3","外语诗歌",0,1), new MusicObj("Now Is The Time","/yinyue/外语诗歌/英语诗歌(2)/Now Is The Time.mp3","外语诗歌",0,1), new MusicObj("Remember Me","/yinyue/外语诗歌/英语诗歌(2)/Remember Me.mp3","外语诗歌",0,1), new MusicObj("Say To The Mountain","/yinyue/外语诗歌/英语诗歌(2)/Say To The Mountain.mp3","外语诗歌",0,1), new MusicObj("The fire of your Love","/yinyue/外语诗歌/英语诗歌(2)/The fire of your Love.mp3","外语诗歌",0,1), new MusicObj("Under The Blood","/yinyue/外语诗歌/英语诗歌(2)/Under The Blood.mp3","外语诗歌",0,1), new MusicObj("Your Grace Is Sufficient","/yinyue/外语诗歌/英语诗歌(2)/Your Grace Is Sufficient.mp3","外语诗歌",0,1), new MusicObj("Your Love","/yinyue/外语诗歌/英语诗歌(2)/Your Love.mp3","外语诗歌",0,1), ]; //播放模式 1-全部循环 2-单曲循环 3-随机播放 var playMode = 1; //当前音乐播放的下标 var index = -1; var length = musicFiles.length; var playMode_H = $("#playMode"); var musicList_H = $("#musicList"); var playMsg_H = $("#playMsg"); var name = $("#name"); var author = $("#author"); var CD = $("#CD"); var picInfo = $("#picInfo"); var pop =$("#pop"); var playMsg = null; _this.fristMusic = function(){ index = 0; _this.play(); } _this.playOrPause=function(){ pop.addClass("Gray"); var popVal = pop.attr("imgVal"); if(popVal == 0){ pop.attr("src","music/play.png"); pop.attr("title","点击播放"); pop.attr("imgVal","1"); musicBox_H.pause(); }else{ pop.attr("src","music/pause.png"); pop.attr("title","点击暂停"); pop.attr("imgVal","0"); musicBox_H.play(); } } _this.end = function(){ index = length -1; _this.play(); } _this.lastMusic = function(){ if(index == 0){ index = length-1; }else{ index --; } _this.play(); } _this.loadMusic = function(){ for(var i in musicFiles){ var html = "