如果你看过我的《android音乐播放简单实现(MediaPlayer)》,那么本篇将会毫无压力。
首先是主界面的三个按钮和一个播放控件
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.cofox.myplayvideo.MainActivity">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:id="@+id/btnPlay"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Play"
android:textAllCaps="false" />
android:id="@+id/btnPause"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Pause"
android:textAllCaps="false" />
android:id="@+id/btnReplay"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Replay"
android:textAllCaps="false" />
android:id="@+id/vdvwFilm"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
在 MainA