Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the black screen that apper before playing the mp4 Video?

I am playing the MP4 in android phone with the below code:

VideoView videoView = (VideoView) findViewById(R.id.VideoView);
        //  Set video link (mp4 format )
        File file2 = new File("/sdcard/Alone.mp4");
        Uri video = Uri.fromFile(file2);

        videoView.setVideoURI(video);
        videoView.start();

But while i playing this video, before starting of that video i seen one black screen for 0.2 or 0.3 second.

I dont want that black screen to appear.

So for that what should i have to do ? I want is, while i play the video, there should be only screen of the video, no any other black screen should be there before playing it ?

Thanks.

like image 432
Shreyash Mahajan Avatar asked Jan 25 '12 06:01

Shreyash Mahajan


People also ask

Why is my mp4 black screen?

The cause of 'Black Screen' can be due to compression issues or read/write errors or file format changes or corruption or virus attack etc. In all these situations, the world's best video repair software like Stellar Repair for Video can only work like wonders.

Why is there a black screen when I play the video?

What Causes Black Screen When Playing Videos? The corrupted file is the main reason that the windows screen turns black. A variety of factors can cause the issue. This includes header issues, video file transfer errors, issues with the video's codecs, and the list goes on.


1 Answers

My solution to this problem was this line:

videoView.setZOrderOnTop(true);

This changes the black screen with a momentary transparent video. You can easily fix this other issue by setting an ImageView with the first video frame behind the VideoView.

like image 185
willy Avatar answered Oct 16 '22 11:10

willy