diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-25 11:56:19 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-25 11:56:19 +0100 |
commit | fc4188746340b65b7615ca0dd07f81ed7a5e53cd (patch) | |
tree | 06360dc45e598ae6e18aa98cb8acfb977a3d451f | |
parent | 69524f6ed170c74fab8d5833920c389fde992f3e (diff) | |
download | PeerTube-fc4188746340b65b7615ca0dd07f81ed7a5e53cd.tar.gz PeerTube-fc4188746340b65b7615ca0dd07f81ed7a5e53cd.tar.zst PeerTube-fc4188746340b65b7615ca0dd07f81ed7a5e53cd.zip |
Fix 00:00 player timestamp
-rw-r--r-- | client/angular.json | 1 | ||||
-rw-r--r-- | client/src/assets/player/utils.ts | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/client/angular.json b/client/angular.json index 5ecc335cb..cf92c7ade 100644 --- a/client/angular.json +++ b/client/angular.json | |||
@@ -150,6 +150,7 @@ | |||
150 | "linkifyjs/html", | 150 | "linkifyjs/html", |
151 | "linkifyjs", | 151 | "linkifyjs", |
152 | "markdown-it", | 152 | "markdown-it", |
153 | "markdown-it-emoji/light", | ||
153 | "sanitize-html", | 154 | "sanitize-html", |
154 | "socket.io-client", | 155 | "socket.io-client", |
155 | "socket.io-parser", | 156 | "socket.io-parser", |
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) { | |||
146 | function secondsToTime (seconds: number, full = false, symbol?: string) { | 146 | function 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' |