I have a stranger problem using VideoView.
Using some .mp4 (coded using ffmpeg) video i have this problem:
The video is stretch to cover all screen-width.
But using .mp4 video coded using a different software(i don't remember it) the result is:
The aspect ratio is preserved.
This is my layout XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/allenamento_activity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<VideoView
android:id="@+id/videoView"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="2dp"
android:layout_gravity="center">
</VideoView>
<---- OTHER XML CODE ------>
</LinearLayout>
</ScrollView>
</RelativeLayout>
How can i prevent the stretching of the video?