I'm an iOS developer porting an iOS app to Android, so bear with me.I have a VideoView that is acting as a "video background". Everything about it is working correctly - except for in portrait view and on orientation change (to portrait view). In the AndroidManifest file, I have my activity setup so that screen orientations do not trigger a layout refresh:
android:configChanges="orientation|screenSize"
This is working correctly; what isn't working correctly is the aspect ratio of the video being played in the VideoView. The video is skewed to fit within the portrait bounds instead of cropping out the left and right sides to maintain aspect ratio. How can I force the VideoView to "aspect-fill" the video in it's container? I should also mention that this VideoView is a subview of a ConstraintView. Here is the applicable XML:
<VideoView
android:layout_width="0dp"
android:layout_height="0dp"
android:id="@+id/videoView2"
app:layout_constraintBottom_toBottomOf="@+id/imageView3"
app:layout_constraintLeft_toLeftOf="@+id/imageView3"
app:layout_constraintRight_toRightOf="@+id/imageView3"
app:layout_constraintTop_toTopOf="@+id/imageView4"
android:scaleType="centerCrop"
android:adjustViewBounds="true"/>