I want to load the list of videos where the scroll should be like tiktok scrolling, I have used vertical viewpager to load each video in different pages and using texturevideo view,when page changed stop video and start the current focused video,likewise for other videos, but I am not getting the proper output, Please provide any solution to achieve it.
Thanks in Advance.
@Override
public void onPageSelected(int position) {
Log.d("PAGER",position + "");
mCurrentFragmentPosition = position;
if (lastPosition > position) {
Log.e("Up",position+"");
Log.e("lastPosition",lastPosition+"");
// customAdapter.fastVideoViews.get(position).start(); customAdapter.fastVideoViews.get(lastPosition).pause();
}else if (lastPosition < position) {
Log.e("Down",position+"");
Log.e("lastPosition",lastPosition+"");
// customAdapter.fastVideoViews.get(position).start(); customAdapter.fastVideoViews.get(lastPosition).pause();
}
lastPosition = position;
customAdapter.fastVideoViews.get(position).start();
}
@Override
public void onPageScrollStateChanged(int position) {
}
});