Player widths and don't update the player while dragging, this causes LAG

This commit is contained in:
dave 2014-08-28 23:29:59 -07:00
parent 77685dd9e7
commit 2f2376c829
2 changed files with 7 additions and 6 deletions

View File

@ -54,21 +54,21 @@ div.slider.slider-horizontal {
float: left;
}
#playerdrop > div.controls {
min-width: 55px;
width: 20%
min-width: 45px;
width: 15%
}
#playerdrop > div.controls button {
display: block;
width: 100%
}
#playerdrop > div.timeshow {
width: 10%;
width: 20%;
text-align: center;
font-size: 18px;
font-weight: 500;
padding-top: 4px;
}
#playerdrop > div.time {
width: 70%;
width: 65%;
padding: 6px 8px 5px 20px;
}

View File

@ -158,14 +158,15 @@ var behaviors = {
$(this).addClass("dragging")
}).on("slideStop", function(){
$(this).removeClass("dragging");
}).on("slide", function(){
paused = $("#player").data().jPlayer.status.paused
newTime = $(".time-holder .player-slider").slider('getValue').val();
if(paused) {
$("#player").jPlayer("pause", parseInt(newTime))
} else {
$("#player").jPlayer("play", parseInt(newTime))
}
}).on("slide", function(){
paused = $("#player").data().jPlayer.status.paused
newTime = $(".time-holder .player-slider").slider('getValue').val();
minutes = Math.floor(newTime/60)
seconds = Math.floor(newTime-(minutes*60))
$(".timeshow").html(minutes+":"+(seconds<10?"0":"")+seconds)