[Android] VideoPlayer: bg playback with secondary display

Geoffrey Métais git at videolan.org
Fri Dec 7 17:02:52 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Dec  7 17:01:13 2018 +0100| [f4fe6460e569fc47a30a1d56b1ab59f3966e8055] | committer: Geoffrey Métais

VideoPlayer: bg playback with secondary display

Allow to continue video playback while multitasking when a secondary
display is detected

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

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

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 411b845e0..634072841 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -49,7 +49,6 @@ import android.util.Log;
 import android.util.Rational;
 import android.view.Display;
 import android.view.KeyEvent;
-import android.view.Menu;
 import android.view.MenuItem;
 import android.view.MotionEvent;
 import android.view.Surface;
@@ -724,7 +723,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
     private void stopPlayback() {
         if (!mPlaybackStarted) return;
 
-        if (mDisplayManager.isOnRenderer() && !isFinishing()) {
+        if (!mDisplayManager.isPrimary() && !isFinishing()) {
             mPlaybackStarted = false;
             return;
         }
@@ -773,7 +772,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
         /* Stop listening for changes to media routes. */
         if (!mIsBenchmark) mDisplayManager.removeMediaRouterCallback();
 
-        mService.getMediaplayer().detachViews();
+        if (!mDisplayManager.isSecondary()) mService.getMediaplayer().detachViews();
 
         mActionBarView.setOnTouchListener(null);
     }



More information about the Android mailing list