diff options
Diffstat (limited to 'client/src/assets/player/videojs-components')
-rw-r--r-- | client/src/assets/player/videojs-components/p2p-info-button.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/client/src/assets/player/videojs-components/p2p-info-button.ts b/client/src/assets/player/videojs-components/p2p-info-button.ts index 2fc4c4562..6424787b2 100644 --- a/client/src/assets/player/videojs-components/p2p-info-button.ts +++ b/client/src/assets/player/videojs-components/p2p-info-button.ts | |||
@@ -75,11 +75,12 @@ class P2pInfoButton extends Button { | |||
75 | } | 75 | } |
76 | 76 | ||
77 | const p2pStats = data.p2p | 77 | const p2pStats = data.p2p |
78 | const httpStats = data.http | ||
78 | 79 | ||
79 | const downloadSpeed = bytes(p2pStats.downloadSpeed) | 80 | const downloadSpeed = bytes(p2pStats.downloadSpeed + httpStats.downloadSpeed) |
80 | const uploadSpeed = bytes(p2pStats.uploadSpeed) | 81 | const uploadSpeed = bytes(p2pStats.uploadSpeed + httpStats.uploadSpeed) |
81 | const totalDownloaded = bytes(p2pStats.downloaded) | 82 | const totalDownloaded = bytes(p2pStats.downloaded + httpStats.downloaded) |
82 | const totalUploaded = bytes(p2pStats.uploaded) | 83 | const totalUploaded = bytes(p2pStats.uploaded + httpStats.uploaded) |
83 | const numPeers = p2pStats.numPeers | 84 | const numPeers = p2pStats.numPeers |
84 | 85 | ||
85 | subDivWebtorrent.title = this.player_.localize('Total downloaded: ') + totalDownloaded.join(' ') + '\n' + | 86 | subDivWebtorrent.title = this.player_.localize('Total downloaded: ') + totalDownloaded.join(' ') + '\n' + |
@@ -92,7 +93,7 @@ class P2pInfoButton extends Button { | |||
92 | uploadSpeedUnit.textContent = ' ' + uploadSpeed[ 1 ] | 93 | uploadSpeedUnit.textContent = ' ' + uploadSpeed[ 1 ] |
93 | 94 | ||
94 | peersNumber.textContent = numPeers | 95 | peersNumber.textContent = numPeers |
95 | peersText.textContent = ' ' + this.player_.localize('peers') | 96 | peersText.textContent = ' ' + (numPeers > 1 ? this.player_.localize('peers') : this.player_.localize('peer')) |
96 | 97 | ||
97 | subDivHttp.className = 'vjs-peertube-hidden' | 98 | subDivHttp.className = 'vjs-peertube-hidden' |
98 | subDivWebtorrent.className = 'vjs-peertube-displayed' | 99 | subDivWebtorrent.className = 'vjs-peertube-displayed' |