2012-04-30 86 views
1

下面的代碼是從CoffeeScript的編譯時,無法設置的未定義的屬性「身份證」,希望它仍然可讀的SoundCloud:試圖播放的歌曲

(function() { 

    $(function() { 
    var PLAYLIST_ID, SOUNDCLOUD_ID, tracks, tracks_ready, tracks_total; 
    SOUNDCLOUD_ID = '6d5064768cc29c71e1f66691f435589a'; 
    PLAYLIST_ID = '1768866'; 
    SC.initialize({ 
     client_id: SOUNDCLOUD_ID 
    }); 
    tracks = []; 
    tracks_total = 0; 
    tracks_ready = function() { 
     return tracks[0].play(); 
    }; 
    return SC.get('/playlists/' + PLAYLIST_ID, function(pl) { 
     var track; 
     track = pl.tracks[0]; 
     return SC.stream('/tracks/' + track.id, function(sound) { 
     tracks.push(sound); 
     return tracks_ready(); 
     }); 
    }); 
    }); 

}).call(this); 

的代碼的jQuery後執行,「//連接。 soundcloud.com/sdk.js「包含在內。

,它給遺漏的類型錯誤:無法設置屬性「ID」的不確定與以下跟蹤:

window.SC.SC.Helper.merge.stream - window.SC.SC.Helper.merge.whenStreamingReady - some SM2 stuff 

回答

2

哦,好像是在SC.stream的錯誤。快速解決方法是通過可選選項對象: SC.stream('/ tracks /'+ track.id,{},function(sound)....) 將確保儘快找到修復可能。

+0

哇,那很快;) – Guard