饺子播放器
2020-07-15 本文已影响0人
魔女小姐的猫
效果图

一 . 添加依赖
在build.gradle下的dependencies中添加
implementation 'cn.jzvd:jiaozivideoplayer:7.0.3'
在build.gradle下的android中添加
android {
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
二. 布局控件
<cn.jzvd.JzvdStd
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
三. 属性
Glide.with(context).load(videolist.get(position).getImage_url()).into(holder.video_view.thumbImageView);
holder.video_view.setUp(videolist.get(position).getVideo_url(), videolist.get(position).getTheme());
播放:
gifUtil.setGif(gifDrawable);//gif图片显示
暂停及继续:
gifUtil.stop();//暂停
gifUtil.start();//继续