From 6942b61061c3c9f180ecfe643376896987d8f026 Mon Sep 17 00:00:00 2001 From: quirkyfiesta-glitch Date: Thu, 5 Nov 2026 09:14:29 +0530 Subject: [PATCH 1/2] fix: respect autoplay preference and control visibility --- .../xyz/mpv/rex/ui/player/PlayerActivity.kt | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/src/main/kotlin/xyz/mpv/rex/ui/player/PlayerActivity.kt b/app/src/main/kotlin/xyz/mpv/rex/ui/player/PlayerActivity.kt index 79c9644c8..0bd261af5 100644 --- a/app/src/main/kotlin/xyz/mpv/rex/ui/player/PlayerActivity.kt +++ b/app/src/main/kotlin/xyz/mpv/rex/ui/player/PlayerActivity.kt @@ -323,14 +323,15 @@ class PlayerActivity : webSubtitlesJob = null if (!isQualitySwitching) { - if ( - isAutoplayNextTriggered || - !playerPreferences.autoplayOnOpen.get() || - playerPreferences.showControlsOnPlay.get() - ) { - viewModel.showControls() - } else { - viewModel.hideControls() + if ( + playerPreferences.showControlsOnPlay.get() || + (!isAutoAdvancing && + (isAutoplayNextTriggered || !playerPreferences.autoplayOnOpen.get())) + ) { + viewModel.showControls() + } else { + viewModel.hideControls() + } } playbackStateLoadJob?.cancel() @@ -354,6 +355,7 @@ class PlayerActivity : override fun onFileLoaded() { Log.d(TAG, "onFileLoaded called") lastFileLoadedTimeMs = SystemClock.elapsedRealtime() + val wasAutoAdvancing = isAutoAdvancing isAutoAdvancing = false val preparedState = if (isQualitySwitching) { null @@ -364,7 +366,7 @@ class PlayerActivity : Log.d(TAG, "Ignoring stale FILE_LOADED restoration for generation ${preparedState.generation}") return } - handleFileLoaded(preparedState) + handleFileLoaded(preparedState, wasAutoAdvancing) isReady = true val subs = pendingWebSubtitles @@ -2009,7 +2011,7 @@ class PlayerActivity : * Initializes playback state, loads saved playback data, restores custom settings, * applies user preferences, and sets up metadata and media session. */ - private fun handleFileLoaded(preparedState: PlayerPlaybackStateController.PreparedPlaybackState? = null) { + private fun handleFileLoaded(preparedState: PlayerPlaybackStateController.PreparedPlaybackState? = null, wasAutoAdvancing: Boolean = false) { if (isQualitySwitching) { isQualitySwitching = false val loadedDurationSec = MPVLib.getPropertyDouble("duration") ?: 0.0 @@ -2081,7 +2083,7 @@ class PlayerActivity : val loadedMediaTitle = fileName val loadGeneration = preparedState?.generation ?: playbackLoadGeneration.get() val isPlaylistNavigation = isAutoplayNextTriggered - val shouldAutoplay = playerPreferences.autoplayOnOpen.get() || isAutoplayNextTriggered + val shouldAutoplay = playerPreferences.autoplayOnOpen.get() || wasAutoAdvancing isAutoplayNextTriggered = false isAutoAdvancing = false From 8350b771b7bbc8aea1e1c874473694902ece0f66 Mon Sep 17 00:00:00 2001 From: quirkyfiesta-glitch Date: Thu, 5 Nov 2026 09:34:32 +0530 Subject: [PATCH 2/2] clean-up --- app/src/main/kotlin/xyz/mpv/rex/ui/player/PlayerActivity.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/kotlin/xyz/mpv/rex/ui/player/PlayerActivity.kt b/app/src/main/kotlin/xyz/mpv/rex/ui/player/PlayerActivity.kt index 0bd261af5..19665660c 100644 --- a/app/src/main/kotlin/xyz/mpv/rex/ui/player/PlayerActivity.kt +++ b/app/src/main/kotlin/xyz/mpv/rex/ui/player/PlayerActivity.kt @@ -332,7 +332,6 @@ class PlayerActivity : } else { viewModel.hideControls() } - } playbackStateLoadJob?.cancel() activePlaybackLoadState = pendingPlaybackLoadStates.poll()