Skip to content
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

exoplayer scrolls in recyclerview incorrectly #5181

Closed
teshlya opened this issue Dec 2, 2018 · 1 comment
Closed

exoplayer scrolls in recyclerview incorrectly #5181

teshlya opened this issue Dec 2, 2018 · 1 comment
Assignees
Labels

Comments

@teshlya
Copy link

teshlya commented Dec 2, 2018

I use exoplayer in the recycler view. Everything works fine, but when I scroll, the exoplayer went beyond the screen, and then come back, the exoplayer call onPlayerStateChanged - STATE_BUFFERING - STATE_READY and the video shifting for a few seconds, although the exoplayer is paused. You understand me because I speak English badly?
https://drive.google.com/open?id=10ZvOtFT0k9VA4v3wPI8SC7EszdVg1Rcj

@andrewlewis andrewlewis self-assigned this Dec 3, 2018
@andrewlewis
Copy link
Collaborator

Before API 23 we can't keep the video decoder active when it loses its output surface, so I think what's happening here is that when the view comes back on screen we are setting a new surface and the player is showing the next keyframe, which means that the output position skips forward. The player position can also skip forward even from API 23 (by a single frame or up to a keyframe on certain devices that don't allow setting the output surface). #677 has more details.

The easiest way to make this work is to avoid having the player output surface get destroyed. You may be able to alter your app's layout to make that possible.

Or another approach (caveat: I haven't tried it!) would be to output to a TextureView and keep a reference to its SurfaceTexture when it goes off screen, then reattach when it comes back onto the screen. Please take a look at the DoubleDecodeActivity in grafika, which does this.

@google google locked and limited conversation to collaborators May 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants