[Android] VideoPlayer: fix playback in background regression

Duncan McNamara git at videolan.org
Fri Apr 11 07:42:57 UTC 2025


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Tue Apr  8 14:36:12 2025 +0200| [6fe7bf3123f35c19a6ef8f4503ffacc3a5c95a77] | committer: Nicolas Pomepuy

VideoPlayer: fix playback in background regression

The video player should switch to audio only if it is not the system pip
(if not pressing the cross to kill it, will keep audio running) or if
the screen is off.

The previous condition stopped the player from switching to audio when
 playback in background was enabled

Regression introduced in 95bb1f3a5bfc49d758ddb3ea7ed2a01e929f31ee

Fixes #3200

> https://code.videolan.org/videolan/vlc-android/commit/6fe7bf3123f35c19a6ef8f4503ffacc3a5c95a77
---

 .../vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index 8d80ca6de8..9992ce5eb5 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -973,7 +973,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
         val isSystemPip = (service?.isInPiPMode?.value ?: false) && !isPlayingPopup
         if (displayManager.isPrimary && !isFinishing && service?.isPlaying == true
                 && "1" == settings.getString(KEY_VIDEO_APP_SWITCH, "0") && !PlaybackService.hasRenderer()
-                && ((!isSystemPip && isInteractive) || (isSystemPip && !isInteractive))) {
+                && (!isSystemPip || !isInteractive)) {
             switchToAudioMode(false)
         }
         cleanUI()



More information about the Android mailing list