Playlist

Playlist

Represents a YouTube playlist

Constructor

new Playlist(youtube, data)

Source:
Parameters:
Name Type Description
youtube YouTube The YouTube instance creating this
data Object The data of the playlist

Members

channel :Channel

The channel this playlist is in
Source:
Type:

(nullable) channelTitle :string

Channel title of this playlist
Source:
Type:
  • string

(nullable) defaultLanguage :string

The language in this playlist's title and description
Source:
Type:
  • string

(nullable) description :string

This playlist's description
Source:
Type:
  • string

embedHTML :string

A string with an iframe tag for embedding this playlist
Source:
Type:
  • string

id :string

This playlist's ID
Source:
Type:
  • string

length :number

The total number of videos in this playlist
Source:
Type:
  • number

(nullable) localized :Object

Information about the playlist as specified in the `hl` parameter
Source:
Type:
  • Object

privacy :string

The privacy status of this video
Source:
Type:
  • string

(nullable) publishedAt :Date

The date/time this playlist was published
Source:
Type:
  • Date

(nullable) thumbnails :Object.<string, Thumbnail>

Thumbnails for this playlist
Source:
Type:

(nullable) title :string

This playlist's title
Source:
Type:
  • string

type :string

The type to filter search results
Source:
Type:
  • string

url :string

The URL to this playlist
Source:
Type:
  • string

videos :Array.<Video>

Videos in this playlist. Available after calling Playlist#getVideos.
Source:
Type:

youtube :YouTube

The YouTube instance that created this
Source:
Type:

Methods

(static) extractID(url) → (nullable) {string}

Get a playlist ID from a string (URL or ID)
Source:
Parameters:
Name Type Description
url string The string to get the ID from
Returns:
Type:
string

fetch(optionsopt) → {Playlist}

Fetch the full representation of this playlist.
Source:
Parameters:
Name Type Attributes Description
options object <optional>
Any extra query params
Returns:
Type:
Playlist

getVideos(limitopt, optionsopt) → {Promise.<Array.<Video>>}

Gets videos in the playlist
Source:
Parameters:
Name Type Attributes Description
limit Number <optional>
Maximum number of videos to obtain. Fetches all if not provided.
options Object <optional>
Options to retrieve for each video.
Returns:
Type:
Promise.<Array.<Video>>