Skip to content

Commit

Permalink
fix: maximise player when playing new video
Browse files Browse the repository at this point in the history
Fixes a regression from 12be4c7,
where upon trying to play a new video, the player would stay minimised.
Additional, the playing video would be added to the queue, causing the
previously played video to be played again.
This is confusing to users, as it breaks the expectation of the player
opening when trying to play a video.
  • Loading branch information
FineFindus committed Nov 26, 2024
1 parent 386f450 commit 0574f85
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import com.github.libretube.ui.base.BaseActivity
import com.github.libretube.ui.fragments.AudioPlayerFragment
import com.github.libretube.ui.fragments.PlayerFragment
import com.github.libretube.ui.views.SingleViewTouchableMotionLayout
import com.github.libretube.util.PlayingQueue

object NavigationHelper {
private val handler = Handler(Looper.getMainLooper())
Expand Down Expand Up @@ -70,6 +71,9 @@ object NavigationHelper {
val activity = ContextHelper.unwrapActivity<MainActivity>(context)
val attachedToRunningPlayer = activity.runOnPlayerFragment {
this.playNextVideo(videoUrlOrId.toID())
PlayingQueue.clear()
// maximize player
this.binding.playerMotionLayout.transitionToStart()
true
}
if (attachedToRunningPlayer) return
Expand Down

0 comments on commit 0574f85

Please sign in to comment.