getByteThumbnail method

Future<Uint8List?> getByteThumbnail(
  1. String path, {
  2. int quality = 100,
  3. int position = -1,
})

JPEG bytes of the frame at position milliseconds (-1 for a representative frame), at JPEG quality 1 to 100. Null if the frame cannot be read.

Implementation

Future<Uint8List?> getByteThumbnail(
  String path, {
  int quality = 100,
  int position = -1,
}) async {
  try {
    return await VideoCompressor.getThumbnail(
      path,
      position: position < 0 ? null : Duration(milliseconds: position),
      quality: quality.clamp(1, 100),
      maxSide: _thumbnailMaxSide,
    );
  } on VideoCompressException catch (e) {
    _log('getByteThumbnail', e);
    return null;
  }
}