A video, round video message or GIF animation.

Note: Legacy GIF animations are also wrapped with this class.

Hierarchy (View Summary)

Constructors

Properties

dcId?: number

DC ID of the file, when available

fileSize?: number

File size in bytes, when available

location:
    | Uint8Array
    | TypeInputFileLocation
    | TypeInputWebFileLocation
    | () => Uint8Array | TypeInputFileLocation | TypeInputWebFileLocation

Location of the file.

Either a TL object declaring remote file location, a Buffer containing actual file content (for stripped thumbnails and vector previews), or a function that will return either of those.

When a function is passed, it will be lazily resolved the first time downloading the file.

type: "video" = ...

Type of the media (for use in a tagged union)

Accessors

  • get codec(): null | string
  • Returns null | string

  • get date(): Date
  • Date the document was sent

    Returns Date

  • get duration(): number
  • Video duration in seconds.

    0 for legacy GIFs

    Returns number

  • get fileId(): string
  • Get TDLib and Bot API compatible File ID representing this document.

    Returns string

  • get fileName(): null | string
  • Original file name, extracted from the document attributes.

    Returns null | string

  • get hasSpoiler(): boolean
  • Whether this video is hidden with a spoiler

    Returns boolean

  • get height(): number
  • Video height in pixels

    Returns number

  • get inputDocument(): TypeInputDocument
  • Input document TL object generated from this object, to be used with methods that use it

    Returns TypeInputDocument

  • get isAnimation(): boolean
  • Whether this video is an animated GIF (represented either by actual GIF or a silent MP4 video)

    Returns boolean

  • get isLegacyGif(): boolean
  • Whether this video is a legacy GIF (i.e. its MIME is image/gif)

    Returns boolean

  • get isRound(): boolean
  • Whether this video is a round video message (aka video note)

    Returns boolean

  • get mimeType(): string
  • File MIME type, as defined by the sender.

    Returns string

  • get thumbnails(): readonly Thumbnail[]
  • Available thumbnails, if any.

    If there are no thumbnails, the array will be empty.

    Returns readonly Thumbnail[]

  • get ttlSeconds(): null | number
  • For self-destructing videos, TTL in seconds

    Returns null | number

  • get uniqueFileId(): string
  • Get a unique File ID representing this document.

    Returns string

  • get videoStartTs(): null | number
  • Returns null | number

  • get width(): number
  • Video width in pixels

    Returns number

Methods

  • Get a thumbnail by its type.

    Thumbnail types are described in the Telegram docs, and are also available as static members of Thumbnail for convenience.

    Parameters

    • type: string

      Thumbnail type

    Returns null | Thumbnail