thumbnailData method

  1. @override
Future<Uint8List> thumbnailData({
  1. required String video,
  2. required Map<String, String>? headers,
  3. required ImageFormat imageFormat,
  4. required int maxHeight,
  5. required int maxWidth,
  6. required int timeMs,
  7. required int quality,
})

Implementation

@override
Future<Uint8List> thumbnailData({
  required String video,
  required Map<String, String>? headers,
  required ImageFormat imageFormat,
  required int maxHeight,
  required int maxWidth,
  required int timeMs,
  required int quality,
}) async {
  final blob = await _createThumbnail(
    videoSrc: video,
    headers: headers,
    imageFormat: imageFormat,
    maxHeight: maxHeight,
    maxWidth: maxWidth,
    timeMs: timeMs,
    quality: quality,
  );
  final path = Url.createObjectUrlFromBlob(blob);
  final file = XFile(path, mimeType: blob.type);
  final bytes = await file.readAsBytes();
  Url.revokeObjectUrl(path);

  return bytes;
}