]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/utils.ts
Use source sans 3 font
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / utils.ts
index ce7a7fe6c966aab587867136129697d2f4ecbc17..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'
@@ -176,18 +178,6 @@ function buildVideoOrPlaylistEmbed (embedUrl: string) {
     '</iframe>'
 }
 
-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,