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