How can I automatically move to next sound after previous track completes using the Soundcloud Javascript SDK for streaming?

后端 未结 1 1065
伪装坚强ぢ
伪装坚强ぢ 2020-12-28 11:24

I\'m new to Javascript and the Soundcloud SDK so if my current solution is way off base please let me know how it can be improved.

I\'m building a custom Soundcloud

相关标签:
1条回答
  • 2020-12-28 11:50

    You can implement the onfinish method when creating the track object, now you can replace the console output with a function.

    SC.stream("http://api.soundcloud.com/tracks/" + trackId, {onfinish: function(){
        console.log('track finished');
    }}, function(sound){
        currentTrack = sound;
    });
    
    0 讨论(0)
提交回复
热议问题