]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/webtorrent-info-button.ts
Cache player translations
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / webtorrent-info-button.ts
index 1296aca3b32691bf30a7035c713b500f2c663f49..deef253ceab4207387cafb988d958caece9ae583 100644 (file)
@@ -3,6 +3,7 @@ import { bytes } from './utils'
 
 const Button: VideoJSComponentInterface = videojsUntyped.getComponent('Button')
 class WebtorrentInfoButton extends Button {
+
   createEl () {
     const div = videojsUntyped.dom.createEl('div', {
       className: 'vjs-peertube'
@@ -75,8 +76,13 @@ class WebtorrentInfoButton extends Button {
 
       const downloadSpeed = bytes(data.downloadSpeed)
       const uploadSpeed = bytes(data.uploadSpeed)
+      const totalDownloaded = bytes(data.downloaded)
+      const totalUploaded = bytes(data.uploaded)
       const numPeers = data.numPeers
 
+      subDivWebtorrent.title = this.player_.localize('Total downloaded: ') + totalDownloaded.join(' ') + '\n' +
+        this.player_.localize('Total uploaded: ' + totalUploaded.join(' '))
+
       downloadSpeedNumber.textContent = downloadSpeed[ 0 ]
       downloadSpeedUnit.textContent = ' ' + downloadSpeed[ 1 ]