]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/shared/peertube/peertube-plugin.ts
Bumped to version v5.2.1
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / shared / peertube / peertube-plugin.ts
index da9b3bd0ea2553b1be3c9a9864cfd672a0332a5d..af21477491444b5192183a1b528d43f7ef89317b 100644 (file)
@@ -180,8 +180,10 @@ class PeerTubePlugin extends Plugin {
     })
 
     this.player.on('seeked', () => {
-      // Don't take into account small seek events
-      if (Math.abs(this.player.currentTime() - lastCurrentTime) < 3) return
+      const diff = Math.floor(this.player.currentTime()) - lastCurrentTime
+
+      // Don't take into account small forwards
+      if (diff > 0 && diff < 3) return
 
       lastViewEvent = 'seek'
     })
@@ -216,7 +218,7 @@ class PeerTubePlugin extends Plugin {
       saveVideoWatchHistory(this.videoUUID, currentTime)
     }
 
-    if (!this.videoViewUrl) return
+    if (!this.videoViewUrl) return Promise.resolve(true)
 
     const body: VideoView = { currentTime, viewEvent }