I have been looking for a way to get rid of the nasty black initial screen on a VideoView before the start() method is run.
I have tried with background image on the
Just show a frame from the video as preview.
vSurface.SeekTo(100);
Use svVideoView.seekTo(position).
Give Position within 5 (ms).
onPause():
position=svVideoView.getCurrentPosition()
onResume():
svVideoView.seekTo(position);
see this
VideoView videoView = (VideoView) findViewById(R.id.VideoView);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
Uri video = Uri.parse("android.resource://your_package_name/"+R.raw.monkeysonthebed_video);
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
videoView.start();
Just use VideoView#setBackgroundDrawable(), I think.
initial settings.
VideoView.setBackgroundDrawable(yourdrawableid);
start video
VideoView.start();
VideoView.setBackgroundDrawable(0);
It works for me on both Activity and Fragment.
VideoView mVideo = (VideoView) findViewById(R.id.yourViewViewId);
mVideo.setVideoURI(mUri);
mVideo.setZOrderOnTop(false);
SurfaceHolder surfaceholder = mVideo.getHolder();
surfaceholder.setFormat(PixelFormat.TRANSPARENT);
I had the same problem on Galaxy tab 2, Android 4.1.1.
Do videoView.setZOrderOnTop(true);
and next videoView.start()
It works fine for me.