mirror of https://github.com/Chocobozzz/PeerTube
Prevent error with metrics in HTTP player
parent
4eb1259e6b
commit
ae7b0cbbcf
|
@ -104,6 +104,8 @@ class MetricsPlugin extends Plugin {
|
|||
|
||||
private trackBytes () {
|
||||
this.player.on('p2pInfo', (_event, data: PlayerNetworkInfo) => {
|
||||
if (!data) return
|
||||
|
||||
this.downloadedBytesHTTP += data.http.downloaded - (this.lastPlayerNetworkInfo?.http.downloaded || 0)
|
||||
this.downloadedBytesP2P += data.p2p.downloaded - (this.lastPlayerNetworkInfo?.p2p.downloaded || 0)
|
||||
|
||||
|
|
Loading…
Reference in New Issue