[Android] PiP: Update AR on video change
Geoffrey Métais
git at videolan.org
Fri Dec 20 16:55:22 CET 2019
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Dec 20 15:34:14 2019 +0100| [5cd908b7b1cfd8046f1340a47e754a00129f58fa] | committer: Geoffrey Métais
PiP: Update AR on video change
Fix #1138
> https://code.videolan.org/videolan/vlc-android/commit/5cd908b7b1cfd8046f1340a47e754a00129f58fa
---
vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index 6b73f672c..3d844fd9c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -1566,6 +1566,11 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
observeDownloadedSubtitles()
optionsDelegate?.setup()
settings.edit().remove(VIDEO_PAUSED).apply()
+ if (isInPictureInPictureMode && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ val track = service?.playlistManager?.player?.mediaplayer?.currentVideoTrack ?: return
+ val ar = Rational(track.width.coerceAtMost((track.height * 2.39f).toInt()), track.height)
+ setPictureInPictureParams(PictureInPictureParams.Builder().setAspectRatio(ar).build())
+ }
}
private fun encounteredError() {
More information about the Android
mailing list