Hi!
I've got a jquery plugin - soundcloud custom player.
Code is here:
http://pastebin.com/nfqssuyjPlayer is embed by:
<a href="http://soundcloud.com/user/music-title" class="sc-player">Title</a>
This plugin works on dubstep.net FINE, but on my website i've got a problem:
Player works but when one track finishes it's not starting next one, in other player.
Everything is in section "onFinish" so problem must be here:
- onFinish = function() {
- var $player = updates.$played.closest('.sc-player'),
- $nextItem;
- // update the scrubber width
- updates.$played.css('width', '0%');
- // show the position in the track position counter
- updates.position.innerHTML = timecode(0);
- // reset the player state
- updatePlayStatus($player, false);
- // stop the audio
- audioEngine.stop();
- // continue playing through all players
- // TODO create a nicer auto-play flow
- log('track finished get the next one');
- //$nextItem = $('.sc-trackslist li.active', $player).next('li');
- // try to find the next track in other player
- //if(!$nextItem.length){
- //$nextItem = $player.nextAll('div.sc-player:first').find('.sc-trackslist li.active');
- //}
- $nextItem = $($player).parent().next().find('.sc-player').find('.sc-trackslist li.active');
- if($($nextItem).length == 0)
- {
- $nextItem = $($player).parent().parent().parent().next().find('.sc-player').find('.sc-trackslist li.active');
- }
- $nextItem.click();
- },
Could somebody help me?