Video and Video Note Messages

tests

You can send MP4 files as a regular video or a video note. Other video formats may be sent as documents.

Video

method sendVideo

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 msg = await botClient.SendVideoAsync(
  chatId: e.Message.Chat,
  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
);

Check the Bot API docs for sendVideo to learn more about video size limits and the thumbnail images.

vide screenshot 1

User should be able to seek through the video without the video being downloaded completely.

vide screenshot 2

Video Note

method sendVideoNote

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.

Message msg;
using (var stream = System.IO.File.OpenRead("/path/to/video-waves.mp4")) {
  msg = await botClient.SendVideoNoteAsync(
    chatId: e.Message.Chat,
    videoNote: stream,
    duration: 47,
    length: 360 // value of width/height
  );
}

vide note screenshot