getVideoThumbnail method

  1. @override
Future<bool> getVideoThumbnail({
  1. required String srcFile,
  2. required String destFile,
  3. required int width,
  4. required int height,
  5. String? format,
  6. bool? srcFileUri,
  7. int? quality,
})
override

Implementation

@override
Future<bool> getVideoThumbnail(
    {required String srcFile,
    required String destFile,
    required int width,
    required int height,
    String? format,
    bool? srcFileUri,
    int? quality}) async {
  var formatValue =
      format ?? (srcFile.toLowerCase().endsWith('.png') ? 'png' : 'jpeg');
  if (width <= 0 && height <= 0) {
    throw ArgumentError('Invalid width and height');
  }
  return (await methodChannel.invokeMethod<bool?>('getVideoThumbnail', {
        'srcFile': srcFile,
        'srcFileUri': srcFileUri,
        'destFile': destFile,
        'width': width,
        'height': height,
        'format': formatValue,
        'quality': quality,
      })) ??
      false;
}