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.
Set this for your VideoView
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
set it programmatically
videoView.setVideoURI(Uri.parse(url))
val metrics = DisplayMetrics()
windowManager.defaultDisplay.getMetrics(metrics)
videoView.layoutParams = RelativeLayout.LayoutParams(metrics.widthPixels, metrics.heightPixels)
videoView.start()
精彩评论