com.google.api.services.youtube.model.PlaylistItemListResponse Java Examples
The following examples show how to use
com.google.api.services.youtube.model.PlaylistItemListResponse.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: YouTubeAPI.java From UTubeTV with The Unlicense | 6 votes |
private String nextToken() { String result = null; if (response == null) result = ""; // first time else { // is there a better way of doing this? if (response instanceof SearchListResponse) { result = ((SearchListResponse) response).getNextPageToken(); } else if (response instanceof PlaylistItemListResponse) { result = ((PlaylistItemListResponse) response).getNextPageToken(); } else if (response instanceof SubscriptionListResponse) { result = ((SubscriptionListResponse) response).getNextPageToken(); } else if (response instanceof VideoListResponse) { result = ((VideoListResponse) response).getNextPageToken(); } else if (response instanceof PlaylistListResponse) { result = ((PlaylistListResponse) response).getNextPageToken(); } else { doHandleExceptionMessage("nextToken bug!"); } } return result; }
Example #2
Source File: GetPlaylistVideos.java From SkyTube with GNU General Public License v3.0 | 5 votes |
@Override public List<CardData> getNextVideos() { setLastException(null); List<CardData> videoList = new ArrayList<>(); if (!noMoreVideoPages()) { try { playlistItemsList.setPageToken(nextPageToken); PlaylistItemListResponse response = playlistItemsList.execute(); List<String> videoIds = new ArrayList<>(); List<PlaylistItem> items = response.getItems(); if(items != null) { for(PlaylistItem item : items) { videoIds.add(item.getContentDetails().getVideoId()); } } // get video details by supplying the videos IDs videoList = getVideoListFromIds(videoIds); nextPageToken = response.getNextPageToken(); if(nextPageToken == null) noMoreVideoPages = true; } catch (IOException e) { setLastException(e); Logger.e(this, "Error has occurred while getting playlist's videos", e); } } return videoList; }