I've been playing around with YouTube API to display playlist on a side bar as explained in the thread. I have given the full code as well in the codepen link.
However, IE failing to display the playlist. the below is the console error.
This the line it triggers the error
function getPlaylistItems(pageToken) {
return gapi.client.youtube.playlistItems.list({
"part": "snippet,contentDetails",
"maxResults": 50,
"playlistId": PLAYLIST_ID,
pageToken //Error is in this line
}).then(function(response) {
const {items, nextPageToken} = response.result;
playlistItems.push(...items);
var index = 0;
items.forEach(function(item) {
const thumbnailItem = createPlaylistItem(item, index);
playlist.appendChild(thumbnailItem);
index++;
});
maxVideoVisible = index - 3;
if (nextPageToken) {
getPlaylistItems(nextPageToken);
}
}, function(err) {
console.error("Execute error", err);
});
}
Can someone help me to understand this issue?
Thanks