Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript SoundCloud SC.Widget.Events.FINISH不再启动HTML5小部件_Javascript_Html_Soundcloud - Fatal编程技术网

Javascript SoundCloud SC.Widget.Events.FINISH不再启动HTML5小部件

Javascript SoundCloud SC.Widget.Events.FINISH不再启动HTML5小部件,javascript,html,soundcloud,Javascript,Html,Soundcloud,我最近注意到,播放列表的HTML5小部件API中不再触发SC.Widget.Events.FINISH事件。以下代码以前工作正常,但现在在歌曲结束时不再执行该功能: READY和PLAY事件对于具有单个曲目的窗口小部件来说似乎正在工作并完成工作,而不是播放列表 SoundCloud的人能确认这是否是一个已知的错误以及何时会被纠正吗?您的代码是正确的。这个问题现在应该解决了 处理它太棒了,它又正常工作了。谢谢汤姆和他的团队! $(function() { var iframe = doc

我最近注意到,播放列表的HTML5小部件API中不再触发SC.Widget.Events.FINISH事件。以下代码以前工作正常,但现在在歌曲结束时不再执行该功能:

READY和PLAY事件对于具有单个曲目的窗口小部件来说似乎正在工作并完成工作,而不是播放列表


SoundCloud的人能确认这是否是一个已知的错误以及何时会被纠正吗?

您的代码是正确的。这个问题现在应该解决了


处理它太棒了,它又正常工作了。谢谢汤姆和他的团队!
$(function() {
    var iframe = document.querySelector('iframe');
    widget = SC.Widget(iframe);        
    widget.bind(SC.Widget.Events.READY, function() {
        console.log("Ready");
        widget.bind(SC.Widget.Events.PLAY, function() {
            //Get info for song playing
            widget.getCurrentSound(function(currentSound) {
                console.log(currentSound.id + " " + currentSound.title + " " + currentSound.artwork_url);
                sid = currentSound.id
                stitle = currentSound.title
                sartlo = currentSound.artwork_url
                display_artwork()
            });
        });         
        widget.bind(SC.Widget.Events.FINISH, function() {        
            console.log("Finish");
            play_next_shuffled_song();
        });
        widget.getSounds(function(sounds) {
            create_shuffled_indexes(sounds.length);
            play_next_shuffled_song();
        });               
    });
});