From fc4188746340b65b7615ca0dd07f81ed7a5e53cd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 25 Nov 2020 11:56:19 +0100 Subject: Fix 00:00 player timestamp --- client/src/assets/player/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'client/src/assets') diff --git a/client/src/assets/player/utils.ts b/client/src/assets/player/utils.ts index 280f721bd..6767459ce 100644 --- a/client/src/assets/player/utils.ts +++ b/client/src/assets/player/utils.ts @@ -68,7 +68,7 @@ function buildVideoLink (options: { const params = generateParams(window.location.search) - if (options.startTime) { + if (options.startTime !== undefined && options.startTime !== null) { const startTimeInt = Math.floor(options.startTime) params.set('start', secondsToTime(startTimeInt)) } @@ -146,6 +146,8 @@ function timeToInt (time: number | string) { function secondsToTime (seconds: number, full = false, symbol?: string) { let time = '' + if (seconds === 0 && !full) return '0s' + const hourSymbol = (symbol || 'h') const minuteSymbol = (symbol || 'm') const secondsSymbol = full ? '' : 's' -- cgit v1.2.3