Fix position when auto-playing next video (#3158)

* Fix position when auto-playing next video
This commit is contained in:
Bnyro 2023-02-22 11:28:16 +01:00 committed by GitHub
parent 5bf5914257
commit 1b0b1e7379
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -913,7 +913,8 @@ class PlayerFragment : Fragment(R.layout.fragment_player), OnlinePlayerOptions {
// save the watch position to the database
// only called when the position is unequal to 0, otherwise it would become reset
// before the player can seek to the saved position from videos of the queue
if (exoPlayer.currentPosition != 0L) saveWatchPosition()
// not called when the video has ended, since it then might save it to the next autoplay video
if (exoPlayer.currentPosition != 0L && playbackState != Player.STATE_ENDED) saveWatchPosition()
// check if video has ended, next video is available and autoplay is enabled.
if (