Video is not showing on VideoView but I can hear its sound

I've tried every method above, but none of them could work.

Finally, I tried to call this function, then the video appeared.

video_view.setZOrderOnTop(true);

Hope this also works for you.


try this :

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <VideoView 
        android:id="@+id/view"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentBottom="true"/>

</RelativeLayout>

it may be help you...


SOLUTION 1:

videoView.setZOrderOnTop(true);

this will set the videoview to the top layer; In other words: block everything under it.

SOLUTION 2:

videoView.setBackgroundColor(Color.TRANSPARENT);

SOLUTION 3:

sometimes this is related about your apptheme; In my case, I changed the apptheme from @style/AppTheme to @android:style/Theme.NoTitleBar.Fullscreen fix my problem.