[Android] PiP: Fallback with default parameters
Geoffrey Métais
git at videolan.org
Wed Oct 11 09:50:44 CEST 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Oct 11 09:50:24 2017 +0200| [daeb283858f7c85f05a87483bce7770274b2b41f] | committer: Geoffrey Métais
PiP: Fallback with default parameters
> https://code.videolan.org/videolan/vlc-android/commit/daeb283858f7c85f05a87483bce7770274b2b41f
---
vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 6 +++++-
1 file changed, 5 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 dbcea290a..ff31c4ab7 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -593,7 +593,11 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
public void switchToPopup() {
if (AndroidDevices.hasPiP) {
if (AndroidUtil.isOOrLater)
- enterPictureInPictureMode(new PictureInPictureParams.Builder().setAspectRatio(new Rational(mVideoWidth, mVideoHeight)).build());
+ try {
+ enterPictureInPictureMode(new PictureInPictureParams.Builder().setAspectRatio(new Rational(mVideoWidth, mVideoHeight)).build());
+ } catch (IllegalArgumentException e) { // Fallback with default parameters
+ enterPictureInPictureMode();
+ }
else
//noinspection deprecation
enterPictureInPictureMode();
More information about the Android
mailing list