From 6de4c373099fc24100fe8bcfd63d2677f4018035 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Wed, 27 Jan 2021 00:53:29 -0500 Subject: Try subtitle --- templates/page.tmpl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'templates/page.tmpl') diff --git a/templates/page.tmpl b/templates/page.tmpl index 576f3d66..44b6a957 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -69,12 +69,11 @@ let qnaVideo; // some pages have a questions and answers video let timestamps; - // expects a string like "mm:ss" + // expects a string like "mm:ss.mmm" function parseSeconds(timeString) { - const times = timeString.split(":"); - const minutes = parseFloat(times[0]); - const seconds = parseFloat(times[1]); - return (minutes * 60) + seconds; + return timeString.split(":").reduce(function(prev, o) { + return prev * 60 + parseFloat(o); + }); } window.onload = function initScript() { -- cgit v1.2.3