Im using Exoplayer for playing the videos in my Android App. I want to place the play/pause button in the middle of the video player view(Like the one in the image below). How to achieve this
Im just inflating a new layout in place of Android default mediaController. Im wondering is it the correct way to get the below kind of image layout
media_controller.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#CC000000"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="4dip"
android:orientation="horizontal">
<ImageButton android:id="@+id/pause"
style="@android:style/MediaButton.Play"
android:layout_gravity="center_horizontal"
android:contentDescription="play/pause" />
<TextView android:id="@+id/time_current"
android:textSize="14sp"
android:textStyle="bold"
android:paddingTop="4dip"
android:paddingLeft="4dip"
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="4dip" />
<SeekBar
android:id="@+id/mediacontroller_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="32dip" />
<TextView android:id="@+id/time"
android:textSize="14sp"
android:textStyle="bold"
android:paddingTop="4dip"
android:paddingRight="4dip"
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="4dip" />
</LinearLayout>
ImageButton
is the button you were trying to add? – Bartek Lipinski