InputMediaVideo.fromFile constructor

InputMediaVideo.fromFile({
  1. required File media,
  2. String? caption,
  3. String? parseMode,
  4. List<MessageEntity>? captionEntities,
  5. String? thumbnail,
  6. int? width,
  7. int? height,
  8. int? duration,
  9. bool? supportsStreaming,
  10. bool? hasSpoiler,
})

Implementation

factory InputMediaVideo.fromFile({
  required io.File media,
  String? caption,
  String? parseMode,
  List<MessageEntity>? captionEntities,
  String? thumbnail,
  int? width,
  int? height,
  int? duration,
  bool? supportsStreaming,
  bool? hasSpoiler,
}) =>
    InputMediaVideo(
      media: 'attach://${media.path}',
      caption: caption,
      parseMode: parseMode,
      captionEntities: captionEntities,
      thumbnail: thumbnail,
      width: width,
      height: height,
      duration: duration,
      supportsStreaming: supportsStreaming,
      hasSpoiler: hasSpoiler,
    )..mediaFile = MultipartFile(
        media.path, media.openRead(), media.lengthSync(),
        filename: media.path.split('/').last);