[Android] TV: Open video player with video nowplaying card

Geoffrey Métais git at videolan.org
Thu Feb 9 13:35:30 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb  9 13:34:48 2017 +0100| [b64bc858e73be9c5fe1f107c7c48f80ecd81f2a3] | committer: Geoffrey Métais

TV: Open video player with video nowplaying card

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

 vlc-android/src/org/videolan/vlc/PlaybackService.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 04b0249..3682f75 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -934,12 +934,15 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
     }
 
     private PendingIntent getSessionPendingIntent() {
-        if (mVideoBackground || (canSwitchToVideo() && !mMediaList.getMedia(mCurrentIndex).hasFlag(MediaWrapper.MEDIA_FORCE_AUDIO))) {
+        if (mMediaPlayer.getVLCVout().areViewsAttached()) { //PIP
+            final Intent notificationIntent = VideoPlayerActivity.getIntent(Intent.ACTION_VIEW, getCurrentMedia(), false, -1);
+            return PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
+        } if (mVideoBackground || (canSwitchToVideo() && !mMediaList.getMedia(mCurrentIndex).hasFlag(MediaWrapper.MEDIA_FORCE_AUDIO))) { //resume video playback
             /* Resume VideoPlayerActivity from ACTION_REMOTE_SWITCH_VIDEO intent */
             final Intent notificationIntent = new Intent(ACTION_REMOTE_SWITCH_VIDEO);
             return PendingIntent.getBroadcast(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
         } else {
-            /* Resume AudioPlayerActivity */
+            /* Show audio player */
             final Intent notificationIntent = getPackageManager().getLaunchIntentForPackage(getPackageName());
             notificationIntent.setAction(AudioPlayerContainerActivity.ACTION_SHOW_PLAYER);
             notificationIntent.addCategory(Intent.CATEGORY_LAUNCHER);



More information about the Android mailing list