From 9f382163d83c3331518e2784b335da28179ac91d Mon Sep 17 00:00:00 2001 From: lovegaoshi <106490582+lovegaoshi@users.noreply.github.com> Date: Thu, 18 Jul 2024 01:53:50 -0700 Subject: [PATCH] fix(android): resize mode cover calculation (#4010) --- .../java/com/brentvatne/exoplayer/AspectRatioFrameLayout.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/src/main/java/com/brentvatne/exoplayer/AspectRatioFrameLayout.kt b/android/src/main/java/com/brentvatne/exoplayer/AspectRatioFrameLayout.kt index 834e5e0c..c26745fe 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/AspectRatioFrameLayout.kt +++ b/android/src/main/java/com/brentvatne/exoplayer/AspectRatioFrameLayout.kt @@ -75,9 +75,9 @@ class AspectRatioFrameLayout(context: Context) : FrameLayout(context) { // Scale video if it doesn't fill the measuredWidth if (width < measuredWidth) { - val scaleFactor: Int = measuredWidth / width - width *= scaleFactor - height = measuredHeight * scaleFactor + val scaleFactor: Float = measuredWidth.toFloat() / width + width = (scaleFactor * width).toInt() + height = (scaleFactor * height).toInt() } }