You can send MP4 files as a regular video or a video note. Other video formats may be sent as documents.
Videos, like other multimedia messages, can have caption, reply, reply markup, and etc. You can optionally specify the duration and resolution of the video.
In the example below, we send a video of a 10 minute countdown and expect the Telegram clients to stream that long video instead of downloading it completely. We also set a thumbnail image for our video.
Message message = await botClient.SendVideoAsync( chatId: chatId, video: "https://raw.githubusercontent.com/TelegramBots/book/master/src/docs/video-countdown.mp4", thumb: "https://raw.githubusercontent.com/TelegramBots/book/master/src/2/docs/thumb-clock.jpg", supportsStreaming: true, cancellationToken: cancellationToken);
Check the Bot API docs for
sendVideomethod to learn more about video size limits and the thumbnail images.
User should be able to seek through the video without the video being downloaded completely.
Video notes, shown in circles to the user, are usually short (1 minute or less) with the same width and height.
You can send a video note only by uploading the video file or reusing the
file_id of another video note.
Sending video note by its HTTP URL is not supported currently.
Download the Sea Waves video to your disk for this example.
await using var stream = System.IO.File.OpenRead("/path/to/video-waves.mp4"); Message message = await botClient.SendVideoNoteAsync( chatId: chatId, videoNote: stream, duration: 47, length: 360, // value of width/height cancellationToken: cancellationToken);