一、先添加依赖
// 节操
implementation 'cn.jzvd:jiaozivideoplayer:6.2.9'
注意:加载依赖时可能会报错 说是版本不兼容之类的,具体解决看图:
二、xml布局
<cn.jzvd.JZVideoPlayerStandard
android:id="@+id/videoplayer"
android:layout_width="match_parent"
android:layout_height="270dp" />
三、加载时写的主要代码
当然用什么方式展示例如:RecyclerView等等。。就看你自己了
//给节操设置播放视频时候的路径
holder.getVideoplayer().setUp(list.get(position).getVideoUrl(),JZVideoPlayerStandard.SCREEN_WINDOW_NORMAL,"谁还不是小仙女呢!");
Glide.with(context).load(cover).into(holder.getVideoplayer().thumbImageView);