Android VideoView fix height issue
<p><strong>XML</strong> file </p>

<pre><code>&lt;RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"&gt;

        &lt;VideoView
            android:id="@+id/video_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true" /&gt;
&lt;/RelativeLayout&gt;
</code></pre>

<p>In Activity I have set width and height programmatically </p>

<pre><code> mVideoView.getLayoutParams().height = screenWidth;
 mVideoView.getLayoutParams().width =  screenWidth;
 mVideoView.requestLayout();
</code></pre>

<p>My issue is when I pick video from gallery which is just captured from default   camera :</p>

<p><strong>If video is captured in portrait mode</strong> it's being stretched</p>

<p><strong>If video is captured in landscape</strong> it automatically resize height to landscape video height </p>

<p>Have tried with custom videoview but didn't work any </p>

<p>Any help would be appreciated Thanks in advance.  </p>