[Android] PiP: Update AR on video change
Geoffrey Métais
git at videolan.org
Fri Dec 20 16:55:50 CET 2019
vlc-android | branch: 3.2.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Dec 20 14:34:14 2019 +0000| [3d4cb224cc3ae3ad9a6a3f8d6d6bef2dc8ecef3c] | committer: Geoffrey Métais
PiP: Update AR on video change
Fix #1138
(cherry picked from commit 5cd908b7b1cfd8046f1340a47e754a00129f58fa)
> https://code.videolan.org/videolan/vlc-android/commit/3d4cb224cc3ae3ad9a6a3f8d6d6bef2dc8ecef3c
---
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 6787c5b58..99f7985cf 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -1564,6 +1564,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