[Android] VideoPlayerActivity: hack to fix lost overlay controls

Edward Wang git at videolan.org
Mon Jul 7 02:57:27 CEST 2014


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Sun Jul  6 20:29:48 2014 -0400| [f32afe5e1d76b4d3ba9c0acddafb81b7221eb05d] | committer: Edward Wang

VideoPlayerActivity: hack to fix lost overlay controls

DVDs are not the only type of media that can contain titles and chapters.

But most other media only have one title (e.g. MKVs) unlike DVDs, so don't hide the overlay for normal files.

A better solution is a button to simply select the title/chapter desired and would work with both DVD and normal media.

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java |   11 +++++++++--
 1 file changed, 9 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 5c3dac6..1d97343 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2229,9 +2229,16 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
 
     private void updateNavStatus() {
         mHasChapters = mLibVLC.getChapterCountForTitle(0) > 1;
-        mIsNavMenu = mHasChapters && mLibVLC.getTitle() == 0;
+        mIsNavMenu = mHasChapters && mLibVLC.getTitle() == 0 && mLibVLC.getTitleCount() > 1;
+        /***
+         * HACK ALERT: assume that any media with >1 titles = DVD with menus
+         * Should be replaced with a more robust title/chapter selection popup
+         */
 
-        Log.e(TAG, "UpdateNavStatus: " + mHasChapters + " " + mIsNavMenu);
+        Log.d(TAG,
+                "updateNavStatus: getChapterCountForTitle(0) = "
+                        + mLibVLC.getChapterCountForTitle(0)
+                        + ", getTitleCount() = " + mLibVLC.getTitleCount());
         if (mIsNavMenu) {
             /*
              * Keep the overlay hidden in order to have touch events directly



More information about the Android mailing list