I am using a recyclerview for displaying and broadcasting videos of users. However, when I scroll through the recycler view, I see my first view, which has my video gets recycled hence why it's not visible to other users. Is there a way I can make sure that the first view is not recycled so I dont have to worry about my video view getting resetrecycled every single time I scroll through my list?
Here's my code : In my fragment... ...
 <android.support.v7.widget.RecyclerView
        android:id="@+id/videoList"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:visibility="invisible"
        app:layout_constraintBottom_toTopOf="@+id/myButtonContainer"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/myoldContainer">
...
and the corresponding adapter...
public class GroupAdapter extends RecyclerView.Adapter<GroupAdapter.myViewHolder> {
    private CopyOnWriteArrayList<Person> persons;
    private Context mContext;
    public GroupAdapter(@NonNull final CopyOnWriteArrayList<Person> persons , Context context) {
        this.persons = persons;
        this.mContext= context;
        for (Person person : this.persons) {
           //get names
        }
    }
    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        final View layout = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_person, parent, false);
        final MyViewHolder viewHolder = new MyViewHolder(layout);
        return viewHolder;
    }
     @Override
        public void onBindViewHolder(MyViewHolder holder, int position) {
        final Person person = person.get(position);
                final Participant participant = person.getParticipant();
                if (person.getName() != null) {
                    holder.personName.setText(person.getName());
                }
                if (person.getImage() != null) {
                    holder.personImage.setImageBitmap(person.getImage());
                } else {
                    holder.personImage.setImageResource(R.drawable.default_profile);
                }
                holder.personImage.setVisibility(View.INVISIBLE);
                holder.personImage.setVisibility(View.VISIBLE);
                final VideoView videoView;
                if (participant.isMe) {
                    videoView = participant.videoStreamer.videoView;
                } else {
                    videoView = participant.videoPlayer.videoView;
                }
                if (holder.personVideo.getChildCount() != 0) {
                        holder.personVideo.removeAllViews();
                }
                if (videoView.getParent() != null) {
                    ViewGroup parent = (ViewGroup) videoView.getParent();
                        parent.removeView(videoView);
                }
                holder.personVideo.addView(videoView, myViewHolder.videoLayoutParams);
                if (person.isVideoPaused()) {
                    holder.personVideo.setVisibility(View.INVISIBLE);
                    holder.personImage.setVisibility(View.VISIBLE);
                } else {
                    holder.personVideo.setVisibility(View.VISIBLE);
                    holder.personImage.setVisibility(View.INVISIBLE);
                }
    }
@Override
    public int getItemCount() {
        return persons.size();
    }
    public static final class MyViewHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.personVideo)
        public ViewGroup personVideo;
        @BindView(R.id.personImage)
        public ImageView personImage;
        @BindView(R.id.personName)
        public TextView personName;
        protected static FrameLayout.LayoutParams videoLayoutParams = new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT
        );
        public MyViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
        }
    }
}
Here's how I am setting it in my fragment:
  LinearLayoutManager manager = new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false);
            videoAdapter = new VideoAdapter(myHelper.getPeople(), getContext());
            videoList.setLayoutManager(manager);
            videoList.setAdapter(videoAdapter);
item_person:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_marginTop="0dp"
    android:background="@drawable/person_border"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <RelativeLayout
        android:id="@+id/personContainer"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintDimensionRatio="1:1"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent">
        <FrameLayout
            android:id="@+id/personVideo"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/black" />
        <ImageView
            android:id="@+id/personImage"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/black"
            android:src="@drawable/default_profile" />
        <TextView
            android:id="@+id/personName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#AA555555"
            android:gravity="center_horizontal|bottom"
            android:textColor="@color/green"
            android:textSize="12sp"
            android:lines="1"
            android:ellipsize="end"
            tools:text="androiduser@gmail.com"
            android:layout_alignParentBottom="true" />
    </RelativeLayout>
</android.support.constraint.ConstraintLayout>
fragment with recycle view: xml
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">
<RelativeLayout>
....
</RelativeLayout>
<include containers>...</include>
...
 <android.support.v7.widget.RecyclerView
        android:id="@+id/personList"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:visibility="invisible"
       >
    </android.support.v7.widget.RecyclerView>
 </android.support.constraint.ConstraintLayout>