Skip to main content

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​

Properties​

client​

• client: Client

An instance of Client

Inherited from​

Continuable.client


continuation​

• Optional continuation: null | string

Inherited from​

Continuable.continuation


items​

• items: VideoCompact[] = []

Inherited from​

Continuable.items


playlist​

• Optional playlist: Playlist

The playlist this videos belongs to

Methods​

next​

▸ next(count?): Promise<VideoCompact[]>

Fetch next items using continuation token

Parameters​

NameTypeDefault value
countnumber1

Returns​

Promise<VideoCompact[]>

Inherited from​

Continuable.next