如何使用 angular 2 从 Youtube 获取我的播放列表视频

How Can I Get my playlist videos from Youtube with angular 2

我是 angular2 的新手,我需要使用 angular2 和 Youtube API 从 Youtube 获取我的播放列表视频,但我不知道最佳形式要开始这项任务,有人可以帮助我吗?

您可以参考此相关线程:api response.Call API 中的 . From the documentation, use the nextPageToken 属性一次或多次以检索列表中的所有项目。只要 API 响应 return 是 nextPageToken,还有更多项目要检索。

In your controller, define a local variable nextPageToken to retrieve the next page and call the getPlaylistVideos with the nextPageToken attribute recursively until all the results are retrieved.

另请注意,函数 getPlaylistVideos 不会 return 任何内容,它会使用获取的播放列表项目更新 $scope.playlistVideos 变量。此外,函数 getPlaylistVideos 使用范围变量 nextPageToken 来获取下一页。

希望对您有所帮助!

下面的代码可以帮助我完成这项任务

enter link description here