[Android] TV: Open video player with video nowplaying card
Geoffrey Métais
git at videolan.org
Thu Feb 9 13:46:59 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb 9 13:34:48 2017 +0100| [296142bcd12073f37cfcac298dc76c3ac665c8be] | committer: Geoffrey Métais
TV: Open video player with video nowplaying card
> https://code.videolan.org/videolan/vlc-android/commit/296142bcd12073f37cfcac298dc76c3ac665c8be
---
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..ed47358 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 = new Intent(this, VideoPlayerActivity.class);
+ 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