试试这个
library
对于.m3u8,这将解决您的问题:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.devbrackets.android.exomedia.ui.widget.VideoView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:useDefaultControls="true"/>
</RelativeLayout>
在活动中写下以下代码
private VideoView videoView;
private void setupVideoView() {
videoView = (VideoView)findViewById(R.id.video_view);
videoView.setOnPreparedListener(this);
videoView.setVideoURI(Uri.parse("https://archive.org/download/Popeye_forPresident/Popeye_forPresident_512kb.m3u8"));
}
@Override
public void onPrepared() {
videoView.start();
}