Fix mpv player crashing on exiting the player when the file has finished playing (#251)

This commit is contained in:
Jarne Demeulemeester 2023-01-28 14:44:48 +01:00 committed by GitHub
parent 8c17259072
commit 6e5e3f0788
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -209,7 +209,7 @@ class MPVPlayer(
when (property) {
"eof-reached" -> {
if (value && isPlayerReady) {
if (currentIndex < (internalMediaItems.size)) {
if (currentIndex < (internalMediaItems.size - 1)) {
currentIndex += 1
prepareMediaItem(currentIndex)
play()