From d5c3cb886d829a510767a1104b6ad5885972540a Mon Sep 17 00:00:00 2001 From: dave Date: Fri, 29 Aug 2014 08:40:07 -0700 Subject: [PATCH] Show hours in player clock --- static/js/app.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index a1afc5d..d9cf63e 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -167,9 +167,10 @@ var behaviors = { $(this).removeClass("dragging"); }).on("slide", function(){ newTime = $(".time-holder .player-slider").slider('getValue').val(); + hours = Math.floor(newTime/60/60) minutes = Math.floor(newTime/60) seconds = Math.floor(newTime-(minutes*60)) - $(".timeshow").html(minutes+":"+(seconds<10?"0":"")+seconds) + $(".timeshow").html((hours>0?hours+":":"")+minutes+":"+(seconds<10?"0":"")+seconds) }); }, play:function() { @@ -183,9 +184,10 @@ var behaviors = { // Update the slider $(".time-holder .player-slider").slider('setValue', event.jPlayer.status.currentTime); // And update the time - minutes = Math.floor(event.jPlayer.status.currentTime/60) - seconds = Math.floor(event.jPlayer.status.currentTime-(minutes*60)) - $(".timeshow").html(minutes+":"+(seconds<10?"0":"")+seconds) + hours = Math.floor(newTime/60/60) + minutes = Math.floor(newTime/60) + seconds = Math.floor(newTime-(minutes*60)) + $(".timeshow").html((hours>0?hours+":":"")+minutes+":"+(seconds<10?"0":"")+seconds) } })