How to make the MediaController visible throughout my video play

Andro Selva picture Andro Selva · May 6, 2011 · Viewed 8.1k times · Source

I am using MediaController in my app. But unfortunately the MediaController disappears after a time period of 3 secs. But I want my MediaController to be visible until my video plays fully.

How to achieve this.

Answer

Andro Selva picture Andro Selva · May 3, 2012

By default the MediaController hides itself after 3 secs of time. In order to make it visible throughout our video playback we will have to override the hide() of MediaController. I have given the code snippet below.

final MediaController mc = new MediaController(this);
video.setMediaController(new MediaController(this) {
    @Override
    public void hide()
    {
       mc.show();
    }

    }); 

video.setMediaController(mc);