I have a video in a videoview that plays and loops as the background of my login/register activity. The video plays and loops fine except it does not cover the entire screen. The activity is locked in portrait mode but the video only displays on the lower half of the screen (as if in landscape mode). The videoview itself does cover the entire screen. This is my current code.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_launcher);
VideoView videoView = (VideoView) findViewById(R.id.launcherVideo);
Uri src = Uri.parse("android.resource://com.package/raw/video");
videoView.setVideoURI(src);
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
mp.setVolume(0, 0);
mp.setLooping(true);
}
});
//videoView.setMediaController(new MediaController(this));
videoView.start();
}
This is my xml
<VideoView
android:id="@+id/launcherVideo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/linearLayout" />
How do I make the video full screen on any size device?