MostafaAnter / VideoPlayerInsideRecyclerView

Integrate RecyclerView with ExoPlayer — The clean way — and customization
Apache License 2.0
127 stars 25 forks source link

Deleting item but next item not starts playing automatically #5

Closed AndroidDeveloperMCT closed 3 years ago

AndroidDeveloperMCT commented 3 years ago

When I remove any item from the recycler view, the next items come on the above position but not starts playing automatically.

Can anyone please help me out

MostafaAnter commented 3 years ago

You need to call playIndexThenPause Previous Player method after execute deletion Screenshot_20210223_140436.jpg

AndroidDeveloperMCT commented 3 years ago

I am calling this

modelList.removeAt(position) notifyItemRemoved(position) notifyItemRangeChanged(position, modelList.size) if (index != -1) { PlayerViewAdapter.playIndexThenPausePreviousPlayer(index) }

but still not working

Any idea, what I am doing wrong? Please let me know

MostafaAnter commented 3 years ago

Try to remove item without notify item changes just remove item from model list and set viability of view holder that u want to delete to gone although call method of playing next item

AndroidDeveloperMCT commented 3 years ago

modelList.remove(model) binding.root.setVisibility = View.GONE if (index != -1) { PlayerViewAdapter.playIndexThenPausePreviousPlayer(index) }

Tried above but still, the video does not start playing automatically

MostafaAnter commented 3 years ago

Great next step is scroll to position programically with animation it should work

MostafaAnter commented 3 years ago

Your problem depends on your code logic not belon the concept of implementing Exoplayer inside recyclerview

AndroidDeveloperMCT commented 3 years ago

I don't think so it is because of code logic because I am running demo only and added the delete button at top/right.

It would be helpful to me if you please add some code for delete in TikTok screen and share the branch PLEASE

MostafaAnter commented 3 years ago

Email me if you would like to hire me for this task, have a great day buddy

AndroidDeveloperMCT commented 3 years ago

Anyway thanks