saveVideo method

Future<AssetEntity> saveVideo(
  1. File inputFile, {
  2. required String? title,
  3. String? desc,
  4. String? relativePath,
  5. int? orientation,
})

Implementation

Future<AssetEntity> saveVideo(
  File inputFile, {
  required String? title,
  String? desc,
  String? relativePath,
  int? orientation,
}) async {
  _throwIfOrientationInvalid(orientation);
  if (!inputFile.existsSync()) {
    throw ArgumentError('The input file ${inputFile.path} does not exists.');
  }
  final Map result = await _channel.invokeMethod(
    PMConstants.mSaveVideo,
    <String, dynamic>{
      'path': inputFile.absolute.path,
      'title': title,
      'desc': desc ?? '',
      'relativePath': relativePath,
      'orientation': orientation,
      ...onlyAddPermission,
    },
  );
  return ConvertUtils.convertMapToAsset(result.cast(), title: title);
}