getVideo method
- @Deprecated('Switch to using pickVideo instead')
- required ImageSource source,
- CameraDevice preferredCameraDevice = CameraDevice.rear,
- Duration? maxDuration,
Returns a PickedFile object wrapping the video that was picked.
The returned PickedFile is intended to be used within a single app session. Do not save the file path and use it across sessions.
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.
The method could throw PlatformException
if the app does not have permission to access
the camera or photos gallery, no camera is available, plugin is already in use,
temporary file could not be created and video could not be cached (iOS only),
plugin activity could not be allocated (Android only) or due to an unknown error.
Implementation
@Deprecated('Switch to using pickVideo instead')
Future<PickedFile?> getVideo({
required ImageSource source,
CameraDevice preferredCameraDevice = CameraDevice.rear,
Duration? maxDuration,
}) {
return platform.pickVideo(
source: source,
preferredCameraDevice: preferredCameraDevice,
maxDuration: maxDuration,
);
}