X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fassets%2Fplayer%2Fwebtorrent-info-button.ts;h=deef253ceab4207387cafb988d958caece9ae583;hb=0491173a61aed66205c017e0d7e0503ea316c144;hp=10945c66557835e5f00211093a9e52bef1224337;hpb=e945b184a0f29b47c33bbd05578f3493ca9c8e6c;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 10945c665..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' @@ -57,7 +58,7 @@ class WebtorrentInfoButton extends Button { className: 'vjs-peertube-hidden' }) const subDivHttpText = videojsUntyped.dom.createEl('span', { - className: 'peers-number', + className: 'http-fallback', textContent: 'HTTP' }) @@ -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 ]