customThumbnail method

String customThumbnail({
  1. String? time,
  2. int? width,
  3. int? height,
  4. ThumbnailFit? fit,
})

Implementation

String customThumbnail({
  /// Start time from the video
  ///
  /// Default value: 0s
  ///
  /// e.g: 8m, 5m2s
  String? time,

  /// Width of the thumbnail
  ///
  /// Default value: 640
  int? width,

  /// Height of the thumbnail
  ///
  /// Default value: 640
  int? height,

  /// Clarifies what to do when requested width and height doesn't match the
  /// original upload, which should be one of [ThumbnailFit] enum values
  ///
  /// Default value: crop
  ///
  /// e.g: scale
  ThumbnailFit? fit,
}) =>
    Uri.parse(customAccountSubdomainUrl ?? videoDeliveryUrl).replace(
      path: '/$id/thumbnails/thumbnail.jpg',
      queryParameters: {
        if (time != null) Params.time: time.toString(),
        if (width != null) Params.width: width.toString(),
        if (height != null) Params.height: height.toString(),
        if (fit != null) Params.fit: fit.name,
      },
    ).toString();