aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/utils.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-25 11:56:19 +0100
committerChocobozzz <me@florianbigard.com>2020-11-25 11:56:19 +0100
commitfc4188746340b65b7615ca0dd07f81ed7a5e53cd (patch)
tree06360dc45e598ae6e18aa98cb8acfb977a3d451f /client/src/assets/player/utils.ts
parent69524f6ed170c74fab8d5833920c389fde992f3e (diff)
downloadPeerTube-fc4188746340b65b7615ca0dd07f81ed7a5e53cd.tar.gz
PeerTube-fc4188746340b65b7615ca0dd07f81ed7a5e53cd.tar.zst
PeerTube-fc4188746340b65b7615ca0dd07f81ed7a5e53cd.zip
Fix 00:00 player timestamp
Diffstat (limited to 'client/src/assets/player/utils.ts')
-rw-r--r--client/src/assets/player/utils.ts4
1 files changed, 3 insertions, 1 deletions
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: {
68 68
69 const params = generateParams(window.location.search) 69 const params = generateParams(window.location.search)
70 70
71 if (options.startTime) { 71 if (options.startTime !== undefined && options.startTime !== null) {
72 const startTimeInt = Math.floor(options.startTime) 72 const startTimeInt = Math.floor(options.startTime)
73 params.set('start', secondsToTime(startTimeInt)) 73 params.set('start', secondsToTime(startTimeInt))
74 } 74 }
@@ -146,6 +146,8 @@ function timeToInt (time: number | string) {
146function secondsToTime (seconds: number, full = false, symbol?: string) { 146function secondsToTime (seconds: number, full = false, symbol?: string) {
147 let time = '' 147 let time = ''
148 148
149 if (seconds === 0 && !full) return '0s'
150
149 const hourSymbol = (symbol || 'h') 151 const hourSymbol = (symbol || 'h')
150 const minuteSymbol = (symbol || 'm') 152 const minuteSymbol = (symbol || 'm')
151 const secondsSymbol = full ? '' : 's' 153 const secondsSymbol = full ? '' : 's'