Class: VideoCompact
Represent a compact video (e.g. from search result, playlist's videos, channel's videos)
Hierarchy
↳
VideoCompact
Implements
VideoCompactProperties
Properties
channel
• Optional channel: BaseChannel
The channel who uploads this video
Implementation of
VideoCompactProperties.channel
client
• client: Client
An instance of Client
Implementation of
VideoCompactProperties.client
Inherited from
description
• description: string
Description of the video (not a full description, rather a preview / snippet)
duration
• duration: null | number
The duration of this video in second, null if the video is live
Implementation of
VideoCompactProperties.duration
id
• id: string
Implementation of
VideoCompactProperties.id
isLive
• isLive: boolean
Whether this video is a live now or not
Implementation of
VideoCompactProperties.isLive
isShort
• isShort: boolean
Whether this video is a shorts or not
thumbnails
• thumbnails: Thumbnails
Thumbnails of the video with different sizes
Implementation of
VideoCompactProperties.thumbnails
title
• title: string
The title of the video
Implementation of
VideoCompactProperties.title
uploadDate
• Optional uploadDate: string
The date this video is uploaded at
Implementation of
VideoCompactProperties.uploadDate
viewCount
• Optional viewCount: null | number
How many view does this video have, null if the view count is hidden
Implementation of
VideoCompactProperties.viewCount
Accessors
isPrivateOrDeleted
• get isPrivateOrDeleted(): boolean
Whether this video is private / deleted or not, only useful in playlist's videos
Returns
boolean
Methods
getTranscript
▸ getTranscript(languageCode?): Promise<undefined | Caption[]>
Get Video transcript (if exists)
Equivalent to
client.getVideoTranscript(video.id);
Parameters
| Name | Type |
|---|---|
languageCode? | string |
Returns
Promise<undefined | Caption[]>
getVideo
▸ getVideo<T>(): Promise<T>
Get Video object based on current video id
Equivalent to
client.getVideo(videoCompact.id);
Type parameters
| Name | Type |
|---|---|
T | extends Video | LiveVideo |
Returns
Promise<T>