Is there anyway I can add a ProgressDialog in VideoView in Android while the video is not showing up yet. Because all I see is black screen until the video plays. I have struggling for almost a week trying to find the solution, please help me I would really appreciate it a lot. Thanks in advance!
Here is the code I am using:
VideoView videoView = (VideoView) findViewById(R.id.VideoView);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
// Set video link (mp4 format )
Uri video = Uri.parse("http://www.yourvideos.mp4");
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
videoView.start();
I didn’t test this but you might add the dialog, and populate it with the percentage fetched by http://developer.android.com/reference/android/widget/MediaController.MediaPlayerControl.html#getBufferPercentage()
use something like a timer to update it every few ms