From 05f01702480b178f5540896e8e28cefb92afc440 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Fri, 26 Aug 2022 17:53:22 +0200 Subject: [PATCH] don't seek to watch position when end of video --- .../main/java/com/github/libretube/fragments/PlayerFragment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt index 17510910a..8248595e0 100644 --- a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt @@ -981,7 +981,8 @@ class PlayerFragment : BaseFragment() { Thread { try { position = DatabaseHolder.db.watchPositionDao().findById(videoId!!).position - if (position!! < streams.duration!! * 0.9) position = null + // position is almost the end of the video => don't seek, start from beginning + if (position!! > streams.duration!! * 1000 * 0.9) position = null } catch (e: Exception) { } }.await()