[Android] Manage viewpoint with DPAD

Geoffrey Métais git at videolan.org
Thu Dec 1 16:46:26 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Dec  1 16:46:04 2016 +0100| [2fc6acc0ede9d3c17aa9f17e3018b2b0fd084b0b] | committer: Geoffrey Métais

Manage viewpoint with DPAD

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

 .../videolan/vlc/gui/video/VideoPlayerActivity.java | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 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 6367a48..097ded8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1171,7 +1171,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             }
             return true;
         }
-        if (mShowing || keyCode == KeyEvent.KEYCODE_DPAD_DOWN)
+        if (mShowing || (mFov == 0f && keyCode == KeyEvent.KEYCODE_DPAD_DOWN))
             showOverlayTimeout(OVERLAY_TIMEOUT);
         switch (keyCode) {
         case KeyEvent.KEYCODE_F:
@@ -1228,20 +1228,33 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             return true;
         case KeyEvent.KEYCODE_DPAD_LEFT:
             if (!mShowing) {
-                seekDelta(-10000);
+                if (mFov == 0f)
+                    seekDelta(-10000);
+                else
+                    mService.updateViewpoint(-5f, 0f, 0f, 0f, false);
                 return true;
             }
         case KeyEvent.KEYCODE_DPAD_RIGHT:
             if (!mShowing) {
-                seekDelta(10000);
+                if (mFov == 0f)
+                    seekDelta(10000);
+                else
+                    mService.updateViewpoint(5f, 0f, 0f, 0f, false);
                 return true;
             }
         case KeyEvent.KEYCODE_DPAD_UP:
             if (!mShowing) {
-                showAdvancedOptions();
+                if (mFov == 0f)
+                    showAdvancedOptions();
+                else
+                    mService.updateViewpoint(0f, -5f, 0f, 0f, false);
                 return true;
             }
         case KeyEvent.KEYCODE_DPAD_DOWN:
+            if (!mShowing && mFov != 0f) {
+                mService.updateViewpoint(0f, 5f, 0f, 0f, false);
+                return true;
+            }
         case KeyEvent.KEYCODE_DPAD_CENTER:
             if (!mShowing) {
                 doPlayPause();



More information about the Android mailing list