Advise on setting display framerate to match video (in jetpack/kotlin context)?
@microkatz is already working on this.
Since Jul 14, 2025.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Hi,
I'm hacking a lot on NextPlayer to support my own custom way of sharing a video. I can get much of it working but i'm just massively stuck when it comes to frame rate control.
I did disable setVideoChangeFrameRateStrategy.
As the docs describe, i probably want to have CHANGE_FRAME_RATE_ALWAYS for video. The conceptual idea to do this is simple. Get the FPS from your video and set that on the surface with the setFrameRate function. Easy, right?..
Not so much. This is the code context i'm in and i'm having serious issues wrapping my head around how to do this. To make it more to the point in terms of questions:
- Where exactly does it make sense in the ExoPlayer API functions to change the surface framerate? I'm thinking as soon as anything gets rendered would be a good time. Hence onRenderedFirstFrame.
- But within that scope, how do you get the FPS from a current video?
- And how do you even get the surface from that scope?
I'm sorry if these questions seem beginner/n00b questions. I thought so too. But based on the many hours wasted on this (including AI help), it apparently just doesn't trigger for me just yet.
Thank you for any help you can provide!
Mark
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.