I am implementing the ExoPlayer in a RecyclerView. But while scrolling the Video stops, but not the audio.
How can I release the ExoPlayer in the RecyclerView? Or how c
I think that it would be cleanest to release the player when its view is recycled.
Adapter Class:
@Override
public void onViewRecycled(@NonNull ViewHolder holder) {
int position = holder.getAdapterPosition();
if (mDataset.get(position) != null) {
mDataset.get(position).getPlayer().release();
}
super.onViewRecycled(holder);
}