一、新建Empty Activity项目:
二、xml布局文件设计:
添加SurfaceView控件
<SurfaceViewandroid:id="@+id/surfaceView"android:layout_width="match_parent"android:layout_height="match_parent"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintStart_toStartOf="parent"app:layout_constraintTop_toTopOf="parent" />
三、MainActivity实现activity:
MediaPlayer.OnBufferingUpdateListener, MediaPlayer.OnCompletionListener,SurfaceHolder.Callback, MediaController.MediaPlayerControl
1)、生成playvideo(