-
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
Display last frame when seeking to end of stream #2568
Comments
You can easily make the display go black when the player transitions to the ended state by having a black View above the surface that you make visible when you see the transition. Showing the last frame in this case is surprisingly non-trivial to do without incurring any additional cost (e.g. latency through the rendering pipeline), so we've kind of ignored the problem up until now. It doesn't seem like a big issue. We'll use this issue for tracking, but it's unlikely we'll be fixing it any time soon. |
That makes sense. I was trying to make sure I didn't miss any methods in ExoPlayer that could do this job. I can do this in the App level as a temp solution. Thank you. |
Related to this issue.. I am not seeking to a specific position but I am just letting the video play and complete itself. After completion, the view is empty. Can you push me in the right direction on how I keep the last frame on screen? |
I don't think that's what happens. The last frame of the video should remain visible. Are you sure the last frame in the video isn't black (or whatever "empty" means in this case)? |
My Activity has a transparent window so basically when my video completes, I can see the content in the Activity behind it. That's my 'empty state' which I was referring too. This is my piece of code: startVideo just calls .start() on the videoView. I have double checked and my videos don't have empty frames at the end :). PS: Great reaction time! |
Hm. Not sure about that. I don't think we have much control over this kind of thing at the ExoPlayer level; we simply release buffers to the surface (and that's about it). I don't know what EMVideoView does internally. You should probably report the issue to the author of that class. In any case, I don't think this discussion is relevant to this issue. |
In our application, to overcome this problem, we do the following and it works well: If the seekTo is within 200ms from the end then we seek to (duration - 200ms) and then unpause the player. Just make sure that you then catch the ExoPlayer.STATE_ENDED event and upon receiving that you pause the player. We have noticed no side effects. And this is barely visible to the user. |
We currently don't display the last frame because the seek time is behind the last frame's timestamps and it's thus marked as decodeOnly. This case can be detected by checking whether all data sent to the codec is marked as decodeOnly at the time we read the end of stream signal. If so, we can re-enable the last frame. This should work for almost all cases because the end-of-stream signal is read in the same feedInputBuffer loop as the last frame and we therefore haven't released the last frame buffer yet. Issue:#2568 PiperOrigin-RevId: 251425870
Issue is solved on the dev-branch now. Closing. |
We currently don't display the last frame because the seek time is behind the last frame's timestamps and it's thus marked as decodeOnly. This case can be detected by checking whether all data sent to the codec is marked as decodeOnly at the time we read the end of stream signal. If so, we can re-enable the last frame. This should work for almost all cases because the end-of-stream signal is read in the same feedInputBuffer loop as the last frame and we therefore haven't released the last frame buffer yet. Issue:#2568 PiperOrigin-RevId: 251425870
Seeking to last ms of a video makes the player switch to STATE_ENDED but the frame before the seeking is performed is still on the screen. Is there any way to make the player display the last frame if we seek to the last ms or just black out the screen? Thank you.
The text was updated successfully, but these errors were encountered: