Skip to content

Commit

Permalink
Merge pull request #6588 from Relwi/fix/next-video-with-autoplay-off
Browse files Browse the repository at this point in the history
fix: click on video playlist won't load if autoplay is off
  • Loading branch information
Bnyro authored Oct 4, 2024
2 parents a2e09ce + bf3519d commit b94ad14
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
(videoStream?.height ?: 0) > (videoStream?.width ?: 0)

PlayingQueue.setOnQueueTapListener { streamItem ->
streamItem.url?.toID()?.let { playNextVideo(it) }
streamItem.url?.toID()?.let { playNextVideo(it, true) }
}

// hide the button to skip SponsorBlock segments manually
Expand Down Expand Up @@ -1042,13 +1042,13 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
/**
* Can be used for autoplay and manually skipping to the next video.
*/
private fun playNextVideo(nextId: String? = null) {
private fun playNextVideo(nextId: String? = null, isOnQueueClick: Boolean = false) {
if (nextId == null && PlayingQueue.repeatMode == Player.REPEAT_MODE_ONE) {
viewModel.player.seekTo(0)
return
}

if (!PlayerHelper.isAutoPlayEnabled(playlistId != null)) return
if (!PlayerHelper.isAutoPlayEnabled(playlistId != null) && !isOnQueueClick) return

// save the current watch position before starting the next video
saveWatchPosition()
Expand Down

0 comments on commit b94ad14

Please sign in to comment.