From ec86424b41acfb056f702b1322d227ac934283f2 Mon Sep 17 00:00:00 2001 From: Ernie Park Date: Tue, 10 Jan 2012 16:05:45 -0500 Subject: [PATCH] fix video duration bug: when formatting time use floor, not round --- js/video_player.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/video_player.js b/js/video_player.js index e86b8ddef7..c4185e8a5f 100644 --- a/js/video_player.js +++ b/js/video_player.js @@ -102,9 +102,9 @@ function caption_index(now) { function format_time(t) { - seconds = Math.round(t); - minutes = Math.round(seconds / 60); - hours = Math.round(minutes / 60); + seconds = Math.floor(t); + minutes = Math.floor(seconds / 60); + hours = Math.floor(minutes / 60); seconds = seconds % 60; minutes = minutes % 60; return hours+":"+((minutes < 10)?"0":"")+minutes+":"+((seconds < 10)?"0":"")+(seconds%60);