Skip to content

Instantly share code, notes, and snippets.

@ThePendulum
Created January 27, 2016 23:29
Show Gist options
  • Save ThePendulum/50abd5012da41170266f to your computer and use it in GitHub Desktop.
Save ThePendulum/50abd5012da41170266f to your computer and use it in GitHub Desktop.
var videoIdArray = [];
var getVideoIds = new Promise( function(resolve, reject) {
ypi.playlistInfo("AIzaSyCgvxvDPy5djGfZhuqi34wrTh-c1UBhEzU", /*program.*/playlist, function(playlistItems) {
var videoIds = playlistItems.map(function(item) {
return item.resourceId.videoId;
});
resolve(videoIds);
});
});
getVideoIds.then(function(videoIds) {
videoIdArray = videoIds;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment