[Android] Do not start popup on video stopping

Geoffrey Métais git at videolan.org
Mon Jul 31 15:31:16 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jul 31 15:01:10 2017 +0200| [c1f98dabdc79a20abc6c74e6c7cd8ad4a34263d3] | committer: Geoffrey Métais

Do not start popup on video stopping

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

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 4 ++--
 1 file changed, 2 insertions(+), 2 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 9dc4b2421..3e7824d48 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -594,7 +594,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
                     (AndroidUtil.isNougatOrLater && !AndroidUtil.isOOrLater //Video on background on Nougat Android TVs
                             && AndroidDevices.isAndroidTv() && !requestVisibleBehind(true)))
                 stopPlayback();
-            else if (!mShowingDialog && "2".equals(mSettings.getString(PreferencesActivity.KEY_VIDEO_APP_SWITCH, "0")) && isInteractive()) {
+            else if (!isFinishing() && !mShowingDialog && "2".equals(mSettings.getString(PreferencesActivity.KEY_VIDEO_APP_SWITCH, "0")) && isInteractive()) {
                 switchToPopup();
             }
         }
@@ -612,7 +612,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             if (Permissions.canDrawOverlays(this)) {
                 mSwitchingView = true;
                 mSwitchToPopup = true;
-                if (!mService.isPlaying())
+                if (mService != null && !mService.isPlaying())
                     mService.getCurrentMediaWrapper().addFlags(MediaWrapper.MEDIA_PAUSED);
                 cleanUI();
                 exitOK();



More information about the Android mailing list