From 4ecaa62c897f628f08d35248a10d8e8f08ee9a29 Mon Sep 17 00:00:00 2001 From: Alberto Berti Date: Tue, 4 Jul 2023 16:48:23 +0200 Subject: [PATCH] Fix hour computation in the video player, fixes #36 --- client/src/lib/VideoFrame.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/lib/VideoFrame.js b/client/src/lib/VideoFrame.js index 5d1c614..b43b3a6 100644 --- a/client/src/lib/VideoFrame.js +++ b/client/src/lib/VideoFrame.js @@ -134,7 +134,7 @@ VideoFrame.prototype.toSMPTE = function(frame) { var fps = this.frameRate; function wrap(n) { return ((n < 10) ? '0' + n : n); } var _hour = ((fps * 60) * 60), _minute = (fps * 60); - var _hours = (frameNumber / _hour).toFixed(0); + var _hours = Math.floor(frameNumber / _hour).toString(); var _minutes = (Number((frameNumber / _minute).toString().split('.')[0]) % 60); var _seconds = (Number((frameNumber / fps).toString().split('.')[0]) % 60); var SMPTE = (wrap(_hours) + ':' + wrap(_minutes) + ':' + wrap(_seconds) + ':' + wrap(Math.round(frameNumber % fps)));