Hi
I want to display list of my Videos from youtube.
How to display below Data in Listview.
var yt = new YouTubeService(new BaseClientService.Initializer() { ApiKey = "AIzaSyAu9f5blF7idzt6cG2l29vQ9g4HBdYy36H" });
var channelsListRequest = yt.Channels.List("contentDetails");
channelsListRequest.ForUsername = "g3ZrkCBQ3GngW-m_nKoaSw";
var channelsListResponse = channelsListRequest.Execute();
int VideoCount = 1;
foreach (var channel in channelsListResponse.Items)
{
var uploadsListId = channel.ContentDetails.RelatedPlaylists.Uploads;
var nextPageToken = "";
while (nextPageToken != null)
{
var playlistItemsListRequest = yt.PlaylistItems.List("snippet");
playlistItemsListRequest.PlaylistId = uploadsListId;
playlistItemsListRequest.MaxResults = 50;
playlistItemsListRequest.PageToken = nextPageToken;
var playlistItemsListResponse = playlistItemsListRequest.Execute();
foreach (var playlistItem in playlistItemsListResponse.Items)
{
Console.WriteLine("Sl No={0}", VideoCount);
Console.Write("Video ID ={0} ", "youtube.com/embed/" + playlistItem.Snippet.ResourceId.VideoId);
VideoCount++;
}
nextPageToken = playlistItemsListResponse.NextPageToken;
}
Console.ReadLine();
}
Thanks