1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-06-24 21:25:23 +00:00

Resume on video end now restarts the video.

This commit is contained in:
Koen 2024-01-06 22:50:37 +01:00
parent 84c6c42349
commit 48cf03f78b

View file

@ -180,6 +180,8 @@ class PlayerActivity : AppCompatActivity() {
} else { } else {
state = 2 state = 2
} }
} else if (_exoPlayer.playbackState == ExoPlayer.STATE_ENDED) {
state = 2
} else { } else {
state = 0 state = 0
} }
@ -447,6 +449,10 @@ class PlayerActivity : AppCompatActivity() {
} }
fun resume() { fun resume() {
if (_exoPlayer.playbackState == ExoPlayer.STATE_ENDED && _exoPlayer.duration - _exoPlayer.currentPosition < 1000) {
_exoPlayer.seekTo(0)
}
_exoPlayer.play() _exoPlayer.play()
} }