setResizeMode

public void setResizeMode(int mode)

Sets the video resize mode.

This determines how the video content should scale to fit its display surface. Each mode controls how the player maintains or alters the video's aspect ratio and layout behavior.

Supported values:

  • 0 - RESIZE_MODE_FIT: Scale to fit while maintaining aspect ratio. May result in letterboxing or pillarboxing.
  • 1 - RESIZE_MODE_FIXED_WIDTH: Fix the width, adjust height to preserve aspect ratio.
  • 2 - RESIZE_MODE_FIXED_HEIGHT: Fix the height, adjust width to preserve aspect ratio.
  • 3 - RESIZE_MODE_FILL: Scale to fill the entire surface, ignoring aspect ratio. May stretch video.
  • 4 - RESIZE_MODE_ZOOM: Scale to fill the surface while preserving aspect ratio. Crops overflow content.

Example usage:

// Set zoom mode to crop and fill the surface while maintaining aspect ratio
player.setResizeMode(4); // RESIZE_MODE_ZOOM

Parameters

mode

Resize mode constant (0-4). Values outside this range are ignored or may throw an error.