Fix player metrics

This commit is contained in:
Chocobozzz 2023-07-19 10:20:01 +02:00
parent 6b745df087
commit bfd01f289d
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 2 additions and 0 deletions

View File

@ -144,6 +144,8 @@ class MetricsPlugin extends Plugin {
this.player.on('http-info', (_event, data: PlayerNetworkInfo) => { this.player.on('http-info', (_event, data: PlayerNetworkInfo) => {
this.downloadedBytesHTTP += Math.round(data.http.downloaded - (this.lastPlayerNetworkInfo?.http.downloaded || 0)) this.downloadedBytesHTTP += Math.round(data.http.downloaded - (this.lastPlayerNetworkInfo?.http.downloaded || 0))
this.lastPlayerNetworkInfo = data
}) })
} }