]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix 00:00 player timestamp
authorChocobozzz <me@florianbigard.com>
Wed, 25 Nov 2020 10:56:19 +0000 (11:56 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 25 Nov 2020 10:56:19 +0000 (11:56 +0100)
client/angular.json
client/src/assets/player/utils.ts

index 5ecc335cbb0ff40fb10cec74ee7cd222ee0be3d1..cf92c7ade204ee0fd0165b169d142d4d75cbbd8f 100644 (file)
               "linkifyjs/html",
               "linkifyjs",
               "markdown-it",
+              "markdown-it-emoji/light",
               "sanitize-html",
               "socket.io-client",
               "socket.io-parser",
index 280f721bdbcdf3d4ec5437e70215e59607d79b4d..6767459ce9fbc800788cb39bd96a2855b3f92d97 100644 (file)
@@ -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'