Fullscreen VideoView in landscape mode

Rahul Matte picture Rahul Matte · Jun 13, 2014 · Viewed 9.8k times · Source

I wish to make VideoView into full screen in landscape mode. I tried this. It shows a margin from left and right. I want to know how I can make the VideoView fullscreen.

My .xml file

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

    <VideoView
        android:id="@+id/videoViewN"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true" />
</RelativeLayout>

Answer

MysticMagicϡ picture MysticMagicϡ · Jun 13, 2014

You may add theme to the activity in manifest file:

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

And for VideoView in xml, change

android:layout_height="wrap_content"

to

android:layout_height="fill_parent"

This will help you achieve fullscreen in video view. Hope it helps.