Hello everyone 👋
I've got a question regarding playing a video full screen portrait.
The videos are typically 16:9 or 4:3 aspect ratio, and the videos are recorded in portrait orientation only (this is enforced while recording).
Is there a way to play these videos in full screen portrait?
That is, I want them to scale and keep aspect ratio intact to match the width/height of the parent container. Something similar to ImageView.ScaleType.CENTER_CROP.
Essentially I want the video to fill the entire screen just like how popular apps like instagram and snapchat play video in full screen portrait. I'm using PlayerView from ExoPlayer UI lib and setting height/width to match_parent.
PlayerView supports passing a
resize_mode
and I believe the default is
fit
which translates to
ImageView.ScaleType.CENTER_INSIDE
There's also a
fill
and
zoom
but these don't seem to keep the aspect ratio intact and stretch the video.
Anyone have any idea if there is some straightforward combination of settings that I may be missing in order to achieve "center_crop" scaling and get the video to show full screen? The easy alternative is to set a black background for letter boxing and playing the video in it's actual aspect ratio, but the fullscreen is definitely preferred.