saveVideo method
Implementation
Future<AssetEntity> saveVideo(
File inputFile, {
required String? title,
String? desc,
String? relativePath,
int? orientation,
double? latitude,
double? longitude,
DateTime? creationDate,
}) async {
_throwIfOrientationInvalid(orientation);
if (!inputFile.existsSync()) {
throw ArgumentError('The input file ${inputFile.path} does not exists.');
}
final filePath = inputFile.absolute.path;
title = title?.trim();
if (title == null || title.isEmpty) {
title = path.basename(filePath);
}
final Map result = await _channel.invokeMethod(
PMConstants.mSaveVideo,
<String, dynamic>{
'path': filePath,
'title': title,
'desc': desc ?? '',
'relativePath': relativePath,
'orientation': orientation,
'latitude': latitude,
'longitude': longitude,
'creationDate': creationDate?.millisecondsSinceEpoch,
...onlyAddPermission,
},
);
return ConvertUtils.convertMapToAsset(result.cast(), title: title);
}