Open rliriano opened 11 years ago
@rliriano probaby because .live() has been deprecated in jQuery since 1.7.
@cgfarmer4 I was able to solve the proble, its the way firefox reads the audio/mpeg it was falling back to the flash version and it wasent firing this player.api_load(url); at around line 212, so I forced it by replacing it with $('.sc-player-engine-container').html(flashHtml(url)); so it creates the container for the flash engine
This is the code im using for the buttons but are nor woking only on firefox
function getNextTrack(player) { var $player = $(player).closest('.sc-player'), $nextItem = $('.sc-trackslist li.active', $player).next('li'); if(!$nextItem.length){ $nextItem = $player.nextAll('div.sc-player:first').find('.sc-trackslist li:active'); } return $nextItem; };
$(document).bind('onPlayerTrackFinish', function(event) { var $nextItem = getNextTrack(event.target); // init the next track but don't play :) $nextItem.click().click(); });
$('a.sc-next').live('click', function(event){ var $player = $(this).closest('.sc-player'), $nextItem = $('.sc-trackslist li.active', $player).next('li'); $nextItem.click(); console.log($nextItem); return false; });
$('a.sc-prev').live('click', function(event) { var $player = $(this).closest('.sc-player'), $prevItem = $('.sc-trackslist li.active', $player).prev('li'); $prevItem.click(); return false; });