InputPaidMedia.video constructor

  1. @Assert('type == InputPaidMediaType.video', 'type must be InputPaidMediaType.video')
const InputPaidMedia.video({
  1. @Default(InputPaidMediaType.video) @JsonKey(name: 'type') InputPaidMediaType type,
  2. @InputFileConverter() @JsonKey(name: 'media') required InputFile media,
  3. @InputFileConverter() @JsonKey(name: 'thumbnail') InputFile? thumbnail,
  4. @JsonKey(name: 'width') int? width,
  5. @JsonKey(name: 'height') int? height,
  6. @JsonKey(name: 'duration') int? duration,
  7. @JsonKey(name: 'supports_streaming') bool? supportsStreaming,
  8. @JsonKey(name: 'start_timestamp') int? startTimestamp,
  9. @InputFileConverter() @JsonKey(name: 'cover') InputFile? cover,
})

The paid media to send is a video.

Implementation

@Assert(
  'type == InputPaidMediaType.video',
  'type must be InputPaidMediaType.video',
)
const factory InputPaidMedia.video({
  /// Type of the media, must be "video".
  @Default(InputPaidMediaType.video)
  @JsonKey(name: 'type')
  final InputPaidMediaType type,

  /// File to send.
  @InputFileConverter()
  @JsonKey(name: 'media')
  required final InputFile media,

  /// Optional. Thumbnail of the file sent; can be ignored if thumbnail
  /// generation for the file is supported server-side.
  @InputFileConverter()
  @JsonKey(name: 'thumbnail')
  final InputFile? thumbnail,

  /// Optional. Video width.
  @JsonKey(name: 'width') final int? width,

  /// Optional. Video height.
  @JsonKey(name: 'height') final int? height,

  /// Optional. Video duration in seconds.
  @JsonKey(name: 'duration') final int? duration,

  /// Optional. Pass True if the uploaded video is suitable for streaming.
  @JsonKey(name: 'supports_streaming') final bool? supportsStreaming,

  /// Optional. Timestamp in seconds from which the video will play in the
  /// message
  @JsonKey(name: 'start_timestamp') final int? startTimestamp,

  /// Optional. Cover for the video in the message.
  @InputFileConverter() @JsonKey(name: 'cover') final InputFile? cover,
}) = InputPaidMediaVideo;