aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-04-15 10:47:48 +0200
committerChocobozzz <me@florianbigard.com>2022-04-15 10:47:48 +0200
commit1222a602a3e23635505c3c78e0470a5b5a7a2cd8 (patch)
tree0714ac96f17c34212327931ea90ace7b868416c3 /client/src
parent3eda9b775ae700ac544e8c5588514627796b83cd (diff)
downloadPeerTube-1222a602a3e23635505c3c78e0470a5b5a7a2cd8.tar.gz
PeerTube-1222a602a3e23635505c3c78e0470a5b5a7a2cd8.tar.zst
PeerTube-1222a602a3e23635505c3c78e0470a5b5a7a2cd8.zip
Use round for views stats
Diffstat (limited to 'client/src')
-rw-r--r--client/src/assets/player/shared/peertube/peertube-plugin.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/client/src/assets/player/shared/peertube/peertube-plugin.ts b/client/src/assets/player/shared/peertube/peertube-plugin.ts
index 8b65903f9..a29a0921f 100644
--- a/client/src/assets/player/shared/peertube/peertube-plugin.ts
+++ b/client/src/assets/player/shared/peertube/peertube-plugin.ts
@@ -159,7 +159,7 @@ class PeerTubePlugin extends Plugin {
159 }) 159 })
160 160
161 this.player.one('ended', () => { 161 this.player.one('ended', () => {
162 const currentTime = Math.floor(this.player.duration()) 162 const currentTime = Math.round(this.player.duration())
163 lastCurrentTime = currentTime 163 lastCurrentTime = currentTime
164 164
165 this.notifyUserIsWatching(currentTime, lastViewEvent) 165 this.notifyUserIsWatching(currentTime, lastViewEvent)
@@ -168,7 +168,7 @@ class PeerTubePlugin extends Plugin {
168 }) 168 })
169 169
170 this.videoViewInterval = setInterval(() => { 170 this.videoViewInterval = setInterval(() => {
171 const currentTime = Math.floor(this.player.currentTime()) 171 const currentTime = Math.round(this.player.currentTime())
172 172
173 // No need to update 173 // No need to update
174 if (currentTime === lastCurrentTime) return 174 if (currentTime === lastCurrentTime) return