[Android] PiP: set opening Pop-Up player to leave the app

Duncan McNamara git at videolan.org
Thu Sep 5 08:07:05 UTC 2024


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Wed Aug 14 11:24:02 2024 +0200| [7cab5c296fb123397d40702a85346230f35ce9b3] | committer: Nicolas Pomepuy

PiP: set opening Pop-Up player to leave the app

When opening PiP / Pop-Up player through the Videoplayer's menu doesnt
leave the app, but open's the pip player in the video section. This
means the user then has to press home to leave the app. This takes the
user home directly when pressing the Pop-Up player button.

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

 .../src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt        | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
index 8f0f0c9a09..1e0db46701 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
@@ -2,6 +2,7 @@ package org.videolan.vlc.gui.helpers
 
 import android.annotation.SuppressLint
 import android.content.DialogInterface
+import android.content.Intent
 import android.support.v4.media.session.PlaybackStateCompat
 import android.view.Gravity
 import android.view.LayoutInflater
@@ -200,6 +201,10 @@ class PlayerOptionsDelegate(val activity: FragmentActivity, val service: Playbac
             }
             ID_POPUP_VIDEO -> {
                 (activity as VideoPlayerActivity).switchToPopup()
+                val startMain = Intent(Intent.ACTION_MAIN)
+                startMain.addCategory(Intent.CATEGORY_HOME)
+                startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+                activity.startActivity(startMain)
                 hide()
             }
             ID_REPEAT -> setRepeatMode()



More information about the Android mailing list