【问题标题】:Looping multiple single song audio players for continuous play循环播放多个单曲音频播放器以进行连续播放
【发布时间】:2011-11-25 05:29:44
【问题描述】:

我正在尝试链接音频播放器,这样当一个播放器播放完毕后,下一首歌曲就会开始播放。我将有无数的玩家,所以我想知道如何做到这一点。这是非常直接的代码。以下是两首歌曲的示例:

<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();
}

【问题讨论】:

  • 你解决了这个问题吗?

标签: javascript html mp3 jplayer ogg


【解决方案1】:

使用播放列表插件:

http://www.jplayer.org/latest/demo-02-jPlayerPlaylist/

在我这边工作正常

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多