X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fassets%2Fplayer%2Futils.ts;h=6767459ce9fbc800788cb39bd96a2855b3f92d97;hb=26171379d0196ac645923e72b12e1cf29089835b;hp=ce7a7fe6c966aab587867136129697d2f4ecbc17;hpb=951b582f52d0694865f020f0e53ccfad2d2d6033;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/assets/player/utils.ts b/client/src/assets/player/utils.ts index ce7a7fe6c..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' @@ -176,18 +178,6 @@ function buildVideoOrPlaylistEmbed (embedUrl: string) { '' } -function copyToClipboard (text: string) { - const el = document.createElement('textarea') - el.value = text - el.setAttribute('readonly', '') - el.style.position = 'absolute' - el.style.left = '-9999px' - document.body.appendChild(el) - el.select() - document.execCommand('copy') - document.body.removeChild(el) -} - function videoFileMaxByResolution (files: VideoFile[]) { let max = files[0] @@ -236,7 +226,6 @@ export { buildVideoOrPlaylistEmbed, videoFileMaxByResolution, videoFileMinByResolution, - copyToClipboard, isMobile, bytes, isIOS,