Skip to content

Commit ad1be01

Browse files
authored
Merge pull request #6593 from Relwi/refactor/next-video-with-autoplay-off
refactor: click on video playlist won't load if autoplay is off
2 parents 1ab57cb + 9ec7e3a commit ad1be01

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
970970
(videoStream?.height ?: 0) > (videoStream?.width ?: 0)
971971

972972
PlayingQueue.setOnQueueTapListener { streamItem ->
973-
streamItem.url?.toID()?.let { playNextVideo(it, true) }
973+
streamItem.url?.toID()?.let { playNextVideo(it) }
974974
}
975975

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

1051-
if (!PlayerHelper.isAutoPlayEnabled(playlistId != null) && !isOnQueueClick) return
1051+
if (!PlayerHelper.isAutoPlayEnabled(playlistId != null) && nextId == null) return
10521052

10531053
// save the current watch position before starting the next video
10541054
saveWatchPosition()

0 commit comments

Comments
 (0)