Fix 00:00 player timestamp

pull/3274/head
Chocobozzz 2020-11-25 11:56:19 +01:00
parent 69524f6ed1
commit fc41887463
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 4 additions and 1 deletions

View File

@ -150,6 +150,7 @@
"linkifyjs/html",
"linkifyjs",
"markdown-it",
"markdown-it-emoji/light",
"sanitize-html",
"socket.io-client",
"socket.io-parser",

View 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'