eneim / toro

Video list auto playback made simple, specially built for RecyclerView
Apache License 2.0
1.42k stars 253 forks source link

Scrolling video not fix the current video #335

Open hafiz013 opened 6 years ago

hafiz013 commented 6 years ago

What kind of issue is this? when i click on those list video and come back scrolling the video position which are previously on third row move to first row and first row goes to third row

eneim commented 6 years ago

@hafiz013 Just have a quick look over your source code. One point is your implementation of ViewHolder and full-screen dialog doesn't take into account the 'recycle' characteristic of ViewHolder. But let me go deep into your code to make a better understanding of your use-case and think about some suggestion as well as improvement to my work.

hafiz013 commented 6 years ago

yes sure because if you could solve my problem the other also use my suggestion as well. this is because the point of list is that user can click full screen of the video (in landscape) and shrink back (in portrait). Secondly what is the different between contain and recyclerview?

eneim commented 6 years ago

@hafiz013 Container is a RecyclerView but has been empowered. You can see that Container extends RecyclerView.

hafiz013 commented 6 years ago

owh i see. so how was it progress?

eneim commented 6 years ago

@hafiz013 So I just try to run your code and here is what I found:

SimpleAdapter.java line 136 (in closeFullscreenDialog()):

((FrameLayout) mContext.findViewById(R.id.main_media_frame)).addView(playerView);

Here you use mContext from Activity to find R.id.main_media_frame. In fact, RecyclerView holds 3 view that contains R.id.main_media_frame as its child. So using mContext.findViewById(R.id.main_media_frame) will find the first one, which is the view on top. That's why you see the video position of first row goes to third row and third row video go to first row..

Changing mContext to itemView.getContext() itemView.findViewById() will fix it.

In fact, this is not an issue of Toro. Please take a look :D.

hafiz013 commented 6 years ago

can you do tutorial about video full screen in new post so that another user can refer to it

hafiz013 commented 6 years ago

hi i still persistent to get landscape when full screen because this code still have bugs.

eneim commented 6 years ago

@hafiz013 About the tutorial, I have one sample and also I try to not be opinionated about how to do this and that. But this is a good idea. About land scape mode, is it the same behaviour? Or what doesn't work well this time? Because switching to landscape mode depends so much on your setup, I cannot tell anything now.

hafiz013 commented 6 years ago

About land scape mode, is it the same behaviour? nope. when landscape only one video play at the time and when go back shrink list video will appear

eneim commented 6 years ago

@hafiz013 Can you take a look at my Facebook demo? Using DialogFragment for full-screen player there. Tell me if it makes sense to you.

hafiz013 commented 6 years ago

may I know what is your facebook page. thank you

eneim commented 6 years ago

@hafiz013 Do you mean Facebook demo? It is here: link.

If you want to ask for my personal Facebook then sorry ^^!

syedmumersajjad commented 5 years ago

Hi @eneim how are you? i want to know the facebook demo project is still updated in 2019? i have visited the link it have multiple projects integrated. What step should i follow to get only the facebook demo? Many thanks looking for your response

syedmumersajjad commented 5 years ago

@hafiz013 Assalam o alikum i am looking for the toro exoplayer integration but didn't find the right solution for it can you please help me little so i'll be on path thanks

eneim commented 5 years ago

@syedmumersajjad The "app" module contains many demos but each folder is isolated. You can clone the source code, cope the source of folder facebook and folder "common" (Base classes) only and it should be Ok. All the dependencies (in build.gradle) are not required, but please clean them up by yourself.

syedmumersajjad commented 5 years ago

@eneim thanks for your reply yeah it's work perfectly. I have implement all the demos separately Thanks a lot great work. I have one more question i didn't see the progress bar and caching video option. Can you help me little on these points?