From 7815dc450ea9f8fd63e2234b6215013a132e6229 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 10 May 2023 14:23:59 +0200 Subject: Prevent invalid end watch section warnings --- client/src/assets/player/shared/peertube/peertube-plugin.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'client/src/assets/player/shared/peertube/peertube-plugin.ts') diff --git a/client/src/assets/player/shared/peertube/peertube-plugin.ts b/client/src/assets/player/shared/peertube/peertube-plugin.ts index cf96b33ba..af2147749 100644 --- a/client/src/assets/player/shared/peertube/peertube-plugin.ts +++ b/client/src/assets/player/shared/peertube/peertube-plugin.ts @@ -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' }) -- cgit v1.2.3