Playpause button functionality
This commit is contained in:
parent
663a92c0d9
commit
585c88aa0b
|
@ -160,8 +160,13 @@ var behaviors = {
|
||||||
|
|
||||||
$(this).removeClass("dragging");
|
$(this).removeClass("dragging");
|
||||||
}).on("slide", function(){
|
}).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();
|
||||||
$("#player").jPlayer("play", parseInt(newTime))
|
if(paused) {
|
||||||
|
$("#player").jPlayer("pause", parseInt(newTime))
|
||||||
|
} else {
|
||||||
|
$("#player").jPlayer("play", parseInt(newTime))
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
play:function() {
|
play:function() {
|
||||||
|
@ -181,7 +186,16 @@ var behaviors = {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$("#playerdrop .playbtn").click(function(){
|
||||||
|
paused = $("#player").data().jPlayer.status.paused
|
||||||
|
if(paused) {
|
||||||
|
$("#player").jPlayer("play")
|
||||||
|
$(this).find("span").removeClass("glyphicon-play").addClass("glyphicon-pause")
|
||||||
|
} else {
|
||||||
|
$("#player").jPlayer("pause")
|
||||||
|
$(this).find("span").removeClass("glyphicon-pause").addClass("glyphicon-play")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
$(".playlink").on("click", function(){
|
$(".playlink").on("click", function(){
|
||||||
url = $(this).data("url")
|
url = $(this).data("url")
|
||||||
|
@ -189,10 +203,7 @@ var behaviors = {
|
||||||
title: "Test",
|
title: "Test",
|
||||||
mp3: url
|
mp3: url
|
||||||
}).jPlayer("play")
|
}).jPlayer("play")
|
||||||
|
$("#playerdrop .playbtn").addClass("glyphicon-pause")
|
||||||
$("#playerdrop .playbtn").click(function(){
|
|
||||||
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
done()
|
done()
|
||||||
|
|
Loading…
Reference in New Issue