1.依赖
implementation 'fm.jiecao:jiecaovideoplayer:4.8.3'
implementation 'com.github.bumptech.glide:glide:3.7.0'
2.布局
<fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard
android:id="@+id/player_list_video"
android:layout_width="match_parent"
android:layout_height="220dp" />
3.主界面
String s1="http://2449.vod.myqcloud.com/2449_22ca37a6ea9011e5acaaf51d105342e3.f20.mp4";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
}
private void initView() {
player_list_video = (JCVideoPlayerStandard) findViewById(R.id.player_list_video);
player_list_video.setUp(s1 , JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, "视频标题");
}
@Override
public void onBackPressed() {
if (JCVideoPlayer.backPress()){
return;
}
super.onBackPressed();
}
@Override
protected void onPause() {
super.onPause();
JCVideoPlayer.releaseAllVideos();
}