I have a VideoView which I want to use to play a movieclip. I use it like this to play it and it works.
VideoView vv = new VideoView(this);
vv.setVideoURI(Uri.parse("android.resource://cortex2.hcbj/raw/intro"));
setContentView(vv);
vv.start();
However I see a black flash just before and after the movie clip. The flash in itself isn't a big problem, but the blackness of it is. The background is white, so if the flash is white, or if it dissapears it will be okay.
My workaround for this diabolical bug utilised a blank View with the background colour of choice over the top of the VideoView.
then in my code I did this:
That got rid of the beginning black flash for me. Then for the end black flash, I did this:
There is one alternative that you are use media controller for this. Here is sample code
Try this.
i had the same problem and white instead of black was ok for me.. i tried all of solutions above i came up with the following
and delayed my video 400 ms start fading from white works like a charm for me
Why not using Styling and Themes
Can you try this ? This might help
colors.xml
styles.xml
To set a theme for all the activities of your application, open the AndroidManifest.xml file and edit the tag to include the android:theme attribute with the style name.
My variation on the @tommyd theme:
Set the drawable to a static video frame, then spam the message queue. After some time, clear the drawable so video frames render. Then, before completion, set the static image back.
I had same problem this has worked for me ..
When you want to show video make videoView.setZOrderOnTop(false); and when you want to hide video view just make videoView.setZOrderOnTop(true);