diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2018-01-08 22:59:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-08 22:59:01 +0100 |
commit | b1c212c2fc62b96f272fc0cedf683018ff312801 (patch) | |
tree | 8eb43238f372ddb17b1158c46c713a2a9323ef3b /app | |
parent | 0c662530b9dbf2f3f0adffed4f539e1476956b19 (diff) | |
parent | 32215ffc2890d8b392838e4ab5c04271390144e4 (diff) | |
download | AntennaPod-b1c212c2fc62b96f272fc0cedf683018ff312801.zip |
Merge pull request #2525 from dirkmueller/video_aspect
Set video aspect on initial creation
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java index 8531a7356..fb5c4d273 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -152,16 +152,9 @@ public class VideoplayerActivity extends MediaplayerActivity { @Override protected void onAwaitingVideoSurface() { + setupVideoAspectRatio(); if (videoSurfaceCreated && controller != null) { Log.d(TAG, "Videosurface already created, setting videosurface now"); - - Pair<Integer, Integer> videoSize = controller.getVideoSize(); - if (videoSize != null && videoSize.first > 0 && videoSize.second > 0) { - Log.d(TAG, "Width,height of video: " + videoSize.first + ", " + videoSize.second); - videoview.setVideoSize(videoSize.first, videoSize.second); - } else { - Log.e(TAG, "Could not determine video size"); - } controller.setVideoSurface(videoview.getHolder()); } } @@ -199,6 +192,18 @@ public class VideoplayerActivity extends MediaplayerActivity { videoControlsHider.start(); } + private void setupVideoAspectRatio() { + if (videoSurfaceCreated && controller != null) { + Pair<Integer, Integer> videoSize = controller.getVideoSize(); + if (videoSize != null && videoSize.first > 0 && videoSize.second > 0) { + Log.d(TAG, "Width,height of video: " + videoSize.first + ", " + videoSize.second); + videoview.setVideoSize(videoSize.first, videoSize.second); + } else { + Log.e(TAG, "Could not determine video size"); + } + } + } + private void toggleVideoControlsVisibility() { if (videoControlsShowing) { getSupportActionBar().hide(); @@ -247,7 +252,7 @@ public class VideoplayerActivity extends MediaplayerActivity { Log.e(TAG, "Couldn't attach surface to mediaplayer - reference to service was null"); } } - + setupVideoAspectRatio(); } @Override |