[Android] Video player: Check layout nullity on popup switch
Geoffrey Métais
git at videolan.org
Tue Jan 29 09:43:58 CET 2019
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jan 29 09:43:00 2019 +0100| [9ea5823113291e0422edb304a2448c755655ed0e] | committer: Geoffrey Métais
Video player: Check layout nullity on popup switch
> https://code.videolan.org/videolan/vlc-android/commit/9ea5823113291e0422edb304a2448c755655ed0e
---
vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 2 +-
1 file changed, 1 insertion(+), 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 161dd63c0..4e07e6484 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -492,7 +492,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
if (mw == null || !AndroidDevices.pipAllowed) return;
if (AndroidDevices.hasPiP) {
if (AndroidUtil.isOOrLater) try {
- final SurfaceView videoSurface = mVideoLayout.findViewById(R.id.surface_video);
+ final SurfaceView videoSurface = (SurfaceView) (mVideoLayout != null ? mVideoLayout.findViewById(R.id.surface_video) : null);
final int height = videoSurface != null && videoSurface.getHeight() != 0 ? videoSurface.getHeight() : mw.getHeight();
final int width = Math.min(videoSurface != null && videoSurface.getWidth() != 0 ? videoSurface.getWidth() : mw.getWidth(), (int) (height*2.39f));
enterPictureInPictureMode(new PictureInPictureParams.Builder().setAspectRatio(new Rational(width, height)).build());
More information about the Android
mailing list