From cf8288b538d7bc70f01c3cd7d6a0e89074c69afd Mon Sep 17 00:00:00 2001 From: GilesMunn Date: Sat, 12 Nov 2022 16:45:52 +0000 Subject: [PATCH] Miniplayer can now restart video if autoplay is not set. --- .../java/com/github/libretube/ui/fragments/PlayerFragment.kt | 4 ++++ 1 file changed, 4 insertions(+) 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 c157a0913..64289add2 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 @@ -306,6 +306,10 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions { if (!exoPlayer.isPlaying) { // start or go on playing binding.playImageView.setImageResource(R.drawable.ic_pause) + if (exoPlayer.playbackState == Player.STATE_ENDED) { + // restart video if finished + exoPlayer.seekTo(0); + } exoPlayer.play() } else { // pause the video