diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt index cc0866b3..8755500b 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt @@ -405,6 +405,7 @@ class PlaybackViewModel enableDirectStream = !forceTranscoding, ) player.prepare() + player.play() this@PlaybackViewModel.chapters.value = Chapter.fromDto(base, api) Timber.v("chapters=${this@PlaybackViewModel.chapters.value?.size}") diff --git a/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvPlayer.kt b/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvPlayer.kt index 5f47aaa9..9f1f738d 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvPlayer.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvPlayer.kt @@ -103,8 +103,7 @@ class MpvPlayer( MPVLib.setOptionString("demuxer-max-back-bytes", "${cacheMegs * 1024 * 1024}") MPVLib.setOptionString("force-window", "no") - // need to idle at least once for playFile() logic to work - MPVLib.setOptionString("idle", "once") + MPVLib.setOptionString("idle", "yes") MPVLib.addObserver(this) MPVProperty.observedProperties.forEach(MPVLib::observeProperty) @@ -201,6 +200,7 @@ class MpvPlayer( if (DEBUG) Timber.v("prepare") durationMs = 0L positionMs = -1L + playbackState = STATE_READY } override fun getPlaybackState(): Int {