[Android] 360Video: fix angle control with gestures disabled

Duncan McNamara git at videolan.org
Fri Jan 7 12:18:34 UTC 2022


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Thu Jan  6 17:03:17 2022 +0100| [7d575f1a11720df1beb206ae554fed3466525147] | committer: Nicolas Pomepuy

360Video: fix angle control with gestures disabled

When all gestures are disabled, the code that makes movement
calculations isn't reached, meaning that for a 360 video, the user can't
move. Adding a check for 360 video using the player fov fixes the
condition.

Closes #2297

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

 .../vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
index 59f129cbd..9bedc10be 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
@@ -110,7 +110,8 @@ class VideoTouchDelegate(private val player: VideoPlayerActivity,
                         return true
                     }
                 }
-                if (touchControls == 0 || player.isLocked) {
+                // fov == 0f -> not a 360 video
+                if ((touchControls == 0  && player.fov == 0f) || player.isLocked) {
                     // locked or swipe disabled, only handle show/hide & ignore all actions
                     if (event.action == MotionEvent.ACTION_UP && touchAction != TOUCH_IGNORE) player.overlayDelegate.toggleOverlay()
                     return false



More information about the Android mailing list