videoview right side white space

Viewed 1534

i can't remove the white space of my video preview i already added all the alignparent but still dont work. it's source is from a server. the video has no white space in it.

here is my layout:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.extras.PermitVideoFrag">

    <VideoView
        android:id="@+id/vid_permit"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_centerHorizontal="true" 
       />
</RelativeLayout>

its really frustrating me now. i can't find a decent answer.

3 Answers

I got stuck at this for more than 3 hrs, finally realised that its all about the resizing of video. I was trying to add videoview of a specific fixed height to my layout and then I got this issue. all it took is setting,

layout_width="wrap_content" 

to videoview and the white space dissapeared.

Related