【发布时间】:2017-11-20 01:10:56
【问题描述】:
我最近刚刚注意到 SC.Widget.Events.FINISH 事件不再在播放列表的 HTML5 小部件 API 中触发。以下代码之前运行良好,但现在歌曲播放完毕后不再执行该功能:
http://jsbin.com/vujedofada/edit?html,css,js,console,output
$(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();
});
});
});
READY 和 PLAY 事件似乎正在工作,而 FINISH 适用于具有单个曲目的小部件,而不是播放列表。
SoundCloud 的人能否确认这是否是一个已知错误以及何时会更正?
【问题讨论】:
标签: javascript html soundcloud