[Android] Pause video when player loses visibility

Geoffrey Métais git at videolan.org
Fri Aug 7 14:12:33 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Aug  7 13:39:49 2015 +0200| [ad497a70d0779174ed8179a0de5c4b8239da5c95] | committer: Geoffrey Métais

Pause video when player loses visibility

Fixes playpause button not pause video on Android TV launcher

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java      |    6 ++++++
 1 file changed, 6 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 9192011..0881d91 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -548,6 +548,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
     }
 
     @Override
+    public void onVisibleBehindCanceled() {
+        super.onVisibleBehindCanceled();
+        pause();
+    }
+
+    @Override
     public void onConfigurationChanged(Configuration newConfig) {
         if (!AndroidUtil.isHoneycombOrLater())
             changeSurfaceLayout();



More information about the Android mailing list