[Android] PiP: screen off shouln't set pip to false

Duncan McNamara git at videolan.org
Thu Sep 5 09:32:53 UTC 2024


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Thu Aug 22 14:07:24 2024 +0200| [cfe99e5419b39a7e9c8b8e811403c75edb14a7cf] | committer: Nicolas Pomepuy

PiP: screen off shouln't set pip to false

In the onStop of the VideoPlayerActivity, isInPiPMode is set to off so
that when reopening the player, it resumes normally.

If the PiP is running, and the screen is turned off, onStop will be
called, and when turning the screen on, the player will resume with
isInPipMode false, but PiP actually not running which triggers the
HUD. Checking in the onStop if the screen is off stops PiP from
being disabled.

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

 .../vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt  | 3 ++-
 1 file changed, 2 insertions(+), 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 705a5ca125..daa4dc3c22 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
@@ -917,7 +917,8 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
         cleanUI()
         stopPlayback()
         service?.playlistManager?.videoStatsOn?.postValue(false)
-        service?.isInPiPMode?.value = false
+        if (isInteractive)
+            service?.isInPiPMode?.value = false
 
         if (savedTime != -1L) settings.putSingle(VIDEO_RESUME_TIME, savedTime)
 



More information about the Android mailing list