diff options
-rw-r--r-- | client/src/assets/player/shared/metrics/metrics-plugin.ts | 2 |
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 | ||