-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
play / pause when clicked #105
Comments
achieved it when i setted the controller also, like
now I got another problem, when i pause the video there is no image remaining on screen, it's totally gone, is it possible to let the paused video image on screen when paused? another doubt, is it possible to set something like "center_crop" to the video? sometimes I got images on the adapter and sometimes videos, the images are center crop, if the video is not center cropped it looks kinda strange when compared to the images... |
ok i believe that I am almost there, now i have done
on my layout file as you recommend in one of your tutorials I am setting the playerView height with a globalLayoutListener because every video can get a different aspect ratio.. my rebinder looks like:
The video is there, if i pause it the image remains there, the dimension is ok, but while scrolling something wired happens, previous video's sound start randomly playing even if there is no playerView on screen, its like its not released i believe.. should I do anything to release it on my adapter? |
done it...had to "clear" the PlayerViews as i scroll...something like Glide does with .clear().....if there is a video on my holder i setup the right url...if there is no video on my holder i setup an empty url and bind it to the gone PlayerView just to avoid recycling mistakes... is it right? Man such a powerfull library and yet really simple to work with....you are a monster |
@iregados I saw you have solved the play/pause on click issue. So the remaining issue is:
I believe. I will try to reproduce and see. |
This is actually solved by setting an empty url and binding it to the
PlayerViews where there is no video to display.
The problem is not with your library but with how Android recycle things...
All I need to do is "clear" those PlayerView without videos to show.
You could create a clear function.. Something like Glide does
Em sáb, 19 de set de 2020 08:35, Nam Nguyen Hoai <notifications@github.com>
escreveu:
… @iregados <https://github.com/iregados> I saw you have solved the
play/pause on click issue. So the remaining issue is:
if i pause it the image remains there, the dimension is ok, but while
scrolling something wired happens, previous video's sound start randomly
playing even if there is no playerView on screen, its like its not released
i believe
I believe. I will try to reproduce and see.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#105 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAS6EDSFYKLCOME2QZTT3ZDSGSJPJANCNFSM4RRL4ILA>
.
|
@iregados Thanks for the kind words. I also acknowledge that the RecyclerView may behave weird. Something a View not in the viewport is attached, etc. I actually try to address that by calculating the View's coordinator and some other metric to know if it is visible or not. Though it maybe not yet enough. I will look into both, one is a kill-switch that client can use in such cases, another thing is to see what can the library do automatically as well. |
@iregados Could you please share the code snaps that worked for you?
but in case I add the tag it will start working but hide the videoview on pause |
@eneim @iregados @sdex does anyone have any solutions for this? |
You can use PlayerView rather than a non-PlayerView. The PlayerView will not be removed for recycling. For debugging, I suggest using another View in the same ViewHolder to receive the click event (replace |
In my fragment i've done
then I pass them to my adapter like
on my adapter i have done
where myController looks like
I want it to play and pause the video when the video is clicked, but it is actually doing nothing, even with manager and playable beeing not null...
I really dont know what I am doing wrong in here
The text was updated successfully, but these errors were encountered: