From 889c2533931ded39cc78f6b1080c161fa33f0a35 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Mon, 18 Nov 2024 16:30:42 +0100 Subject: [PATCH] fix: video aspect ratio ignored when playing videos offline --- .../libretube/ui/activities/OfflinePlayerActivity.kt | 12 +++++------- .../github/libretube/ui/views/CustomExoPlayerView.kt | 2 ++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/github/libretube/ui/activities/OfflinePlayerActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/OfflinePlayerActivity.kt index bd61ee4d0c..87050d8919 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/OfflinePlayerActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/OfflinePlayerActivity.kt @@ -71,18 +71,16 @@ class OfflinePlayerActivity : BaseActivity() { playerBinding.duration.text = DateUtils.formatElapsedTime( player.duration / 1000 ) - - if (events.contains(Player.EVENT_TRACKS_CHANGED)) { - requestedOrientation = PlayerHelper.getOrientation( - playerController.videoSize.width, - playerController.videoSize.height - ) - } } override fun onIsPlayingChanged(isPlaying: Boolean) { super.onIsPlayingChanged(isPlaying) + requestedOrientation = PlayerHelper.getOrientation( + playerController.videoSize.width, + playerController.videoSize.height + ) + if (PlayerHelper.pipEnabled) { PictureInPictureCompat.setPictureInPictureParams( this@OfflinePlayerActivity, diff --git a/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt b/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt index fe2015207a..fa34cbf3d5 100644 --- a/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt +++ b/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt @@ -260,6 +260,8 @@ abstract class CustomExoPlayerView( binding.queueToggle.setOnClickListener { PlayingQueueSheet().show(supportFragmentManager, null) } + + updateMarginsByFullscreenMode() } /**