1

Hi I have following Layout:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/myFrameLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/black" >

    <VideoView
        android:id="@+id/myVideoView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="center" >

    </VideoView>    

</FrameLayout>

And somewhere in the Code I start the Video:

        objVideoView.setVideoURI(uriVideo);

        objVideoView.start();   

The Video is displayed correctly in the center of the screen but I have white corners above and below the video.

Whatever I tried (For example adding another Framelayout and make it invisible on Video prepare) it didn't help. Changing the Video Vieo layout to wrap content didn't help either.

I was thinking that it must be a simple thing. The Videoview is a Subview of the Framelayout so there should be no corners because the layout is black. Even with wrapcontent setting.

So I need help.

aqm
  • 142
  • 2
  • 17

1 Answers1

2

Take it in a RelativeLayout and write it as

<VideoView
    android:id="@+id/myVideoView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:alignParentRight="true"
    android:alignParentLeft="true"
    android:alignParentTop="true"
    android:alignParentBottom="true" >