I'm playing a video in VideoView on Android Studio. The video starts when I click on the video. How can I get it to display the video instead of a black screen before I click the video to start? I also want to make the video full screen when it is clicked and I'm also struggling to do this. Any help would be greatly appreciated, thanks.
LegWorkouts.java
burpeeButton.setOnClickListener(new Button.OnClickListener(){
@Override
public void onClick(View v) {
VideoView mVideoView2 = (VideoView) findViewById(R.id.burpees);
String uriPath = "android.resource://com.delta.object.newandroidproject/"+R.raw.burpees;
Uri uri1 = Uri.parse(uriPath);
mVideoView2.setVideoURI(uri1);
mVideoView2.requestFocus();
mVideoView2.start();
}
});
LegWorkouts.xml
<VideoView
android:id="@+id/burpees"
android:layout_width="80dp"
android:layout_height="131dp"
android:layout_alignStart="@+id/secondJump"
android:layout_below="@+id/secondJump"
android:layout_gravity="center"
android:layout_marginTop="14dp"
android:visibility="visible" />