thumbnailFiles method

  1. @override
Future<List<XFile>> thumbnailFiles({
  1. required List<String> videos,
  2. required Map<String, String>? headers,
  3. required String? thumbnailPath,
  4. required ImageFormat imageFormat,
  5. required int maxHeight,
  6. required int maxWidth,
  7. int? timeMs,
  8. required int quality,
})

Implementation

@override
Future<List<XFile>> thumbnailFiles({
  required List<String> videos,
  required Map<String, String>? headers,
  required String? thumbnailPath,
  required ImageFormat imageFormat,
  required int maxHeight,
  required int maxWidth,
  int? timeMs,
  required int quality,
}) async {
  final blobs = <Blob>[];

  for (final video in videos) {
    blobs.add(
      await _createThumbnail(
        videoSrc: video,
        headers: headers,
        imageFormat: imageFormat,
        maxHeight: maxHeight,
        maxWidth: maxWidth,
        timeMs: timeMs ?? 0,
        quality: quality,
      ),
    );
  }

  return blobs
      .map(
        (blob) =>
            XFile(Url.createObjectUrlFromBlob(blob), mimeType: blob.type),
      )
      .toList();
}