varaudioMap=['source/1.wav','source/2.wav','source/3.wav',];varplayer=document.querySelector('#player'),len=audioMap.length;player.setAttribute('src',audioMap[0]);player.onended=function(){varcurrentPath=player.getAttribute('src'),currentIndex=audioMap.indexOf(currentPath),iNow=currentIndex+1;if(iNow===len)return;player.setAttribute('src',audioMap[iNow]);}有那个属性,也有这个事件,用事件可以 |