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_FILLscales 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_FITscales 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
Related to:
Articles in this section
- Video Content Appears Cropped on Android Devices
- Screensharing outside Native SDK Application
- How many participants can join an Android session?
- Where can I see the sample code for Vonage Video Android SDK?
- What devices does the Vonage Video Android SDK support?
- Inline Installation of Screen Sharing Extensions in Chrome Deprecated
- Where can I get the Vonage Video API Android SDK?
- Why READ_PHONE_STATE permission is required while using Video API Android SDK?
- How to avoid Gradle build failure with OpenTok Android SDK 2.22.0+