By using android VideoView
can't display the complete width of video at the screen. Right side of the screen displays the background image. That means 75% of screen width (left side) displays the video and other 25% of the screen (right side) displays the background image.
Below is my code.
MainActivity.java
final VideoView videoView =(VideoView)child.findViewById(R.id.video_player);
MediaController mediaController= new MediaController(this);
mediaController.setAnchorView(videoView);
Uri uri=Uri.parse("http://www.androidbegin.com/tutorial/AndroidCommercial.3gp");
videoView.setMediaController(mediaController);
videoView.setVideoURI(uri);
videoView.requestFocus();
videoView.start();
activity_main.xml
<LinearLayout
android:layout_height="200dp"
android:orientation="vertical"
android:layout_width="match_parent">
<VideoView
android:id="@+id/video_player"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
How to display the full width of video in android-video view
?