From ac5fb5fbb434d96fc140b1c0819c998ef0fbc940 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Tue, 15 Aug 2023 13:05:02 +0200 Subject: [PATCH] fix: restoring playback positions via notification controls --- .../libretube/ui/fragments/PlayerFragment.kt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index f1a98728a..f09881335 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -813,15 +813,14 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { saveWatchPosition() // save the id of the next stream as videoId and load the next video - if (nextVideoId != null) { - videoId = nextVideoId + if (nextVideoId == null) return - // play the next video - playVideo() - - // close comment bottom-sheet for next video - commentsViewModel.commentsSheetDismiss?.invoke() - } + isTransitioning = true + videoId = nextVideoId + // start to play the next video + playVideo() + // close comment bottom sheet for next video + commentsViewModel.commentsSheetDismiss?.invoke() } private fun prepareExoPlayerView() {