VideoView black flash before and after playing

前端 未结 14 2218
谎友^
谎友^ 2020-12-09 04:04

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(Ur         


        
14条回答
  •  执念已碎
    2020-12-09 04:32

    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

    vv.setBackgroundColor(Color.WHITE);
    vv.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        vv.setVideoURI(videoUri);
                    }
                }, 100);
    vv.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        vv.setBackgroundColor(Color.TRANSPARENT);
                    }
                }, 300);
                vv.requestFocus();
                vv.start();
    

    and delayed my video 400 ms start fading from white works like a charm for me

提交回复
热议问题