Player widths and don't update the player while dragging, this causes LAG
This commit is contained in:
parent
77685dd9e7
commit
2f2376c829
|
@ -54,21 +54,21 @@ div.slider.slider-horizontal {
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
#playerdrop > div.controls {
|
#playerdrop > div.controls {
|
||||||
min-width: 55px;
|
min-width: 45px;
|
||||||
width: 20%
|
width: 15%
|
||||||
}
|
}
|
||||||
#playerdrop > div.controls button {
|
#playerdrop > div.controls button {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%
|
width: 100%
|
||||||
}
|
}
|
||||||
#playerdrop > div.timeshow {
|
#playerdrop > div.timeshow {
|
||||||
width: 10%;
|
width: 20%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
}
|
}
|
||||||
#playerdrop > div.time {
|
#playerdrop > div.time {
|
||||||
width: 70%;
|
width: 65%;
|
||||||
padding: 6px 8px 5px 20px;
|
padding: 6px 8px 5px 20px;
|
||||||
}
|
}
|
|
@ -158,14 +158,15 @@ var behaviors = {
|
||||||
$(this).addClass("dragging")
|
$(this).addClass("dragging")
|
||||||
}).on("slideStop", function(){
|
}).on("slideStop", function(){
|
||||||
$(this).removeClass("dragging");
|
$(this).removeClass("dragging");
|
||||||
}).on("slide", function(){
|
|
||||||
paused = $("#player").data().jPlayer.status.paused
|
|
||||||
newTime = $(".time-holder .player-slider").slider('getValue').val();
|
newTime = $(".time-holder .player-slider").slider('getValue').val();
|
||||||
if(paused) {
|
if(paused) {
|
||||||
$("#player").jPlayer("pause", parseInt(newTime))
|
$("#player").jPlayer("pause", parseInt(newTime))
|
||||||
} else {
|
} else {
|
||||||
$("#player").jPlayer("play", parseInt(newTime))
|
$("#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)
|
minutes = Math.floor(newTime/60)
|
||||||
seconds = Math.floor(newTime-(minutes*60))
|
seconds = Math.floor(newTime-(minutes*60))
|
||||||
$(".timeshow").html(minutes+":"+(seconds<10?"0":"")+seconds)
|
$(".timeshow").html(minutes+":"+(seconds<10?"0":"")+seconds)
|
||||||
|
|
Loading…
Reference in New Issue