mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-29 09:39:03 +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" -> {
|
"pause" -> {
|
||||||
if (!isFinishing) {
|
if (!isFinishing) {
|
||||||
setAudioFocus(value)
|
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)
|
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