setScalingType

fun setScalingType(scalingType: RendererCommon.ScalingType)

This method can be used to set the scaling type for how the video frame fits within the view.

The scaling type determines how the video is resized when the video dimensions do not match the view dimensions.

Available scaling types:

  • SCALE_ASPECT_FIT — scales the video to fit inside the view, preserving aspect ratio (may leave black bars)
  • SCALE_ASPECT_FILL — scales the video to fill the entire view, preserving aspect ratio (may crop edges)
  • SCALE_ASPECT_BALANCED — a balance between fit and fill

Code Example:


// Fill the entire view (may crop edges)
videoView.setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FILL)

// Fit within the view (may have black bars)
videoView.setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FIT)

Parameters

scalingType

the RendererCommon.ScalingType to use for rendering