getVideo method

Future<XFile?> getVideo({
  1. required ImageSource source,
  2. CameraDevice preferredCameraDevice = CameraDevice.rear,
  3. Duration? maxDuration,
})

Returns a XFile containing the video that was picked.

The source argument controls where the video comes from. This can be either ImageSource.camera or ImageSource.gallery.

The maxDuration argument specifies the maximum duration of the captured video. If no maxDuration is specified, the maximum duration will be infinite.

Use preferredCameraDevice to specify the camera to use when the source is ImageSource.camera. The preferredCameraDevice is ignored when source is ImageSource.gallery. It is also ignored if the chosen camera is not supported on the device. Defaults to CameraDevice.rear.

In Android, the MainActivity can be destroyed for various reasons. If that happens, the result will be lost in this call. You can then call getLostData when your app relaunches to retrieve the lost data.

If no images were picked, the return value is null.

Implementation

Future<XFile?> getVideo({
  required ImageSource source,
  CameraDevice preferredCameraDevice = CameraDevice.rear,
  Duration? maxDuration,
}) {
  throw UnimplementedError('getVideo() has not been implemented.');
}