Class: VideoComments
Continuable of videos inside a Video
Example
const video = await youtube.getVideo(VIDEO_ID);
await video.comments.next();
console.log(video.comments) // first 20 comments
let newComments = await video.comments.next();
console.log(newComments) // 20 loaded comments
console.log(video.comments) // first 40 comments
await video.comments.next(0); // load the rest of the comments in the video
Param
How many times to load the next comments. Set 0 to load all comments (might take a while on a video with many comments!)
Hierarchy
↳
VideoComments
Properties
client
• client: Client
An instance of Client
Inherited from
continuation
• Optional continuation: null | string
Inherited from
items
• items: Comment[] = []
Inherited from
video
• video: Video
The playlist this videos belongs to
Methods
next
▸ next(count?): Promise<Comment[]>
Fetch next items using continuation token
Parameters
| Name | Type | Default value |
|---|---|---|
count | number | 1 |
Returns
Promise<Comment[]>