开发者

Android Show MediaController

开发者 https://www.devze.com 2023-01-02 18:48 出处:网络
I am adding MediaController to a VideoView, but it does not show up unless I tap the phone. The controller disappears after a while.

I am adding MediaController to a VideoView, but it does not show up unless I tap the phone. The controller disappears after a while.

Is there a way I can have t开发者_JAVA技巧he MediaController show always?

Thanks Chris


As Default mediacontroller will hide in 3 seconds of user's inactivity. you can set the timeout seconds by

new media controller().show(50000);

check this link


The below code shows MediaController always:

VideoView videoView;   
MediaController mc;  

videoView.setMediaController(new MediaController(this)  
    {
        public void hide()
        {
            System.out.println("HIDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEHELLLOO");
            mc.show();
        }
    });
0

精彩评论

暂无评论...
验证码 换一张
取 消