[Android] video player: allow scale pinch if start state is fit screen

Sébastien Toque git at videolan.org
Tue Sep 25 00:13:53 CEST 2018


vlc-android | branch: master | Sébastien Toque <xilasz at gmail.com> | Tue Sep 25 00:11:44 2018 +0200| [23f13f50869db3f95e4c034f188a96c2471d3c82] | committer: Sébastien Toque

video player: allow scale pinch if start state is fit screen

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

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

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 46fa70b88..103813615 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -174,7 +174,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
     private PlaylistAdapter mPlaylistAdapter;
     private PlaylistModel mPlaylistModel;
 
-    private static final int SURFACE_BEST_FIT = 0;
+    static final int SURFACE_BEST_FIT = 0;
     static final int SURFACE_FIT_SCREEN = 1;
     private static final int SURFACE_FILL = 2;
     private static final int SURFACE_16_9 = 3;
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt b/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
index 93f4352e3..7948350e0 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
@@ -300,6 +300,8 @@ class VideoTouchDelegate(private val player: VideoPlayerActivity,
                 } else if (!grow && savedSize != -1) {
                     player.setVideoSurfacesize(savedSize)
                     savedSize = -1
+                } else if (!grow && player.currentSize == VideoPlayerActivity.SURFACE_FIT_SCREEN) {
+                    player.setVideoSurfacesize(VideoPlayerActivity.SURFACE_BEST_FIT)
                 }
             }
         }



More information about the Android mailing list