0

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

XML:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"


    <VideoView
        android:id="@+id/media_video_preview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentBottom="true"
        android:layout_alignParentEnd="true"
    />
</RelativeLayout>

below i had updated my answer which i had tried and got solution for this please have look at it.

Manoj
  • 3,947
  • 9
  • 46
  • 84

2 Answers2

0

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.

Community
  • 1
  • 1
MysticMagicϡ
  • 28,593
  • 16
  • 73
  • 124
0

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

DisplayMetrics metrics = getApplicationContext().getResources().getDisplayMetrics();
        int screenWidthPx = (metrics.widthPixels);
     int screenHeightPx = (metrics.heightPixels);
 MediaController mediaController = new MediaController(Activity.this);
  mediaController.setPadding(0, 0, 0, screenHeightPx );

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

Hope this helps.

Manoj
  • 3,947
  • 9
  • 46
  • 84