2013-03-14 134 views
0

我正在用我的朋友創建一個個人博客,我們通過soundcloud上傳我們最喜歡的歌曲,並希望歌曲一個接一個地播放。Soundcloud Flash Widget,試圖播放下一首歌曲

這是每首歌曲將在頁面上列出的一般想法。 http://jsfiddle.net/PJWQZ/

<div class="item"> 
<object height="200" width="200"> <param name="movie" value=  "https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F60974071&amp;auto_play=false&amp;player_type=artwork&amp;color=0066cc"> 
<param name="allowscriptaccess" value="always"> <embed allowscriptaccess="always" height="200" width="200" src="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F60974071&amp;auto_play=false&amp;player_type=artwork&amp;color=0066cc" type="application/x-shockwave-flash">   </object> 
</div> 

唯一的問題是,一旦歌曲結束時沒有任何反應。我正在查看是否可以使用Javascript來查找歌曲何時結束(使用onMediaEnd),並自動播放下一首歌曲,而無需使用播放列表API。

感謝

回答

1

這裏的基礎上,Custom Player API一個例子。

http://jsfiddle.net/8mWXq/

我不能讓圖形上的jsfiddle加載,但單擊第一個曲目開始玩它,然後FF(點擊)接近尾聲和第一首曲目停止時第二將啓動。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html> 
    <head> 
    <title>SC player example: Artwork Skin</title> 
    <link rel="stylesheet" href="../css/sc-player-artwork.css" type="text/css"> 
    </head> 
    <body> 
    <h1>I Love Cover-Art</h1> 
    <div class="post"> 
     <h2>2012</h2> 
     <div class="sc-player"> 
     <a href="http://soundcloud.com/kreek/you-know-it" class="sc-player">Track 1</a> 
     <a href="http://soundcloud.com/kreek/amnesia" class="sc-player">Track 2</a> 
     </div> 
    </div> 
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> 
    <script type="text/javascript" src="../js/soundcloud.player.api.js"></script> 
    <script type="text/javascript" src="../js/sc-player.js"></script> 
    </body> 
</html> 
相關問題