From 57193c4f7328ade93dd31aabda5b11604f05f0b1 Mon Sep 17 00:00:00 2001 From: torcado194 Date: Thu, 14 Apr 2022 22:23:33 -0400 Subject: [PATCH] prevent NaN on scrubbing loading track --- index.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.html b/index.html index 20fb3f3..516a760 100644 --- a/index.html +++ b/index.html @@ -1281,6 +1281,9 @@ //t: 0-1 value in relation to the actual audio start/end function updateScrubPosition(t){ + if(currentEntry.needsDuration){ + return; + } //rebase t to full (assumed) duration t = currentEntry.audioStart + (t * currentEntry.duration); //clip to preview @@ -1474,6 +1477,10 @@ function toHMS(secs){ + if(isNaN(secs)){ + return '00:00'; + } + let sec_num = Math.max(0, Math.round(secs)); //flooring is more correct, but rounding gives nicer results due to playback event buffering let hours = Math.floor(sec_num / 3600); let minutes = Math.floor(sec_num / 60) % 60;