X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fassets%2Fplayer%2Fwebtorrent-info-button.ts;h=deef253ceab4207387cafb988d958caece9ae583;hb=5d128505dca854cb7225624936d1053f06473260;hp=1296aca3b32691bf30a7035c713b500f2c663f49;hpb=1ee156b2c5e1a7354fb843d99c17761bcc733580;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/assets/player/webtorrent-info-button.ts b/client/src/assets/player/webtorrent-info-button.ts index 1296aca3b..deef253ce 100644 --- a/client/src/assets/player/webtorrent-info-button.ts +++ b/client/src/assets/player/webtorrent-info-button.ts @@ -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 ]