Video view is not full screen in landscape mode

六眼飞鱼酱① 提交于 2019-12-03 20:24:42

Are you sure that it is not filling up the screen. it works fine for me. Here is the xml file,

main.xml

<?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/video"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
       android:layout_alignParentRight="true"
       android:layout_alignParentBottom="true"
       android:layout_alignParentTop="true"
        />
</RelativeLayout>

onCreate()

VideoView video=null;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    video=(VideoView)findViewById(R.id.video);
    video.setVideoURI(Uri.parse("http://www.pocketjourney.com/downloads/pj/video/famous.3gp"));
    video.start();
}

ScreenShot for Portrait mode

Screenshot for Landscape Mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!