2011-11-24 232 views
0

我正在嘗試鏈接音頻播放器,以便當一個完成時,下一首歌曲將開始播放。我將有無數的球員,所以我想知道如何做到這一點。這是非常直接的代碼。下面是兩首歌曲的例子:循環連續播放多個單曲音頻播放器

<div class="container"> 
<!-- DJ Picture --> 
<img src="Pictures/Calvinharris.jpg" class="img1" /> 
     <div class="box"> 
     <!-- DJ Name --> 
     <span class="bigroom">Calvin Harris</span> 

     <!-- Song Title --> 
     <h2>We Found Love (Chuckie Mix)</h2> 

     <!--Song Description(179 characters with spaces)--> 
     <h4>Beautiful, pounding piano stabs combined with great vocals make this       track a phenomenal one. Manages to powerfully fill a massive sound-space without sounding cluttered.</h4> 
       <!--Song file info--> 
      <div class="player"> 
     <body><a id="m12" class="audio {skin:'#010101',showVolumLevel:false,showTime:false,ogg:'MP3/Rihanna feat. Calvin Harris - We Found Love (Chuckie Extended Mix).ogg'}" href="MP3/Rihanna feat. Calvin Harris - We Found Love (Chuckie Extended Mix).mp3"></a> 
     </div> 
    </div> 
</div> 

<div class="container"> 
<!-- DJ Picture --> 
<img src="Pictures/dirtyharris.jpg" class="img1" /> 
     <div class="box"> 
     <!-- DJ Name --> 
     <span class="techno"> ThreeSixty & Dirty Harris</span> 

     <!-- Song Title --> 
     <h2>Louka (Funkagenda Re-Edit)</h2> 

     <!--Song Description(179 characters with spaces)--> 
     <h4>I had to include this one since it literally took over control of me while driving the other morning. I was bouncing around in my seat like a little kid who desparately needs to use the bathroom. </h4> 

      <!--Song file info--> 
      <div class="player"> 
     <body><a id="m11" class="audio {skin:'#010101',showVolumLevel:false,showTime:false,ogg:'MP3/ThreeSixty, Funkagenda - Loudka (Funkagenda Re-Edit).ogg'}" href="MP3/ThreeSixty, Funkagenda - Loudka (Funkagenda Re-Edit).mp3"></a> 
     </div> 
    </div> 
</div> 

這裏是我提出的jquery,但它不起作用。

function playNext(idx){ 
var players=$(".audio"); 
document.playerIDX = idx+1 <= players.length-1 ? idx+1 : 0; 
players.eq(document.playerIDX).mb_miniPlayer_play(); 
} 
+0

你解決這個問題了嗎? – Lloyd

回答