-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Avoid Video frame render before exoPlayer.setPlayWhenReady(true) #6886
Comments
You could show an opaque "shutter" view on top of the player layout until you want to show the first frame. |
@andrewlewis what I want to achieve is smooth transitions between videos, so an opaque view is not a solution. |
Can you use playlists for that? If not please could you describe in a bit more detail what you're trying to achieve? |
I cannot use playlist or concatenated source because I only know what needs to play next after current video finishes. |
I initially opened this issue as a Question, I thought I was missing something. |
Is the desired behavior to stay showing the last frame of the video that just ended while buffering the next video, then only advance to the first frame of the next video and resume when it can be played without buffering at the start? @marcbaechinger, @tonihei I tried implementing this using a concatenation and pausing then adding a new media source after getting to the ended state. However, there isn't really an easy way to resume playback only when the next item is loaded far enough to play seamlessly, as it seems to be necessary to issue a seek to exit the ended state. Any ideas on a better way to do this? Aside: I think a simple way to reduce the pause that might be sufficient for this use case (not using a concatenation) would be to customize load control to require a very small duration to be buffered before transitioning to the ready state (the content is local so this shouldn't be an issue). |
The suggestion above seems to work for me using code like that:
Note that seeking to |
The comment above is using the new playlist APIs that will be added in 2.12. For the current release you can the equivalent with
|
We should only ignore seek to the current position if we are currently READY or BUFFERING. Also, pending initial seek positions should only be saved while we have an empty timeline, independent of the player state. Issue:#6886 PiperOrigin-RevId: 297813854
We pushed a fix so that you no longer have to seek to position-1 in the example above. I'll update the code snippet for future reference of how it should look like. |
I'm using a SimpleExoPlayer instance to play videos with audio.
I'm playing video files from local storage.
Basic stuff, just like the Hello World setup (https://exoplayer.dev/hello-world.html)
The issue I have is that the first frame of the video is rendered before I call exoPlayer.setPlayWhenReady(true).
This, combined with audio latency, creates a small freeze on the first frame of each video when playing back to back videos.
I was able to modify MediaCodecVideoRenderer to avoid this, but my question is if there is a setting to avoid the first frame being rendered before exoPlayer.setPlayWhenReady(true) without modifying the code?
If there is no way I think this should be improved.
The text was updated successfully, but these errors were encountered: