Salve a tutti, ho un problema con jPlayer... Mi sto cimentando nella riparazione di tuunes.co -> ho gia sistemato un po il player.. solo che adesso quando si prova ad ascoltare un brano il vecchio ascoltato rimane in memoria.. quindi si sente l'inizio del vecchio dopo di che inizia il nuovo... questo su desktop, mentre su mobile e´ tutto ok... vi posto il codice, qualcuno mi sa aiutare?
codice:
$(document).on('click', '.stop-me', function(e){
window.setTimeout(updatePlaylist, 500);
$(this).jPlayer("pauseOthers");
$(this).jPlayer("stop"); // stop all players except this one.
var id = $(this).attr("data-id");
var i = inObj(id, playlist);
player.pause(i);
$('.stop-me').removeClass('stop-me').addClass('play-me');
$(".play-me").html("<img class='im-res' src='http://www.tuunes.co/ply.png'>");
});
// bind click on play-me element.
$(document).on('click', '.play-me', function(e){
$(this).jPlayer("pauseOthers");
$(this).jPlayer("stop"); // stop all players except this one.
//MOSTRA CARICAMENTO
$(".play-me").html("<img class='im-res' src='http://www.tuunes.co/loading.gif'>");
$('.play-me').removeClass('play-me').addClass('stop-me');
//RECUPERO l'ID DAL TAG data-id e lo assegno a ID
var id = $(this).attr("data-id");
var i = inObj(id, playlist);
$.ajax({
type : "get",
dataType : "json",
url : ajax_object.ajaxurl,
data : {action: "get_media", id : id},
success: function(obj) {
if(obj.length == 1){
player.add( obj[0], true );
updatePlaylist();
player.play(id);
$(".stop-me").html("<img class='im-res' src='http://www.tuunes.co/stp.png'>");
}
else if(obj.length > 1){
player.setPlaylist(obj);
player.play(0);
updatePlaylist();
player.play(id);
$(".stop-me").html("<img class='im-res' src='http://www.tuunes.co/stp.png'>");
}
}
});
player.play(i);
$(".stop-me").html("<img class='im-res' src='http://www.tuunes.co/stp.png'>");
});
Maledizione!!!