getPreferredPreviewSizeForVideo method

Future<CameraSize?> getPreferredPreviewSizeForVideo()

Returns the preferred or recommended preview size (width and height) in pixels for video recording.

Camcorder applications should set the preview size to a value that is not larger than the preferred preview size. In other words, the product of the width and height of the preview size should not be larger than that of the preferred preview size. In addition, we recommend to choose a preview size that has the same aspect ratio as the resolution of video to be recorded.

If getSupportedVideoSizes returns null; null is returned.

Implementation

Future<CameraSize?> getPreferredPreviewSizeForVideo() async {
  return await _channel.$getPreferredPreviewSizeForVideo(this) as CameraSize?;
}