[Android] Enable background video playback on TV

Geoffrey Métais git at videolan.org
Thu Jul 9 15:48:19 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jul  9 14:49:16 2015 +0200| [d6fb6156255487fca583f1c4286623309d3596df] | committer: Geoffrey Métais

Enable background video playback on TV

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=d6fb6156255487fca583f1c4286623309d3596df
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index f362e40..76052dd 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -528,6 +528,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             setRequestedOrientation(mScreenOrientationLock);
     }
 
+    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
     @Override
     protected void onPause() {
         super.onPause();
@@ -541,6 +542,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         /* Stop the earliest possible to avoid vout error */
         if (isFinishing())
             stopPlayback();
+        else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
+            requestVisibleBehind(true);
     }
 
     @Override



More information about the Android mailing list