thumbnailFile static method

Future<XFile> thumbnailFile({
  1. required String video,
  2. Map<String, String>? headers,
  3. String? thumbnailPath,
  4. ImageFormat imageFormat = ImageFormat.PNG,
  5. int maxHeight = 0,
  6. int maxWidth = 0,
  7. int timeMs = 0,
  8. int quality = 10,
})

Generates a thumbnail file under specified thumbnail folder or given full path and name which matches expected ext. The video can be a local video file, or an URL repreents iOS or Android native supported video format. If the thumbnailPath is ommited or null, a thumbnail image file will be created under the same folder as the video file. Specify the maximum height or width for the thumbnail or 0 for same resolution as the original video. The lower quality value creates lower quality of the thumbnail image, but it gets ignored for PNG format.

Implementation

static Future<XFile> thumbnailFile({
  required String video,
  Map<String, String>? headers,
  String? thumbnailPath,
  ImageFormat imageFormat = ImageFormat.PNG,
  int maxHeight = 0,
  int maxWidth = 0,
  int timeMs = 0,
  int quality = 10,
}) async {
  assert(video.isNotEmpty);

  return VideoThumbnailPlatform.instance.thumbnailFile(
    video: video,
    headers: headers,
    thumbnailPath: thumbnailPath,
    imageFormat: imageFormat,
    maxHeight: maxHeight,
    maxWidth: maxWidth,
    timeMs: timeMs,
    quality: quality,
  );
}