RecyclerView 实现仿抖音上下滑动切换视频效果,已有线上项目,稳定可用。
implementation 'com.lmxjw3.media:videoplay:1.0.1'
<com.lmx.library.media.VideoPlayRecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent" />
public class MyVideoAdapter extends VideoPlayAdapter {
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return null;
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return 0;
}
@Override
public void onPageSelected(int itemPosition, View itemView) {
// 监听页面切换
}
}