mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-25 22:29:45 +03:00
use eof-reached
for autoplay
This commit is contained in:
parent
7b2f0bf107
commit
e9a1d7f542
1 changed files with 8 additions and 9 deletions
|
@ -1270,18 +1270,17 @@ class PlayerActivity :
|
|||
"pause" -> {
|
||||
if (!isFinishing) {
|
||||
setAudioFocus(value)
|
||||
|
||||
if (player.timePos != null && player.duration != null) {
|
||||
animationHandler.removeCallbacks(nextEpisodeRunnable)
|
||||
val isVideoEof = MPVLib.getPropertyBoolean("eof-reached") == true
|
||||
val isVideoCompleted = isVideoEof || (player.timePos!! >= player.duration!!)
|
||||
if (isVideoCompleted && preferences.autoplayEnabled().get()) {
|
||||
animationHandler.postDelayed(nextEpisodeRunnable, 1000L)
|
||||
}
|
||||
}
|
||||
updatePlaybackStatus(value)
|
||||
}
|
||||
}
|
||||
"eof-reached" -> endFile(value)
|
||||
}
|
||||
}
|
||||
|
||||
private fun endFile(eofReached: Boolean) {
|
||||
animationHandler.removeCallbacks(nextEpisodeRunnable)
|
||||
if (eofReached && preferences.autoplayEnabled().get()) {
|
||||
animationHandler.postDelayed(nextEpisodeRunnable, 1000L)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue