aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-10-25 15:07:58 +0200
committerChocobozzz <me@florianbigard.com>2022-10-25 15:08:12 +0200
commitae7b0cbbcf05f7847dee765d8def9cf91052aec0 (patch)
treeffe18f67c7da4f0960bc0da3da6a8d49cfcf3685 /client/src/assets
parent4eb1259e6b2753e07a059671963a049bacb860b4 (diff)
downloadPeerTube-ae7b0cbbcf05f7847dee765d8def9cf91052aec0.tar.gz
PeerTube-ae7b0cbbcf05f7847dee765d8def9cf91052aec0.tar.zst
PeerTube-ae7b0cbbcf05f7847dee765d8def9cf91052aec0.zip
Prevent error with metrics in HTTP player
Diffstat (limited to 'client/src/assets')
-rw-r--r--client/src/assets/player/shared/metrics/metrics-plugin.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/client/src/assets/player/shared/metrics/metrics-plugin.ts b/client/src/assets/player/shared/metrics/metrics-plugin.ts
index 2844828da..0e296bef6 100644
--- a/client/src/assets/player/shared/metrics/metrics-plugin.ts
+++ b/client/src/assets/player/shared/metrics/metrics-plugin.ts
@@ -104,6 +104,8 @@ class MetricsPlugin extends Plugin {
104 104
105 private trackBytes () { 105 private trackBytes () {
106 this.player.on('p2pInfo', (_event, data: PlayerNetworkInfo) => { 106 this.player.on('p2pInfo', (_event, data: PlayerNetworkInfo) => {
107 if (!data) return
108
107 this.downloadedBytesHTTP += data.http.downloaded - (this.lastPlayerNetworkInfo?.http.downloaded || 0) 109 this.downloadedBytesHTTP += data.http.downloaded - (this.lastPlayerNetworkInfo?.http.downloaded || 0)
108 this.downloadedBytesP2P += data.p2p.downloaded - (this.lastPlayerNetworkInfo?.p2p.downloaded || 0) 110 this.downloadedBytesP2P += data.p2p.downloaded - (this.lastPlayerNetworkInfo?.p2p.downloaded || 0)
109 111