-
Notifications
You must be signed in to change notification settings - Fork 527
Support Player$Listener.onVideoSizeChanged()
to be called before Player.setVideoSurface()
or Player.setsetVideoTextureView()
#2066
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
Comments
The decoder requires a set surface in order to provide accurate dimensions for the Player to provide the Is there a reason you cannot set the surface or texture unto the player and then update it after receiving the |
To add to what @microkatz had to say:
However, we run into catch-22 where The size of the video seemed like something independent of rendering and I looked into ways of extracting it earlier in the pipeline. Perhaps from some Metadata callbacks, from Format of selected Tracks etc. None of these places are reliable to give the video size at all, let alone the correct one. It is unfortunate that we get the sizing information so late, but that is the limitation of the setup where only the act of rendering the video to the surface can guarantee the sizing callback. For that reason, the only UX friendly thing you can do (as described in MainActivity) is always keep the
I urge you to browse PresentationState and you will see how it's used in MainActivity to get the correct aspect ratio like
|
Many thanks to you and your colleagues for your comprehensive and professional answers, which have completely deepened my understanding of the subject! |
I can't customize the
PlayerSurface
(from media3-ui-compose) size by getting the video size in thePlayer$Listener.onVideoSizeChanged()
method.The text was updated successfully, but these errors were encountered: