Video Content Appears Cropped on Android Devices Video Content Appears Cropped on Android Devices

Video Content Appears Cropped on Android Devices

Vonage API Support

Symptom

Video rendered for a Publisher or Subscriber on Android appears cropped or zoomed, resulting in partial loss of the video frame (for example, portions of the participant’s face may not be visible).

Applies To

  • Video API
  • Android SDK
  • React Native Android

Resolution

By default, the Vonage Android SDK renders video using the FILL scaling mode. If this behavior is not desired, the scaling mode must be explicitly configured.

Default scaling behavior (FILL)

  • STYLE_VIDEO_FILL scales the video to fully occupy the view.

  • To preserve the aspect ratio, portions of the video may be cropped.

Alternative scaling behavior (FIT)

  • STYLE_VIDEO_FIT scales the video to fit entirely within the view.

  • The original aspect ratio is preserved, and no cropping occurs.

Example:

setStyle(
    BaseVideoRenderer.STYLE_VIDEO_SCALE,
    BaseVideoRenderer.STYLE_VIDEO_FIT
)

This configuration can be applied to either the Publisher or Subscriber instance, depending on the use case.

Cause

The observed video cropping occurs because the default renderer configuration uses STYLE_VIDEO_FILL, which prioritizes filling the view over preserving the entire video frame.

Additional Information

Please refer to the developer documentation links below for more details on configuring video scaling behavior:

Unified Environment

OpenTok environment

How to recognize if I’m using Vonage Video API Unified Environment or Vonage Video API OpenTok environment?