Set the video resize mode
The resize mode controls how video scales inside the PlayerView. Use it to letterbox a video so nothing is cropped, or to fill the view and crop the overflow, which is what full-screen feeds do.
Before you begin
Make sure you have the FastPix Android Player SDK installed and a player set up. See Install FastPix Android player and Set up the player.
Set the resize mode
Set resizeMode on the PlayerView in code:
Or set it in your layout XML:
Resize modes
FIT is right for a general-purpose player, where cropping would hide content. Full-screen feeds normally want ZOOM, so a source of any shape fills the page the way short-form apps present it.
Frequently asked questions
How do I make a video fill the screen without black bars?
Set resizeMode = ResizeMode.ZOOM (or app:fastPixResizeMode="zoom" in XML). ZOOM fills the view while preserving aspect ratio and crops the overflow, so there are no letterbox bars.
What's the default resize mode?
FIT. It scales the video to fit inside the view and letterboxes as needed, so no content is cropped. This is the right default for a general-purpose player.
What's the difference between FILL and ZOOM?
FILL stretches the video to fill the view and ignores aspect ratio, which can distort the picture. ZOOM fills the view while preserving aspect ratio and crops whatever overflows, so the picture stays undistorted.
Can I set the resize mode in XML instead of code?
Yes. Use the app:fastPixResizeMode attribute on the PlayerView, for example app:fastPixResizeMode="zoom". You can also change it at runtime with the resizeMode property.
What’s next
- Preload and cache for faster startup to make feed items start faster.
- Enable fullscreen mode for full-screen playback.