I'm using the SC HTML5 player, when one sound finishes, I load in another source, however the FINISH event only seems to fire for the first song, my code is as follows
//Set the source document.getElementById("sc-widget").src = scPath; //get the widget reference var widgetIframe = document.getElementById('sc-widget'), widget = SC.Widget(widgetIframe); //set the finish event widget.bind(SC.Widget.Events.FINISH, endSC); function endSC() { var scPath = "http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F1848538&show_artwork=true&auto_play=true"; document.getElementById("sc-widget").src = scPath; var widgetIframe = document.getElementById('sc-widget'), widget = SC.Widget(widgetIframe); widget.bind(SC.Widget.Events.FINISH, endSC); }
I've tried setting the endSC target to another function but that doesn't work, what am I missing? Thanks!