Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to Remove white space while streaming video in videoview?

I am trying to stream video in video view over HTTP. and my code is as shown below. I am getting a white space between the video. I want to play video in whole screen ... can anyone suggest what to do?

MediaController mc = new MediaController(VideoViewActivity.this);
mc.setAnchorView(mVideoView);
mc.setMediaPlayer(mVideoView);
Uri video = Uri.parse(path);
mVideoView.requestFocus();
mVideoView.setMediaController(mc);
mVideoView.setVideoURI(video);
mVideoView.start();

This is how i have coded to play the video. Below Image shows while space. image of videoview with white stripe

like image 380
Kruti Mevada Avatar asked Sep 09 '11 09:09

Kruti Mevada


People also ask

How do I make Android videos full screen?

Tap the video you'd like to watch. At the bottom of the video player, tap full screen .

What is video view in android?

android.widget.VideoView. Displays a video file. The VideoView class can load images from various sources (such as resources or content providers), takes care of computing its measurement from the video so that it can be used in any layout manager, and provides various display options such as scaling and tinting.

Which view class should be used to display video in Android?

By the help of MediaController and VideoView classes, we can play the video files in android.


1 Answers

Set this for your VideoView

    android:layout_alignParentTop="true"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentRight="true"
like image 81
Hruskozrout Avatar answered Oct 25 '22 04:10

Hruskozrout