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() } }