Skip to content Skip to sidebar Skip to footer

How To Get Hardware Key Option To Center Of Screen

How to get the pause play forward button option to center of the screen in MediaPlayer but by default it shows at the bottom of the screen. Here I am using videoView in fullscreen

Solution 1:

You can use custom MediaController or set it position by

mediaController.setPadding(0, 0, 0, px); 

Refer this

You can also use setAnchorView which will reposition controller below particular anchor view, but in your case that won't be possible.

Hope this helps.

Solution 2:

we can get key options any where in the fullscreen in videoview by below:

DisplayMetricsmetrics= getApplicationContext().getResources().getDisplayMetrics();
        intscreenWidthPx= (metrics.widthPixels);
     intscreenHeightPx= (metrics.heightPixels);
 MediaControllermediaController=newMediaController(Activity.this);
  mediaController.setPadding(0, 0, 0, screenHeightPx );

screenHeightPx : you can adjust it where ever you want in the screen.

Hope this helps.

Post a Comment for "How To Get Hardware Key Option To Center Of Screen"