saveVideo static method
saves video from provided temp path and optional album name in gallery
Implementation
static Future<bool?> saveVideo(
String path, {
String? albumName,
bool toDcim = false,
Map<String, String>? headers,
}) async {
File? tempFile;
if (path.isEmpty) {
throw ArgumentError(pleaseProvidePath);
}
if (!isVideo(path)) {
throw ArgumentError(fileIsNotVideo);
}
if (!isLocalFilePath(path)) {
tempFile = await _downloadFile(path, headers: headers);
path = tempFile.path;
}
bool? result = await _channel.invokeMethod(
methodSaveVideo,
<String, dynamic>{'path': path, 'albumName': albumName, 'toDcim': toDcim},
);
if (tempFile != null) {
tempFile.delete();
}
return result;
}