[Android] Pip: when reopening app force VideoPlayerActivity
Duncan McNamara
git at videolan.org
Wed Jun 26 12:44:09 UTC 2024
vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Tue Jun 25 13:42:58 2024 +0200| [59435b6b43dab78ff1b7475d4394ecd6afb072f6] | committer: Nicolas Pomepuy
Pip: when reopening app force VideoPlayerActivity
To avoid having PiP in the app, it was decided to reopen the
VideoPlayerActivity in fullscreen when reopening the app and pip is
running.
Fixes #3034
> https://code.videolan.org/videolan/vlc-android/commit/59435b6b43dab78ff1b7475d4394ecd6afb072f6
---
application/vlc-android/src/org/videolan/vlc/StartActivity.kt | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/application/vlc-android/src/org/videolan/vlc/StartActivity.kt b/application/vlc-android/src/org/videolan/vlc/StartActivity.kt
index 638f629216..2fc3412c61 100644
--- a/application/vlc-android/src/org/videolan/vlc/StartActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/StartActivity.kt
@@ -214,8 +214,14 @@ class StartActivity : FragmentActivity() {
startActivity(Intent().apply { component = ComponentName(this at StartActivity, "org.videolan.vlc.webserver.gui.remoteaccess.RemoteAccessShareActivity") })
} else {
val target = idFromShortcut
+ val service = PlaybackService.instance
if (target == R.id.ml_menu_last_playlist)
PlaybackService.loadLastAudio(this)
+ else if (service != null && service.isInPiPMode.value == true) {
+ val startIntent = Intent(this, VideoPlayerActivity::class.java)
+ startIntent.flags = Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
+ startActivity(startIntent)
+ }
else
startApplication(tv, firstRun, upgrade, target, removeOldDevices)
}
More information about the Android
mailing list