首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >循环播放多个单曲音频播放器,连续播放

循环播放多个单曲音频播放器,连续播放
EN

Stack Overflow用户
提问于 2011-11-24 12:31:54
回答 1查看 787关注 0票数 0

我正在尝试连接音频播放器,以便当一个结束时,下一首歌曲将开始播放。我会有无数的玩家,所以我想知道如何做到这一点。这是非常简单的代码。下面是两首歌曲的例子:

代码语言:javascript
复制
<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,但它不能工作。

代码语言:javascript
复制
function playNext(idx){
var players=$(".audio");
document.playerIDX = idx+1 <= players.length-1 ? idx+1 : 0;
players.eq(document.playerIDX).mb_miniPlayer_play();
}
EN

回答 1

Stack Overflow用户

发布于 2011-11-25 05:10:43

使用播放列表附加组件:

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

在我这一边工作得很好

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8252248

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档