I use Vitamio library to make a RTSP streaming app for Android phone. Now I need to create a play/pause button for the player. Normally I can just use mVideoView.setMediaController(new MediaController(getActivity()))
to create it, but it will mess up my layout, so I opted to create a custom button instead. I created a button with help from github source :
<ImageButton
android:id="@+id/mediacontroller_play_pause"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:background="@drawable/mediacontroller_button"
android:contentDescription="@string/mediacontroller_play_pause"
android:src="@drawable/mediacontroller_pause" />
now, the hard part is write code to make this button functional. There is code for that function in Vitamio's MediaControlller.java but I can't make it work at all. Help is much appreciated, thanks for reading. Here is a link to the java file for reference.