Builder for video payloads.
This module provides a fluent API for sending videos from URLs, file paths, or Telegram file IDs. Videos can include duration, cover images, and other options.
Examples
# Send video from local file
ctx
|> Video.path("/tmp/video.mp4")
|> Video.duration(120)
|> Video.send(chat_id)
# Send video from URL with cover
ctx
|> Video.url("https://example.com/video.mp4")
|> Video.cover_url("https://example.com/cover.jpg")
|> Video.send(chat_id)
# Send video by file ID
ctx
|> Video.id("example_file_id")
|> Video.send(chat_id)
Summary
Functions
Sets the video cover image from a local file path.
Sets the video cover image from a URL.
Sets the video duration in seconds.
Sets the video by Telegram file ID.
Sets the video from a local file path.
Sends the video to the specified chat.
Sends the video without notification sound.
Sets the video from a URL.
Functions
Sets the video cover image from a local file path.
Parameters
ctx- Context mappath- Path to the cover image file
Returns
Updated context map with cover image content set.
Sets the video cover image from a URL.
Parameters
ctx- Context mapurl- URL of the cover image
Returns
Updated context map with cover image URL set.
Sets the video duration in seconds.
Parameters
ctx- Context mapseconds- Duration in seconds
Returns
Updated context map with duration set.
Sets the video by Telegram file ID.
Parameters
ctx- Context mapid- Telegram file ID
Returns
Updated context map with video ID set.
Sets the video from a local file path.
Parameters
ctx- Context mappath- Path to the video file
Returns
Updated context map with video file content set.
Sends the video to the specified chat.
Parameters
ctx- Context map with accumulated video dataid- Chat ID to send the video to
Returns
:ok- Video sent successfully{:error, reason}- Failed to send video
Sends the video without notification sound.
Parameters
ctx- Context map
Returns
Updated context map with silent flag set.
Sets the video from a URL.
Parameters
ctx- Context mapurl- URL of the video
Returns
Updated context map with video URL set.